@patternfly/react-core 5.2.0-prerelease.9 → 6.0.0-alpha.2
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 +129 -0
- 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/Chip/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/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/DragDrop/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/Text/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/Tile/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/ApplicationLauncher/package.json +1 -1
- package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
- package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
- package/dist/dynamic/deprecated/components/Select/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/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/favorites/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/next/components/package.json +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +15 -39
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
- package/dist/esm/components/Chip/Chip.js +2 -2
- package/dist/esm/components/Chip/Chip.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js +2 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js +4 -4
- package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.js +1 -51
- package/dist/esm/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/esm/components/Masthead/Masthead.d.ts +0 -2
- package/dist/esm/components/Masthead/Masthead.d.ts.map +1 -1
- package/dist/esm/components/Masthead/Masthead.js +3 -3
- package/dist/esm/components/Masthead/Masthead.js.map +1 -1
- package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
- package/dist/esm/components/Menu/Menu.js +2 -1
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/MenuContainer.d.ts +2 -0
- package/dist/esm/components/Menu/MenuContainer.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuContainer.js.map +1 -1
- package/dist/esm/components/Nav/NavExpandable.d.ts +3 -3
- package/dist/esm/components/Nav/NavExpandable.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavExpandable.js +2 -2
- package/dist/esm/components/Nav/NavExpandable.js.map +1 -1
- package/dist/esm/components/Nav/NavItem.d.ts +2 -0
- package/dist/esm/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavItem.js +2 -2
- package/dist/esm/components/Nav/NavItem.js.map +1 -1
- package/dist/esm/components/Nav/NavList.js +3 -3
- package/dist/esm/components/Nav/NavList.js.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/esm/components/Page/PageSection.d.ts +2 -5
- package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSection.js +1 -7
- package/dist/esm/components/Page/PageSection.js.map +1 -1
- package/dist/esm/components/Page/PageSidebar.d.ts +0 -2
- package/dist/esm/components/Page/PageSidebar.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSidebar.js +2 -2
- package/dist/esm/components/Page/PageSidebar.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts +2 -0
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +2 -2
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +2 -0
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
- package/dist/esm/components/Slider/Slider.js +2 -1
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +3 -3
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/demos/DashboardWrapper.js +1 -1
- package/dist/esm/demos/DashboardWrapper.js.map +1 -1
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts +0 -2
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts.map +1 -1
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.js +2 -2
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.js.map +1 -1
- package/dist/esm/helpers/Popper/Popper.d.ts +2 -1
- package/dist/esm/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/esm/helpers/Popper/Popper.js +7 -16
- package/dist/esm/helpers/Popper/Popper.js.map +1 -1
- package/dist/esm/helpers/datetimeUtils.d.ts +1 -1
- package/dist/esm/helpers/datetimeUtils.d.ts.map +1 -1
- package/dist/esm/helpers/datetimeUtils.js.map +1 -1
- package/dist/esm/helpers/util.d.ts +9 -0
- package/dist/esm/helpers/util.d.ts.map +1 -1
- package/dist/esm/helpers/util.js +18 -0
- package/dist/esm/helpers/util.js.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +15 -39
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/Chip/Chip.d.ts.map +1 -1
- package/dist/js/components/Chip/Chip.js +2 -2
- package/dist/js/components/Chip/Chip.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js +2 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js +3 -3
- package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/js/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.js +1 -51
- package/dist/js/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/js/components/Masthead/Masthead.d.ts +0 -2
- package/dist/js/components/Masthead/Masthead.d.ts.map +1 -1
- package/dist/js/components/Masthead/Masthead.js +3 -3
- package/dist/js/components/Masthead/Masthead.js.map +1 -1
- package/dist/js/components/Menu/Menu.d.ts.map +1 -1
- package/dist/js/components/Menu/Menu.js +2 -1
- package/dist/js/components/Menu/Menu.js.map +1 -1
- package/dist/js/components/Menu/MenuContainer.d.ts +2 -0
- package/dist/js/components/Menu/MenuContainer.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuContainer.js.map +1 -1
- package/dist/js/components/Nav/NavExpandable.d.ts +3 -3
- package/dist/js/components/Nav/NavExpandable.d.ts.map +1 -1
- package/dist/js/components/Nav/NavExpandable.js +2 -2
- package/dist/js/components/Nav/NavExpandable.js.map +1 -1
- package/dist/js/components/Nav/NavItem.d.ts +2 -0
- package/dist/js/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/js/components/Nav/NavItem.js +2 -2
- package/dist/js/components/Nav/NavItem.js.map +1 -1
- package/dist/js/components/Nav/NavList.js +2 -2
- package/dist/js/components/Nav/NavList.js.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/js/components/Page/PageSection.d.ts +2 -5
- package/dist/js/components/Page/PageSection.d.ts.map +1 -1
- package/dist/js/components/Page/PageSection.js +1 -7
- package/dist/js/components/Page/PageSection.js.map +1 -1
- package/dist/js/components/Page/PageSidebar.d.ts +0 -2
- package/dist/js/components/Page/PageSidebar.d.ts.map +1 -1
- package/dist/js/components/Page/PageSidebar.js +2 -2
- package/dist/js/components/Page/PageSidebar.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts +2 -0
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js +2 -2
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +2 -0
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Slider/Slider.d.ts.map +1 -1
- package/dist/js/components/Slider/Slider.js +2 -1
- package/dist/js/components/Slider/Slider.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +2 -2
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/demos/DashboardWrapper.js +1 -1
- package/dist/js/demos/DashboardWrapper.js.map +1 -1
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts +0 -2
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts.map +1 -1
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.js +2 -2
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.js.map +1 -1
- package/dist/js/helpers/Popper/Popper.d.ts +2 -1
- package/dist/js/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/js/helpers/Popper/Popper.js +9 -19
- package/dist/js/helpers/Popper/Popper.js.map +1 -1
- package/dist/js/helpers/datetimeUtils.d.ts +1 -1
- package/dist/js/helpers/datetimeUtils.d.ts.map +1 -1
- package/dist/js/helpers/datetimeUtils.js.map +1 -1
- package/dist/js/helpers/util.d.ts +9 -0
- package/dist/js/helpers/util.d.ts.map +1 -1
- package/dist/js/helpers/util.js +20 -1
- package/dist/js/helpers/util.js.map +1 -1
- package/dist/styles/assets/images/logo__pf--reverse-on-md.svg +1 -1
- package/dist/styles/assets/images/pf-c-brand__logo-on-sm.svg +1 -1
- package/dist/styles/base-no-reset.css +849 -0
- package/dist/styles/base.css +861 -13
- 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 +8 -7
- package/src/components/CalendarMonth/CalendarMonth.tsx +18 -43
- package/src/components/Checkbox/__tests__/Checkbox.test.tsx +223 -69
- package/src/components/Checkbox/__tests__/__snapshots__/Checkbox.test.tsx.snap +3 -198
- package/src/components/Chip/Chip.tsx +2 -1
- package/src/components/Chip/__tests__/Chip.test.tsx +249 -32
- package/src/components/Chip/__tests__/ChipGroup.test.tsx +288 -61
- package/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap +9 -209
- package/src/components/Chip/__tests__/__snapshots__/ChipGroup.test.tsx.snap +2 -313
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +1 -1
- package/src/components/ClipboardCopy/ClipboardCopyButton.tsx +2 -0
- package/src/components/ClipboardCopy/ClipboardCopyToggle.tsx +1 -1
- package/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx +344 -0
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyAction.test.tsx +37 -0
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyButton.test.tsx +136 -19
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyExpanded.test.tsx +71 -14
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyToggle.test.tsx +78 -34
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopy.test.tsx.snap +57 -0
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyAction.test.tsx.snap +11 -0
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyButton.test.tsx.snap +50 -24
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyExpanded.test.tsx.snap +3 -23
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap +5 -6
- package/src/components/Drawer/DrawerPanelContent.tsx +4 -4
- package/src/components/Dropdown/Dropdown.tsx +2 -0
- package/src/components/ExpandableSection/ExpandableSection.tsx +1 -1
- package/src/components/InputGroup/InputGroup.tsx +1 -53
- package/src/components/InputGroup/__tests__/InputGroup.test.tsx +7 -44
- package/src/components/Masthead/Masthead.tsx +0 -5
- package/src/components/Masthead/examples/Masthead.md +0 -44
- package/src/components/Menu/Menu.tsx +2 -1
- package/src/components/Menu/MenuContainer.tsx +2 -0
- package/src/components/Nav/NavExpandable.tsx +5 -5
- package/src/components/Nav/NavItem.tsx +4 -1
- package/src/components/Nav/NavList.tsx +3 -3
- package/src/components/Nav/examples/Nav.md +8 -0
- package/src/components/Nav/examples/NavExpandableThirdLevel.tsx +1 -1
- package/src/components/Nav/examples/NavLinkText.tsx +109 -0
- package/src/components/Nav/examples/nav.css +1 -0
- package/src/components/NotificationBadge/NotificationBadge.tsx +1 -1
- package/src/components/NumberInput/__tests__/NumberInput.test.tsx +0 -1
- package/src/components/Page/PageSection.tsx +3 -9
- package/src/components/Page/PageSidebar.tsx +0 -4
- package/src/components/Page/__tests__/Generated/PageSidebar.test.tsx +1 -1
- package/src/components/Page/__tests__/Page.test.tsx +1 -40
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +0 -195
- package/src/components/Page/examples/PageGroupSection.tsx +3 -4
- package/src/components/Page/examples/PageHorizontalNav.tsx +3 -4
- package/src/components/Page/examples/PageMainSectionPadding.tsx +2 -7
- package/src/components/Page/examples/PageMultipleSidebarBody.tsx +3 -4
- package/src/components/Page/examples/PageTertiaryNav.tsx +3 -4
- package/src/components/Page/examples/PageUncontrolledNav.tsx +3 -4
- package/src/components/Page/examples/PageVerticalNav.tsx +3 -4
- package/src/components/SearchInput/SearchInput.tsx +5 -1
- package/src/components/SearchInput/__tests__/SearchInput.test.tsx +8 -0
- package/src/components/Select/Select.tsx +2 -0
- package/src/components/Slider/Slider.tsx +2 -1
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/demos/Banner.md +2 -4
- package/src/demos/CardView/examples/CardView.tsx +2 -8
- package/src/demos/DashboardWrapper.tsx +1 -1
- package/src/demos/JumpLinks.md +1 -1
- package/src/demos/Nav.md +10 -1673
- package/src/demos/NotificationDrawer/examples/NotificationDrawerBasic.tsx +2 -3
- package/src/demos/NotificationDrawer/examples/NotificationDrawerGrouped.tsx +2 -3
- package/src/demos/PrimaryDetail.md +4 -7
- package/src/demos/Tabs.md +6 -8
- package/src/demos/Wizard/WizardDemo.md +6 -761
- package/src/demos/examples/AlertGroup/AlertGroupToastWithNotificationDrawer.tsx +4 -5
- package/src/demos/examples/BackToTop/BackToTopNameDemo.tsx +1 -2
- package/src/demos/examples/DashboardWrapper.js +127 -0
- package/src/demos/examples/JumpLinks/JumpLinksWithDrawer.js +3 -4
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +1 -2
- package/src/demos/examples/Nav/NavDefault.tsx +97 -0
- package/src/demos/examples/Nav/NavDrilldown.tsx +2 -0
- package/src/demos/examples/Nav/NavExpandable.tsx +123 -0
- package/src/demos/examples/Nav/NavFlyout.tsx +277 -0
- package/src/demos/examples/Nav/NavGrouped.tsx +98 -0
- package/src/demos/examples/Nav/NavHorizontal.tsx +236 -0
- package/src/demos/examples/Nav/NavHorizontalWithSubnav.tsx +296 -0
- package/src/demos/examples/Nav/NavManual.tsx +272 -0
- package/src/demos/examples/Nav/NavWithSubnav.tsx +141 -0
- package/src/demos/examples/Nav/deprecated/NavLight.tsx +95 -0
- package/src/demos/examples/Nav/deprecated/NavTertiary.tsx +91 -0
- package/src/demos/examples/Page/PageStickySectionBreadcrumb.tsx +1 -2
- package/src/demos/examples/Page/PageStickySectionGroup.tsx +1 -2
- package/src/demos/examples/Page/PageStickySectionGroupAlternate.tsx +1 -2
- package/src/demos/examples/PrimaryDetail/PrimaryDetailContentPadding.tsx +1 -2
- package/src/demos/examples/PrimaryDetail/PrimaryDetailFullPage.tsx +2 -3
- package/src/demos/examples/PrimaryDetail/PrimaryDetailInlineModifier.tsx +2 -3
- package/src/demos/examples/Tabs/ModalTabs.tsx +1 -2
- package/src/demos/examples/Tabs/NestedUnindentedTabs.tsx +2 -2
- package/src/demos/examples/Tabs/TabsAndTable.tsx +2 -3
- package/src/demos/examples/Toolbar/ConsoleLogViewerToolbar.tsx +1 -2
- package/src/demos/examples/Wizard/InModal.tsx +75 -0
- package/src/demos/examples/Wizard/InModalWithDrawer.tsx +115 -0
- package/src/demos/examples/Wizard/InModalWithDrawerInformationalStep.tsx +122 -0
- package/src/demos/examples/Wizard/InPage.tsx +35 -0
- package/src/demos/examples/Wizard/InPageWithDrawer.tsx +195 -0
- package/src/demos/examples/Wizard/InPageWithDrawerInformationalStep.tsx +200 -0
- package/src/deprecated/components/PageHeader/PageHeaderToolsItem.tsx +0 -4
- package/src/deprecated/components/PageHeader/examples/PageVerticalNavUsingPageHeaderComponent.tsx +4 -4
- package/src/deprecated/components/PageHeader/tests/PageHeaderToolsItem.test.tsx +1 -3
- package/src/deprecated/components/PageHeader/tests/__snapshots__/PageHeaderToolsItem.test.tsx.snap +1 -1
- package/src/helpers/Popper/Popper.tsx +10 -19
- package/src/helpers/__mocks__/util.ts +2 -0
- package/src/helpers/datetimeUtils.ts +1 -1
- package/src/helpers/util.ts +22 -0
- package/dist/styles/assets/images/pf-c-brand__logo-on-lg-white.svg +0 -32
- package/dist/styles/assets/images/pf-c-brand__logo-on-md-white.svg +0 -42
- package/dist/styles/assets/images/pf-c-brand__logo-on-sm-white.svg +0 -17
- package/dist/styles/assets/images/pf-c-brand__logo-on-xl-white.svg +0 -39
- package/dist/styles/assets/images/pf_logo_white.hbs +0 -35
- package/dist/styles/assets/images/pf_logo_white.svg +0 -38
- package/src/components/ClipboardCopy/__tests__/Generated/ClipboardCopy.test.tsx +0 -40
- package/src/components/ClipboardCopy/__tests__/Generated/__snapshots__/ClipboardCopy.test.tsx.snap +0 -55
|
@@ -1,48 +1,92 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
import { screen, render } from '@testing-library/react';
|
|
3
|
+
import { ClipboardCopyToggle } from '../ClipboardCopyToggle';
|
|
4
|
+
import styles from '@patternfly/react-styles/css/components/ClipboardCopy/clipboard-copy';
|
|
4
5
|
import userEvent from '@testing-library/user-event';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
isExpanded: false,
|
|
13
|
-
className: 'myclassName',
|
|
14
|
-
onClick: jest.fn()
|
|
7
|
+
const onClickMock = jest.fn();
|
|
8
|
+
const requiredProps = {
|
|
9
|
+
id: 'main-id',
|
|
10
|
+
textId: 'text-id',
|
|
11
|
+
contentId: 'content-id',
|
|
12
|
+
onClick: onClickMock
|
|
15
13
|
};
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
// Must be kept as first test to avoid Button's ouiaId updating in snapshots
|
|
16
|
+
test('Matches snapshot', () => {
|
|
17
|
+
const { asFragment } = render(<ClipboardCopyToggle {...requiredProps} />);
|
|
18
|
+
|
|
19
|
+
expect(asFragment()).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('Renders without children', () => {
|
|
23
|
+
render(
|
|
24
|
+
<div data-testid="container">
|
|
25
|
+
<ClipboardCopyToggle {...requiredProps} />
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
expect(screen.getByTestId('container').firstChild).toBeVisible();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('Renders with id prop', () => {
|
|
33
|
+
render(<ClipboardCopyToggle {...requiredProps} />);
|
|
34
|
+
|
|
35
|
+
expect(screen.getByRole('button')).toHaveAttribute('id', requiredProps.id);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('Renders with aria-labelledby concatenated from id and textId props', () => {
|
|
39
|
+
render(
|
|
40
|
+
<>
|
|
41
|
+
<ClipboardCopyToggle aria-label="Toggle content" {...requiredProps} />
|
|
42
|
+
<span id={requiredProps.textId}>Test content</span>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
21
45
|
|
|
22
|
-
|
|
23
|
-
|
|
46
|
+
expect(screen.getByRole('button')).toHaveAccessibleName('Toggle content Test content');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('Renders with aria-controls with passed in contentId prop', () => {
|
|
50
|
+
render(<ClipboardCopyToggle {...requiredProps} />);
|
|
51
|
+
|
|
52
|
+
expect(screen.getByRole('button')).toHaveAttribute('aria-controls', requiredProps.contentId);
|
|
53
|
+
});
|
|
24
54
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const user = userEvent.setup();
|
|
55
|
+
test('Renders with aria-expanded of false by default', () => {
|
|
56
|
+
render(<ClipboardCopyToggle {...requiredProps} />);
|
|
28
57
|
|
|
29
|
-
|
|
58
|
+
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'false');
|
|
59
|
+
});
|
|
30
60
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
61
|
+
test('Renders with aria-expanded based on isExpanded prop', () => {
|
|
62
|
+
render(<ClipboardCopyToggle isExpanded={true} {...requiredProps} />);
|
|
34
63
|
|
|
35
|
-
|
|
36
|
-
|
|
64
|
+
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'true');
|
|
65
|
+
});
|
|
37
66
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
67
|
+
test('Calls onClick when clipboard toggle is clicked', async () => {
|
|
68
|
+
const user = userEvent.setup();
|
|
69
|
+
render(<ClipboardCopyToggle {...requiredProps} />);
|
|
70
|
+
|
|
71
|
+
await user.click(screen.getByRole('button'));
|
|
72
|
+
expect(onClickMock).toHaveBeenCalledTimes(1);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('Does not call onClick when clipboard toggle is not clicked', async () => {
|
|
76
|
+
const user = userEvent.setup();
|
|
77
|
+
render(
|
|
78
|
+
<>
|
|
79
|
+
<ClipboardCopyToggle {...requiredProps} />
|
|
80
|
+
<button>Test clicker</button>
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
await user.click(screen.getByRole('button', { name: 'Test clicker' }));
|
|
85
|
+
expect(onClickMock).not.toHaveBeenCalled();
|
|
86
|
+
});
|
|
41
87
|
|
|
42
|
-
|
|
43
|
-
|
|
88
|
+
test('Spreads additional props to container', () => {
|
|
89
|
+
render(<ClipboardCopyToggle data-prop="test" {...requiredProps} />);
|
|
44
90
|
|
|
45
|
-
|
|
46
|
-
expect(toggleButton).toHaveAttribute('aria-expanded', 'false');
|
|
47
|
-
});
|
|
91
|
+
expect(screen.getByRole('button')).toHaveAttribute('data-prop', 'test');
|
|
48
92
|
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Matches snapshot 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="pf-v5-c-clipboard-copy"
|
|
7
|
+
data-ouia-component-id="snapshot"
|
|
8
|
+
data-ouia-component-type="PF5/ClipboardCopy"
|
|
9
|
+
data-ouia-safe="true"
|
|
10
|
+
id="snapshot"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
class="pf-v5-c-clipboard-copy__group"
|
|
14
|
+
>
|
|
15
|
+
<span
|
|
16
|
+
class="pf-v5-c-form-control"
|
|
17
|
+
>
|
|
18
|
+
<input
|
|
19
|
+
aria-invalid="false"
|
|
20
|
+
aria-label="Copyable input"
|
|
21
|
+
data-ouia-component-id="OUIA-Generated-TextInputBase-26"
|
|
22
|
+
data-ouia-component-type="PF5/TextInput"
|
|
23
|
+
data-ouia-safe="true"
|
|
24
|
+
id="text-input-34"
|
|
25
|
+
type="text"
|
|
26
|
+
value="Copyable text"
|
|
27
|
+
/>
|
|
28
|
+
</span>
|
|
29
|
+
<div
|
|
30
|
+
data-testid="clipboardCopyButton-mock"
|
|
31
|
+
>
|
|
32
|
+
<p>
|
|
33
|
+
exitDelay: 1500
|
|
34
|
+
</p>
|
|
35
|
+
<p>
|
|
36
|
+
entryDelay: 300
|
|
37
|
+
</p>
|
|
38
|
+
<p>
|
|
39
|
+
maxWidth: 150px
|
|
40
|
+
</p>
|
|
41
|
+
<p>
|
|
42
|
+
position: top
|
|
43
|
+
</p>
|
|
44
|
+
<p>
|
|
45
|
+
button-ariaLabel: Copy to clipboard
|
|
46
|
+
</p>
|
|
47
|
+
<div>
|
|
48
|
+
children: Copy to clipboard
|
|
49
|
+
</div>
|
|
50
|
+
<button>
|
|
51
|
+
Test CCB clicker
|
|
52
|
+
</button>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</DocumentFragment>
|
|
57
|
+
`;
|
package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyButton.test.tsx.snap
CHANGED
|
@@ -1,31 +1,57 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Matches snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
aria-label="click this button to copy text"
|
|
8
|
-
aria-labelledby="my-id my-text-id"
|
|
9
|
-
class="pf-v5-c-button pf-m-control fancy-copy-button"
|
|
10
|
-
data-ouia-component-id="OUIA-Generated-Button-control-1"
|
|
11
|
-
data-ouia-component-type="PF5/Button"
|
|
12
|
-
data-ouia-safe="true"
|
|
13
|
-
id="my-id"
|
|
14
|
-
type="button"
|
|
5
|
+
<div
|
|
6
|
+
data-testid="tooltip-mock"
|
|
15
7
|
>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
class="pf-v5-svg"
|
|
19
|
-
fill="currentColor"
|
|
20
|
-
height="1em"
|
|
21
|
-
role="img"
|
|
22
|
-
viewBox="0 0 448 512"
|
|
23
|
-
width="1em"
|
|
8
|
+
<div
|
|
9
|
+
data-testid="tooltip-mock-content"
|
|
24
10
|
>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</
|
|
29
|
-
|
|
11
|
+
<div>
|
|
12
|
+
Button content
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<p>
|
|
16
|
+
exitDelay: 0
|
|
17
|
+
</p>
|
|
18
|
+
<p>
|
|
19
|
+
entryDelay: 300
|
|
20
|
+
</p>
|
|
21
|
+
<p>
|
|
22
|
+
maxWidth: 100px
|
|
23
|
+
</p>
|
|
24
|
+
<p>
|
|
25
|
+
position: top
|
|
26
|
+
</p>
|
|
27
|
+
<a>
|
|
28
|
+
onTooltipHidden clicker
|
|
29
|
+
</a>
|
|
30
|
+
<button
|
|
31
|
+
aria-disabled="false"
|
|
32
|
+
aria-label="Copyable input"
|
|
33
|
+
aria-labelledby="button-id text-id"
|
|
34
|
+
class="pf-v5-c-button pf-m-control"
|
|
35
|
+
data-ouia-component-id="OUIA-Generated-Button-control-1"
|
|
36
|
+
data-ouia-component-type="PF5/Button"
|
|
37
|
+
data-ouia-safe="true"
|
|
38
|
+
id="button-id"
|
|
39
|
+
type="button"
|
|
40
|
+
>
|
|
41
|
+
<svg
|
|
42
|
+
aria-hidden="true"
|
|
43
|
+
class="pf-v5-svg"
|
|
44
|
+
fill="currentColor"
|
|
45
|
+
height="1em"
|
|
46
|
+
role="img"
|
|
47
|
+
viewBox="0 0 448 512"
|
|
48
|
+
width="1em"
|
|
49
|
+
>
|
|
50
|
+
<path
|
|
51
|
+
d="M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"
|
|
52
|
+
/>
|
|
53
|
+
</svg>
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
30
56
|
</DocumentFragment>
|
|
31
57
|
`;
|
package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyExpanded.test.tsx.snap
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Matches snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="pf-v5-c-clipboard-copy__expandable-content
|
|
6
|
+
class="pf-v5-c-clipboard-copy__expandable-content"
|
|
7
7
|
contenteditable="true"
|
|
8
|
-
id="id-1"
|
|
9
8
|
>
|
|
10
|
-
|
|
11
|
-
dir="ltr"
|
|
12
|
-
>
|
|
13
|
-
{
|
|
14
|
-
"name": "@patternfly/react-core",
|
|
15
|
-
"version": "1.33.2"
|
|
16
|
-
}
|
|
17
|
-
</pre>
|
|
18
|
-
</div>
|
|
19
|
-
</DocumentFragment>
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
exports[`expanded content render 1`] = `
|
|
23
|
-
<DocumentFragment>
|
|
24
|
-
<div
|
|
25
|
-
class="pf-v5-c-clipboard-copy__expandable-content class-1"
|
|
26
|
-
contenteditable="true"
|
|
27
|
-
id="id-1"
|
|
28
|
-
>
|
|
29
|
-
This is my text
|
|
9
|
+
Expanded content
|
|
30
10
|
</div>
|
|
31
11
|
</DocumentFragment>
|
|
32
12
|
`;
|
package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Matches snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<button
|
|
6
|
-
aria-controls="
|
|
6
|
+
aria-controls="content-id"
|
|
7
7
|
aria-disabled="false"
|
|
8
8
|
aria-expanded="false"
|
|
9
|
-
aria-
|
|
10
|
-
|
|
11
|
-
class="pf-v5-c-button pf-m-control myclassName"
|
|
9
|
+
aria-labelledby="main-id text-id"
|
|
10
|
+
class="pf-v5-c-button pf-m-control"
|
|
12
11
|
data-ouia-component-id="OUIA-Generated-Button-control-1"
|
|
13
12
|
data-ouia-component-type="PF5/Button"
|
|
14
13
|
data-ouia-safe="true"
|
|
15
|
-
id="
|
|
14
|
+
id="main-id"
|
|
16
15
|
type="button"
|
|
17
16
|
>
|
|
18
17
|
<div
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import { DrawerColorVariant, DrawerContext } from './Drawer';
|
|
5
|
-
import { formatBreakpointMods } from '../../helpers/util';
|
|
5
|
+
import { formatBreakpointMods, getLanguageDirection } from '../../helpers/util';
|
|
6
6
|
import { GenerateId } from '../../helpers/GenerateId/GenerateId';
|
|
7
7
|
import { FocusTrap } from '../../helpers/FocusTrap/FocusTrap';
|
|
8
8
|
import cssPanelMdFlexBasis from '@patternfly/react-tokens/dist/esm/c_drawer__panel_md_FlexBasis';
|
|
@@ -111,7 +111,7 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
111
111
|
const calcValueNow = () => {
|
|
112
112
|
let splitterPos;
|
|
113
113
|
let drawerSize;
|
|
114
|
-
const isRTL =
|
|
114
|
+
const isRTL = getLanguageDirection(panel.current) === 'rtl';
|
|
115
115
|
|
|
116
116
|
if (isInline && (position === 'end' || position === 'right')) {
|
|
117
117
|
if (isRTL) {
|
|
@@ -198,7 +198,7 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
198
198
|
};
|
|
199
199
|
|
|
200
200
|
const handleControlMove = (e: MouseEvent | TouchEvent, controlPosition: number) => {
|
|
201
|
-
const isRTL =
|
|
201
|
+
const isRTL = getLanguageDirection(panel.current) === 'rtl';
|
|
202
202
|
|
|
203
203
|
e.stopPropagation();
|
|
204
204
|
if (!isResizing) {
|
|
@@ -264,7 +264,7 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
264
264
|
const callbackMouseUp = React.useCallback(handleMouseup, []);
|
|
265
265
|
|
|
266
266
|
const handleKeys = (e: React.KeyboardEvent) => {
|
|
267
|
-
const isRTL =
|
|
267
|
+
const isRTL = getLanguageDirection(panel.current) === 'rtl';
|
|
268
268
|
|
|
269
269
|
const key = e.key;
|
|
270
270
|
if (
|
|
@@ -19,6 +19,8 @@ export interface DropdownPopperProps {
|
|
|
19
19
|
enableFlip?: boolean;
|
|
20
20
|
/** The container to append the popper to. Defaults to 'inline'. */
|
|
21
21
|
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
22
|
+
/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */
|
|
23
|
+
preventOverflow?: boolean;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export interface DropdownToggleProps {
|
|
@@ -143,7 +143,7 @@ class ExpandableSection extends React.Component<ExpandableSectionProps, Expandab
|
|
|
143
143
|
componentDidUpdate(prevProps: ExpandableSectionProps) {
|
|
144
144
|
if (
|
|
145
145
|
this.props.variant === ExpandableSectionVariant.truncate &&
|
|
146
|
-
prevProps.truncateMaxLines !== this.props.truncateMaxLines
|
|
146
|
+
(prevProps.truncateMaxLines !== this.props.truncateMaxLines || prevProps.children !== this.props.children)
|
|
147
147
|
) {
|
|
148
148
|
const expandableContent = this.expandableContentRef.current;
|
|
149
149
|
setLineClamp(this.props.truncateMaxLines, expandableContent);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/InputGroup/input-group';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
|
-
import { FormSelect } from '../FormSelect';
|
|
5
|
-
import { TextArea } from '../TextArea';
|
|
6
|
-
import { TextInput } from '../TextInput';
|
|
7
4
|
|
|
8
5
|
export interface InputGroupProps extends React.HTMLProps<HTMLDivElement> {
|
|
9
6
|
/** Additional classes added to the input group. */
|
|
@@ -20,61 +17,12 @@ export const InputGroupBase: React.FunctionComponent<InputGroupProps> = ({
|
|
|
20
17
|
innerRef,
|
|
21
18
|
...props
|
|
22
19
|
}: InputGroupProps) => {
|
|
23
|
-
const getIdItem = () => {
|
|
24
|
-
const getChildId = (_children: any) =>
|
|
25
|
-
React.Children.toArray(_children).find(
|
|
26
|
-
(_child: any) => !formCtrls.includes(_child?.type?.displayName) && _child?.props?.id
|
|
27
|
-
);
|
|
28
|
-
let childId = getChildId(children);
|
|
29
|
-
if (childId) {
|
|
30
|
-
return childId;
|
|
31
|
-
}
|
|
32
|
-
React.Children.toArray(children).find((child: any) => {
|
|
33
|
-
const _childId = getChildId(child.props.children);
|
|
34
|
-
if (_childId) {
|
|
35
|
-
childId = _childId;
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
return childId;
|
|
40
|
-
};
|
|
41
|
-
const formCtrls = [FormSelect, TextArea, TextInput].map((comp) => comp.displayName);
|
|
42
|
-
const idItem = getIdItem() as React.ReactElement<{ id: string }>;
|
|
43
20
|
const ref = React.useRef(null);
|
|
44
21
|
const inputGroupRef = innerRef || ref;
|
|
45
22
|
|
|
46
|
-
const childrenWithId = React.Children.map(children, (child: any) => {
|
|
47
|
-
if (child?.type.displayName === 'InputGroupItem') {
|
|
48
|
-
const newChildren = React.Children.map(child.props.children, (_child) => {
|
|
49
|
-
if (!_child.props) {
|
|
50
|
-
return _child;
|
|
51
|
-
}
|
|
52
|
-
if (_child.props['aria-describedby']) {
|
|
53
|
-
return _child;
|
|
54
|
-
}
|
|
55
|
-
if (!formCtrls.includes(_child.type.displayName)) {
|
|
56
|
-
return _child;
|
|
57
|
-
}
|
|
58
|
-
return React.cloneElement(_child, {
|
|
59
|
-
'aria-describedby': _child.props['aria-describedby'] === '' ? undefined : idItem?.props?.id
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
return React.cloneElement(child, {}, newChildren);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (child?.props['aria-describedby']) {
|
|
66
|
-
return child;
|
|
67
|
-
}
|
|
68
|
-
if (!formCtrls.includes(child?.type.displayName)) {
|
|
69
|
-
return child;
|
|
70
|
-
}
|
|
71
|
-
return React.cloneElement(child, {
|
|
72
|
-
'aria-describedby': child.props['aria-describedby'] === '' ? undefined : idItem?.props?.id
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
23
|
return (
|
|
76
24
|
<div ref={inputGroupRef} className={css(styles.inputGroup, className)} {...props}>
|
|
77
|
-
{
|
|
25
|
+
{children}
|
|
78
26
|
</div>
|
|
79
27
|
);
|
|
80
28
|
};
|
|
@@ -8,59 +8,22 @@ import { Button } from '../../Button';
|
|
|
8
8
|
import { TextInput } from '../../TextInput';
|
|
9
9
|
|
|
10
10
|
describe('InputGroup', () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// If Button has an id props, this should be used in aria-describedby.
|
|
11
|
+
// Regression test for https://github.com/patternfly/patternfly-react/issues/9667
|
|
12
|
+
test('wont add aria-describedby automatically to form-control', () => {
|
|
14
13
|
render(
|
|
15
14
|
<InputGroup>
|
|
16
15
|
<InputGroupItem>
|
|
17
|
-
<TextInput
|
|
16
|
+
<TextInput aria-label="User password" />
|
|
18
17
|
</InputGroupItem>
|
|
19
18
|
<InputGroupItem>
|
|
20
|
-
<Button variant="
|
|
21
|
-
|
|
19
|
+
<Button variant="control" id="show-password-toggler">
|
|
20
|
+
Show
|
|
22
21
|
</Button>
|
|
23
22
|
</InputGroupItem>
|
|
24
23
|
</InputGroup>
|
|
25
24
|
);
|
|
26
|
-
expect(screen.getByLabelText('some text')).toHaveAttribute('aria-describedby', 'button-id');
|
|
27
|
-
});
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// If Button has an id props, this should be used in aria-describedby, but this
|
|
32
|
-
// example has an empty aria-describedby to prevent that from happening.
|
|
33
|
-
render(
|
|
34
|
-
<InputGroup>
|
|
35
|
-
<InputGroupItem>
|
|
36
|
-
<TextInput value="some data" aria-describedby="" aria-label="some text" />
|
|
37
|
-
</InputGroupItem>
|
|
38
|
-
<InputGroupItem>
|
|
39
|
-
<Button id="button-id">
|
|
40
|
-
hello
|
|
41
|
-
</Button>
|
|
42
|
-
</InputGroupItem>
|
|
43
|
-
</InputGroup>
|
|
44
|
-
);
|
|
45
|
-
expect(screen.getByLabelText('some text')).not.toHaveAttribute('aria-describedby');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
test('wont override aria-describedby in form-control if describedby has value', () => {
|
|
49
|
-
// In this test, TextInput is a form-control component and Button is not.
|
|
50
|
-
// If Button has an id props, this should be used in aria-describedby, but this
|
|
51
|
-
// example has a predefined aria-describedby to prevent that from happening
|
|
52
|
-
render(
|
|
53
|
-
<InputGroup>
|
|
54
|
-
<InputGroupItem>
|
|
55
|
-
<TextInput value="some data" aria-describedby="myself" aria-label="some text" />
|
|
56
|
-
</InputGroupItem>
|
|
57
|
-
<InputGroupItem>
|
|
58
|
-
<Button id="button-id">
|
|
59
|
-
hello
|
|
60
|
-
</Button>
|
|
61
|
-
</InputGroupItem>
|
|
62
|
-
</InputGroup>
|
|
63
|
-
);
|
|
64
|
-
expect(screen.getByLabelText('some text')).toHaveAttribute('aria-describedby', 'myself');
|
|
26
|
+
const formControl = screen.getByLabelText("User password");
|
|
27
|
+
expect(formControl).not.toHaveAttribute("aria-describedby");
|
|
65
28
|
});
|
|
66
29
|
});
|
|
@@ -9,8 +9,6 @@ export interface MastheadProps extends React.DetailedHTMLProps<React.HTMLProps<H
|
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
/** Additional classes added to the masthead */
|
|
11
11
|
className?: string;
|
|
12
|
-
/** Background theme color of the masthead */
|
|
13
|
-
backgroundColor?: 'dark' | 'light' | 'light200';
|
|
14
12
|
/** Display type at various breakpoints */
|
|
15
13
|
display?: {
|
|
16
14
|
default?: 'inline' | 'stack';
|
|
@@ -34,7 +32,6 @@ export interface MastheadProps extends React.DetailedHTMLProps<React.HTMLProps<H
|
|
|
34
32
|
export const Masthead: React.FunctionComponent<MastheadProps> = ({
|
|
35
33
|
children,
|
|
36
34
|
className,
|
|
37
|
-
backgroundColor = 'dark',
|
|
38
35
|
display = {
|
|
39
36
|
md: 'inline'
|
|
40
37
|
},
|
|
@@ -48,8 +45,6 @@ export const Masthead: React.FunctionComponent<MastheadProps> = ({
|
|
|
48
45
|
styles.masthead,
|
|
49
46
|
formatBreakpointMods(display, styles, 'display-', getBreakpoint(width)),
|
|
50
47
|
formatBreakpointMods(inset, styles, '', getBreakpoint(width)),
|
|
51
|
-
backgroundColor === 'light' && styles.modifiers.light,
|
|
52
|
-
backgroundColor === 'light200' && styles.modifiers.light_200,
|
|
53
48
|
className
|
|
54
49
|
)}
|
|
55
50
|
{...props}
|
|
@@ -140,50 +140,6 @@ import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
|
140
140
|
</Masthead>;
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
### Light variant
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
import React from 'react';
|
|
147
|
-
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
148
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
149
|
-
|
|
150
|
-
<Masthead id="light-masthead" backgroundColor="light">
|
|
151
|
-
<MastheadToggle>
|
|
152
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
153
|
-
<BarsIcon />
|
|
154
|
-
</Button>
|
|
155
|
-
</MastheadToggle>
|
|
156
|
-
<MastheadMain>
|
|
157
|
-
<MastheadBrand>Logo</MastheadBrand>
|
|
158
|
-
</MastheadMain>
|
|
159
|
-
<MastheadContent>
|
|
160
|
-
<span>Content</span>
|
|
161
|
-
</MastheadContent>
|
|
162
|
-
</Masthead>;
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Light 200 variant
|
|
166
|
-
|
|
167
|
-
```ts
|
|
168
|
-
import React from 'react';
|
|
169
|
-
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
170
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
171
|
-
|
|
172
|
-
<Masthead id="light200-masthead" backgroundColor="light200">
|
|
173
|
-
<MastheadToggle>
|
|
174
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
175
|
-
<BarsIcon />
|
|
176
|
-
</Button>
|
|
177
|
-
</MastheadToggle>
|
|
178
|
-
<MastheadMain>
|
|
179
|
-
<MastheadBrand>Logo</MastheadBrand>
|
|
180
|
-
</MastheadMain>
|
|
181
|
-
<MastheadContent>
|
|
182
|
-
<span>Content</span>
|
|
183
|
-
</MastheadContent>
|
|
184
|
-
</Masthead>;
|
|
185
|
-
```
|
|
186
|
-
|
|
187
143
|
### Inset
|
|
188
144
|
|
|
189
145
|
```ts
|
|
@@ -311,7 +311,8 @@ class MenuBase extends React.Component<MenuProps, MenuState> {
|
|
|
311
311
|
noHorizontalArrowHandling={
|
|
312
312
|
document.activeElement &&
|
|
313
313
|
(document.activeElement.classList.contains(breadcrumbStyles.breadcrumbLink) ||
|
|
314
|
-
document.activeElement.classList.contains(dropdownStyles.dropdownToggle)
|
|
314
|
+
document.activeElement.classList.contains(dropdownStyles.dropdownToggle) ||
|
|
315
|
+
document.activeElement.tagName === 'INPUT')
|
|
315
316
|
}
|
|
316
317
|
noEnterHandling
|
|
317
318
|
noSpaceHandling
|
|
@@ -14,6 +14,8 @@ export interface MenuPopperProps {
|
|
|
14
14
|
maxWidth?: string | 'trigger';
|
|
15
15
|
/** Enable to flip the popper when it reaches the boundary */
|
|
16
16
|
enableFlip?: boolean;
|
|
17
|
+
/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */
|
|
18
|
+
preventOverflow?: boolean;
|
|
17
19
|
}
|
|
18
20
|
export interface MenuContainerProps {
|
|
19
21
|
/** Menu to be rendered */
|