@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
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.4.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.4.0","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.4.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.4.0","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.4.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.4.0","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.4.1
|
|
3
|
+
"version": "6.4.1",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"react": "^17 || ^18 || ^19",
|
|
64
64
|
"react-dom": "^17 || ^18 || ^19"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "476782a298df81cb78de7f3cd804f3ff8f33993c"
|
|
67
67
|
}
|
|
@@ -3,7 +3,6 @@ import styles from '@patternfly/react-styles/css/components/Check/check';
|
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import { PickOptional } from '../../helpers/typeUtils';
|
|
5
5
|
import { getDefaultOUIAId, getOUIAProps, OUIAProps } from '../../helpers';
|
|
6
|
-
import { getUniqueId } from '../../helpers/util';
|
|
7
6
|
import { ASTERISK } from '../../helpers/htmlConstants';
|
|
8
7
|
|
|
9
8
|
export interface CheckboxProps
|
|
@@ -40,8 +39,6 @@ export interface CheckboxProps
|
|
|
40
39
|
description?: React.ReactNode;
|
|
41
40
|
/** Body text of the checkbox */
|
|
42
41
|
body?: React.ReactNode;
|
|
43
|
-
/** Custom aria-describedby value for the checkbox input. If not provided and description is set, a unique ID will be generated automatically. */
|
|
44
|
-
'aria-describedby'?: string;
|
|
45
42
|
/** Sets the checkbox wrapper component to render. Defaults to "div". If set to "label", behaves the same as if isLabelWrapped prop was specified. */
|
|
46
43
|
component?: React.ElementType;
|
|
47
44
|
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
@@ -55,7 +52,6 @@ const defaultOnChange = () => {};
|
|
|
55
52
|
|
|
56
53
|
interface CheckboxState {
|
|
57
54
|
ouiaStateId: string;
|
|
58
|
-
descriptionId: string;
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
@@ -74,8 +70,7 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
74
70
|
constructor(props: any) {
|
|
75
71
|
super(props);
|
|
76
72
|
this.state = {
|
|
77
|
-
ouiaStateId: getDefaultOUIAId(Checkbox.displayName)
|
|
78
|
-
descriptionId: getUniqueId('pf-checkbox-description')
|
|
73
|
+
ouiaStateId: getDefaultOUIAId(Checkbox.displayName)
|
|
79
74
|
};
|
|
80
75
|
}
|
|
81
76
|
|
|
@@ -86,7 +81,6 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
86
81
|
render() {
|
|
87
82
|
const {
|
|
88
83
|
'aria-label': ariaLabel,
|
|
89
|
-
'aria-describedby': ariaDescribedBy,
|
|
90
84
|
className,
|
|
91
85
|
inputClassName,
|
|
92
86
|
onChange,
|
|
@@ -121,14 +115,6 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
121
115
|
checkedProps.defaultChecked = defaultChecked;
|
|
122
116
|
}
|
|
123
117
|
|
|
124
|
-
// Handle aria-describedby logic
|
|
125
|
-
let ariaDescribedByValue: string | undefined;
|
|
126
|
-
if (ariaDescribedBy !== undefined) {
|
|
127
|
-
ariaDescribedByValue = ariaDescribedBy === '' ? undefined : ariaDescribedBy;
|
|
128
|
-
} else if (description) {
|
|
129
|
-
ariaDescribedByValue = this.state.descriptionId;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
118
|
const inputRendered = (
|
|
133
119
|
<input
|
|
134
120
|
{...props}
|
|
@@ -137,7 +123,6 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
137
123
|
onChange={this.handleChange}
|
|
138
124
|
aria-invalid={!isValid}
|
|
139
125
|
aria-label={ariaLabel}
|
|
140
|
-
aria-describedby={ariaDescribedByValue}
|
|
141
126
|
disabled={isDisabled}
|
|
142
127
|
required={isRequired}
|
|
143
128
|
ref={(elem) => {
|
|
@@ -184,11 +169,7 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
184
169
|
{labelRendered}
|
|
185
170
|
</>
|
|
186
171
|
)}
|
|
187
|
-
{description && (
|
|
188
|
-
<span id={this.state.descriptionId} className={css(styles.checkDescription)}>
|
|
189
|
-
{description}
|
|
190
|
-
</span>
|
|
191
|
-
)}
|
|
172
|
+
{description && <span className={css(styles.checkDescription)}>{description}</span>}
|
|
192
173
|
{body && <span className={css(styles.checkBody)}>{body}</span>}
|
|
193
174
|
</Component>
|
|
194
175
|
);
|
|
@@ -287,37 +287,3 @@ test('Matches snapshot', () => {
|
|
|
287
287
|
|
|
288
288
|
expect(asFragment()).toMatchSnapshot();
|
|
289
289
|
});
|
|
290
|
-
|
|
291
|
-
test('Sets aria-describedby when description is provided', () => {
|
|
292
|
-
render(<Checkbox id="test-id" description="test description" />);
|
|
293
|
-
|
|
294
|
-
const checkbox = screen.getByRole('checkbox');
|
|
295
|
-
const descriptionElement = screen.getByText('test description');
|
|
296
|
-
|
|
297
|
-
expect(checkbox).toHaveAttribute('aria-describedby', descriptionElement.id);
|
|
298
|
-
expect(descriptionElement).toHaveAttribute('id');
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
test('Sets custom aria-describedby when provided', () => {
|
|
302
|
-
render(<Checkbox id="test-id" description="test description" aria-describedby="custom-id" />);
|
|
303
|
-
|
|
304
|
-
const checkbox = screen.getByRole('checkbox');
|
|
305
|
-
|
|
306
|
-
expect(checkbox).toHaveAttribute('aria-describedby', 'custom-id');
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
test('Does not set aria-describedby when no description is provided', () => {
|
|
310
|
-
render(<Checkbox id="test-id" />);
|
|
311
|
-
|
|
312
|
-
const checkbox = screen.getByRole('checkbox');
|
|
313
|
-
|
|
314
|
-
expect(checkbox).not.toHaveAttribute('aria-describedby');
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
test('Does not set aria-describedby when description is provided but aria-describedby is empty string', () => {
|
|
318
|
-
render(<Checkbox id="test-id" description="test description" aria-describedby="" />);
|
|
319
|
-
|
|
320
|
-
const checkbox = screen.getByRole('checkbox');
|
|
321
|
-
|
|
322
|
-
expect(checkbox).not.toHaveAttribute('aria-describedby');
|
|
323
|
-
});
|
|
@@ -77,7 +77,6 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
77
77
|
widths,
|
|
78
78
|
colorVariant = DrawerColorVariant.default,
|
|
79
79
|
focusTrap,
|
|
80
|
-
style,
|
|
81
80
|
...props
|
|
82
81
|
}: DrawerPanelContentProps) => {
|
|
83
82
|
const panel = useRef<HTMLDivElement>(undefined);
|
|
@@ -382,10 +381,9 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
382
381
|
}
|
|
383
382
|
}}
|
|
384
383
|
hidden={hidden}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}}
|
|
384
|
+
{...((defaultSize || minSize || maxSize) && {
|
|
385
|
+
style: boundaryCssVars as React.CSSProperties
|
|
386
|
+
})}
|
|
389
387
|
{...props}
|
|
390
388
|
ref={panel}
|
|
391
389
|
>
|
|
@@ -121,40 +121,3 @@ test('Renders with role="dialog" when focusTrap.enabled is true', () => {
|
|
|
121
121
|
|
|
122
122
|
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
|
123
123
|
});
|
|
124
|
-
|
|
125
|
-
test('Applies style prop as expected', () => {
|
|
126
|
-
render(
|
|
127
|
-
<Drawer isExpanded>
|
|
128
|
-
<DrawerPanelContent style={{ backgroundColor: 'red', padding: '20px' }}>Drawer panel content</DrawerPanelContent>
|
|
129
|
-
</Drawer>
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
const panelContent = screen.getByText('Drawer panel content');
|
|
133
|
-
expect(panelContent).toHaveStyle({ backgroundColor: 'red', padding: '20px' });
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
test('Style prop overrides boundaryCssVars', () => {
|
|
137
|
-
render(
|
|
138
|
-
<Drawer isExpanded>
|
|
139
|
-
<DrawerPanelContent
|
|
140
|
-
defaultSize="200px"
|
|
141
|
-
minSize="100px"
|
|
142
|
-
maxSize="400px"
|
|
143
|
-
style={{
|
|
144
|
-
'--pf-v6-c-drawer__panel--md--FlexBasis': '300px',
|
|
145
|
-
'--pf-v6-c-drawer__panel--md--FlexBasis--min': '150px',
|
|
146
|
-
'--pf-v6-c-drawer__panel--md--FlexBasis--max': '500px'
|
|
147
|
-
}}
|
|
148
|
-
>
|
|
149
|
-
Drawer panel content
|
|
150
|
-
</DrawerPanelContent>
|
|
151
|
-
</Drawer>
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
const panelContent = screen.getByText('Drawer panel content');
|
|
155
|
-
expect(panelContent).toHaveStyle({
|
|
156
|
-
'--pf-v6-c-drawer__panel--md--FlexBasis': '300px',
|
|
157
|
-
'--pf-v6-c-drawer__panel--md--FlexBasis--min': '150px',
|
|
158
|
-
'--pf-v6-c-drawer__panel--md--FlexBasis--max': '500px'
|
|
159
|
-
});
|
|
160
|
-
});
|
|
@@ -56,10 +56,6 @@ export interface ExpandableSectionProps extends Omit<React.HTMLProps<HTMLDivElem
|
|
|
56
56
|
* both are specified; used for uncontrolled expandable with dynamic toggle text).
|
|
57
57
|
*/
|
|
58
58
|
toggleTextExpanded?: string;
|
|
59
|
-
/** Accessible name via human readable string for the expandable section toggle. */
|
|
60
|
-
toggleAriaLabel?: string;
|
|
61
|
-
/** Accessible name via space delimtted list of IDs for the expandable section toggle. */
|
|
62
|
-
toggleAriaLabelledBy?: string;
|
|
63
59
|
/** Truncates the expandable content to the specified number of lines when using the
|
|
64
60
|
* "truncate" variant.
|
|
65
61
|
*/
|
|
@@ -113,8 +109,6 @@ class ExpandableSection extends Component<ExpandableSectionProps, ExpandableSect
|
|
|
113
109
|
toggleText: '',
|
|
114
110
|
toggleTextExpanded: '',
|
|
115
111
|
toggleTextCollapsed: '',
|
|
116
|
-
toggleAriaLabel: undefined,
|
|
117
|
-
toggleAriaLabelledBy: undefined,
|
|
118
112
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
119
113
|
onToggle: (event, isExpanded): void => undefined,
|
|
120
114
|
isDetached: false,
|
|
@@ -202,8 +196,6 @@ class ExpandableSection extends Component<ExpandableSectionProps, ExpandableSect
|
|
|
202
196
|
toggleTextExpanded,
|
|
203
197
|
toggleTextCollapsed,
|
|
204
198
|
toggleContent,
|
|
205
|
-
toggleAriaLabel,
|
|
206
|
-
toggleAriaLabelledBy,
|
|
207
199
|
children,
|
|
208
200
|
isExpanded,
|
|
209
201
|
isDetached,
|
|
@@ -262,8 +254,6 @@ class ExpandableSection extends Component<ExpandableSectionProps, ExpandableSect
|
|
|
262
254
|
</span>
|
|
263
255
|
)
|
|
264
256
|
})}
|
|
265
|
-
aria-label={toggleAriaLabel}
|
|
266
|
-
aria-labelledby={toggleAriaLabelledBy}
|
|
267
257
|
>
|
|
268
258
|
{toggleContent || computedToggleText}
|
|
269
259
|
</Button>
|
|
@@ -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
|
|