@patternfly/react-core 6.4.1-prerelease.8 → 6.4.1
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/CHANGELOG.md +2 -44
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/Content/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -1
- package/dist/dynamic/deprecated/components/Tile/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/esm/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/esm/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +4 -14
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js +4 -2
- package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +0 -4
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js +3 -5
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts +0 -4
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js +2 -2
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts +0 -2
- package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Modal/ModalContent.d.ts +0 -2
- package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalContent.js +2 -2
- package/dist/esm/components/Modal/ModalContent.js.map +1 -1
- package/dist/esm/components/Progress/ProgressContainer.js +2 -2
- package/dist/esm/components/Progress/ProgressContainer.js.map +1 -1
- package/dist/esm/components/Radio/Radio.d.ts +0 -3
- package/dist/esm/components/Radio/Radio.d.ts.map +1 -1
- package/dist/esm/components/Radio/Radio.js +5 -15
- package/dist/esm/components/Radio/Radio.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNavInternal.js +3 -3
- package/dist/esm/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.d.ts +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.js +1 -2
- package/dist/esm/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/esm/components/Wizard/WizardStep.d.ts +1 -1
- package/dist/esm/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/components/Wizard/types.d.ts +2 -3
- package/dist/esm/components/Wizard/types.d.ts.map +1 -1
- package/dist/esm/components/Wizard/types.js +0 -1
- package/dist/esm/components/Wizard/types.js.map +1 -1
- package/dist/esm/helpers/FocusTrap/FocusTrap.d.ts +0 -2
- package/dist/esm/helpers/FocusTrap/FocusTrap.d.ts.map +1 -1
- package/dist/esm/helpers/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/esm/helpers/resizeObserver.js +2 -2
- package/dist/esm/helpers/resizeObserver.js.map +1 -1
- package/dist/js/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/js/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/js/components/Checkbox/Checkbox.js +4 -14
- package/dist/js/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js +4 -2
- package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +0 -4
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js +3 -5
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts +0 -4
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js +2 -2
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/js/components/Modal/Modal.d.ts +0 -2
- package/dist/js/components/Modal/Modal.d.ts.map +1 -1
- package/dist/js/components/Modal/Modal.js.map +1 -1
- package/dist/js/components/Modal/ModalContent.d.ts +0 -2
- package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalContent.js +2 -2
- package/dist/js/components/Modal/ModalContent.js.map +1 -1
- package/dist/js/components/Progress/ProgressContainer.js +2 -2
- package/dist/js/components/Progress/ProgressContainer.js.map +1 -1
- package/dist/js/components/Radio/Radio.d.ts +0 -3
- package/dist/js/components/Radio/Radio.d.ts.map +1 -1
- package/dist/js/components/Radio/Radio.js +5 -15
- package/dist/js/components/Radio/Radio.js.map +1 -1
- package/dist/js/components/Wizard/WizardNavInternal.js +3 -3
- package/dist/js/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/js/components/Wizard/WizardNavItem.d.ts +1 -1
- package/dist/js/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardNavItem.js +1 -2
- package/dist/js/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/components/Wizard/WizardStep.d.ts +1 -1
- package/dist/js/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/components/Wizard/types.d.ts +2 -3
- package/dist/js/components/Wizard/types.d.ts.map +1 -1
- package/dist/js/components/Wizard/types.js +0 -1
- package/dist/js/components/Wizard/types.js.map +1 -1
- package/dist/js/helpers/FocusTrap/FocusTrap.d.ts +0 -2
- package/dist/js/helpers/FocusTrap/FocusTrap.d.ts.map +1 -1
- package/dist/js/helpers/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/js/helpers/resizeObserver.js +1 -1
- package/dist/js/helpers/resizeObserver.js.map +1 -1
- package/dist/umd/assets/{output-CyRsIwqr.css → output-Bj1Aarly.css} +16495 -16495
- package/dist/umd/react-core.min.js +1 -1
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/Checkbox/Checkbox.tsx +2 -21
- package/src/components/Checkbox/__tests__/Checkbox.test.tsx +0 -34
- package/src/components/Drawer/DrawerPanelContent.tsx +3 -5
- package/src/components/Drawer/__tests__/DrawerPanelContent.test.tsx +0 -37
- package/src/components/ExpandableSection/ExpandableSection.tsx +0 -10
- package/src/components/ExpandableSection/ExpandableSectionToggle.tsx +0 -8
- package/src/components/ExpandableSection/__tests__/ExpandableSection.test.tsx +0 -17
- package/src/components/ExpandableSection/__tests__/ExpandableSectionToggle.test.tsx +0 -17
- package/src/components/MenuToggle/examples/MenuToggle.md +96 -13
- package/src/components/Modal/Modal.tsx +0 -2
- package/src/components/Modal/ModalContent.tsx +0 -4
- package/src/components/Modal/__tests__/Modal.test.tsx +0 -9
- package/src/components/Modal/__tests__/ModalContent.test.tsx +1 -17
- package/src/components/Modal/examples/Modal.md +5 -14
- package/src/components/Modal/examples/ModalWithDropdown.tsx +7 -34
- package/src/components/Panel/examples/Panel.md +159 -10
- package/src/components/Progress/ProgressContainer.tsx +2 -2
- package/src/components/Progress/__tests__/Generated/__snapshots__/ProgressContainer.test.tsx.snap +1 -1
- package/src/components/Progress/__tests__/__snapshots__/Progress.test.tsx.snap +1 -1
- package/src/components/Radio/Radio.tsx +3 -21
- package/src/components/Radio/__tests__/Radio.test.tsx +0 -44
- package/src/components/Tabs/__tests__/Tabs.test.tsx +1 -109
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +2 -2
- package/src/components/Tabs/examples/Tabs.md +4 -38
- package/src/components/Tabs/examples/TabsSeparateContent.tsx +2 -3
- package/src/components/Wizard/WizardNavInternal.tsx +3 -3
- package/src/components/Wizard/WizardNavItem.tsx +2 -5
- package/src/components/Wizard/WizardStep.tsx +1 -1
- package/src/components/Wizard/__tests__/Wizard.test.tsx +39 -0
- package/src/components/Wizard/__tests__/WizardNavItem.test.tsx +0 -6
- package/src/components/Wizard/__tests__/WizardStep.test.tsx +0 -2
- package/src/components/Wizard/examples/WizardStepStatus.tsx +7 -28
- package/src/components/Wizard/types.tsx +2 -3
- package/src/demos/AlertGroup.md +1 -1
- package/src/demos/BackToTop.md +1 -1
- package/src/demos/{Button/examples/ButtonProgress.tsx → Button.md} +19 -1
- package/src/demos/CardView/CardView.md +1 -1
- package/src/demos/DataListDemo.md +4 -4
- package/src/demos/DescriptionList/DescriptionList.md +2 -2
- package/src/demos/Nav.md +9 -9
- package/src/demos/{PasswordGenerator/examples/PasswordGenerator.tsx → PasswordGenerator.md} +19 -3
- package/src/demos/PrimaryDetail.md +6 -6
- package/src/demos/RTL/RTL.md +1 -1
- package/src/demos/SearchInput/SearchInput.md +487 -2
- package/src/demos/Toolbar.md +1 -1
- package/src/demos/examples/BackToTop/BackToTopNameDemo.tsx +1 -1
- package/src/helpers/FocusTrap/FocusTrap.tsx +0 -2
- package/src/helpers/FocusTrap/__tests__/Generated/FocusTrap.test.tsx +3 -3
- package/src/helpers/OUIA/OUIA.md +10 -2
- package/src/helpers/resizeObserver.tsx +2 -2
- package/src/layouts/Bullseye/examples/Bullseye.md +5 -1
- package/src/layouts/Flex/examples/Flex.md +442 -42
- package/src/layouts/Level/examples/Level.md +15 -3
- package/src/layouts/Split/examples/Split.md +34 -4
- package/src/components/MenuToggle/examples/MenuToggleAvatarText.tsx +0 -15
- package/src/components/MenuToggle/examples/MenuToggleBadge.tsx +0 -9
- package/src/components/MenuToggle/examples/MenuToggleCollapsed.tsx +0 -3
- package/src/components/MenuToggle/examples/MenuToggleDisabled.tsx +0 -3
- package/src/components/MenuToggle/examples/MenuToggleExpanded.tsx +0 -3
- package/src/components/MenuToggle/examples/MenuToggleFullHeight.tsx +0 -9
- package/src/components/MenuToggle/examples/MenuToggleFullWidth.tsx +0 -7
- package/src/components/MenuToggle/examples/MenuTogglePlainIcon.tsx +0 -11
- package/src/components/MenuToggle/examples/MenuTogglePlainTextLabel.tsx +0 -16
- package/src/components/MenuToggle/examples/MenuToggleVariantStyles.tsx +0 -14
- package/src/components/Panel/examples/PanelBasic.tsx +0 -9
- package/src/components/Panel/examples/PanelBordered.tsx +0 -9
- package/src/components/Panel/examples/PanelFooterExample.tsx +0 -10
- package/src/components/Panel/examples/PanelHeaderExample.tsx +0 -11
- package/src/components/Panel/examples/PanelHeaderFooter.tsx +0 -12
- package/src/components/Panel/examples/PanelNoBody.tsx +0 -7
- package/src/components/Panel/examples/PanelRaised.tsx +0 -9
- package/src/components/Panel/examples/PanelScrollable.tsx +0 -35
- package/src/components/Panel/examples/PanelScrollableHeaderFooter.tsx +0 -38
- package/src/components/Panel/examples/PanelSecondaryVariant.tsx +0 -9
- package/src/demos/Button/Button.md +0 -19
- package/src/demos/PasswordGenerator/PasswordGenerator.md +0 -16
- package/src/demos/SearchInput/examples/SearchInputAdvancedComposable.tsx +0 -322
- package/src/demos/SearchInput/examples/SearchInputAutocomplete.tsx +0 -165
- package/src/helpers/FocusTrap/__tests__/FocusTrap.test.tsx +0 -17
- package/src/helpers/OUIA/examples/OuiaExample.tsx +0 -11
- package/src/layouts/Bullseye/examples/BullseyeBasic.tsx +0 -7
- package/src/layouts/Flex/examples/FlexAdjustingWidth.tsx +0 -18
- package/src/layouts/Flex/examples/FlexAlignAdjacentContent.tsx +0 -16
- package/src/layouts/Flex/examples/FlexAlignRightMultipleGroups.tsx +0 -18
- package/src/layouts/Flex/examples/FlexAlignRightSingleItem.tsx +0 -8
- package/src/layouts/Flex/examples/FlexAlignSelfBaseline.tsx +0 -15
- package/src/layouts/Flex/examples/FlexAlignSelfCenter.tsx +0 -15
- package/src/layouts/Flex/examples/FlexAlignSelfFlexEnd.tsx +0 -15
- package/src/layouts/Flex/examples/FlexAlignSelfStretch.tsx +0 -15
- package/src/layouts/Flex/examples/FlexAligningRight.tsx +0 -11
- package/src/layouts/Flex/examples/FlexAlternative.tsx +0 -11
- package/src/layouts/Flex/examples/FlexBasic.tsx +0 -11
- package/src/layouts/Flex/examples/FlexCanGrow.tsx +0 -18
- package/src/layouts/Flex/examples/FlexColumnGap.tsx +0 -16
- package/src/layouts/Flex/examples/FlexColumnLayout.tsx +0 -9
- package/src/layouts/Flex/examples/FlexColumnWidths.tsx +0 -18
- package/src/layouts/Flex/examples/FlexControlTextWidth.tsx +0 -17
- package/src/layouts/Flex/examples/FlexDefaultLayout.tsx +0 -11
- package/src/layouts/Flex/examples/FlexFirstLastOrder.tsx +0 -13
- package/src/layouts/Flex/examples/FlexGap.tsx +0 -16
- package/src/layouts/Flex/examples/FlexIndividuallySpaced.tsx +0 -14
- package/src/layouts/Flex/examples/FlexInline.tsx +0 -11
- package/src/layouts/Flex/examples/FlexJustifyContentEnd.tsx +0 -10
- package/src/layouts/Flex/examples/FlexJustifyContentFlexStart.tsx +0 -9
- package/src/layouts/Flex/examples/FlexJustifyContentSpaceBetween.tsx +0 -9
- package/src/layouts/Flex/examples/FlexNestedItems.tsx +0 -15
- package/src/layouts/Flex/examples/FlexNesting.tsx +0 -15
- package/src/layouts/Flex/examples/FlexNestingInColumns.tsx +0 -15
- package/src/layouts/Flex/examples/FlexOrdering.tsx +0 -24
- package/src/layouts/Flex/examples/FlexResponsiveFirstLastOrder.tsx +0 -15
- package/src/layouts/Flex/examples/FlexResponsiveOrdering.tsx +0 -25
- package/src/layouts/Flex/examples/FlexRowGap.tsx +0 -16
- package/src/layouts/Flex/examples/FlexSpacingNone.tsx +0 -11
- package/src/layouts/Flex/examples/FlexSpacingXl.tsx +0 -11
- package/src/layouts/Flex/examples/FlexStackingElements.tsx +0 -18
- package/src/layouts/Flex/examples/FlexSwitchingColumnRow.tsx +0 -16
- package/src/layouts/Level/examples/LevelBasic.tsx +0 -9
- package/src/layouts/Level/examples/LevelWithGutters.tsx +0 -9
- package/src/layouts/Split/examples/SplitBasic.tsx +0 -9
- package/src/layouts/Split/examples/SplitWithGutter.tsx +0 -9
- package/src/layouts/Split/examples/SplitWrappable.tsx +0 -20
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ActionGroup,
|
|
4
|
-
Button,
|
|
5
|
-
DatePicker,
|
|
6
|
-
Form,
|
|
7
|
-
FormGroup,
|
|
8
|
-
Grid,
|
|
9
|
-
GridItem,
|
|
10
|
-
isValidDate,
|
|
11
|
-
Menu,
|
|
12
|
-
MenuContent,
|
|
13
|
-
MenuItem,
|
|
14
|
-
MenuList,
|
|
15
|
-
MenuToggle,
|
|
16
|
-
Panel,
|
|
17
|
-
PanelMain,
|
|
18
|
-
PanelMainBody,
|
|
19
|
-
Popper,
|
|
20
|
-
SearchInput,
|
|
21
|
-
TextInput,
|
|
22
|
-
yyyyMMddFormat
|
|
23
|
-
} from '@patternfly/react-core';
|
|
24
|
-
|
|
25
|
-
export const SearchInputAdvancedComposable: React.FunctionComponent = () => {
|
|
26
|
-
const [value, setValue] = useState('');
|
|
27
|
-
const [hasWords, setHasWords] = useState('');
|
|
28
|
-
const [dateWithin, setDateWithin] = useState('1 day');
|
|
29
|
-
const [date, setDate] = useState();
|
|
30
|
-
|
|
31
|
-
const [isAdvancedSearchOpen, setIsAdvancedSearchOpen] = useState(false);
|
|
32
|
-
const [isDateWithinOpen, setIsDateWithinOpen] = useState(false);
|
|
33
|
-
|
|
34
|
-
const isInitialMount = useRef(true);
|
|
35
|
-
const firstAttrRef = useRef(null);
|
|
36
|
-
const searchInputRef = useRef(null);
|
|
37
|
-
const advancedSearchPaneRef = useRef(null);
|
|
38
|
-
const dateWithinToggleRef = useRef(undefined);
|
|
39
|
-
const dateWithinMenuRef = useRef(undefined);
|
|
40
|
-
|
|
41
|
-
const onClear = () => {
|
|
42
|
-
setValue('');
|
|
43
|
-
setHasWords('');
|
|
44
|
-
setDateWithin('');
|
|
45
|
-
setDate('');
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const onChange = (_event, value) => {
|
|
49
|
-
if (value.length <= hasWords.length + 1) {
|
|
50
|
-
setValue(value);
|
|
51
|
-
setHasWords(value);
|
|
52
|
-
} else {
|
|
53
|
-
setValue(hasWords);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// After initial page load, whenever the advanced search menu is opened, the browser focus should be placed on the
|
|
58
|
-
// first advanced search form input. Whenever the advanced search menu is closed, the browser focus should
|
|
59
|
-
// be returned to the search input.
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
if (isInitialMount.current) {
|
|
62
|
-
isInitialMount.current = false;
|
|
63
|
-
} else {
|
|
64
|
-
if (isAdvancedSearchOpen && firstAttrRef && firstAttrRef.current) {
|
|
65
|
-
firstAttrRef.current.focus();
|
|
66
|
-
} else if (!isAdvancedSearchOpen && searchInputRef) {
|
|
67
|
-
searchInputRef.current.focus();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}, [isAdvancedSearchOpen]);
|
|
71
|
-
|
|
72
|
-
// If a menu is open and has browser focus, then the escape key closes them and puts the browser focus onto their
|
|
73
|
-
// respective toggle. The 'date within' menu also needs to close when the 'tab' key is hit. However, hitting tab while
|
|
74
|
-
// focus is in the advanced search form should move the focus to the next form input, not close the advanced search
|
|
75
|
-
// menu.
|
|
76
|
-
const handleMenuKeys = (event) => {
|
|
77
|
-
if (isDateWithinOpen && dateWithinMenuRef.current && dateWithinMenuRef.current.contains(event.target)) {
|
|
78
|
-
if (event.key === 'Escape' || event.key === 'Tab') {
|
|
79
|
-
setIsDateWithinOpen(!isDateWithinOpen);
|
|
80
|
-
dateWithinToggleRef.current.focus();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (isAdvancedSearchOpen && advancedSearchPaneRef.current && advancedSearchPaneRef.current.contains(event.target)) {
|
|
84
|
-
if (
|
|
85
|
-
event.key === 'Escape' ||
|
|
86
|
-
(event.key === 'Tab' &&
|
|
87
|
-
!event.shiftKey &&
|
|
88
|
-
advancedSearchPaneRef.current.querySelector('button[type=reset]') === event.target)
|
|
89
|
-
) {
|
|
90
|
-
setIsAdvancedSearchOpen(!isAdvancedSearchOpen);
|
|
91
|
-
searchInputRef.current.focus();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
// If a menu is open and has browser focus, then clicking outside the menu should close it.
|
|
97
|
-
const handleClickOutside = (event) => {
|
|
98
|
-
if (
|
|
99
|
-
isDateWithinOpen &&
|
|
100
|
-
dateWithinMenuRef &&
|
|
101
|
-
dateWithinMenuRef.current &&
|
|
102
|
-
!dateWithinMenuRef.current.contains(event.target)
|
|
103
|
-
) {
|
|
104
|
-
setIsDateWithinOpen(false);
|
|
105
|
-
}
|
|
106
|
-
if (
|
|
107
|
-
isAdvancedSearchOpen &&
|
|
108
|
-
advancedSearchPaneRef &&
|
|
109
|
-
advancedSearchPaneRef.current &&
|
|
110
|
-
!advancedSearchPaneRef.current.contains(event.target)
|
|
111
|
-
) {
|
|
112
|
-
setIsAdvancedSearchOpen(false);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
useEffect(() => {
|
|
117
|
-
window.addEventListener('keydown', handleMenuKeys);
|
|
118
|
-
window.addEventListener('click', handleClickOutside);
|
|
119
|
-
return () => {
|
|
120
|
-
window.removeEventListener('keydown', handleMenuKeys);
|
|
121
|
-
window.removeEventListener('click', handleClickOutside);
|
|
122
|
-
};
|
|
123
|
-
}, [dateWithinMenuRef.current, advancedSearchPaneRef.current, isAdvancedSearchOpen, isDateWithinOpen]);
|
|
124
|
-
|
|
125
|
-
// This demo and its handling of 'date within' and a date picker is modeled after the gmail advanced search form.
|
|
126
|
-
const onSubmit = (event, _value) => {
|
|
127
|
-
event.preventDefault();
|
|
128
|
-
|
|
129
|
-
if (isValidDate(new Date(date)) && dateWithin) {
|
|
130
|
-
const afterDate = new Date(date);
|
|
131
|
-
const toDate = new Date(date);
|
|
132
|
-
switch (dateWithin) {
|
|
133
|
-
case '1 day':
|
|
134
|
-
afterDate.setDate(afterDate.getDate());
|
|
135
|
-
toDate.setDate(toDate.getDate() + 2);
|
|
136
|
-
break;
|
|
137
|
-
case '3 days':
|
|
138
|
-
afterDate.setDate(afterDate.getDate() - 2);
|
|
139
|
-
toDate.setDate(toDate.getDate() + 4);
|
|
140
|
-
break;
|
|
141
|
-
case '1 week':
|
|
142
|
-
afterDate.setDate(afterDate.getDate() - 6);
|
|
143
|
-
toDate.setDate(toDate.getDate() + 8);
|
|
144
|
-
break;
|
|
145
|
-
case '2 weeks':
|
|
146
|
-
afterDate.setDate(afterDate.getDate() - 13);
|
|
147
|
-
toDate.setDate(toDate.getDate() + 15);
|
|
148
|
-
break;
|
|
149
|
-
case '1 month':
|
|
150
|
-
afterDate.setMonth(afterDate.getMonth() - 1);
|
|
151
|
-
afterDate.setDate(afterDate.getDate() + 1);
|
|
152
|
-
toDate.setMonth(toDate.getMonth() + 1);
|
|
153
|
-
toDate.setDate(toDate.getDate() + 1);
|
|
154
|
-
break;
|
|
155
|
-
case '2 months':
|
|
156
|
-
afterDate.setMonth(afterDate.getMonth() - 2);
|
|
157
|
-
afterDate.setDate(afterDate.getDate() + 1);
|
|
158
|
-
toDate.setMonth(toDate.getMonth() + 2);
|
|
159
|
-
toDate.setDate(toDate.getDate() + 1);
|
|
160
|
-
break;
|
|
161
|
-
case '6 months':
|
|
162
|
-
afterDate.setMonth(afterDate.getMonth() - 6);
|
|
163
|
-
afterDate.setDate(afterDate.getDate() + 1);
|
|
164
|
-
toDate.setMonth(toDate.getMonth() + 6);
|
|
165
|
-
toDate.setDate(toDate.getDate() + 1);
|
|
166
|
-
break;
|
|
167
|
-
case '1 year':
|
|
168
|
-
afterDate.setFullYear(afterDate.getFullYear() - 1);
|
|
169
|
-
afterDate.setDate(afterDate.getDate() + 1);
|
|
170
|
-
toDate.setFullYear(toDate.getFullYear() + 1);
|
|
171
|
-
toDate.setDate(toDate.getDate() + 1);
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
setValue(`${hasWords && hasWords + ' '}after:${yyyyMMddFormat(afterDate)} to:${yyyyMMddFormat(toDate)}`);
|
|
175
|
-
} else {
|
|
176
|
-
setValue(hasWords);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
setIsAdvancedSearchOpen(false);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
const searchInput = (
|
|
183
|
-
<SearchInput
|
|
184
|
-
value={value}
|
|
185
|
-
onChange={onChange}
|
|
186
|
-
onToggleAdvancedSearch={(e, isOpen) => {
|
|
187
|
-
e.stopPropagation();
|
|
188
|
-
setIsAdvancedSearchOpen(isOpen);
|
|
189
|
-
}}
|
|
190
|
-
isAdvancedSearchOpen={isAdvancedSearchOpen}
|
|
191
|
-
onClear={onClear}
|
|
192
|
-
onSearch={onSubmit}
|
|
193
|
-
ref={searchInputRef}
|
|
194
|
-
id="custom-advanced-search"
|
|
195
|
-
aria-label="Composable advanced search"
|
|
196
|
-
/>
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
// Clicking the 'date within' toggle should open its associated menu and then place the browser
|
|
200
|
-
// focus on the first menu item.
|
|
201
|
-
const toggleDateWithinMenu = (ev) => {
|
|
202
|
-
ev.stopPropagation(); // Stop handleClickOutside from handling
|
|
203
|
-
setTimeout(() => {
|
|
204
|
-
if (dateWithinMenuRef.current) {
|
|
205
|
-
const firstElement = dateWithinMenuRef.current.querySelector('li > button:not(:disabled)');
|
|
206
|
-
firstElement && firstElement.focus();
|
|
207
|
-
}
|
|
208
|
-
}, 0);
|
|
209
|
-
setIsDateWithinOpen(!isDateWithinOpen);
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
// Selecting a date within option closes the menu, sets the value of date within, and puts browser focus back
|
|
213
|
-
// on the date within toggle.
|
|
214
|
-
const onDateWithinSelect = (e, itemId) => {
|
|
215
|
-
e.stopPropagation();
|
|
216
|
-
setIsDateWithinOpen(false);
|
|
217
|
-
setDateWithin(itemId);
|
|
218
|
-
if (dateWithinToggleRef && dateWithinToggleRef.current) {
|
|
219
|
-
dateWithinToggleRef.current.focus();
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
const dateWithinOptions = (
|
|
224
|
-
<Menu ref={dateWithinMenuRef} selected={dateWithin} onSelect={onDateWithinSelect}>
|
|
225
|
-
<MenuContent>
|
|
226
|
-
<MenuList>
|
|
227
|
-
<MenuItem itemId="1 day">1 day</MenuItem>
|
|
228
|
-
<MenuItem itemId="3 days">3 days</MenuItem>
|
|
229
|
-
<MenuItem itemId="1 week">1 week</MenuItem>
|
|
230
|
-
<MenuItem itemId="2 weeks">2 weeks</MenuItem>
|
|
231
|
-
<MenuItem itemId="1 month">1 month</MenuItem>
|
|
232
|
-
<MenuItem itemId="2 months">2 months</MenuItem>
|
|
233
|
-
<MenuItem itemId="6 months">6 months</MenuItem>
|
|
234
|
-
<MenuItem itemId="1 year">1 year</MenuItem>
|
|
235
|
-
</MenuList>
|
|
236
|
-
</MenuContent>
|
|
237
|
-
</Menu>
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
const dateWithinToggle = (
|
|
241
|
-
<MenuToggle
|
|
242
|
-
ref={dateWithinToggleRef}
|
|
243
|
-
onClick={toggleDateWithinMenu}
|
|
244
|
-
isExpanded={isDateWithinOpen}
|
|
245
|
-
style={{ width: '100%' }}
|
|
246
|
-
>
|
|
247
|
-
{dateWithin}
|
|
248
|
-
</MenuToggle>
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
const advancedForm = (
|
|
252
|
-
<div ref={advancedSearchPaneRef} role="dialog" aria-label="Advanced search form">
|
|
253
|
-
<Panel variant="raised">
|
|
254
|
-
<PanelMain>
|
|
255
|
-
<PanelMainBody>
|
|
256
|
-
<Form>
|
|
257
|
-
<FormGroup label="Has the words" fieldId="has-words" key="has-words">
|
|
258
|
-
<TextInput
|
|
259
|
-
type="text"
|
|
260
|
-
id="has-words"
|
|
261
|
-
value={hasWords}
|
|
262
|
-
onChange={(_event, value) => {
|
|
263
|
-
setHasWords(value);
|
|
264
|
-
setValue(value);
|
|
265
|
-
}}
|
|
266
|
-
ref={firstAttrRef}
|
|
267
|
-
/>
|
|
268
|
-
</FormGroup>
|
|
269
|
-
<Grid hasGutter md={6}>
|
|
270
|
-
<GridItem>
|
|
271
|
-
<FormGroup label="Date within" fieldId="date-within" key="date-within">
|
|
272
|
-
<Popper
|
|
273
|
-
trigger={dateWithinToggle}
|
|
274
|
-
triggerRef={dateWithinToggleRef}
|
|
275
|
-
popper={dateWithinOptions}
|
|
276
|
-
popperRef={dateWithinMenuRef}
|
|
277
|
-
isVisible={isDateWithinOpen}
|
|
278
|
-
/>
|
|
279
|
-
</FormGroup>
|
|
280
|
-
</GridItem>
|
|
281
|
-
<GridItem>
|
|
282
|
-
<FormGroup label="Of date" fieldId="date" key="date">
|
|
283
|
-
<DatePicker
|
|
284
|
-
id="datePicker"
|
|
285
|
-
style={{ width: '100%' }}
|
|
286
|
-
value={date}
|
|
287
|
-
onChange={(_e, newValue) => setDate(newValue)}
|
|
288
|
-
appendTo={() => document.querySelector('#datePicker')}
|
|
289
|
-
/>
|
|
290
|
-
</FormGroup>
|
|
291
|
-
</GridItem>
|
|
292
|
-
</Grid>
|
|
293
|
-
<ActionGroup>
|
|
294
|
-
<Button variant="primary" type="submit" onClick={(e) => onSubmit(null, e)}>
|
|
295
|
-
Submit
|
|
296
|
-
</Button>
|
|
297
|
-
{!!onClear && (
|
|
298
|
-
<Button variant="link" type="reset" onClick={onClear}>
|
|
299
|
-
Reset
|
|
300
|
-
</Button>
|
|
301
|
-
)}
|
|
302
|
-
</ActionGroup>
|
|
303
|
-
</Form>
|
|
304
|
-
</PanelMainBody>
|
|
305
|
-
</PanelMain>
|
|
306
|
-
</Panel>
|
|
307
|
-
</div>
|
|
308
|
-
);
|
|
309
|
-
|
|
310
|
-
// Popper is just one way to build a relationship between a toggle and a menu.
|
|
311
|
-
return (
|
|
312
|
-
<Popper
|
|
313
|
-
trigger={searchInput}
|
|
314
|
-
triggerRef={searchInputRef}
|
|
315
|
-
popper={advancedForm}
|
|
316
|
-
popperRef={advancedSearchPaneRef}
|
|
317
|
-
isVisible={isAdvancedSearchOpen}
|
|
318
|
-
enableFlip={false}
|
|
319
|
-
appendTo={() => document.querySelector('#custom-advanced-search')}
|
|
320
|
-
/>
|
|
321
|
-
);
|
|
322
|
-
};
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { Menu, MenuContent, MenuItem, MenuList, Popper, SearchInput } from '@patternfly/react-core';
|
|
3
|
-
|
|
4
|
-
import { words } from '../words';
|
|
5
|
-
|
|
6
|
-
export const SearchInputAutocomplete: React.FunctionComponent = () => {
|
|
7
|
-
const [value, setValue] = useState('');
|
|
8
|
-
const [hint, setHint] = useState('');
|
|
9
|
-
const [autocompleteOptions, setAutocompleteOptions] = useState([]);
|
|
10
|
-
|
|
11
|
-
const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false);
|
|
12
|
-
|
|
13
|
-
const searchInputRef = useRef(null);
|
|
14
|
-
const autocompleteRef = useRef(null);
|
|
15
|
-
|
|
16
|
-
const onClear = () => {
|
|
17
|
-
setValue('');
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const onChange = (_event, newValue) => {
|
|
21
|
-
if (
|
|
22
|
-
newValue !== '' &&
|
|
23
|
-
searchInputRef &&
|
|
24
|
-
searchInputRef.current &&
|
|
25
|
-
searchInputRef.current.contains(document.activeElement)
|
|
26
|
-
) {
|
|
27
|
-
setIsAutocompleteOpen(true);
|
|
28
|
-
|
|
29
|
-
// When the value of the search input changes, build a list of no more than 10 autocomplete options.
|
|
30
|
-
// Options which start with the search input value are listed first, followed by options which contain
|
|
31
|
-
// the search input value.
|
|
32
|
-
let options = words
|
|
33
|
-
.filter((option) => option.startsWith(newValue.toLowerCase()))
|
|
34
|
-
.map((option) => (
|
|
35
|
-
<MenuItem itemId={option} key={option}>
|
|
36
|
-
{option}
|
|
37
|
-
</MenuItem>
|
|
38
|
-
));
|
|
39
|
-
if (options.length > 10) {
|
|
40
|
-
options = options.slice(0, 10);
|
|
41
|
-
} else {
|
|
42
|
-
options = [
|
|
43
|
-
...options,
|
|
44
|
-
...words
|
|
45
|
-
.filter((option) => !option.startsWith(newValue.toLowerCase()) && option.includes(newValue.toLowerCase()))
|
|
46
|
-
.map((option) => (
|
|
47
|
-
<MenuItem itemId={option} key={option}>
|
|
48
|
-
{option}
|
|
49
|
-
</MenuItem>
|
|
50
|
-
))
|
|
51
|
-
].slice(0, 10);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// The hint is set whenever there is only one autocomplete option left.
|
|
55
|
-
setHint(options.length === 1 ? options[0].props.itemId : '');
|
|
56
|
-
// The menu is hidden if there are no options
|
|
57
|
-
setIsAutocompleteOpen(options.length > 0);
|
|
58
|
-
setAutocompleteOptions(options);
|
|
59
|
-
} else {
|
|
60
|
-
setIsAutocompleteOpen(false);
|
|
61
|
-
}
|
|
62
|
-
setValue(newValue);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// Whenever an autocomplete option is selected, set the search input value, close the menu, and put the browser
|
|
66
|
-
// focus back on the search input
|
|
67
|
-
const onSelect = (e, itemId) => {
|
|
68
|
-
e.stopPropagation();
|
|
69
|
-
setValue(itemId);
|
|
70
|
-
setIsAutocompleteOpen(false);
|
|
71
|
-
searchInputRef.current.focus();
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const handleMenuKeys = (event) => {
|
|
75
|
-
// If there is a hint while the browser focus is on the search input, tab or right arrow will 'accept' the hint value
|
|
76
|
-
// and set it as the search input value
|
|
77
|
-
if (hint && (event.key === 'Tab' || event.key === 'ArrowRight') && searchInputRef.current === event.target) {
|
|
78
|
-
setValue(hint);
|
|
79
|
-
setHint('');
|
|
80
|
-
setIsAutocompleteOpen(false);
|
|
81
|
-
if (event.key === 'ArrowRight') {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
}
|
|
84
|
-
// if the autocomplete is open and the browser focus is on the search input,
|
|
85
|
-
} else if (isAutocompleteOpen && searchInputRef.current && searchInputRef.current === event.target) {
|
|
86
|
-
// the escape key closes the autocomplete menu and keeps the focus on the search input.
|
|
87
|
-
if (event.key === 'Escape') {
|
|
88
|
-
setIsAutocompleteOpen(false);
|
|
89
|
-
searchInputRef.current.focus();
|
|
90
|
-
// the up and down arrow keys move browser focus into the autocomplete menu
|
|
91
|
-
} else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
92
|
-
const firstElement = autocompleteRef.current.querySelector('li > button:not(:disabled)');
|
|
93
|
-
firstElement && firstElement.focus();
|
|
94
|
-
event.preventDefault(); // by default, the up and down arrow keys scroll the window
|
|
95
|
-
// the tab, enter, and space keys will close the menu, and the tab key will move browser
|
|
96
|
-
// focus forward one element (by default)
|
|
97
|
-
} else if (event.key === 'Tab' || event.key === 'Enter' || event.key === ' ') {
|
|
98
|
-
setIsAutocompleteOpen(false);
|
|
99
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
100
|
-
event.preventDefault();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
// If the autocomplete is open and the browser focus is in the autocomplete menu
|
|
104
|
-
// hitting tab will close the autocomplete and but browser focus back on the search input.
|
|
105
|
-
} else if (isAutocompleteOpen && autocompleteRef.current.contains(event.target) && event.key === 'Tab') {
|
|
106
|
-
event.preventDefault();
|
|
107
|
-
setIsAutocompleteOpen(false);
|
|
108
|
-
searchInputRef.current.focus();
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
// The autocomplete menu should close if the user clicks outside the menu.
|
|
113
|
-
const handleClickOutside = (event) => {
|
|
114
|
-
if (
|
|
115
|
-
isAutocompleteOpen &&
|
|
116
|
-
autocompleteRef &&
|
|
117
|
-
autocompleteRef.current &&
|
|
118
|
-
!autocompleteRef.current.contains(event.target)
|
|
119
|
-
) {
|
|
120
|
-
setIsAutocompleteOpen(false);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
useEffect(() => {
|
|
125
|
-
window.addEventListener('keydown', handleMenuKeys);
|
|
126
|
-
window.addEventListener('click', handleClickOutside);
|
|
127
|
-
return () => {
|
|
128
|
-
window.removeEventListener('keydown', handleMenuKeys);
|
|
129
|
-
window.removeEventListener('click', handleClickOutside);
|
|
130
|
-
};
|
|
131
|
-
}, [isAutocompleteOpen, hint, searchInputRef.current]);
|
|
132
|
-
|
|
133
|
-
const searchInput = (
|
|
134
|
-
<SearchInput
|
|
135
|
-
value={value}
|
|
136
|
-
onChange={onChange}
|
|
137
|
-
onClear={onClear}
|
|
138
|
-
ref={searchInputRef}
|
|
139
|
-
hint={hint}
|
|
140
|
-
id="autocomplete-search"
|
|
141
|
-
aria-label="Search with autocomplete"
|
|
142
|
-
/>
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
const autocomplete = (
|
|
146
|
-
<Menu ref={autocompleteRef} onSelect={onSelect}>
|
|
147
|
-
<MenuContent>
|
|
148
|
-
<MenuList>{autocompleteOptions}</MenuList>
|
|
149
|
-
</MenuContent>
|
|
150
|
-
</Menu>
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<Popper
|
|
155
|
-
trigger={searchInput}
|
|
156
|
-
triggerRef={searchInputRef}
|
|
157
|
-
popper={autocomplete}
|
|
158
|
-
popperRef={autocompleteRef}
|
|
159
|
-
isVisible={isAutocompleteOpen}
|
|
160
|
-
enableFlip={false}
|
|
161
|
-
// append the autocomplete menu to the search input in the DOM for the sake of the keyboard navigation experience
|
|
162
|
-
appendTo={() => document.querySelector('#autocomplete-search')}
|
|
163
|
-
/>
|
|
164
|
-
);
|
|
165
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import { FocusTrap } from '../FocusTrap';
|
|
3
|
-
|
|
4
|
-
test('Focus trap can have an id added', () => {
|
|
5
|
-
render(
|
|
6
|
-
<FocusTrap
|
|
7
|
-
children={<div>ReactNode</div>}
|
|
8
|
-
className={'string'}
|
|
9
|
-
active={false}
|
|
10
|
-
paused={false}
|
|
11
|
-
focusTrapOptions={undefined}
|
|
12
|
-
id="focus-trap-id"
|
|
13
|
-
data-testid="focus-trap"
|
|
14
|
-
/>
|
|
15
|
-
);
|
|
16
|
-
expect(screen.getByTestId('focus-trap')).toHaveAttribute('id', 'focus-trap-id');
|
|
17
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Fragment } from 'react';
|
|
2
|
-
import { Button } from '@patternfly/react-core';
|
|
3
|
-
|
|
4
|
-
export const OuiaExample: React.FunctionComponent = () => (
|
|
5
|
-
<Fragment>
|
|
6
|
-
<Button>Button</Button>
|
|
7
|
-
<br />
|
|
8
|
-
<br />
|
|
9
|
-
<Button ouiaId="static_id">Button with ouiaId</Button>
|
|
10
|
-
</Fragment>
|
|
11
|
-
);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAdjustingWidth: React.FunctionComponent = () => (
|
|
4
|
-
<Flex>
|
|
5
|
-
<Flex flex={{ default: 'flex_1' }}>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
</Flex>
|
|
8
|
-
<Flex flex={{ default: 'flex_1' }}>
|
|
9
|
-
<FlexItem>Flex item</FlexItem>
|
|
10
|
-
<FlexItem>Flex item</FlexItem>
|
|
11
|
-
</Flex>
|
|
12
|
-
<Flex flex={{ default: 'flex_1' }}>
|
|
13
|
-
<FlexItem>Flex item</FlexItem>
|
|
14
|
-
<FlexItem>Flex item</FlexItem>
|
|
15
|
-
<FlexItem>Flex item</FlexItem>
|
|
16
|
-
</Flex>
|
|
17
|
-
</Flex>
|
|
18
|
-
);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAlignAdjacentContent: React.FunctionComponent = () => (
|
|
4
|
-
<Flex>
|
|
5
|
-
<Flex flex={{ default: 'flex_1' }}>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
<FlexItem>Flex item</FlexItem>
|
|
8
|
-
<FlexItem>Flex item</FlexItem>
|
|
9
|
-
<FlexItem>Flex item</FlexItem>
|
|
10
|
-
</Flex>
|
|
11
|
-
<Flex>
|
|
12
|
-
<FlexItem>Flex item</FlexItem>
|
|
13
|
-
<FlexItem>Flex item</FlexItem>
|
|
14
|
-
</Flex>
|
|
15
|
-
</Flex>
|
|
16
|
-
);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAlignRightMultipleGroups: React.FunctionComponent = () => (
|
|
4
|
-
<Flex>
|
|
5
|
-
<Flex>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
<FlexItem>Flex item</FlexItem>
|
|
8
|
-
</Flex>
|
|
9
|
-
<Flex align={{ default: 'alignRight' }}>
|
|
10
|
-
<FlexItem>Flex item</FlexItem>
|
|
11
|
-
<FlexItem>Flex item</FlexItem>
|
|
12
|
-
</Flex>
|
|
13
|
-
<Flex align={{ default: 'alignRight' }}>
|
|
14
|
-
<FlexItem>Flex item</FlexItem>
|
|
15
|
-
<FlexItem>Flex item</FlexItem>
|
|
16
|
-
</Flex>
|
|
17
|
-
</Flex>
|
|
18
|
-
);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAlignRightSingleItem: React.FunctionComponent = () => (
|
|
4
|
-
<Flex className="example-border">
|
|
5
|
-
<FlexItem align={{ default: 'alignRight' }}>Flex item</FlexItem>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
</Flex>
|
|
8
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAlignSelfBaseline: React.FunctionComponent = () => (
|
|
4
|
-
<Flex>
|
|
5
|
-
<Flex direction={{ default: 'column' }}>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
<FlexItem>Flex item</FlexItem>
|
|
8
|
-
<FlexItem>Flex item</FlexItem>
|
|
9
|
-
</Flex>
|
|
10
|
-
<Flex direction={{ default: 'column' }} alignSelf={{ default: 'alignSelfBaseline' }}>
|
|
11
|
-
<FlexItem>Flex item</FlexItem>
|
|
12
|
-
<FlexItem>Flex item</FlexItem>
|
|
13
|
-
</Flex>
|
|
14
|
-
</Flex>
|
|
15
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAlignSelfCenter: React.FunctionComponent = () => (
|
|
4
|
-
<Flex>
|
|
5
|
-
<Flex direction={{ default: 'column' }}>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
<FlexItem>Flex item</FlexItem>
|
|
8
|
-
<FlexItem>Flex item</FlexItem>
|
|
9
|
-
</Flex>
|
|
10
|
-
<Flex direction={{ default: 'column' }} alignSelf={{ default: 'alignSelfCenter' }}>
|
|
11
|
-
<FlexItem>Flex item</FlexItem>
|
|
12
|
-
<FlexItem>Flex item</FlexItem>
|
|
13
|
-
</Flex>
|
|
14
|
-
</Flex>
|
|
15
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAlignSelfFlexEnd: React.FunctionComponent = () => (
|
|
4
|
-
<Flex>
|
|
5
|
-
<Flex direction={{ default: 'column' }}>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
<FlexItem>Flex item</FlexItem>
|
|
8
|
-
<FlexItem>Flex item</FlexItem>
|
|
9
|
-
</Flex>
|
|
10
|
-
<Flex direction={{ default: 'column' }} alignSelf={{ default: 'alignSelfFlexEnd' }}>
|
|
11
|
-
<FlexItem>Flex item</FlexItem>
|
|
12
|
-
<FlexItem>Flex item</FlexItem>
|
|
13
|
-
</Flex>
|
|
14
|
-
</Flex>
|
|
15
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAlignSelfStretch: React.FunctionComponent = () => (
|
|
4
|
-
<Flex>
|
|
5
|
-
<Flex direction={{ default: 'column' }}>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
<FlexItem>Flex item</FlexItem>
|
|
8
|
-
<FlexItem>Flex item</FlexItem>
|
|
9
|
-
</Flex>
|
|
10
|
-
<Flex direction={{ default: 'column' }} alignSelf={{ default: 'alignSelfStretch' }}>
|
|
11
|
-
<FlexItem>Flex item</FlexItem>
|
|
12
|
-
<FlexItem>Flex item</FlexItem>
|
|
13
|
-
</Flex>
|
|
14
|
-
</Flex>
|
|
15
|
-
);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAligningRight: React.FunctionComponent = () => (
|
|
4
|
-
<Flex className="example-border">
|
|
5
|
-
<FlexItem>Flex item</FlexItem>
|
|
6
|
-
<FlexItem>Flex item</FlexItem>
|
|
7
|
-
<FlexItem>Flex item</FlexItem>
|
|
8
|
-
<FlexItem align={{ default: 'alignRight' }}>Flex item</FlexItem>
|
|
9
|
-
<FlexItem>Flex item</FlexItem>
|
|
10
|
-
</Flex>
|
|
11
|
-
);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
3
|
-
export const FlexAlternative: React.FunctionComponent = () => (
|
|
4
|
-
<Flex component="ul">
|
|
5
|
-
<FlexItem component="li">Flex item</FlexItem>
|
|
6
|
-
<FlexItem component="li">Flex item</FlexItem>
|
|
7
|
-
<FlexItem component="li">Flex item</FlexItem>
|
|
8
|
-
<FlexItem component="li">Flex item</FlexItem>
|
|
9
|
-
<FlexItem component="li">Flex item</FlexItem>
|
|
10
|
-
</Flex>
|
|
11
|
-
);
|