@carbon/react 1.29.0 → 1.30.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_virtual/_rollupPluginBabelHelpers.js +16 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -7
- package/es/components/Accordion/Accordion.js +1 -8
- package/es/components/Accordion/AccordionItem.js +5 -19
- package/es/components/AspectRatio/AspectRatio.js +0 -5
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/es/components/Breadcrumb/Breadcrumb.js +0 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/es/components/Button/Button.Skeleton.js +2 -7
- package/es/components/Button/Button.js +2 -36
- package/es/components/ButtonSet/ButtonSet.js +0 -2
- package/es/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/es/components/Checkbox/Checkbox.js +4 -20
- package/es/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/es/components/ClassPrefix/index.d.ts +26 -0
- package/es/components/ClassPrefix/index.js +0 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/es/components/CodeSnippet/CodeSnippet.js +6 -45
- package/es/components/ComboBox/ComboBox.js +12 -79
- package/es/components/ComboBox/tools/filter.js +0 -1
- package/es/components/ComboButton/index.js +0 -14
- package/es/components/ComposedModal/ComposedModal.js +2 -32
- package/es/components/ComposedModal/ModalFooter.js +0 -21
- package/es/components/ComposedModal/ModalHeader.js +0 -12
- package/es/components/ContainedList/ContainedList.js +5 -32
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/es/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/es/components/ContextMenu/useContextMenu.js +1 -6
- package/es/components/Copy/Copy.js +8 -31
- package/es/components/CopyButton/CopyButton.js +0 -4
- package/es/components/DangerButton/DangerButton.js +0 -1
- package/es/components/DataTable/DataTable.js +171 -91
- package/es/components/DataTable/Table.js +0 -6
- package/es/components/DataTable/TableBatchAction.js +0 -4
- package/es/components/DataTable/TableBatchActions.js +0 -8
- package/es/components/DataTable/TableBody.js +0 -1
- package/es/components/DataTable/TableContainer.js +0 -5
- package/es/components/DataTable/TableExpandHeader.js +0 -7
- package/es/components/DataTable/TableExpandRow.js +0 -6
- package/es/components/DataTable/TableExpandedRow.js +0 -6
- package/es/components/DataTable/TableHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +3 -19
- package/es/components/DataTable/TableRow.js +4 -5
- package/es/components/DataTable/TableSelectAll.js +0 -8
- package/es/components/DataTable/TableSelectRow.js +2 -10
- package/es/components/DataTable/TableToolbar.js +0 -3
- package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +3 -6
- package/es/components/DataTable/TableToolbarSearch.js +2 -30
- package/es/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/es/components/DataTable/state/sorting.js +5 -8
- package/es/components/DataTable/tools/denormalize.js +2 -2
- package/es/components/DataTable/tools/filter.js +0 -2
- package/es/components/DataTable/tools/instanceId.js +0 -1
- package/es/components/DataTable/tools/normalize.js +10 -10
- package/es/components/DataTable/tools/sorting.js +5 -13
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/es/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/es/components/DatePicker/DatePicker.js +154 -177
- package/es/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/es/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/es/components/DatePickerInput/DatePickerInput.js +2 -28
- package/es/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/es/components/Dropdown/Dropdown.js +43 -52
- package/es/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/es/components/FeatureFlags/index.js +8 -20
- package/es/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/es/components/FileUploader/FileUploader.js +3 -38
- package/es/components/FileUploader/FileUploaderButton.js +3 -24
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/es/components/FileUploader/FileUploaderItem.js +1 -11
- package/es/components/FileUploader/Filename.js +0 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/es/components/FluidComboBox/FluidComboBox.js +0 -18
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/es/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/es/components/FluidDropdown/FluidDropdown.js +0 -18
- package/es/components/FluidForm/FluidForm.js +0 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/es/components/FluidSelect/FluidSelect.js +0 -10
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/es/components/FluidTextArea/FluidTextArea.js +0 -20
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/es/components/FluidTextInput/FluidTextInput.js +0 -14
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/es/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/es/components/Form/Form.d.ts +23 -0
- package/es/components/Form/Form.js +3 -6
- package/es/components/Form/index.d.ts +7 -0
- package/es/components/FormGroup/FormGroup.js +0 -7
- package/es/components/FormItem/FormItem.js +0 -2
- package/es/components/FormLabel/FormLabel.js +1 -7
- package/es/components/Grid/CSSGrid.js +2 -15
- package/es/components/Grid/Column.js +18 -59
- package/es/components/Grid/ColumnHang.js +2 -5
- package/es/components/Grid/FlexGrid.js +2 -8
- package/es/components/Grid/Grid.js +0 -8
- package/es/components/Grid/GridContext.js +1 -3
- package/es/components/Grid/Row.js +2 -7
- package/es/components/Heading/index.js +0 -4
- package/es/components/Icon/Icon.Skeleton.js +2 -2
- package/es/components/IconButton/index.js +0 -10
- package/es/components/IdPrefix/index.js +0 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/es/components/InlineLoading/InlineLoading.js +0 -12
- package/es/components/Layer/index.js +3 -6
- package/es/components/Layout/LayoutDirection.js +0 -3
- package/es/components/Layout/useLayoutDirection.js +0 -1
- package/es/components/Link/Link.js +3 -10
- package/es/components/ListBox/ListBox.js +2 -13
- package/es/components/ListBox/ListBoxField.js +0 -5
- package/es/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/es/components/ListBox/ListBoxMenuItem.js +2 -6
- package/es/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/es/components/ListBox/ListBoxSelection.js +1 -13
- package/es/components/ListBox/next/ListBoxSelection.js +1 -14
- package/es/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/es/components/ListItem/ListItem.d.ts +23 -0
- package/es/components/ListItem/ListItem.js +4 -8
- package/es/components/ListItem/index.d.ts +7 -0
- package/es/components/Loading/Loading.js +0 -6
- package/es/components/Menu/Menu.js +22 -40
- package/es/components/Menu/MenuContext.js +4 -5
- package/es/components/Menu/MenuItem.js +5 -39
- package/es/components/MenuButton/index.js +0 -9
- package/es/components/Modal/Modal.js +0 -43
- package/es/components/ModalWrapper/ModalWrapper.js +2 -15
- package/es/components/MultiSelect/FilterableMultiSelect.js +2 -60
- package/es/components/MultiSelect/MultiSelect.js +22 -70
- package/es/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/es/components/MultiSelect/index.js +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -2
- package/es/components/MultiSelect/tools/sorting.js +3 -4
- package/es/components/Notification/Notification.js +0 -78
- package/es/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/es/components/NumberInput/NumberInput.js +3 -60
- package/es/components/OrderedList/OrderedList.d.ts +39 -0
- package/es/components/OrderedList/OrderedList.js +7 -19
- package/es/components/{Form/index.js → OrderedList/index.d.ts} +1 -3
- package/es/components/OverflowMenu/OverflowMenu.js +65 -86
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/es/components/OverflowMenuV2/index.js +0 -5
- package/es/components/Pagination/Pagination.Skeleton.js +0 -2
- package/es/components/Pagination/Pagination.js +11 -47
- package/es/components/Pagination/experimental/PageSelector.js +0 -10
- package/es/components/Pagination/experimental/Pagination.js +2 -48
- package/es/components/PaginationNav/PaginationNav.js +15 -59
- package/es/components/Popover/index.d.ts +14 -8
- package/es/components/Popover/index.js +44 -48
- package/es/components/PrimaryButton/PrimaryButton.js +0 -1
- package/es/components/ProgressBar/ProgressBar.js +0 -15
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/es/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/es/components/RadioButton/RadioButton.js +0 -13
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/es/components/RadioTile/RadioTile.js +0 -12
- package/es/components/Search/Search.Skeleton.js +0 -2
- package/es/components/Search/Search.js +1 -28
- package/es/components/SecondaryButton/SecondaryButton.js +0 -1
- package/es/components/Select/Select.Skeleton.js +0 -2
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +6 -33
- package/es/components/SelectItem/SelectItem.js +0 -5
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -7
- package/es/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +0 -12
- package/es/components/Slider/Slider.Skeleton.js +0 -2
- package/es/components/Slider/Slider.d.ts +0 -1
- package/es/components/Slider/Slider.js +112 -135
- package/es/components/Stack/Stack.js +1 -8
- package/es/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/es/components/StructuredList/StructuredList.js +1 -25
- package/es/components/Switch/IconSwitch.js +0 -18
- package/es/components/Switch/Switch.js +0 -11
- package/es/components/TabContent/TabContent.js +2 -6
- package/es/components/Tabs/Tabs.Skeleton.js +0 -4
- package/es/components/Tabs/Tabs.js +135 -104
- package/es/components/Tabs/usePressable.js +18 -31
- package/es/components/Tag/Tag.Skeleton.js +0 -2
- package/es/components/Tag/Tag.js +0 -15
- package/es/components/Text/Text.js +5 -18
- package/es/components/Text/TextDirection.js +0 -3
- package/es/components/Text/TextDirectionContext.js +0 -1
- package/es/components/Text/createTextComponent.js +0 -3
- package/es/components/TextArea/TextArea.Skeleton.js +0 -2
- package/es/components/TextArea/TextArea.js +11 -33
- package/es/components/TextInput/ControlledPasswordInput.js +0 -20
- package/es/components/TextInput/PasswordInput.js +0 -25
- package/es/components/TextInput/TextInput.Skeleton.js +0 -2
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +5 -33
- package/es/components/TextInput/util.js +3 -5
- package/es/components/Theme/index.js +1 -6
- package/es/components/Tile/Tile.js +32 -59
- package/es/components/TileGroup/TileGroup.js +1 -22
- package/es/components/TimePicker/TimePicker.js +6 -32
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/es/components/Toggle/Toggle.Skeleton.js +0 -8
- package/es/components/Toggle/Toggle.js +0 -16
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/es/components/Toggletip/index.d.ts +148 -0
- package/es/components/Toggletip/index.js +20 -44
- package/es/components/Tooltip/DefinitionTooltip.js +0 -11
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +4 -21
- package/es/components/TreeView/TreeNode.js +21 -66
- package/es/components/TreeView/TreeView.js +11 -67
- package/es/components/UIShell/Content.js +2 -4
- package/es/components/UIShell/Header.js +0 -2
- package/es/components/UIShell/HeaderContainer.d.ts +33 -0
- package/es/components/UIShell/HeaderContainer.js +13 -11
- package/es/components/UIShell/HeaderGlobalAction.js +0 -6
- package/es/components/UIShell/HeaderGlobalBar.js +0 -1
- package/es/components/UIShell/HeaderMenu.js +32 -31
- package/es/components/UIShell/HeaderMenuButton.js +2 -4
- package/es/components/UIShell/HeaderMenuItem.js +0 -8
- package/es/components/UIShell/HeaderName.js +0 -5
- package/es/components/UIShell/HeaderNavigation.js +0 -2
- package/es/components/UIShell/HeaderPanel.js +0 -2
- package/es/components/UIShell/HeaderSideNavItems.js +0 -2
- package/es/components/UIShell/Link.js +2 -3
- package/es/components/UIShell/SideNav.d.ts +3 -1
- package/es/components/UIShell/SideNav.js +44 -36
- package/es/components/UIShell/SideNavDetails.js +0 -3
- package/es/components/UIShell/SideNavDivider.js +0 -1
- package/es/components/UIShell/SideNavFooter.js +1 -4
- package/es/components/UIShell/SideNavHeader.js +0 -4
- package/es/components/UIShell/SideNavIcon.js +0 -3
- package/es/components/UIShell/SideNavItem.js +0 -3
- package/es/components/UIShell/SideNavItems.js +2 -6
- package/es/components/UIShell/SideNavLink.js +3 -7
- package/es/components/UIShell/SideNavLinkText.js +0 -2
- package/es/components/UIShell/SideNavMenu.js +0 -16
- package/es/components/UIShell/SideNavMenuItem.js +0 -2
- package/es/components/UIShell/SideNavSwitcher.js +2 -5
- package/es/components/UIShell/SkipToContent.d.ts +32 -0
- package/es/components/UIShell/SkipToContent.js +8 -15
- package/es/components/UIShell/Switcher.js +0 -2
- package/es/components/UIShell/SwitcherDivider.js +0 -1
- package/es/components/UIShell/SwitcherItem.js +0 -3
- package/es/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/es/components/UnorderedList/UnorderedList.js +6 -16
- package/es/components/UnorderedList/index.d.ts +7 -0
- package/es/index.js +7 -8
- package/es/internal/ClickListener.js +3 -13
- package/es/internal/FloatingMenu.js +57 -63
- package/es/internal/OptimizedResize.js +6 -12
- package/es/internal/Selection.js +2 -25
- package/es/internal/createClassWrapper.js +0 -2
- package/es/internal/deprecateFieldOnObject.js +0 -4
- package/es/internal/focus/index.js +0 -1
- package/es/internal/keyboard/keys.js +2 -1
- package/es/internal/keyboard/match.js +1 -6
- package/es/internal/keyboard/navigation.js +8 -7
- package/es/internal/useAnnouncer.js +0 -1
- package/es/internal/useAttachedMenu.js +1 -9
- package/es/internal/useControllableState.js +6 -13
- package/es/internal/useDelayedState.js +2 -4
- package/es/internal/useEffectOnce.js +0 -1
- package/es/internal/useEvent.js +61 -3
- package/es/internal/useId.js +2 -5
- package/es/internal/useIsomorphicEffect.js +1 -0
- package/es/internal/useMergedRefs.js +2 -2
- package/es/internal/useNoInteractiveChildren.js +2 -13
- package/es/internal/useNormalizedInputProps.js +0 -3
- package/es/internal/useSavedCallback.js +1 -2
- package/es/internal/warning.js +0 -3
- package/es/internal/wrapFocus.js +1 -8
- package/es/prop-types/deprecate.js +2 -5
- package/es/prop-types/isRequiredOneOf.js +2 -5
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/es/tools/array.js +0 -3
- package/es/tools/events.js +0 -3
- package/es/tools/mergeRefs.js +0 -2
- package/es/tools/wrapComponent.js +2 -5
- package/lib/_virtual/_rollupPluginBabelHelpers.js +17 -4
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -7
- package/lib/components/Accordion/Accordion.js +1 -27
- package/lib/components/Accordion/AccordionItem.js +5 -19
- package/lib/components/AspectRatio/AspectRatio.js +0 -5
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +0 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/lib/components/Button/Button.Skeleton.js +2 -26
- package/lib/components/Button/Button.js +2 -36
- package/lib/components/ButtonSet/ButtonSet.js +0 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/lib/components/Checkbox/Checkbox.js +4 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/lib/components/ClassPrefix/index.d.ts +26 -0
- package/lib/components/ClassPrefix/index.js +0 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/lib/components/CodeSnippet/CodeSnippet.js +6 -45
- package/lib/components/ComboBox/ComboBox.js +19 -86
- package/lib/components/ComboBox/tools/filter.js +0 -1
- package/lib/components/ComboButton/index.js +0 -14
- package/lib/components/ComposedModal/ComposedModal.js +2 -32
- package/lib/components/ComposedModal/ModalFooter.js +0 -21
- package/lib/components/ComposedModal/ModalHeader.js +0 -12
- package/lib/components/ContainedList/ContainedList.js +5 -32
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/lib/components/ContextMenu/useContextMenu.js +1 -6
- package/lib/components/Copy/Copy.js +8 -50
- package/lib/components/CopyButton/CopyButton.js +0 -4
- package/lib/components/DangerButton/DangerButton.js +0 -1
- package/lib/components/DataTable/DataTable.js +171 -91
- package/lib/components/DataTable/Table.js +0 -6
- package/lib/components/DataTable/TableBatchAction.js +0 -4
- package/lib/components/DataTable/TableBatchActions.js +0 -8
- package/lib/components/DataTable/TableBody.js +0 -1
- package/lib/components/DataTable/TableContainer.js +0 -5
- package/lib/components/DataTable/TableExpandHeader.js +0 -7
- package/lib/components/DataTable/TableExpandRow.js +0 -6
- package/lib/components/DataTable/TableExpandedRow.js +0 -6
- package/lib/components/DataTable/TableHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +3 -19
- package/lib/components/DataTable/TableRow.js +4 -5
- package/lib/components/DataTable/TableSelectAll.js +0 -8
- package/lib/components/DataTable/TableSelectRow.js +2 -10
- package/lib/components/DataTable/TableToolbar.js +0 -3
- package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +3 -6
- package/lib/components/DataTable/TableToolbarSearch.js +2 -30
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/lib/components/DataTable/state/sorting.js +5 -8
- package/lib/components/DataTable/tools/denormalize.js +2 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/instanceId.js +0 -1
- package/lib/components/DataTable/tools/normalize.js +10 -10
- package/lib/components/DataTable/tools/sorting.js +5 -13
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/lib/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/lib/components/DatePicker/DatePicker.js +154 -177
- package/lib/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -28
- package/lib/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/lib/components/Dropdown/Dropdown.js +50 -59
- package/lib/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/lib/components/FeatureFlags/index.js +8 -20
- package/lib/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/lib/components/FileUploader/FileUploader.js +3 -57
- package/lib/components/FileUploader/FileUploaderButton.js +3 -43
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/lib/components/FileUploader/FileUploaderItem.js +1 -30
- package/lib/components/FileUploader/Filename.js +0 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/lib/components/FluidComboBox/FluidComboBox.js +0 -18
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/lib/components/FluidDropdown/FluidDropdown.js +0 -18
- package/lib/components/FluidForm/FluidForm.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/lib/components/FluidSelect/FluidSelect.js +0 -10
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +0 -20
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +0 -14
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/lib/components/Form/Form.d.ts +23 -0
- package/lib/components/Form/Form.js +3 -6
- package/lib/components/Form/index.d.ts +7 -0
- package/lib/components/FormGroup/FormGroup.js +0 -7
- package/lib/components/FormItem/FormItem.js +0 -2
- package/lib/components/FormLabel/FormLabel.js +1 -26
- package/lib/components/Grid/CSSGrid.js +2 -15
- package/lib/components/Grid/Column.js +18 -59
- package/lib/components/Grid/ColumnHang.js +2 -5
- package/lib/components/Grid/FlexGrid.js +2 -8
- package/lib/components/Grid/Grid.js +0 -8
- package/lib/components/Grid/GridContext.js +1 -3
- package/lib/components/Grid/Row.js +2 -7
- package/lib/components/Heading/index.js +0 -4
- package/lib/components/Icon/Icon.Skeleton.js +2 -2
- package/lib/components/IconButton/index.js +0 -10
- package/lib/components/IdPrefix/index.js +0 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/lib/components/InlineLoading/InlineLoading.js +0 -12
- package/lib/components/Layer/index.js +3 -6
- package/lib/components/Layout/LayoutDirection.js +0 -3
- package/lib/components/Layout/useLayoutDirection.js +0 -1
- package/lib/components/Link/Link.js +3 -10
- package/lib/components/ListBox/ListBox.js +2 -13
- package/lib/components/ListBox/ListBoxField.js +0 -5
- package/lib/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -6
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/lib/components/ListBox/ListBoxSelection.js +1 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +1 -14
- package/lib/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/lib/components/ListItem/ListItem.d.ts +23 -0
- package/lib/components/ListItem/ListItem.js +4 -8
- package/lib/components/ListItem/index.d.ts +7 -0
- package/lib/components/Loading/Loading.js +0 -6
- package/lib/components/Menu/Menu.js +22 -40
- package/lib/components/Menu/MenuContext.js +4 -5
- package/lib/components/Menu/MenuItem.js +5 -39
- package/lib/components/MenuButton/index.js +0 -9
- package/lib/components/Modal/Modal.js +0 -43
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -15
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -66
- package/lib/components/MultiSelect/MultiSelect.js +30 -78
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/lib/components/MultiSelect/index.js +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -2
- package/lib/components/MultiSelect/tools/sorting.js +3 -4
- package/lib/components/Notification/Notification.js +0 -78
- package/lib/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/lib/components/NumberInput/NumberInput.js +3 -60
- package/lib/components/OrderedList/OrderedList.d.ts +39 -0
- package/lib/components/OrderedList/OrderedList.js +7 -19
- package/lib/components/OrderedList/index.d.ts +7 -0
- package/lib/components/OverflowMenu/OverflowMenu.js +65 -86
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/lib/components/OverflowMenuV2/index.js +0 -5
- package/lib/components/Pagination/Pagination.Skeleton.js +0 -2
- package/lib/components/Pagination/Pagination.js +11 -47
- package/lib/components/Pagination/experimental/PageSelector.js +0 -10
- package/lib/components/Pagination/experimental/Pagination.js +2 -67
- package/lib/components/PaginationNav/PaginationNav.js +15 -78
- package/lib/components/Popover/index.d.ts +14 -8
- package/lib/components/Popover/index.js +44 -48
- package/lib/components/PrimaryButton/PrimaryButton.js +0 -1
- package/lib/components/ProgressBar/ProgressBar.js +0 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/lib/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/lib/components/RadioButton/RadioButton.js +0 -13
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/lib/components/RadioTile/RadioTile.js +0 -12
- package/lib/components/Search/Search.Skeleton.js +0 -2
- package/lib/components/Search/Search.js +1 -28
- package/lib/components/SecondaryButton/SecondaryButton.js +0 -1
- package/lib/components/Select/Select.Skeleton.js +0 -2
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +6 -33
- package/lib/components/SelectItem/SelectItem.js +0 -5
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -26
- package/lib/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +0 -12
- package/lib/components/Slider/Slider.Skeleton.js +0 -2
- package/lib/components/Slider/Slider.d.ts +0 -1
- package/lib/components/Slider/Slider.js +112 -154
- package/lib/components/Stack/Stack.js +1 -8
- package/lib/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/lib/components/StructuredList/StructuredList.js +1 -25
- package/lib/components/Switch/IconSwitch.js +0 -18
- package/lib/components/Switch/Switch.js +0 -11
- package/lib/components/TabContent/TabContent.js +2 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +0 -4
- package/lib/components/Tabs/Tabs.js +133 -102
- package/lib/components/Tabs/usePressable.js +18 -31
- package/lib/components/Tag/Tag.Skeleton.js +0 -2
- package/lib/components/Tag/Tag.js +0 -15
- package/lib/components/Text/Text.js +5 -18
- package/lib/components/Text/TextDirection.js +0 -3
- package/lib/components/Text/TextDirectionContext.js +0 -1
- package/lib/components/Text/createTextComponent.js +0 -3
- package/lib/components/TextArea/TextArea.Skeleton.js +0 -2
- package/lib/components/TextArea/TextArea.js +10 -32
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -20
- package/lib/components/TextInput/PasswordInput.js +0 -25
- package/lib/components/TextInput/TextInput.Skeleton.js +0 -2
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +5 -52
- package/lib/components/TextInput/util.js +3 -5
- package/lib/components/Theme/index.js +1 -6
- package/lib/components/Tile/Tile.js +31 -58
- package/lib/components/TileGroup/TileGroup.js +1 -22
- package/lib/components/TimePicker/TimePicker.js +6 -32
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/lib/components/Toggle/Toggle.Skeleton.js +0 -8
- package/lib/components/Toggle/Toggle.js +0 -16
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/lib/components/Toggletip/index.d.ts +148 -0
- package/lib/components/Toggletip/index.js +20 -44
- package/lib/components/Tooltip/DefinitionTooltip.js +0 -11
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +4 -21
- package/lib/components/TreeView/TreeNode.js +21 -66
- package/lib/components/TreeView/TreeView.js +11 -67
- package/lib/components/UIShell/Content.js +2 -4
- package/lib/components/UIShell/Header.js +0 -2
- package/lib/components/UIShell/HeaderContainer.d.ts +33 -0
- package/lib/components/UIShell/HeaderContainer.js +13 -11
- package/lib/components/UIShell/HeaderGlobalAction.js +0 -6
- package/lib/components/UIShell/HeaderGlobalBar.js +0 -1
- package/lib/components/UIShell/HeaderMenu.js +32 -31
- package/lib/components/UIShell/HeaderMenuButton.js +2 -4
- package/lib/components/UIShell/HeaderMenuItem.js +0 -8
- package/lib/components/UIShell/HeaderName.js +0 -5
- package/lib/components/UIShell/HeaderNavigation.js +0 -2
- package/lib/components/UIShell/HeaderPanel.js +0 -2
- package/lib/components/UIShell/HeaderSideNavItems.js +0 -2
- package/lib/components/UIShell/Link.js +2 -3
- package/lib/components/UIShell/SideNav.d.ts +3 -1
- package/lib/components/UIShell/SideNav.js +43 -35
- package/lib/components/UIShell/SideNavDetails.js +0 -3
- package/lib/components/UIShell/SideNavDivider.js +0 -1
- package/lib/components/UIShell/SideNavFooter.js +1 -4
- package/lib/components/UIShell/SideNavHeader.js +0 -4
- package/lib/components/UIShell/SideNavIcon.js +0 -3
- package/lib/components/UIShell/SideNavItem.js +0 -3
- package/lib/components/UIShell/SideNavItems.js +2 -6
- package/lib/components/UIShell/SideNavLink.js +3 -7
- package/lib/components/UIShell/SideNavLinkText.js +0 -2
- package/lib/components/UIShell/SideNavMenu.js +0 -16
- package/lib/components/UIShell/SideNavMenuItem.js +0 -2
- package/lib/components/UIShell/SideNavSwitcher.js +2 -5
- package/lib/components/UIShell/SkipToContent.d.ts +32 -0
- package/lib/components/UIShell/SkipToContent.js +8 -15
- package/lib/components/UIShell/Switcher.js +0 -2
- package/lib/components/UIShell/SwitcherDivider.js +0 -1
- package/lib/components/UIShell/SwitcherItem.js +0 -3
- package/lib/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/lib/components/UnorderedList/UnorderedList.js +6 -16
- package/lib/components/UnorderedList/index.d.ts +7 -0
- package/lib/index.js +42 -43
- package/lib/internal/ClickListener.js +3 -13
- package/lib/internal/FloatingMenu.js +57 -63
- package/lib/internal/OptimizedResize.js +6 -12
- package/lib/internal/Selection.js +2 -25
- package/lib/internal/createClassWrapper.js +0 -2
- package/lib/internal/deprecateFieldOnObject.js +0 -4
- package/lib/internal/focus/index.js +0 -1
- package/lib/internal/keyboard/keys.js +2 -1
- package/lib/internal/keyboard/match.js +1 -6
- package/lib/internal/keyboard/navigation.js +8 -7
- package/lib/internal/useAnnouncer.js +0 -1
- package/lib/internal/useAttachedMenu.js +1 -9
- package/lib/internal/useControllableState.js +6 -13
- package/lib/internal/useDelayedState.js +2 -4
- package/lib/internal/useEffectOnce.js +0 -1
- package/lib/internal/useEvent.js +61 -2
- package/lib/internal/useId.js +2 -5
- package/lib/internal/useIsomorphicEffect.js +1 -0
- package/lib/internal/useMergedRefs.js +2 -2
- package/lib/internal/useNoInteractiveChildren.js +2 -13
- package/lib/internal/useNormalizedInputProps.js +0 -3
- package/lib/internal/useSavedCallback.js +1 -2
- package/lib/internal/warning.js +0 -3
- package/lib/internal/wrapFocus.js +1 -8
- package/lib/prop-types/deprecate.js +2 -5
- package/lib/prop-types/isRequiredOneOf.js +2 -5
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/lib/tools/array.js +0 -3
- package/lib/tools/events.js +0 -3
- package/lib/tools/mergeRefs.js +0 -2
- package/lib/tools/wrapComponent.js +2 -5
- package/package.json +9 -9
- package/es/components/Tab/Tab.js +0 -185
- package/es/components/Tab/index.js +0 -14
- package/es/components/TimePickerSelect/index.js +0 -13
- package/lib/components/Form/index.js +0 -17
- package/lib/components/Tab/Tab.js +0 -214
- package/lib/components/Tab/index.js +0 -39
- package/lib/components/TimePickerSelect/index.js +0 -38
|
@@ -58,23 +58,19 @@ ModalBody.propTypes = {
|
|
|
58
58
|
* Required props for the accessibility label of the header
|
|
59
59
|
*/
|
|
60
60
|
['aria-label']: requiredIfGivenPropIsTruthy["default"]('hasScrollingContent', PropTypes__default["default"].string),
|
|
61
|
-
|
|
62
61
|
/**
|
|
63
62
|
* Specify the content to be placed in the ModalBody
|
|
64
63
|
*/
|
|
65
64
|
children: PropTypes__default["default"].node,
|
|
66
|
-
|
|
67
65
|
/**
|
|
68
66
|
* Specify an optional className to be added to the Modal Body node
|
|
69
67
|
*/
|
|
70
68
|
className: PropTypes__default["default"].string,
|
|
71
|
-
|
|
72
69
|
/**
|
|
73
70
|
* Provide whether the modal content has a form element.
|
|
74
71
|
* If `true` is used here, non-form child content should have `bx--modal-content__regular-content` class.
|
|
75
72
|
*/
|
|
76
73
|
hasForm: PropTypes__default["default"].bool,
|
|
77
|
-
|
|
78
74
|
/**
|
|
79
75
|
* Specify whether the modal contains scrolling content
|
|
80
76
|
*/
|
|
@@ -105,37 +101,30 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
105
101
|
const button = React.useRef();
|
|
106
102
|
const startSentinel = React.useRef();
|
|
107
103
|
const endSentinel = React.useRef();
|
|
108
|
-
|
|
109
104
|
if (open !== prevOpen) {
|
|
110
105
|
setisOpen(open);
|
|
111
106
|
setPrevOpen(open);
|
|
112
107
|
}
|
|
113
|
-
|
|
114
108
|
function handleKeyDown(evt) {
|
|
115
109
|
// Esc key
|
|
116
110
|
if (evt.which === 27) {
|
|
117
111
|
closeModal(evt);
|
|
118
112
|
}
|
|
119
|
-
|
|
120
113
|
onKeyDown(evt);
|
|
121
114
|
}
|
|
122
|
-
|
|
123
115
|
function handleMousedown(evt) {
|
|
124
116
|
if (!innerModal.current.contains(evt.target) && preventCloseOnClickOutside) {
|
|
125
117
|
return;
|
|
126
118
|
}
|
|
127
|
-
|
|
128
119
|
if (innerModal.current && !innerModal.current.contains(evt.target)) {
|
|
129
120
|
closeModal(evt);
|
|
130
121
|
}
|
|
131
122
|
}
|
|
132
|
-
|
|
133
123
|
function handleBlur(_ref3) {
|
|
134
124
|
let {
|
|
135
125
|
target: oldActiveNode,
|
|
136
126
|
relatedTarget: currentActiveNode
|
|
137
127
|
} = _ref3;
|
|
138
|
-
|
|
139
128
|
if (open && currentActiveNode && oldActiveNode) {
|
|
140
129
|
const {
|
|
141
130
|
current: bodyNode
|
|
@@ -156,13 +145,11 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
156
145
|
});
|
|
157
146
|
}
|
|
158
147
|
}
|
|
159
|
-
|
|
160
148
|
function closeModal(evt) {
|
|
161
149
|
if (!onClose || onClose(evt) !== false) {
|
|
162
150
|
setisOpen(false);
|
|
163
151
|
}
|
|
164
152
|
}
|
|
165
|
-
|
|
166
153
|
const modalClass = cx__default["default"]({
|
|
167
154
|
[`${prefix}--modal`]: true,
|
|
168
155
|
'is-visible': isOpen,
|
|
@@ -174,8 +161,9 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
174
161
|
[`${prefix}--modal-container--${size}`]: size,
|
|
175
162
|
[`${prefix}--modal-container--full-width`]: isFullWidth,
|
|
176
163
|
[containerClassName]: containerClassName
|
|
177
|
-
});
|
|
164
|
+
});
|
|
178
165
|
|
|
166
|
+
// Generate aria-label based on Modal Header label if one is not provided (L253)
|
|
179
167
|
let generatedAriaLabel;
|
|
180
168
|
const childrenWithProps = React__default["default"].Children.toArray(children).map(child => {
|
|
181
169
|
switch (child.type) {
|
|
@@ -184,13 +172,11 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
184
172
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
185
173
|
closeModal: closeModal
|
|
186
174
|
});
|
|
187
|
-
|
|
188
175
|
case React__default["default"].createElement(ModalFooter.ModalFooter).type:
|
|
189
176
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
190
177
|
closeModal: closeModal,
|
|
191
178
|
inputref: button
|
|
192
179
|
});
|
|
193
|
-
|
|
194
180
|
default:
|
|
195
181
|
return child;
|
|
196
182
|
}
|
|
@@ -211,22 +197,18 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
211
197
|
const focusButton = focusContainerElement => {
|
|
212
198
|
if (focusContainerElement) {
|
|
213
199
|
const primaryFocusElement = focusContainerElement.querySelector(selectorPrimaryFocus);
|
|
214
|
-
|
|
215
200
|
if (primaryFocusElement) {
|
|
216
201
|
primaryFocusElement.focus();
|
|
217
202
|
return;
|
|
218
203
|
}
|
|
219
|
-
|
|
220
204
|
if (button.current) {
|
|
221
205
|
button.current.focus();
|
|
222
206
|
}
|
|
223
207
|
}
|
|
224
208
|
};
|
|
225
|
-
|
|
226
209
|
if (!open) {
|
|
227
210
|
return;
|
|
228
211
|
}
|
|
229
|
-
|
|
230
212
|
if (innerModal.current) {
|
|
231
213
|
focusButton(innerModal.current);
|
|
232
214
|
}
|
|
@@ -263,67 +245,55 @@ ComposedModal.propTypes = {
|
|
|
263
245
|
* Specify the aria-label for bx--modal-container
|
|
264
246
|
*/
|
|
265
247
|
['aria-label']: PropTypes__default["default"].string,
|
|
266
|
-
|
|
267
248
|
/**
|
|
268
249
|
* Specify the aria-labelledby for bx--modal-container
|
|
269
250
|
*/
|
|
270
251
|
['aria-labelledby']: PropTypes__default["default"].string,
|
|
271
|
-
|
|
272
252
|
/**
|
|
273
253
|
* Specify the content to be placed in the ComposedModal
|
|
274
254
|
*/
|
|
275
255
|
children: PropTypes__default["default"].node,
|
|
276
|
-
|
|
277
256
|
/**
|
|
278
257
|
* Specify an optional className to be applied to the modal root node
|
|
279
258
|
*/
|
|
280
259
|
className: PropTypes__default["default"].string,
|
|
281
|
-
|
|
282
260
|
/**
|
|
283
261
|
* Specify an optional className to be applied to the modal node
|
|
284
262
|
*/
|
|
285
263
|
containerClassName: PropTypes__default["default"].string,
|
|
286
|
-
|
|
287
264
|
/**
|
|
288
265
|
* Specify whether the primary button should be replaced with danger button.
|
|
289
266
|
* Note that this prop is not applied if you render primary/danger button by yourself
|
|
290
267
|
*/
|
|
291
268
|
danger: PropTypes__default["default"].bool,
|
|
292
|
-
|
|
293
269
|
/**
|
|
294
270
|
* Specify whether or not the Modal content should have any inner padding.
|
|
295
271
|
*/
|
|
296
272
|
isFullWidth: PropTypes__default["default"].bool,
|
|
297
|
-
|
|
298
273
|
/**
|
|
299
274
|
* Specify an optional handler for closing modal.
|
|
300
275
|
* Returning `false` here prevents closing modal.
|
|
301
276
|
*/
|
|
302
277
|
onClose: PropTypes__default["default"].func,
|
|
303
|
-
|
|
304
278
|
/**
|
|
305
279
|
* Specify an optional handler for the `onKeyDown` event. Called for all
|
|
306
280
|
* `onKeyDown` events that do not close the modal
|
|
307
281
|
*/
|
|
308
282
|
onKeyDown: PropTypes__default["default"].func,
|
|
309
|
-
|
|
310
283
|
/**
|
|
311
284
|
* Specify whether the Modal is currently open
|
|
312
285
|
*/
|
|
313
286
|
open: PropTypes__default["default"].bool,
|
|
314
287
|
preventCloseOnClickOutside: PropTypes__default["default"].bool,
|
|
315
|
-
|
|
316
288
|
/**
|
|
317
289
|
* Specify a CSS selector that matches the DOM element that should be
|
|
318
290
|
* focused when the Modal opens
|
|
319
291
|
*/
|
|
320
292
|
selectorPrimaryFocus: PropTypes__default["default"].string,
|
|
321
|
-
|
|
322
293
|
/**
|
|
323
294
|
* Specify the CSS selectors that match the floating menus
|
|
324
295
|
*/
|
|
325
296
|
selectorsFloatingMenus: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
|
|
326
|
-
|
|
327
297
|
/**
|
|
328
298
|
* Specify the size variant.
|
|
329
299
|
*/
|
|
@@ -31,12 +31,10 @@ function SecondaryButtonSet(_ref) {
|
|
|
31
31
|
closeModal,
|
|
32
32
|
onRequestClose
|
|
33
33
|
} = _ref;
|
|
34
|
-
|
|
35
34
|
function handleRequestClose(evt) {
|
|
36
35
|
closeModal(evt);
|
|
37
36
|
onRequestClose(evt);
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
if (Array.isArray(secondaryButtons) && secondaryButtons.length <= 2) {
|
|
41
39
|
return secondaryButtons.map((_ref2, i) => {
|
|
42
40
|
let {
|
|
@@ -51,7 +49,6 @@ function SecondaryButtonSet(_ref) {
|
|
|
51
49
|
}, buttonText);
|
|
52
50
|
});
|
|
53
51
|
}
|
|
54
|
-
|
|
55
52
|
if (secondaryButtonText) {
|
|
56
53
|
return /*#__PURE__*/React__default["default"].createElement(Button["default"], {
|
|
57
54
|
className: secondaryClassName,
|
|
@@ -59,10 +56,8 @@ function SecondaryButtonSet(_ref) {
|
|
|
59
56
|
kind: "secondary"
|
|
60
57
|
}, secondaryButtonText);
|
|
61
58
|
}
|
|
62
|
-
|
|
63
59
|
return null;
|
|
64
60
|
}
|
|
65
|
-
|
|
66
61
|
SecondaryButtonSet.propTypes = {
|
|
67
62
|
closeModal: PropTypes__default["default"].func,
|
|
68
63
|
onRequestClose: PropTypes__default["default"].func,
|
|
@@ -72,7 +67,6 @@ SecondaryButtonSet.propTypes = {
|
|
|
72
67
|
if (!Array.isArray(props.secondaryButtons) || props.secondaryButtons.length !== 2) {
|
|
73
68
|
return new Error(`${propName} needs to be an array of two button config objects`);
|
|
74
69
|
}
|
|
75
|
-
|
|
76
70
|
const shape = {
|
|
77
71
|
buttonText: PropTypes__default["default"].node,
|
|
78
72
|
onClick: PropTypes__default["default"].func
|
|
@@ -81,7 +75,6 @@ SecondaryButtonSet.propTypes = {
|
|
|
81
75
|
PropTypes__default["default"].checkPropTypes(shape, secondaryButton, propName, componentName);
|
|
82
76
|
});
|
|
83
77
|
}
|
|
84
|
-
|
|
85
78
|
return null;
|
|
86
79
|
},
|
|
87
80
|
secondaryClassName: PropTypes__default["default"].string
|
|
@@ -133,62 +126,51 @@ ModalFooter.propTypes = {
|
|
|
133
126
|
* Pass in content that will be rendered in the Modal Footer
|
|
134
127
|
*/
|
|
135
128
|
children: PropTypes__default["default"].node,
|
|
136
|
-
|
|
137
129
|
/**
|
|
138
130
|
* Specify a custom className to be applied to the Modal Footer container
|
|
139
131
|
*/
|
|
140
132
|
className: PropTypes__default["default"].string,
|
|
141
|
-
|
|
142
133
|
/**
|
|
143
134
|
* Specify an optional function that is called whenever the modal is closed
|
|
144
135
|
*/
|
|
145
136
|
closeModal: PropTypes__default["default"].func,
|
|
146
|
-
|
|
147
137
|
/**
|
|
148
138
|
* Specify whether the primary button should be replaced with danger button.
|
|
149
139
|
* Note that this prop is not applied if you render primary/danger button by yourself
|
|
150
140
|
*/
|
|
151
141
|
danger: PropTypes__default["default"].bool,
|
|
152
|
-
|
|
153
142
|
/**
|
|
154
143
|
* The `ref` callback for the primary button.
|
|
155
144
|
*/
|
|
156
145
|
inputref: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
|
|
157
146
|
current: PropTypes__default["default"].any
|
|
158
147
|
})]),
|
|
159
|
-
|
|
160
148
|
/**
|
|
161
149
|
* Specify an optional function for when the modal is requesting to be
|
|
162
150
|
* closed
|
|
163
151
|
*/
|
|
164
152
|
onRequestClose: PropTypes__default["default"].func,
|
|
165
|
-
|
|
166
153
|
/**
|
|
167
154
|
* Specify an optional function for when the modal is requesting to be
|
|
168
155
|
* submitted
|
|
169
156
|
*/
|
|
170
157
|
onRequestSubmit: PropTypes__default["default"].func,
|
|
171
|
-
|
|
172
158
|
/**
|
|
173
159
|
* Specify whether the primary button should be disabled
|
|
174
160
|
*/
|
|
175
161
|
primaryButtonDisabled: PropTypes__default["default"].bool,
|
|
176
|
-
|
|
177
162
|
/**
|
|
178
163
|
* Specify the text for the primary button
|
|
179
164
|
*/
|
|
180
165
|
primaryButtonText: PropTypes__default["default"].string,
|
|
181
|
-
|
|
182
166
|
/**
|
|
183
167
|
* Specify a custom className to be applied to the primary button
|
|
184
168
|
*/
|
|
185
169
|
primaryClassName: PropTypes__default["default"].string,
|
|
186
|
-
|
|
187
170
|
/**
|
|
188
171
|
* Specify the text for the secondary button
|
|
189
172
|
*/
|
|
190
173
|
secondaryButtonText: PropTypes__default["default"].string,
|
|
191
|
-
|
|
192
174
|
/**
|
|
193
175
|
* Specify an array of config objects for secondary buttons
|
|
194
176
|
* (`Array<{
|
|
@@ -201,7 +183,6 @@ ModalFooter.propTypes = {
|
|
|
201
183
|
if (!Array.isArray(props.secondaryButtons) || props.secondaryButtons.length !== 2) {
|
|
202
184
|
return new Error(`${propName} needs to be an array of two button config objects`);
|
|
203
185
|
}
|
|
204
|
-
|
|
205
186
|
const shape = {
|
|
206
187
|
buttonText: PropTypes__default["default"].node,
|
|
207
188
|
onClick: PropTypes__default["default"].func
|
|
@@ -210,10 +191,8 @@ ModalFooter.propTypes = {
|
|
|
210
191
|
PropTypes__default["default"].checkPropTypes(shape, secondaryButton, propName, componentName);
|
|
211
192
|
});
|
|
212
193
|
}
|
|
213
|
-
|
|
214
194
|
return null;
|
|
215
195
|
},
|
|
216
|
-
|
|
217
196
|
/**
|
|
218
197
|
* Specify a custom className to be applied to the secondary button
|
|
219
198
|
*/
|
|
@@ -38,12 +38,10 @@ const ModalHeader = /*#__PURE__*/React__default["default"].forwardRef(function M
|
|
|
38
38
|
...rest
|
|
39
39
|
} = _ref;
|
|
40
40
|
const prefix = usePrefix.usePrefix();
|
|
41
|
-
|
|
42
41
|
function handleCloseButtonClick(evt) {
|
|
43
42
|
closeModal(evt);
|
|
44
43
|
buttonOnClick();
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
const headerClass = cx__default["default"]({
|
|
48
46
|
[`${prefix}--modal-header`]: true,
|
|
49
47
|
[customClassName]: customClassName
|
|
@@ -89,53 +87,43 @@ ModalHeader.propTypes = {
|
|
|
89
87
|
* clicked
|
|
90
88
|
*/
|
|
91
89
|
buttonOnClick: PropTypes__default["default"].func,
|
|
92
|
-
|
|
93
90
|
/**
|
|
94
91
|
* Specify the content to be placed in the ModalHeader
|
|
95
92
|
*/
|
|
96
93
|
children: PropTypes__default["default"].node,
|
|
97
|
-
|
|
98
94
|
/**
|
|
99
95
|
* Specify an optional className to be applied to the modal header
|
|
100
96
|
*/
|
|
101
97
|
className: PropTypes__default["default"].string,
|
|
102
|
-
|
|
103
98
|
/**
|
|
104
99
|
* Specify an optional className to be applied to the modal close node
|
|
105
100
|
*/
|
|
106
101
|
closeClassName: PropTypes__default["default"].string,
|
|
107
|
-
|
|
108
102
|
/**
|
|
109
103
|
* Specify an optional className to be applied to the modal close icon node
|
|
110
104
|
*/
|
|
111
105
|
closeIconClassName: PropTypes__default["default"].string,
|
|
112
|
-
|
|
113
106
|
/**
|
|
114
107
|
* Provide an optional function to be called when the modal is closed
|
|
115
108
|
*/
|
|
116
109
|
closeModal: PropTypes__default["default"].func,
|
|
117
|
-
|
|
118
110
|
/**
|
|
119
111
|
* Specify a description for the close icon that can be read by screen
|
|
120
112
|
* readers
|
|
121
113
|
*/
|
|
122
114
|
iconDescription: PropTypes__default["default"].string,
|
|
123
|
-
|
|
124
115
|
/**
|
|
125
116
|
* Specify an optional label to be displayed
|
|
126
117
|
*/
|
|
127
118
|
label: PropTypes__default["default"].node,
|
|
128
|
-
|
|
129
119
|
/**
|
|
130
120
|
* Specify an optional className to be applied to the modal header label
|
|
131
121
|
*/
|
|
132
122
|
labelClassName: PropTypes__default["default"].string,
|
|
133
|
-
|
|
134
123
|
/**
|
|
135
124
|
* Specify an optional title to be displayed
|
|
136
125
|
*/
|
|
137
126
|
title: PropTypes__default["default"].node,
|
|
138
|
-
|
|
139
127
|
/**
|
|
140
128
|
* Specify an optional className to be applied to the modal heading
|
|
141
129
|
*/
|
|
@@ -22,50 +22,30 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
22
22
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
23
|
|
|
24
24
|
const variants = ['on-page', 'disclosed'];
|
|
25
|
-
|
|
26
25
|
function filterChildren(children) {
|
|
27
|
-
var _children$type;
|
|
28
|
-
|
|
29
26
|
if (Array.isArray(children)) {
|
|
30
|
-
return children
|
|
31
|
-
var _child$type;
|
|
32
|
-
|
|
33
|
-
return !['Search', 'ExpandableSearch'].includes(child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName);
|
|
34
|
-
});
|
|
27
|
+
return children?.filter(child => !['Search', 'ExpandableSearch'].includes(child?.type?.displayName));
|
|
35
28
|
}
|
|
36
|
-
|
|
37
|
-
if (children && !['Search', 'ExpandableSearch'].includes(children === null || children === void 0 ? void 0 : (_children$type = children.type) === null || _children$type === void 0 ? void 0 : _children$type.displayName)) {
|
|
29
|
+
if (children && !['Search', 'ExpandableSearch'].includes(children?.type?.displayName)) {
|
|
38
30
|
return children;
|
|
39
31
|
}
|
|
40
|
-
|
|
41
32
|
return null;
|
|
42
33
|
}
|
|
43
|
-
|
|
44
34
|
function renderChildren(children) {
|
|
45
|
-
var _children$type2;
|
|
46
|
-
|
|
47
35
|
if (Array.isArray(children)) {
|
|
48
36
|
children.map((child, index) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (index === 0 && ((_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === 'Search') {
|
|
37
|
+
if (index === 0 && child.type?.displayName === 'Search') {
|
|
52
38
|
return child;
|
|
53
39
|
}
|
|
54
|
-
|
|
55
40
|
return child;
|
|
56
41
|
});
|
|
57
42
|
}
|
|
58
|
-
|
|
59
|
-
if (children && ((_children$type2 = children.type) === null || _children$type2 === void 0 ? void 0 : _children$type2.displayName) === 'Search') {
|
|
43
|
+
if (children && children.type?.displayName === 'Search') {
|
|
60
44
|
return children;
|
|
61
45
|
}
|
|
62
|
-
|
|
63
46
|
return children;
|
|
64
47
|
}
|
|
65
|
-
|
|
66
48
|
function ContainedList(_ref) {
|
|
67
|
-
var _action$type;
|
|
68
|
-
|
|
69
49
|
let {
|
|
70
50
|
action,
|
|
71
51
|
children,
|
|
@@ -81,7 +61,7 @@ function ContainedList(_ref) {
|
|
|
81
61
|
[`${prefix}--contained-list--inset-rulers`]: isInset
|
|
82
62
|
}, `${prefix}--contained-list--${kind}`, `${prefix}--contained-list--${size}`, className);
|
|
83
63
|
const filteredChildren = filterChildren(children);
|
|
84
|
-
const isActionSearch = ['Search', 'ExpandableSearch'].includes(action
|
|
64
|
+
const isActionSearch = ['Search', 'ExpandableSearch'].includes(action?.type?.displayName);
|
|
85
65
|
const renderedChildren = renderChildren(children);
|
|
86
66
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
87
67
|
className: classes
|
|
@@ -96,38 +76,31 @@ function ContainedList(_ref) {
|
|
|
96
76
|
"aria-labelledby": labelId
|
|
97
77
|
}, isActionSearch ? filteredChildren : renderedChildren));
|
|
98
78
|
}
|
|
99
|
-
|
|
100
79
|
ContainedList.propTypes = {
|
|
101
80
|
/**
|
|
102
81
|
* A slot for a possible interactive element to render.
|
|
103
82
|
*/
|
|
104
83
|
action: PropTypes__default["default"].node,
|
|
105
|
-
|
|
106
84
|
/**
|
|
107
85
|
* A collection of ContainedListItems to be rendered in the ContainedList
|
|
108
86
|
*/
|
|
109
87
|
children: PropTypes__default["default"].node,
|
|
110
|
-
|
|
111
88
|
/**
|
|
112
89
|
* Additional CSS class names.
|
|
113
90
|
*/
|
|
114
91
|
className: PropTypes__default["default"].string,
|
|
115
|
-
|
|
116
92
|
/**
|
|
117
93
|
* Specify whether the dividing lines in between list items should be inset.
|
|
118
94
|
*/
|
|
119
95
|
isInset: PropTypes__default["default"].bool,
|
|
120
|
-
|
|
121
96
|
/**
|
|
122
97
|
* The kind of ContainedList you want to display
|
|
123
98
|
*/
|
|
124
99
|
kind: PropTypes__default["default"].oneOf(variants),
|
|
125
|
-
|
|
126
100
|
/**
|
|
127
101
|
* A label describing the contained list.
|
|
128
102
|
*/
|
|
129
103
|
label: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].node]).isRequired,
|
|
130
|
-
|
|
131
104
|
/**
|
|
132
105
|
* Specify the size of the contained list.
|
|
133
106
|
*/
|
|
@@ -52,33 +52,27 @@ function ContainedListItem(_ref) {
|
|
|
52
52
|
className: `${prefix}--contained-list-item__action`
|
|
53
53
|
}, action));
|
|
54
54
|
}
|
|
55
|
-
|
|
56
55
|
ContainedListItem.propTypes = {
|
|
57
56
|
/**
|
|
58
57
|
* A slot for a possible interactive element to render within the item.
|
|
59
58
|
*/
|
|
60
59
|
action: PropTypes__default["default"].node,
|
|
61
|
-
|
|
62
60
|
/**
|
|
63
61
|
* The content of this item. Must not contain any interactive elements. Use props.action to include those.
|
|
64
62
|
*/
|
|
65
63
|
children: PropTypes__default["default"].node,
|
|
66
|
-
|
|
67
64
|
/**
|
|
68
65
|
* Additional CSS class names.
|
|
69
66
|
*/
|
|
70
67
|
className: PropTypes__default["default"].string,
|
|
71
|
-
|
|
72
68
|
/**
|
|
73
69
|
* Whether this item is disabled.
|
|
74
70
|
*/
|
|
75
71
|
disabled: PropTypes__default["default"].bool,
|
|
76
|
-
|
|
77
72
|
/**
|
|
78
73
|
* Provide an optional function to be called when the item is clicked.
|
|
79
74
|
*/
|
|
80
75
|
onClick: PropTypes__default["default"].func,
|
|
81
|
-
|
|
82
76
|
/**
|
|
83
77
|
* Provide an optional icon to render in front of the item's content.
|
|
84
78
|
*/
|
|
@@ -29,35 +29,29 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
29
29
|
class ContentSwitcher extends React__default["default"].Component {
|
|
30
30
|
constructor() {
|
|
31
31
|
super(...arguments);
|
|
32
|
-
|
|
33
32
|
_rollupPluginBabelHelpers.defineProperty(this, "_switchRefs", []);
|
|
34
|
-
|
|
35
33
|
_rollupPluginBabelHelpers.defineProperty(this, "state", {});
|
|
36
|
-
|
|
37
34
|
_rollupPluginBabelHelpers.defineProperty(this, "handleItemRef", index => ref => {
|
|
38
35
|
this._switchRefs[index] = ref;
|
|
39
36
|
});
|
|
40
|
-
|
|
41
37
|
_rollupPluginBabelHelpers.defineProperty(this, "handleChildChange", data => {
|
|
42
38
|
const {
|
|
43
39
|
selectionMode
|
|
44
|
-
} = this.props;
|
|
45
|
-
|
|
40
|
+
} = this.props;
|
|
41
|
+
// the currently selected child index
|
|
46
42
|
const {
|
|
47
43
|
selectedIndex
|
|
48
|
-
} = this.state;
|
|
49
|
-
|
|
44
|
+
} = this.state;
|
|
45
|
+
// the newly selected child index
|
|
50
46
|
const {
|
|
51
47
|
index
|
|
52
48
|
} = data;
|
|
53
49
|
const {
|
|
54
50
|
key
|
|
55
51
|
} = data;
|
|
56
|
-
|
|
57
52
|
if (match.matches(data, [keys.ArrowRight, keys.ArrowLeft])) {
|
|
58
53
|
const nextIndex = navigation.getNextIndex(key, index, this.props.children.length);
|
|
59
54
|
const children = React__default["default"].Children.toArray(this.props.children);
|
|
60
|
-
|
|
61
55
|
if (selectionMode === 'manual') {
|
|
62
56
|
const switchRef = this._switchRefs[nextIndex];
|
|
63
57
|
switchRef && switchRef.focus();
|
|
@@ -68,7 +62,8 @@ class ContentSwitcher extends React__default["default"].Component {
|
|
|
68
62
|
const child = children[this.state.selectedIndex];
|
|
69
63
|
const switchRef = this._switchRefs[this.state.selectedIndex];
|
|
70
64
|
switchRef && switchRef.focus();
|
|
71
|
-
this.props.onChange({
|
|
65
|
+
this.props.onChange({
|
|
66
|
+
...data,
|
|
72
67
|
index: this.state.selectedIndex,
|
|
73
68
|
name: child.props.name,
|
|
74
69
|
text: child.props.text
|
|
@@ -86,7 +81,11 @@ class ContentSwitcher extends React__default["default"].Component {
|
|
|
86
81
|
}
|
|
87
82
|
});
|
|
88
83
|
}
|
|
89
|
-
|
|
84
|
+
/**
|
|
85
|
+
* The DOM references of child `<Switch>`.
|
|
86
|
+
* @type {Array<Element>}
|
|
87
|
+
* @private
|
|
88
|
+
*/
|
|
90
89
|
static getDerivedStateFromProps(_ref, state) {
|
|
91
90
|
let {
|
|
92
91
|
selectedIndex
|
|
@@ -99,7 +98,6 @@ class ContentSwitcher extends React__default["default"].Component {
|
|
|
99
98
|
prevSelectedIndex: selectedIndex
|
|
100
99
|
};
|
|
101
100
|
}
|
|
102
|
-
|
|
103
101
|
render() {
|
|
104
102
|
const prefix = this.context;
|
|
105
103
|
const {
|
|
@@ -133,49 +131,39 @@ class ContentSwitcher extends React__default["default"].Component {
|
|
|
133
131
|
size
|
|
134
132
|
})));
|
|
135
133
|
}
|
|
136
|
-
|
|
137
134
|
}
|
|
138
|
-
|
|
139
135
|
_rollupPluginBabelHelpers.defineProperty(ContentSwitcher, "propTypes", {
|
|
140
136
|
/**
|
|
141
137
|
* Pass in Switch components to be rendered in the ContentSwitcher
|
|
142
138
|
*/
|
|
143
139
|
children: PropTypes__default["default"].node,
|
|
144
|
-
|
|
145
140
|
/**
|
|
146
141
|
* Specify an optional className to be added to the container node
|
|
147
142
|
*/
|
|
148
143
|
className: PropTypes__default["default"].string,
|
|
149
|
-
|
|
150
144
|
/**
|
|
151
145
|
* `true` to use the light variant.
|
|
152
146
|
*/
|
|
153
147
|
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `ContentSwitcher` is no longer needed and has ' + 'been deprecated. It will be removed in the next major release.'),
|
|
154
|
-
|
|
155
148
|
/**
|
|
156
149
|
* Specify an `onChange` handler that is called whenever the ContentSwitcher
|
|
157
150
|
* changes which item is selected
|
|
158
151
|
*/
|
|
159
152
|
onChange: PropTypes__default["default"].func.isRequired,
|
|
160
|
-
|
|
161
153
|
/**
|
|
162
154
|
* Specify a selected index for the initially selected content
|
|
163
155
|
*/
|
|
164
156
|
selectedIndex: PropTypes__default["default"].number,
|
|
165
|
-
|
|
166
157
|
/**
|
|
167
158
|
* Choose whether or not to automatically change selection on focus
|
|
168
159
|
*/
|
|
169
160
|
selectionMode: PropTypes__default["default"].oneOf(['automatic', 'manual']),
|
|
170
|
-
|
|
171
161
|
/**
|
|
172
162
|
* Specify the size of the Content Switcher. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
|
|
173
163
|
*/
|
|
174
164
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg'])
|
|
175
165
|
});
|
|
176
|
-
|
|
177
166
|
_rollupPluginBabelHelpers.defineProperty(ContentSwitcher, "contextType", usePrefix.PrefixContext);
|
|
178
|
-
|
|
179
167
|
_rollupPluginBabelHelpers.defineProperty(ContentSwitcher, "defaultProps", {
|
|
180
168
|
selectedIndex: 0,
|
|
181
169
|
selectionMode: 'automatic',
|
|
@@ -15,12 +15,10 @@ var React = require('react');
|
|
|
15
15
|
* @param {Element|Document|Window|object} [trigger=document] The element or ref which should trigger the Menu on right-click
|
|
16
16
|
* @returns {object} Props object to pass onto Menu component
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
18
|
function useContextMenu() {
|
|
20
19
|
let trigger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
21
20
|
const [open, setOpen] = React.useState(false);
|
|
22
21
|
const [position, setPosition] = React.useState([0, 0]);
|
|
23
|
-
|
|
24
22
|
function openContextMenu(e) {
|
|
25
23
|
e.preventDefault();
|
|
26
24
|
const {
|
|
@@ -30,14 +28,11 @@ function useContextMenu() {
|
|
|
30
28
|
setPosition([x, y]);
|
|
31
29
|
setOpen(true);
|
|
32
30
|
}
|
|
33
|
-
|
|
34
31
|
function onClose() {
|
|
35
32
|
setOpen(false);
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
React.useEffect(() => {
|
|
39
|
-
const el =
|
|
40
|
-
|
|
35
|
+
const el = trigger?.current ?? trigger;
|
|
41
36
|
if (el && el instanceof Element || el instanceof Document || el instanceof Window) {
|
|
42
37
|
el.addEventListener('contextmenu', openContextMenu);
|
|
43
38
|
return () => {
|