@patternfly/react-core 6.4.1-prerelease.9 → 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 -48
- 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-CJfbZNQh.css → output-Bj1Aarly.css} +14883 -14883
- 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/Alert/examples/Alert.md +275 -26
- 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/Alert/examples/AlertCustomIcons.tsx +0 -17
- package/src/components/Alert/examples/AlertExpandable.tsx +0 -36
- package/src/components/Alert/examples/AlertInlineVariants.tsx +0 -12
- package/src/components/Alert/examples/AlertInlineVariations.tsx +0 -45
- package/src/components/Alert/examples/AlertPlainInlineVariants.tsx +0 -12
- package/src/components/Alert/examples/AlertPlainInlineVariations.tsx +0 -7
- package/src/components/Alert/examples/AlertStaticLiveRegion.tsx +0 -29
- package/src/components/Alert/examples/AlertTimeout.tsx +0 -45
- package/src/components/Alert/examples/AlertTruncated.tsx +0 -28
- package/src/components/Alert/examples/AlertVariants.tsx +0 -12
- package/src/components/Alert/examples/AlertVariations.tsx +0 -43
- 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
|
@@ -30,10 +30,6 @@ export interface ExpandableSectionToggleProps extends Omit<React.HTMLProps<HTMLD
|
|
|
30
30
|
onToggle?: (isExpanded: boolean) => void;
|
|
31
31
|
/** Flag indicating that the expandable section and expandable toggle are detached from one another. */
|
|
32
32
|
isDetached?: boolean;
|
|
33
|
-
/** Accessible name via human readable string for the expandable section toggle. */
|
|
34
|
-
toggleAriaLabel?: string;
|
|
35
|
-
/** Accessible name via space delimtted list of IDs for the expandable section toggle. */
|
|
36
|
-
toggleAriaLabelledBy?: string;
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
export const ExpandableSectionToggle: React.FunctionComponent<ExpandableSectionToggleProps> = ({
|
|
@@ -46,8 +42,6 @@ export const ExpandableSectionToggle: React.FunctionComponent<ExpandableSectionT
|
|
|
46
42
|
direction = 'down',
|
|
47
43
|
hasTruncatedContent = false,
|
|
48
44
|
isDetached,
|
|
49
|
-
toggleAriaLabel,
|
|
50
|
-
toggleAriaLabelledBy,
|
|
51
45
|
...props
|
|
52
46
|
}: ExpandableSectionToggleProps) => (
|
|
53
47
|
<div
|
|
@@ -80,8 +74,6 @@ export const ExpandableSectionToggle: React.FunctionComponent<ExpandableSectionT
|
|
|
80
74
|
</span>
|
|
81
75
|
)
|
|
82
76
|
})}
|
|
83
|
-
aria-label={toggleAriaLabel}
|
|
84
|
-
aria-labelledby={toggleAriaLabelledBy}
|
|
85
77
|
>
|
|
86
78
|
{children}
|
|
87
79
|
</Button>
|
|
@@ -191,20 +191,3 @@ test('Renders with class pf-m-detached when isDetached is true and direction is
|
|
|
191
191
|
|
|
192
192
|
expect(screen.getByText('Test content').parentElement).toHaveClass('pf-m-detached');
|
|
193
193
|
});
|
|
194
|
-
|
|
195
|
-
test('Renders with aria-label when toggleAriaLabel is passed', () => {
|
|
196
|
-
render(<ExpandableSection toggleAriaLabel="Test label"></ExpandableSection>);
|
|
197
|
-
|
|
198
|
-
expect(screen.getByRole('button')).toHaveAccessibleName('Test label');
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
test('Renders with aria-labelledby when toggleAriaLabelledBy is passed', () => {
|
|
202
|
-
render(
|
|
203
|
-
<>
|
|
204
|
-
<div id="test-id">Test label</div>
|
|
205
|
-
<ExpandableSection toggleAriaLabelledBy="test-id"></ExpandableSection>
|
|
206
|
-
</>
|
|
207
|
-
);
|
|
208
|
-
|
|
209
|
-
expect(screen.getByRole('button')).toHaveAccessibleName('Test label');
|
|
210
|
-
});
|
|
@@ -30,20 +30,3 @@ test('Renders with class pf-m-detached when isDetached is true', () => {
|
|
|
30
30
|
|
|
31
31
|
expect(screen.getByTestId('test-id')).toHaveClass('pf-m-detached');
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
test('Renders with aria-label when toggleAriaLabel is passed', () => {
|
|
35
|
-
render(<ExpandableSectionToggle toggleAriaLabel="Test label"></ExpandableSectionToggle>);
|
|
36
|
-
|
|
37
|
-
expect(screen.getByRole('button')).toHaveAccessibleName('Test label');
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
test('Renders with aria-labelledby when toggleAriaLabelledBy is passed', () => {
|
|
41
|
-
render(
|
|
42
|
-
<>
|
|
43
|
-
<div id="test-id">Test label</div>
|
|
44
|
-
<ExpandableSectionToggle toggleAriaLabelledBy="test-id"></ExpandableSectionToggle>
|
|
45
|
-
</>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
expect(screen.getByRole('button')).toHaveAccessibleName('Test label');
|
|
49
|
-
});
|
|
@@ -19,21 +19,29 @@ import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
|
19
19
|
|
|
20
20
|
A toggle is collapsed until it is selected by a user.
|
|
21
21
|
|
|
22
|
-
```ts
|
|
22
|
+
```ts
|
|
23
|
+
import { MenuToggle } from '@patternfly/react-core';
|
|
24
|
+
|
|
25
|
+
<MenuToggle>Collapsed</MenuToggle>
|
|
26
|
+
|
|
23
27
|
```
|
|
24
28
|
|
|
25
29
|
### Expanded toggle
|
|
26
30
|
|
|
27
31
|
When a user selects a toggle, it becomes expanded and is styled with a blue underline. To flag expanded toggles, and apply expanded styling, use the `isExpanded` property .
|
|
28
32
|
|
|
29
|
-
```ts
|
|
33
|
+
```ts
|
|
34
|
+
import { MenuToggle } from '@patternfly/react-core';
|
|
35
|
+
|
|
36
|
+
<MenuToggle isExpanded>Expanded</MenuToggle>;
|
|
37
|
+
|
|
30
38
|
```
|
|
31
39
|
|
|
32
40
|
### Small toggle
|
|
33
41
|
|
|
34
42
|
You can pass `size="sm"` to a MenuToggle to style it as a small toggle, such as within a [breadcrumb](/components/breadcrumb).
|
|
35
43
|
|
|
36
|
-
```ts file="MenuToggleSmall.tsx"
|
|
44
|
+
```ts file="./MenuToggleSmall.tsx"
|
|
37
45
|
|
|
38
46
|
```
|
|
39
47
|
|
|
@@ -41,21 +49,32 @@ You can pass `size="sm"` to a MenuToggle to style it as a small toggle, such as
|
|
|
41
49
|
|
|
42
50
|
To disable the selection and expansion of a toggle, use the `isDisabled` property.
|
|
43
51
|
|
|
44
|
-
```ts
|
|
52
|
+
```ts
|
|
53
|
+
import { MenuToggle } from '@patternfly/react-core';
|
|
54
|
+
|
|
55
|
+
<MenuToggle isDisabled>Disabled</MenuToggle>
|
|
56
|
+
|
|
45
57
|
```
|
|
46
58
|
|
|
47
59
|
### With a badge
|
|
48
60
|
|
|
49
61
|
To display a count of selected items in a toggle, use the `badge` property. You can also pass in `variant="plainText"` for a badge only toggle.
|
|
50
62
|
|
|
51
|
-
```ts
|
|
63
|
+
```ts
|
|
64
|
+
import { Fragment } from 'react';
|
|
65
|
+
import { MenuToggle, Badge } from '@patternfly/react-core';
|
|
66
|
+
|
|
67
|
+
<Fragment>
|
|
68
|
+
<MenuToggle badge={<Badge>4 selected</Badge>}>Count</MenuToggle>
|
|
69
|
+
<MenuToggle variant="plainText" badge={<Badge screenReaderText="additional items">4</Badge>} />
|
|
70
|
+
</Fragment>
|
|
52
71
|
```
|
|
53
72
|
|
|
54
73
|
### Settings toggle
|
|
55
74
|
|
|
56
75
|
To create a "settings" menu toggle that will animate on hover and focus, you can pass the `isSettings` property in. Doing so will override the `icon` property, as a specific icon is used internally for the animations.
|
|
57
76
|
|
|
58
|
-
```ts file="MenuToggleSettings.tsx"
|
|
77
|
+
```ts file="./MenuToggleSettings.tsx"
|
|
59
78
|
|
|
60
79
|
```
|
|
61
80
|
|
|
@@ -65,7 +84,7 @@ To add a recognizable icon to a menu toggle, use the `icon` property. The follow
|
|
|
65
84
|
|
|
66
85
|
For most basic icons, it is recommended to wrap it inside our [icon component](/components/icon).
|
|
67
86
|
|
|
68
|
-
```ts file="MenuToggleCustomIcon.tsx"
|
|
87
|
+
```ts file="./MenuToggleCustomIcon.tsx"
|
|
69
88
|
|
|
70
89
|
```
|
|
71
90
|
|
|
@@ -75,14 +94,37 @@ You can also pass images into the `icon` property. The following example passes
|
|
|
75
94
|
|
|
76
95
|
This can be used alongside a text label that provides more context for the image.
|
|
77
96
|
|
|
78
|
-
```ts
|
|
97
|
+
```ts
|
|
98
|
+
import { Fragment } from 'react';
|
|
99
|
+
import { MenuToggle, Avatar } from '@patternfly/react-core';
|
|
100
|
+
import imgAvatar from '@patternfly/react-core/src/components/assets/avatarImg.svg';
|
|
101
|
+
|
|
102
|
+
<Fragment>
|
|
103
|
+
<MenuToggle icon={<Avatar src={imgAvatar} alt="avatar" />}>Ned Username</MenuToggle>{' '}
|
|
104
|
+
<MenuToggle icon={<Avatar src={imgAvatar} alt="avatar" />} isExpanded>Ned Username</MenuToggle>{' '}
|
|
105
|
+
<MenuToggle icon={<Avatar src={imgAvatar} alt="avatar" />} isDisabled>Ned Username</MenuToggle>
|
|
106
|
+
</Fragment>
|
|
79
107
|
```
|
|
80
108
|
|
|
81
109
|
### Variant styles
|
|
82
110
|
|
|
83
111
|
Variant styling can be applied to menu toggles. In the following example, the toggle uses primary styling by passing `variant="primary"` into the `<MenuToggle>` component. Additional variant options include “default”, “plain”, “plainText”, “secondary”, and “typeahead”.
|
|
84
112
|
|
|
85
|
-
```ts
|
|
113
|
+
```ts
|
|
114
|
+
import { Fragment } from 'react';
|
|
115
|
+
import { MenuToggle } from '@patternfly/react-core';
|
|
116
|
+
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
117
|
+
|
|
118
|
+
<Fragment>
|
|
119
|
+
<MenuToggle variant="primary">Collapsed</MenuToggle>{' '}
|
|
120
|
+
<MenuToggle variant="primary" isExpanded>
|
|
121
|
+
Expanded
|
|
122
|
+
</MenuToggle>{' '}
|
|
123
|
+
<MenuToggle variant="primary" isDisabled>
|
|
124
|
+
Disabled
|
|
125
|
+
</MenuToggle>
|
|
126
|
+
</Fragment>
|
|
127
|
+
|
|
86
128
|
```
|
|
87
129
|
|
|
88
130
|
### Plain toggle with icon
|
|
@@ -91,14 +133,39 @@ To apply plain styling to a menu toggle with an icon, pass in `variant="plain"`.
|
|
|
91
133
|
|
|
92
134
|
If the toggle does not have any visible text content, use the `aria-label` property to provide an accessible name.
|
|
93
135
|
|
|
94
|
-
```ts
|
|
136
|
+
```ts
|
|
137
|
+
import { Fragment } from 'react';
|
|
138
|
+
import { MenuToggle } from '@patternfly/react-core';
|
|
139
|
+
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
140
|
+
|
|
141
|
+
<Fragment>
|
|
142
|
+
<MenuToggle icon={<EllipsisVIcon />} variant="plain" aria-label="plain kebab"/>
|
|
143
|
+
{' '}
|
|
144
|
+
<MenuToggle icon={<EllipsisVIcon />} variant="plain" isExpanded aria-label="plain expanded kebab"/>
|
|
145
|
+
{' '}
|
|
146
|
+
<MenuToggle icon={<EllipsisVIcon />} variant="plain" isDisabled aria-label="disabled plain kebab"/>
|
|
147
|
+
</Fragment>
|
|
95
148
|
```
|
|
96
149
|
|
|
97
150
|
### Plain toggle with text label
|
|
98
151
|
|
|
99
152
|
To apply plain styling to a menu toggle with a text label, pass in `variant="plainText"`. Unlike the “plain” variant, “plainText” adds a caret pointing down in the toggle.
|
|
100
153
|
|
|
101
|
-
```ts
|
|
154
|
+
```ts
|
|
155
|
+
import { Fragment } from 'react';
|
|
156
|
+
import { MenuToggle } from '@patternfly/react-core';
|
|
157
|
+
|
|
158
|
+
<Fragment>
|
|
159
|
+
<MenuToggle variant="plainText" isDisabled aria-label="Disabled plain menu toggle">
|
|
160
|
+
Disabled
|
|
161
|
+
</MenuToggle>{' '}
|
|
162
|
+
<MenuToggle variant="plainText" aria-label="Plain menu toggle">
|
|
163
|
+
Custom text
|
|
164
|
+
</MenuToggle>{' '}
|
|
165
|
+
<MenuToggle variant="plainText" isExpanded aria-label="Expanded plain menu toggle">
|
|
166
|
+
Custom text (expanded)
|
|
167
|
+
</MenuToggle>
|
|
168
|
+
</Fragment>
|
|
102
169
|
```
|
|
103
170
|
|
|
104
171
|
### Split toggle with checkbox
|
|
@@ -149,7 +216,14 @@ A full height toggle fills the height of its parent. To flag a full height toggl
|
|
|
149
216
|
|
|
150
217
|
In the following example, the toggle fills the size of the "80px" `<div>` element that it is within.
|
|
151
218
|
|
|
152
|
-
```ts
|
|
219
|
+
```ts
|
|
220
|
+
import { MenuToggle } from '@patternfly/react-core';
|
|
221
|
+
|
|
222
|
+
<div style={{ height: "80px" }}>
|
|
223
|
+
<MenuToggle isFullHeight aria-label="Full height menu toggle">
|
|
224
|
+
Full height
|
|
225
|
+
</MenuToggle>
|
|
226
|
+
</div>
|
|
153
227
|
```
|
|
154
228
|
|
|
155
229
|
### Full width toggle
|
|
@@ -158,7 +232,16 @@ A full width toggle fills the width of its parent. To flag a full width toggle,
|
|
|
158
232
|
|
|
159
233
|
In the following example, the toggle fills the width of its parent as the window size changes.
|
|
160
234
|
|
|
161
|
-
```ts
|
|
235
|
+
```ts
|
|
236
|
+
import { MenuToggle } from '@patternfly/react-core';
|
|
237
|
+
|
|
238
|
+
const fullWidth: React.FunctionComponent = () => {
|
|
239
|
+
return (
|
|
240
|
+
<MenuToggle isFullWidth aria-label="Full width menu toggle" >
|
|
241
|
+
Full width
|
|
242
|
+
</MenuToggle>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
162
245
|
```
|
|
163
246
|
|
|
164
247
|
### Typeahead toggle
|
|
@@ -27,8 +27,6 @@ export interface ModalProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
|
|
|
27
27
|
* focusable element will receive focus.
|
|
28
28
|
*/
|
|
29
29
|
elementToFocus?: HTMLElement | SVGElement | string;
|
|
30
|
-
/** Id of the focus trap in the ModalContent component */
|
|
31
|
-
focusTrapId?: string;
|
|
32
30
|
/** An id to use for the modal box container. */
|
|
33
31
|
id?: string;
|
|
34
32
|
/** Flag to show the modal. */
|
|
@@ -29,8 +29,6 @@ export interface ModalContentProps extends OUIAProps {
|
|
|
29
29
|
* focusable element will receive focus.
|
|
30
30
|
*/
|
|
31
31
|
elementToFocus?: HTMLElement | SVGElement | string;
|
|
32
|
-
/** Id of the focus trap */
|
|
33
|
-
focusTrapId?: string;
|
|
34
32
|
/** Flag to show the modal. */
|
|
35
33
|
isOpen?: boolean;
|
|
36
34
|
/** A callback for when the close button is clicked. */
|
|
@@ -71,7 +69,6 @@ export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
|
|
|
71
69
|
ouiaId,
|
|
72
70
|
ouiaSafe = true,
|
|
73
71
|
elementToFocus,
|
|
74
|
-
focusTrapId,
|
|
75
72
|
...props
|
|
76
73
|
}: ModalContentProps) => {
|
|
77
74
|
if (!isOpen) {
|
|
@@ -125,7 +122,6 @@ export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
|
|
|
125
122
|
initialFocus: elementToFocus || undefined
|
|
126
123
|
}}
|
|
127
124
|
className={css(bullsEyeStyles.bullseye)}
|
|
128
|
-
id={focusTrapId}
|
|
129
125
|
>
|
|
130
126
|
{modalBox}
|
|
131
127
|
</FocusTrap>
|
|
@@ -172,13 +172,4 @@ describe('Modal', () => {
|
|
|
172
172
|
expect(asideSibling).not.toHaveAttribute('aria-hidden');
|
|
173
173
|
expect(articleSibling).not.toHaveAttribute('aria-hidden');
|
|
174
174
|
});
|
|
175
|
-
|
|
176
|
-
test('Modal can add id to focus trap correctly for use with dropdowns', () => {
|
|
177
|
-
render(<Modal focusTrapId="focus-trap" isOpen onClose={jest.fn()} children="modal content" />);
|
|
178
|
-
expect(screen.getByRole('dialog', { name: /modal content/i }).parentElement).toHaveAttribute('id', 'focus-trap');
|
|
179
|
-
expect(screen.getByRole('dialog', { name: /modal content/i }).parentElement).toHaveAttribute(
|
|
180
|
-
'class',
|
|
181
|
-
'pf-v6-l-bullseye'
|
|
182
|
-
);
|
|
183
|
-
});
|
|
184
175
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
2
|
|
|
3
3
|
import { ModalContent } from '../ModalContent';
|
|
4
4
|
|
|
@@ -43,19 +43,3 @@ test('Modal Content Test with onclose', () => {
|
|
|
43
43
|
);
|
|
44
44
|
expect(asFragment()).toMatchSnapshot();
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
test('Modal content can add id to focus trap correctly for use with dropdowns', () => {
|
|
48
|
-
render(
|
|
49
|
-
<ModalContent focusTrapId="focus-trap" isOpen {...modalContentProps}>
|
|
50
|
-
This is a ModalBox header
|
|
51
|
-
</ModalContent>
|
|
52
|
-
);
|
|
53
|
-
expect(screen.getByRole('dialog', { name: /This is a ModalBox header/i }).parentElement).toHaveAttribute(
|
|
54
|
-
'id',
|
|
55
|
-
'focus-trap'
|
|
56
|
-
);
|
|
57
|
-
expect(screen.getByRole('dialog', { name: /This is a ModalBox header/i }).parentElement).toHaveAttribute(
|
|
58
|
-
'class',
|
|
59
|
-
'pf-v6-l-bullseye'
|
|
60
|
-
);
|
|
61
|
-
});
|
|
@@ -17,7 +17,7 @@ import formStyles from '@patternfly/react-styles/css/components/Form/form';
|
|
|
17
17
|
|
|
18
18
|
### Basic modals
|
|
19
19
|
|
|
20
|
-
Basic modals give users the option to either confirm or cancel an action.
|
|
20
|
+
Basic modals give users the option to either confirm or cancel an action.
|
|
21
21
|
|
|
22
22
|
To flag an open modal, use the `isOpen` property. To execute a callback when a modal is closed, use the `onClose` property.
|
|
23
23
|
|
|
@@ -71,7 +71,7 @@ To choose a specific width for a modal, use the `width` property. The following
|
|
|
71
71
|
|
|
72
72
|
### Custom header
|
|
73
73
|
|
|
74
|
-
To add a custom header to a modal, your custom content must be passed as a child of the `<ModalHeader>` component. Do not pass the `title` property to `<ModalHeader>` when using a custom header.
|
|
74
|
+
To add a custom header to a modal, your custom content must be passed as a child of the `<ModalHeader>` component. Do not pass the `title` property to `<ModalHeader>` when using a custom header.
|
|
75
75
|
|
|
76
76
|
```ts file="./ModalCustomHeader.tsx"
|
|
77
77
|
|
|
@@ -113,18 +113,9 @@ To guide users through a series of steps in a modal, you can add a [wizard](/com
|
|
|
113
113
|
|
|
114
114
|
### With dropdown
|
|
115
115
|
|
|
116
|
-
To present a menu of actions or links to a user, you can add a [dropdown](/components/menus/dropdown) to a modal.
|
|
116
|
+
To present a menu of actions or links to a user, you can add a [dropdown](/components/menus/dropdown) to a modal.
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
built-in focus trap. To allow the dropdown to visually break out of the modal container, set the Dropdown's
|
|
120
|
-
`popperProps appendTo` property to id of the focus trap for the modal. This can be done by adding prop
|
|
121
|
-
`focusTrapId` to the modal, and then setting the append location to that as per this example. Otherwise you
|
|
122
|
-
can use `inline` to allow it to scroll within the modal itself. Appending to the focus trap should allow the
|
|
123
|
-
menu to expand visually outside the Modal (no scrollbar created in the Modal itself), and still allow
|
|
124
|
-
focusing the content within that menu via keyboard. You should also handle the modal's closing behavior by
|
|
125
|
-
listening to the
|
|
126
|
-
`onEscapePress` callback on the `<Modal>` component. This allows the "escape" key to collapse the
|
|
127
|
-
dropdown without closing the entire modal.
|
|
118
|
+
To allow the dropdown to visually break out of the modal container, set the `menuAppendTo` property to “parent”. Handle the modal’s closing behavior by listening to the `onEscapePress` callback on the `<Modal>` component. This allows the "escape" key to collapse the dropdown without closing the entire modal.
|
|
128
119
|
|
|
129
120
|
```ts file="./ModalWithDropdown.tsx"
|
|
130
121
|
|
|
@@ -150,7 +141,7 @@ To enable form submission from a button in the modal's footer (outside of the `<
|
|
|
150
141
|
|
|
151
142
|
### Custom focus
|
|
152
143
|
|
|
153
|
-
To customize which element inside the modal receives focus when initially opened, use the `elementToFocus` property`.
|
|
144
|
+
To customize which element inside the modal receives focus when initially opened, use the `elementToFocus` property`.
|
|
154
145
|
|
|
155
146
|
```ts file="./ModalCustomFocus.tsx"
|
|
156
147
|
|
|
@@ -32,10 +32,8 @@ export const ModalWithDropdown: React.FunctionComponent = () => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const onFocus = () => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(element as HTMLElement)?.focus();
|
|
38
|
-
}
|
|
35
|
+
const element = document.getElementById('modal-dropdown-toggle');
|
|
36
|
+
(element as HTMLElement).focus();
|
|
39
37
|
};
|
|
40
38
|
|
|
41
39
|
const onEscapePress = (event: KeyboardEvent) => {
|
|
@@ -47,16 +45,6 @@ export const ModalWithDropdown: React.FunctionComponent = () => {
|
|
|
47
45
|
}
|
|
48
46
|
};
|
|
49
47
|
|
|
50
|
-
const getAppendLocation = () => {
|
|
51
|
-
// document doesn't exist when PatternFly website docs framework gets pre-rendered
|
|
52
|
-
// this is just to avoid that issue - works fine at runtime without it
|
|
53
|
-
if (typeof document !== 'undefined' && document.getElementById) {
|
|
54
|
-
return document.getElementById('modal-with-dropdown-focus-trap');
|
|
55
|
-
} else {
|
|
56
|
-
return 'inline';
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
48
|
return (
|
|
61
49
|
<Fragment>
|
|
62
50
|
<Button variant="primary" onClick={handleModalToggle}>
|
|
@@ -69,21 +57,14 @@ export const ModalWithDropdown: React.FunctionComponent = () => {
|
|
|
69
57
|
onEscapePress={onEscapePress}
|
|
70
58
|
aria-labelledby="modal-with-dropdown"
|
|
71
59
|
aria-describedby="modal-box-body-with-dropdown"
|
|
72
|
-
focusTrapId="modal-with-dropdown-focus-trap"
|
|
73
60
|
>
|
|
74
61
|
<ModalHeader title="Dropdown modal" labelId="modal-with-dropdown" />
|
|
75
62
|
<ModalBody id="modal-box-body-with-dropdown">
|
|
76
63
|
<div>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
can use "inline" to allow it to scroll within the modal itself. Appending to the focus trap should allow the
|
|
82
|
-
menu to expand visually outside the Modal (no scrollbar created in the Modal itself), and still allow
|
|
83
|
-
focusing the content within that menu via keyboard. You should also handle the modal's closing behavior by
|
|
84
|
-
listening to the
|
|
85
|
-
<em>onEscapePress</em> callback on the Modal component. This allows the "escape" key to collapse the
|
|
86
|
-
dropdown without closing the entire modal.
|
|
64
|
+
Set the dropdown <strong>menuAppendTo</strong> prop to <em>parent</em> in order to allow the dropdown menu
|
|
65
|
+
break out of the modal container. You'll also want to handle closing of the modal yourself, by listening to
|
|
66
|
+
the <strong>onEscapePress</strong> callback on the Modal component, so you can close the Dropdown first if
|
|
67
|
+
it's open without closing the entire modal.
|
|
87
68
|
</div>
|
|
88
69
|
<br />
|
|
89
70
|
<div>
|
|
@@ -92,18 +73,10 @@ export const ModalWithDropdown: React.FunctionComponent = () => {
|
|
|
92
73
|
onSelect={onSelect}
|
|
93
74
|
onOpenChange={(isOpen: boolean) => setIsDropdownOpen(isOpen)}
|
|
94
75
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
95
|
-
<MenuToggle
|
|
96
|
-
id="modal-dropdown-toggle"
|
|
97
|
-
ref={toggleRef}
|
|
98
|
-
onClick={handleDropdownToggle}
|
|
99
|
-
isExpanded={isDropdownOpen}
|
|
100
|
-
>
|
|
76
|
+
<MenuToggle ref={toggleRef} onClick={handleDropdownToggle} isExpanded={isDropdownOpen}>
|
|
101
77
|
Dropdown
|
|
102
78
|
</MenuToggle>
|
|
103
79
|
)}
|
|
104
|
-
popperProps={{
|
|
105
|
-
appendTo: getAppendLocation()
|
|
106
|
-
}}
|
|
107
80
|
>
|
|
108
81
|
<DropdownList>
|
|
109
82
|
<DropdownItem value={0} key="action">
|
|
@@ -9,50 +9,199 @@ propComponents: [Panel, PanelMain, PanelMainBody, PanelHeader, PanelFooter]
|
|
|
9
9
|
|
|
10
10
|
### Basic
|
|
11
11
|
|
|
12
|
-
```
|
|
12
|
+
```js
|
|
13
|
+
import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
|
|
14
|
+
|
|
15
|
+
const BasicPanel = () => (
|
|
16
|
+
<Panel>
|
|
17
|
+
<PanelMain>
|
|
18
|
+
<PanelMainBody>Main content</PanelMainBody>
|
|
19
|
+
</PanelMain>
|
|
20
|
+
</Panel>
|
|
21
|
+
);
|
|
13
22
|
```
|
|
14
23
|
|
|
15
24
|
### Header
|
|
16
25
|
|
|
17
|
-
```
|
|
26
|
+
```js
|
|
27
|
+
import { Panel, PanelMain, PanelMainBody, PanelHeader, Divider } from '@patternfly/react-core';
|
|
28
|
+
|
|
29
|
+
const HeaderPanel = () => (
|
|
30
|
+
<Panel>
|
|
31
|
+
<PanelHeader>Header content</PanelHeader>
|
|
32
|
+
<Divider />
|
|
33
|
+
<PanelMain>
|
|
34
|
+
<PanelMainBody>Main content</PanelMainBody>
|
|
35
|
+
</PanelMain>
|
|
36
|
+
</Panel>
|
|
37
|
+
);
|
|
18
38
|
```
|
|
19
39
|
|
|
20
40
|
### Footer
|
|
21
41
|
|
|
22
|
-
```
|
|
42
|
+
```js
|
|
43
|
+
import { Panel, PanelMain, PanelMainBody, PanelFooter } from '@patternfly/react-core';
|
|
44
|
+
|
|
45
|
+
const FooterPanel = () => (
|
|
46
|
+
<Panel>
|
|
47
|
+
<PanelMain>
|
|
48
|
+
<PanelMainBody>Main content</PanelMainBody>
|
|
49
|
+
</PanelMain>
|
|
50
|
+
<PanelFooter>Footer content</PanelFooter>
|
|
51
|
+
</Panel>
|
|
52
|
+
);
|
|
23
53
|
```
|
|
24
54
|
|
|
25
55
|
### Header and footer
|
|
26
56
|
|
|
27
|
-
```
|
|
57
|
+
```js
|
|
58
|
+
import { Panel, PanelMain, PanelMainBody, PanelHeader, Divider, PanelFooter } from '@patternfly/react-core';
|
|
59
|
+
|
|
60
|
+
const HeaderFooterPanel = () => (
|
|
61
|
+
<Panel>
|
|
62
|
+
<PanelHeader>Header content</PanelHeader>
|
|
63
|
+
<Divider />
|
|
64
|
+
<PanelMain>
|
|
65
|
+
<PanelMainBody>Main content</PanelMainBody>
|
|
66
|
+
</PanelMain>
|
|
67
|
+
<PanelFooter>Footer content</PanelFooter>
|
|
68
|
+
</Panel>
|
|
69
|
+
);
|
|
28
70
|
```
|
|
29
71
|
|
|
30
72
|
### No body
|
|
31
73
|
|
|
32
|
-
```
|
|
74
|
+
```js
|
|
75
|
+
import { Panel, PanelMain } from '@patternfly/react-core';
|
|
76
|
+
|
|
77
|
+
const NoBodyPanel = () => (
|
|
78
|
+
<Panel>
|
|
79
|
+
<PanelMain>Main content</PanelMain>
|
|
80
|
+
</Panel>
|
|
81
|
+
);
|
|
33
82
|
```
|
|
34
83
|
|
|
35
84
|
### Raised
|
|
36
85
|
|
|
37
|
-
```
|
|
86
|
+
```js
|
|
87
|
+
import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
|
|
88
|
+
|
|
89
|
+
const RaisedPanel = () => (
|
|
90
|
+
<Panel variant="raised">
|
|
91
|
+
<PanelMain>
|
|
92
|
+
<PanelMainBody>Main content</PanelMainBody>
|
|
93
|
+
</PanelMain>
|
|
94
|
+
</Panel>
|
|
95
|
+
);
|
|
38
96
|
```
|
|
39
97
|
|
|
40
98
|
### Bordered
|
|
41
99
|
|
|
42
|
-
```
|
|
100
|
+
```js
|
|
101
|
+
import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
|
|
102
|
+
|
|
103
|
+
const BorderedPanel = () => (
|
|
104
|
+
<Panel variant="bordered">
|
|
105
|
+
<PanelMain>
|
|
106
|
+
<PanelMainBody>Main content</PanelMainBody>
|
|
107
|
+
</PanelMain>
|
|
108
|
+
</Panel>
|
|
109
|
+
);
|
|
43
110
|
```
|
|
44
111
|
|
|
45
112
|
### Secondary variant
|
|
46
113
|
|
|
47
|
-
```
|
|
114
|
+
```js
|
|
115
|
+
import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
|
|
116
|
+
|
|
117
|
+
const PanelSecondaryVariant = () => (
|
|
118
|
+
<Panel variant="secondary">
|
|
119
|
+
<PanelMain>
|
|
120
|
+
<PanelMainBody>Main content</PanelMainBody>
|
|
121
|
+
</PanelMain>
|
|
122
|
+
</Panel>
|
|
123
|
+
);
|
|
48
124
|
```
|
|
49
125
|
|
|
50
126
|
### Scrollable
|
|
51
127
|
|
|
52
|
-
```
|
|
128
|
+
```js
|
|
129
|
+
import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
|
|
130
|
+
|
|
131
|
+
const ScrollablePanel = () => (
|
|
132
|
+
<Panel isScrollable>
|
|
133
|
+
<PanelMain tabIndex={0}>
|
|
134
|
+
<PanelMainBody>
|
|
135
|
+
Main content
|
|
136
|
+
<br />
|
|
137
|
+
<br />
|
|
138
|
+
Main content
|
|
139
|
+
<br />
|
|
140
|
+
<br />
|
|
141
|
+
Main content
|
|
142
|
+
<br />
|
|
143
|
+
<br />
|
|
144
|
+
Main content
|
|
145
|
+
<br />
|
|
146
|
+
<br />
|
|
147
|
+
Main content
|
|
148
|
+
<br />
|
|
149
|
+
<br />
|
|
150
|
+
Main content
|
|
151
|
+
<br />
|
|
152
|
+
<br />
|
|
153
|
+
Main content
|
|
154
|
+
<br />
|
|
155
|
+
<br />
|
|
156
|
+
Main content
|
|
157
|
+
<br />
|
|
158
|
+
<br />
|
|
159
|
+
Main content
|
|
160
|
+
</PanelMainBody>
|
|
161
|
+
</PanelMain>
|
|
162
|
+
</Panel>
|
|
163
|
+
);
|
|
53
164
|
```
|
|
54
165
|
|
|
55
166
|
### Scrollable with header and footer
|
|
56
167
|
|
|
57
|
-
```
|
|
168
|
+
```js
|
|
169
|
+
import { Panel, PanelMain, PanelMainBody, PanelHeader, Divider, PanelFooter } from '@patternfly/react-core';
|
|
170
|
+
|
|
171
|
+
const ScrollableHeaderFooterPanel = () => (
|
|
172
|
+
<Panel isScrollable>
|
|
173
|
+
<PanelHeader>Header content</PanelHeader>
|
|
174
|
+
<Divider />
|
|
175
|
+
<PanelMain tabIndex={0}>
|
|
176
|
+
<PanelMainBody>
|
|
177
|
+
Main content
|
|
178
|
+
<br />
|
|
179
|
+
<br />
|
|
180
|
+
Main content
|
|
181
|
+
<br />
|
|
182
|
+
<br />
|
|
183
|
+
Main content
|
|
184
|
+
<br />
|
|
185
|
+
<br />
|
|
186
|
+
Main content
|
|
187
|
+
<br />
|
|
188
|
+
<br />
|
|
189
|
+
Main content
|
|
190
|
+
<br />
|
|
191
|
+
<br />
|
|
192
|
+
Main content
|
|
193
|
+
<br />
|
|
194
|
+
<br />
|
|
195
|
+
Main content
|
|
196
|
+
<br />
|
|
197
|
+
<br />
|
|
198
|
+
Main content
|
|
199
|
+
<br />
|
|
200
|
+
<br />
|
|
201
|
+
Main content
|
|
202
|
+
</PanelMainBody>
|
|
203
|
+
</PanelMain>
|
|
204
|
+
<PanelFooter>Footer content</PanelFooter>
|
|
205
|
+
</Panel>
|
|
206
|
+
);
|
|
58
207
|
```
|