@patternfly/react-core 6.3.0-prerelease.2 → 6.3.0-prerelease.21
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 +105 -0
- package/CONTRIBUTING.md +3 -5
- 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/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/dynamic-modules.json +2 -0
- package/dist/esm/components/Button/Button.d.ts +12 -0
- package/dist/esm/components/Button/Button.d.ts.map +1 -1
- package/dist/esm/components/Button/Button.js +33 -3
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Button/hamburgerIcon.d.ts +2 -0
- package/dist/esm/components/Button/hamburgerIcon.d.ts.map +1 -0
- package/dist/esm/components/Button/hamburgerIcon.js +7 -0
- package/dist/esm/components/Button/hamburgerIcon.js.map +1 -0
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +2 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.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/DualListSelector/DualListSelector.d.ts +5 -0
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.js +4 -3
- package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorContext.d.ts +1 -0
- package/dist/esm/components/DualListSelector/DualListSelectorContext.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorContext.js +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorContext.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTree.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTree.js +4 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTree.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTreeItem.d.ts +5 -0
- package/dist/esm/components/DualListSelector/DualListSelectorTreeItem.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTreeItem.js +8 -4
- package/dist/esm/components/DualListSelector/DualListSelectorTreeItem.js.map +1 -1
- package/dist/esm/components/Form/FormFieldGroupExpandable.d.ts +5 -0
- package/dist/esm/components/Form/FormFieldGroupExpandable.d.ts.map +1 -1
- package/dist/esm/components/Form/FormFieldGroupExpandable.js +2 -2
- package/dist/esm/components/Form/FormFieldGroupExpandable.js.map +1 -1
- package/dist/esm/components/Form/FormGroupLabelHelp.js +2 -2
- package/dist/esm/components/Form/FormGroupLabelHelp.js.map +1 -1
- package/dist/esm/components/Form/InternalFormFieldGroup.d.ts +5 -0
- package/dist/esm/components/Form/InternalFormFieldGroup.d.ts.map +1 -1
- package/dist/esm/components/Form/InternalFormFieldGroup.js +2 -2
- package/dist/esm/components/Form/InternalFormFieldGroup.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts +2 -0
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js +4 -3
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Nav/NavExpandable.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavExpandable.js +1 -1
- package/dist/esm/components/Nav/NavExpandable.js.map +1 -1
- package/dist/esm/components/Page/PageToggleButton.d.ts +4 -0
- package/dist/esm/components/Page/PageToggleButton.d.ts.map +1 -1
- package/dist/esm/components/Page/PageToggleButton.js +2 -2
- package/dist/esm/components/Page/PageToggleButton.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/Tabs/OverflowTab.d.ts +26 -0
- package/dist/esm/components/Tabs/OverflowTab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/OverflowTab.js +2 -2
- package/dist/esm/components/Tabs/OverflowTab.js.map +1 -1
- package/dist/esm/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tab.js +5 -2
- package/dist/esm/components/Tabs/Tab.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.d.ts +8 -0
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +41 -9
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Tabs/TabsContext.d.ts +1 -0
- package/dist/esm/components/Tabs/TabsContext.d.ts.map +1 -1
- package/dist/esm/components/Tabs/TabsContext.js +1 -0
- package/dist/esm/components/Tabs/TabsContext.js.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.js +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.js.map +1 -1
- package/dist/esm/components/Truncate/Truncate.d.ts +11 -8
- package/dist/esm/components/Truncate/Truncate.d.ts.map +1 -1
- package/dist/esm/components/Truncate/Truncate.js +22 -12
- package/dist/esm/components/Truncate/Truncate.js.map +1 -1
- package/dist/esm/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/esm/demos/DashboardHeader.js +1 -2
- package/dist/esm/demos/DashboardHeader.js.map +1 -1
- package/dist/esm/demos/sampleData.d.ts.map +1 -1
- package/dist/esm/demos/sampleData.js +225 -226
- package/dist/esm/demos/sampleData.js.map +1 -1
- package/dist/esm/demos/sampleDataRTL.d.ts +7 -0
- package/dist/esm/demos/sampleDataRTL.d.ts.map +1 -0
- package/dist/esm/demos/sampleDataRTL.js +128 -0
- package/dist/esm/demos/sampleDataRTL.js.map +1 -0
- package/dist/esm/helpers/KeyboardHandler.js +3 -2
- package/dist/esm/helpers/KeyboardHandler.js.map +1 -1
- package/dist/esm/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/esm/helpers/Popper/Popper.js +1 -0
- package/dist/esm/helpers/Popper/Popper.js.map +1 -1
- package/dist/esm/helpers/util.d.ts +17 -0
- package/dist/esm/helpers/util.d.ts.map +1 -1
- package/dist/esm/helpers/util.js +36 -0
- package/dist/esm/helpers/util.js.map +1 -1
- package/dist/js/components/Button/Button.d.ts +12 -0
- package/dist/js/components/Button/Button.d.ts.map +1 -1
- package/dist/js/components/Button/Button.js +33 -3
- package/dist/js/components/Button/Button.js.map +1 -1
- package/dist/js/components/Button/hamburgerIcon.d.ts +2 -0
- package/dist/js/components/Button/hamburgerIcon.d.ts.map +1 -0
- package/dist/js/components/Button/hamburgerIcon.js +11 -0
- package/dist/js/components/Button/hamburgerIcon.js.map +1 -0
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +2 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopy.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/DualListSelector/DualListSelector.d.ts +5 -0
- package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.js +4 -3
- package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorContext.d.ts +1 -0
- package/dist/js/components/DualListSelector/DualListSelectorContext.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorContext.js +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorContext.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListWrapper.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListWrapper.js +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListWrapper.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorTree.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorTree.js +4 -1
- package/dist/js/components/DualListSelector/DualListSelectorTree.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorTreeItem.d.ts +5 -0
- package/dist/js/components/DualListSelector/DualListSelectorTreeItem.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorTreeItem.js +7 -3
- package/dist/js/components/DualListSelector/DualListSelectorTreeItem.js.map +1 -1
- package/dist/js/components/Form/FormFieldGroupExpandable.d.ts +5 -0
- package/dist/js/components/Form/FormFieldGroupExpandable.d.ts.map +1 -1
- package/dist/js/components/Form/FormFieldGroupExpandable.js +2 -2
- package/dist/js/components/Form/FormFieldGroupExpandable.js.map +1 -1
- package/dist/js/components/Form/FormGroupLabelHelp.js +2 -2
- package/dist/js/components/Form/FormGroupLabelHelp.js.map +1 -1
- package/dist/js/components/Form/InternalFormFieldGroup.d.ts +5 -0
- package/dist/js/components/Form/InternalFormFieldGroup.d.ts.map +1 -1
- package/dist/js/components/Form/InternalFormFieldGroup.js +2 -2
- package/dist/js/components/Form/InternalFormFieldGroup.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts +2 -0
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js +4 -3
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Nav/NavExpandable.d.ts.map +1 -1
- package/dist/js/components/Nav/NavExpandable.js +1 -1
- package/dist/js/components/Nav/NavExpandable.js.map +1 -1
- package/dist/js/components/Page/PageToggleButton.d.ts +4 -0
- package/dist/js/components/Page/PageToggleButton.d.ts.map +1 -1
- package/dist/js/components/Page/PageToggleButton.js +2 -2
- package/dist/js/components/Page/PageToggleButton.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/Tabs/OverflowTab.d.ts +26 -0
- package/dist/js/components/Tabs/OverflowTab.d.ts.map +1 -1
- package/dist/js/components/Tabs/OverflowTab.js +2 -2
- package/dist/js/components/Tabs/OverflowTab.js.map +1 -1
- package/dist/js/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tab.js +4 -1
- package/dist/js/components/Tabs/Tab.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts +8 -0
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +40 -8
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/components/Tabs/TabsContext.d.ts +1 -0
- package/dist/js/components/Tabs/TabsContext.d.ts.map +1 -1
- package/dist/js/components/Tabs/TabsContext.js +1 -0
- package/dist/js/components/Tabs/TabsContext.js.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.js +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.js.map +1 -1
- package/dist/js/components/Truncate/Truncate.d.ts +11 -8
- package/dist/js/components/Truncate/Truncate.d.ts.map +1 -1
- package/dist/js/components/Truncate/Truncate.js +21 -12
- package/dist/js/components/Truncate/Truncate.js.map +1 -1
- package/dist/js/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/js/demos/DashboardHeader.js +1 -2
- package/dist/js/demos/DashboardHeader.js.map +1 -1
- package/dist/js/demos/sampleData.d.ts.map +1 -1
- package/dist/js/demos/sampleData.js +225 -226
- package/dist/js/demos/sampleData.js.map +1 -1
- package/dist/js/demos/sampleDataRTL.d.ts +7 -0
- package/dist/js/demos/sampleDataRTL.d.ts.map +1 -0
- package/dist/js/demos/sampleDataRTL.js +131 -0
- package/dist/js/demos/sampleDataRTL.js.map +1 -0
- package/dist/js/helpers/KeyboardHandler.js +3 -2
- package/dist/js/helpers/KeyboardHandler.js.map +1 -1
- package/dist/js/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/js/helpers/Popper/Popper.js +1 -0
- package/dist/js/helpers/Popper/Popper.js.map +1 -1
- package/dist/js/helpers/util.d.ts +17 -0
- package/dist/js/helpers/util.d.ts.map +1 -1
- package/dist/js/helpers/util.js +39 -1
- package/dist/js/helpers/util.js.map +1 -1
- package/dist/styles/assets/images/icon-help.hbs +3 -0
- package/dist/styles/assets/images/icon-outlined-star.hbs +3 -0
- package/dist/styles/assets/images/icon-star.hbs +3 -0
- package/dist/styles/base-no-reset.css +52 -11
- package/dist/styles/base.css +52 -11
- package/dist/umd/assets/{output-CTQ3-b33.css → output-BDZoYci_.css} +19699 -19088
- package/dist/umd/react-core.min.js +3 -3
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +6 -6
- package/src/components/Button/Button.tsx +78 -5
- package/src/components/Button/__tests__/Button.test.tsx +380 -74
- package/src/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +1 -1
- package/src/components/Button/examples/Button.md +57 -14
- package/src/components/Button/examples/ButtonFavorite.tsx +18 -0
- package/src/components/Button/examples/ButtonHamburger.tsx +9 -0
- package/src/components/Button/examples/ButtonSettings.tsx +10 -0
- package/src/components/Button/hamburgerIcon.tsx +13 -0
- package/src/components/Card/examples/Card.md +1 -1
- package/src/components/Card/examples/CardSelectable.tsx +73 -60
- package/src/components/Card/examples/CardSingleSelectable.tsx +65 -48
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +2 -1
- package/src/components/ClipboardCopy/ClipboardCopyToggle.tsx +1 -1
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyToggle.test.tsx +7 -1
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap +0 -1
- package/src/components/DualListSelector/DualListSelector.tsx +18 -4
- package/src/components/DualListSelector/DualListSelectorContext.ts +2 -1
- package/src/components/DualListSelector/DualListSelectorListWrapper.tsx +8 -5
- package/src/components/DualListSelector/DualListSelectorTree.tsx +4 -0
- package/src/components/DualListSelector/DualListSelectorTreeItem.tsx +17 -2
- package/src/components/DualListSelector/__tests__/DualListSelector.test.tsx +32 -1
- package/src/components/DualListSelector/__tests__/DualListSelectorTreeItem.test.tsx +55 -0
- package/src/components/DualListSelector/examples/DualListSelectorTree.tsx +1 -1
- package/src/components/Form/FormFieldGroupExpandable.tsx +7 -0
- package/src/components/Form/FormGroupLabelHelp.tsx +2 -2
- package/src/components/Form/InternalFormFieldGroup.tsx +19 -3
- package/src/components/Form/__tests__/FormFieldGroupExpandable.test.tsx +55 -0
- package/src/components/Form/examples/FormFieldGroups.tsx +7 -1
- package/src/components/LoginPage/examples/LoginPageBasic.tsx +1 -1
- package/src/components/LoginPage/examples/LoginPageLanguageSelect.tsx +1 -1
- package/src/components/LoginPage/examples/LoginPageShowHidePassword.tsx +1 -1
- package/src/components/Masthead/examples/MastheadBasic.tsx +1 -2
- package/src/components/Masthead/examples/MastheadBasicMixedContent.tsx +1 -2
- package/src/components/Masthead/examples/MastheadDisplayInline.tsx +1 -2
- package/src/components/Masthead/examples/MastheadDisplayStack.tsx +1 -2
- package/src/components/Masthead/examples/MastheadDisplayStackInlineResponsive.tsx +1 -2
- package/src/components/Masthead/examples/MastheadInsets.tsx +1 -2
- package/src/components/Masthead/examples/MastheadLogoCustomComponent.tsx +1 -2
- package/src/components/MenuToggle/MenuToggle.tsx +6 -1
- package/src/components/MenuToggle/__tests__/MenuToggle.test.tsx +59 -45
- package/src/components/MenuToggle/__tests__/__snapshots__/MenuToggle.test.tsx.snap +9 -9
- package/src/components/MenuToggle/examples/MenuToggle.md +14 -30
- package/src/components/MenuToggle/examples/MenuToggleCustomIcon.tsx +17 -0
- package/src/components/MenuToggle/examples/MenuToggleSettings.tsx +8 -0
- package/src/components/Nav/NavExpandable.tsx +6 -1
- package/src/components/Nav/__tests__/Generated/__snapshots__/NavExpandable.test.tsx.snap +1 -0
- package/src/components/Nav/__tests__/NavExpandable.test.tsx +15 -0
- package/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap +3 -0
- package/src/components/Page/PageToggleButton.tsx +9 -2
- package/src/components/Page/examples/Page.md +1 -1
- package/src/components/Page/examples/PageCenteredSection.tsx +5 -9
- package/src/components/Page/examples/PageGroupSection.tsx +11 -8
- package/src/components/Page/examples/PageHorizontalNav.tsx +9 -3
- package/src/components/Page/examples/PageMainSectionPadding.tsx +14 -9
- package/src/components/Page/examples/PageMainSectionVariations.tsx +8 -11
- package/src/components/Page/examples/PageMultipleSidebarBody.tsx +11 -8
- package/src/components/Page/examples/PageUncontrolledNav.tsx +10 -7
- package/src/components/Page/examples/PageVerticalNav.tsx +11 -8
- package/src/components/Page/examples/PageWithOrWithoutFill.tsx +10 -9
- package/src/components/SearchInput/SearchInput.tsx +8 -1
- package/src/components/Select/examples/Select.md +3 -26
- package/src/components/Skeleton/examples/SkeletonText.tsx +0 -1
- package/src/components/Tabs/OverflowTab.tsx +29 -0
- package/src/components/Tabs/Tab.tsx +6 -2
- package/src/components/Tabs/Tabs.tsx +70 -11
- package/src/components/Tabs/TabsContext.ts +2 -0
- package/src/components/Tabs/__tests__/Tabs.test.tsx +43 -1
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +39 -26
- package/src/components/Tabs/examples/Tabs.md +1 -1
- package/src/components/Timestamp/examples/TimestampBasicFormats.tsx +1 -1
- package/src/components/Timestamp/examples/TimestampDefaultTooltip.tsx +1 -1
- package/src/components/TreeView/TreeViewListItem.tsx +1 -3
- package/src/components/TreeView/__tests__/TreeViewListItem.test.tsx +10 -0
- package/src/components/Truncate/Truncate.tsx +48 -22
- package/src/components/Truncate/__tests__/Truncate.test.tsx +28 -2
- package/src/components/Truncate/__tests__/__snapshots__/Truncate.test.tsx.snap +2 -2
- package/src/components/Truncate/examples/Truncate.md +8 -0
- package/src/components/Truncate/examples/TruncateLinks.tsx +22 -0
- package/src/demos/Banner.md +6 -6
- package/src/demos/CardDemos.md +1 -1
- package/src/demos/CardView/examples/CardView.tsx +9 -4
- package/src/demos/DashboardHeader.tsx +2 -5
- package/src/demos/DataList/examples/DataListActionable.tsx +5 -3
- package/src/demos/DataList/examples/DataListBasic.tsx +2 -2
- package/src/demos/DataList/examples/DataListExpandableControlInToolbar.tsx +2 -2
- package/src/demos/DataList/examples/DataListStaticBottomPagination.tsx +4 -2
- package/src/demos/DescriptionList/examples/DescriptionListBasic.tsx +4 -4
- package/src/demos/DescriptionList/examples/DescriptionListInDrawer.tsx +5 -3
- package/src/demos/JumpLinks.md +5 -5
- package/src/demos/NotificationDrawer/examples/NotificationDrawerBasic.tsx +2 -5
- package/src/demos/NotificationDrawer/examples/NotificationDrawerGrouped.tsx +2 -5
- package/src/demos/PasswordGenerator.md +1 -1
- package/src/demos/RTL/RTL.md +1 -0
- package/src/demos/RTL/examples/PaginatedTable.tsx +18 -53
- package/src/demos/Tabs.md +6 -6
- package/src/demos/examples/AlertGroup/AlertGroupToastWithNotificationDrawer.tsx +6 -6
- package/src/demos/examples/BackToTop/BackToTopNameDemo.tsx +2 -2
- package/src/demos/examples/Card/CardAggregateStatus.tsx +2 -6
- package/src/demos/examples/Card/CardDetails.tsx +2 -3
- package/src/demos/examples/Card/CardEventsView.tsx +2 -3
- package/src/demos/examples/Card/CardLogView.tsx +2 -3
- package/src/demos/examples/Card/CardStatus.tsx +0 -1
- package/src/demos/examples/Card/CardUtilizationDemo3.tsx +0 -1
- package/src/demos/examples/Masthead/MastheadWithHorizontalNav.tsx +6 -4
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +5 -8
- package/src/demos/examples/Nav/NavDefault.tsx +3 -3
- package/src/demos/examples/Nav/NavDrilldown.tsx +1 -1
- package/src/demos/examples/Nav/NavExpandable.tsx +3 -3
- package/src/demos/examples/Nav/NavFlyout.tsx +12 -9
- package/src/demos/examples/Nav/NavGrouped.tsx +14 -6
- package/src/demos/examples/Nav/NavHorizontal.tsx +4 -4
- package/src/demos/examples/Nav/NavHorizontalWithSubnav.tsx +7 -10
- package/src/demos/examples/Nav/NavManual.tsx +6 -9
- package/src/demos/examples/Nav/NavWithSubnav.tsx +5 -5
- package/src/demos/examples/Page/PageContextSelector.tsx +3 -6
- package/src/demos/examples/Page/PageStickySectionBreadcrumb.tsx +2 -5
- package/src/demos/examples/Page/PageStickySectionGroup.tsx +2 -5
- package/src/demos/examples/Page/PageStickySectionGroupAlternate.tsx +2 -5
- package/src/demos/examples/Tabs/ModalTabs.tsx +3 -3
- package/src/demos/examples/Tabs/NestedTabs.tsx +2 -2
- package/src/demos/examples/Tabs/NestedUnindentedTabs.tsx +2 -2
- package/src/demos/examples/Tabs/TabsAndTable.tsx +3 -3
- package/src/demos/examples/Toolbar/ConsoleLogViewerToolbar.tsx +2 -3
- package/src/demos/examples/Wizard/InPageWithDrawer.tsx +1 -4
- package/src/demos/examples/Wizard/InPageWithDrawerInformationalStep.tsx +1 -4
- package/src/demos/sampleData.tsx +225 -227
- package/src/demos/sampleDataRTL.tsx +133 -0
- package/src/helpers/KeyboardHandler.tsx +2 -2
- package/src/helpers/Popper/Popper.tsx +1 -0
- package/src/helpers/util.ts +45 -0
- package/src/demos/RTL/examples/PaginatedTable.jsx +0 -504
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
ToolbarContent,
|
|
16
16
|
ToolbarItem
|
|
17
17
|
} from '@patternfly/react-core';
|
|
18
|
-
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
19
18
|
|
|
20
19
|
export const PageMultipleSidebarBody: React.FunctionComponent = () => {
|
|
21
20
|
const [isSidebarOpen, setIsSidebarOpen] = useState(true);
|
|
@@ -37,14 +36,12 @@ export const PageMultipleSidebarBody: React.FunctionComponent = () => {
|
|
|
37
36
|
<MastheadMain>
|
|
38
37
|
<MastheadToggle>
|
|
39
38
|
<PageToggleButton
|
|
40
|
-
variant="plain"
|
|
41
39
|
aria-label="Global navigation"
|
|
42
40
|
isSidebarOpen={isSidebarOpen}
|
|
43
41
|
onSidebarToggle={onSidebarToggle}
|
|
44
42
|
id="multiple-sidebar-body-nav-toggle"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</PageToggleButton>
|
|
43
|
+
isHamburgerButton
|
|
44
|
+
/>
|
|
48
45
|
</MastheadToggle>
|
|
49
46
|
<MastheadBrand>
|
|
50
47
|
<MastheadLogo href="https://patternfly.org" target="_blank">
|
|
@@ -71,9 +68,15 @@ export const PageMultipleSidebarBody: React.FunctionComponent = () => {
|
|
|
71
68
|
|
|
72
69
|
return (
|
|
73
70
|
<Page masthead={masthead} sidebar={sidebar}>
|
|
74
|
-
<PageSection
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
<PageSection aria-labelledby="section-1">
|
|
72
|
+
<h2 id="section-1">Multiple sidebar body example section 1</h2>
|
|
73
|
+
</PageSection>
|
|
74
|
+
<PageSection aria-labelledby="section-2">
|
|
75
|
+
<h2 id="section-2">Multiple sidebar body example section 2</h2>
|
|
76
|
+
</PageSection>
|
|
77
|
+
<PageSection aria-labelledby="section-3">
|
|
78
|
+
<h2 id="section-3">Multiple sidebar body example section 3</h2>
|
|
79
|
+
</PageSection>
|
|
77
80
|
</Page>
|
|
78
81
|
);
|
|
79
82
|
};
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
ToolbarContent,
|
|
15
15
|
ToolbarItem
|
|
16
16
|
} from '@patternfly/react-core';
|
|
17
|
-
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
18
17
|
|
|
19
18
|
export const PageUncontrolledNav: React.FunctionComponent = () => {
|
|
20
19
|
const headerToolbar = (
|
|
@@ -29,9 +28,7 @@ export const PageUncontrolledNav: React.FunctionComponent = () => {
|
|
|
29
28
|
<Masthead>
|
|
30
29
|
<MastheadMain>
|
|
31
30
|
<MastheadToggle>
|
|
32
|
-
<PageToggleButton
|
|
33
|
-
<BarsIcon />
|
|
34
|
-
</PageToggleButton>
|
|
31
|
+
<PageToggleButton isHamburgerButton aria-label="Global navigation" id="uncontrolled-nav-toggle" />
|
|
35
32
|
</MastheadToggle>
|
|
36
33
|
<MastheadBrand>
|
|
37
34
|
<MastheadLogo href="https://patternfly.org" target="_blank">
|
|
@@ -51,9 +48,15 @@ export const PageUncontrolledNav: React.FunctionComponent = () => {
|
|
|
51
48
|
|
|
52
49
|
return (
|
|
53
50
|
<Page isManagedSidebar masthead={masthead} sidebar={sidebar}>
|
|
54
|
-
<PageSection
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
<PageSection aria-labelledby="section-1">
|
|
52
|
+
<h2 id="section-1">Uncontrolled nav example section 1</h2>
|
|
53
|
+
</PageSection>
|
|
54
|
+
<PageSection aria-labelledby="section-2">
|
|
55
|
+
<h2 id="section-2">Uncontrolled nav example section 2</h2>
|
|
56
|
+
</PageSection>
|
|
57
|
+
<PageSection aria-labelledby="section-3">
|
|
58
|
+
<h2 id="section-3">Uncontrolled nav example section 3</h2>
|
|
59
|
+
</PageSection>
|
|
57
60
|
</Page>
|
|
58
61
|
);
|
|
59
62
|
};
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
ToolbarContent,
|
|
16
16
|
ToolbarItem
|
|
17
17
|
} from '@patternfly/react-core';
|
|
18
|
-
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
19
18
|
|
|
20
19
|
export const PageVerticalNav: React.FunctionComponent = () => {
|
|
21
20
|
const [isSidebarOpen, setIsSidebarOpen] = useState(true);
|
|
@@ -37,14 +36,12 @@ export const PageVerticalNav: React.FunctionComponent = () => {
|
|
|
37
36
|
<MastheadMain>
|
|
38
37
|
<MastheadToggle>
|
|
39
38
|
<PageToggleButton
|
|
40
|
-
|
|
39
|
+
isHamburgerButton
|
|
41
40
|
aria-label="Global navigation"
|
|
42
41
|
isSidebarOpen={isSidebarOpen}
|
|
43
42
|
onSidebarToggle={onSidebarToggle}
|
|
44
43
|
id="vertical-nav-toggle"
|
|
45
|
-
|
|
46
|
-
<BarsIcon />
|
|
47
|
-
</PageToggleButton>
|
|
44
|
+
/>
|
|
48
45
|
</MastheadToggle>
|
|
49
46
|
<MastheadBrand>
|
|
50
47
|
<MastheadLogo href="https://patternfly.org" target="_blank">
|
|
@@ -64,9 +61,15 @@ export const PageVerticalNav: React.FunctionComponent = () => {
|
|
|
64
61
|
|
|
65
62
|
return (
|
|
66
63
|
<Page masthead={masthead} sidebar={sidebar}>
|
|
67
|
-
<PageSection
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
<PageSection aria-labelledby="section-1">
|
|
65
|
+
<h2 id="section-1">Vertical nav example section 1</h2>
|
|
66
|
+
</PageSection>
|
|
67
|
+
<PageSection variant="secondary" aria-labelledby="section-2">
|
|
68
|
+
<h2 id="section-2">Vertical nav example section 2 with secondary variant styling</h2>
|
|
69
|
+
</PageSection>
|
|
70
|
+
<PageSection aria-labelledby="section-3">
|
|
71
|
+
<h2 id="section-3">Vertical nav example section 3</h2>
|
|
72
|
+
</PageSection>
|
|
70
73
|
</Page>
|
|
71
74
|
);
|
|
72
75
|
};
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
ToolbarContent,
|
|
16
16
|
ToolbarItem
|
|
17
17
|
} from '@patternfly/react-core';
|
|
18
|
-
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
19
18
|
|
|
20
19
|
export const PageWithOrWithoutFill: React.FunctionComponent = () => {
|
|
21
20
|
const [isSidebarOpen, setIsSidebarOpen] = useState(true);
|
|
@@ -37,14 +36,12 @@ export const PageWithOrWithoutFill: React.FunctionComponent = () => {
|
|
|
37
36
|
<MastheadMain>
|
|
38
37
|
<MastheadToggle>
|
|
39
38
|
<PageToggleButton
|
|
40
|
-
|
|
39
|
+
isHamburgerButton
|
|
41
40
|
aria-label="Global navigation"
|
|
42
41
|
isSidebarOpen={isSidebarOpen}
|
|
43
42
|
onSidebarToggle={onSidebarToggle}
|
|
44
43
|
id="fill-nav-toggle"
|
|
45
|
-
|
|
46
|
-
<BarsIcon />
|
|
47
|
-
</PageToggleButton>
|
|
44
|
+
/>
|
|
48
45
|
</MastheadToggle>
|
|
49
46
|
<MastheadBrand>
|
|
50
47
|
<MastheadLogo href="https://patternfly.org" target="_blank">
|
|
@@ -64,11 +61,15 @@ export const PageWithOrWithoutFill: React.FunctionComponent = () => {
|
|
|
64
61
|
|
|
65
62
|
return (
|
|
66
63
|
<Page isContentFilled masthead={masthead} sidebar={sidebar}>
|
|
67
|
-
<PageSection
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
<PageSection aria-labelledby="section-1">
|
|
65
|
+
<h2 id="section-1">Section without fill</h2>
|
|
66
|
+
</PageSection>
|
|
67
|
+
<PageSection isFilled={true} variant="secondary" aria-labelledby="section-2">
|
|
68
|
+
<h2 id="section-2">Section with fill</h2>
|
|
69
|
+
</PageSection>
|
|
70
|
+
<PageSection aria-labelledby="section-3">
|
|
71
|
+
<h2 id="section-3">Another section without fill</h2>
|
|
70
72
|
</PageSection>
|
|
71
|
-
<PageSection>A default page section</PageSection>
|
|
72
73
|
</Page>
|
|
73
74
|
);
|
|
74
75
|
};
|
|
@@ -118,6 +118,8 @@ export interface SearchInputProps extends Omit<React.HTMLProps<HTMLDivElement>,
|
|
|
118
118
|
/** The number of search results returned. Either a total number of results,
|
|
119
119
|
* or a string representing the current result over the total number of results. i.e. "1 / 5". */
|
|
120
120
|
resultsCount?: number | string;
|
|
121
|
+
/** Screenreader text that will appear after resultsCount to give context for what that value represents to assistive technologies. */
|
|
122
|
+
resultsCountContext?: string;
|
|
121
123
|
/** Label for the button which calls the onSearch event handler. */
|
|
122
124
|
submitSearchButtonLabel?: string;
|
|
123
125
|
/** Value of the search input. */
|
|
@@ -144,6 +146,7 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
144
146
|
onToggleAdvancedSearch,
|
|
145
147
|
isAdvancedSearchOpen = false,
|
|
146
148
|
resultsCount,
|
|
149
|
+
resultsCountContext = ' results',
|
|
147
150
|
onNextClick,
|
|
148
151
|
onPreviousClick,
|
|
149
152
|
innerRef,
|
|
@@ -309,7 +312,11 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
309
312
|
/>
|
|
310
313
|
{(renderUtilities || areUtilitiesDisplayed) && (
|
|
311
314
|
<TextInputGroupUtilities>
|
|
312
|
-
{resultsCount &&
|
|
315
|
+
{resultsCount && (
|
|
316
|
+
<Badge isRead screenReaderText={resultsCountContext}>
|
|
317
|
+
{resultsCount}
|
|
318
|
+
</Badge>
|
|
319
|
+
)}
|
|
313
320
|
{!!onNextClick && !!onPreviousClick && (
|
|
314
321
|
<div className={textInputGroupStyles.textInputGroupGroup}>
|
|
315
322
|
<Button
|
|
@@ -78,11 +78,6 @@ By default, the menu toggle will display a badge to indicate the number of items
|
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
### Typeahead
|
|
81
|
-
Typeahead is a select variant that replaces the typical button toggle for opening the select menu with a text input and button toggle combo. As a user enters characters into the text input, the menu options will be filtered to match.
|
|
82
|
-
|
|
83
|
-
Typeahead is a select variant that replaces the typical button toggle for opening the select menu with a text input and button toggle combo. As a user enters characters into the text input, the menu options will be filtered to match.
|
|
84
|
-
|
|
85
|
-
To make a typeahead, pass `variant=typeahead` into the `<MenuToggle>` component and link an `onClick` function to the `<TextInputGroupMain>` component.
|
|
86
81
|
|
|
87
82
|
Typeahead is a select variant that replaces the typical button toggle for opening the select menu with a text input and button toggle combo. As a user enters characters into the text input, the menu options will be filtered to match.
|
|
88
83
|
|
|
@@ -93,13 +88,6 @@ To make a typeahead, pass `variant=typeahead` into the `<MenuToggle>` component
|
|
|
93
88
|
```
|
|
94
89
|
|
|
95
90
|
### Typeahead with create option
|
|
96
|
-
If a user enters a value into a typeahead select menu that does not exist, you can allow them to create an option of that value.
|
|
97
|
-
|
|
98
|
-
If a user enters a value into a typeahead select menu that does not exist, you can allow them to create an option of that value.
|
|
99
|
-
|
|
100
|
-
To enable the creation ability, pass a predetermined `value` into a `<SelectOption>` component. You can use the `placeholder` property to change the default text shown in the text input.
|
|
101
|
-
|
|
102
|
-
The following example outlines the code implementation required to create a working typeahead menu that allows for creation.
|
|
103
91
|
|
|
104
92
|
If a user enters a value into a typeahead select menu that does not exist, you can allow them to create an option of that value.
|
|
105
93
|
|
|
@@ -111,14 +99,9 @@ The following example outlines the code implementation required to create a work
|
|
|
111
99
|
|
|
112
100
|
```
|
|
113
101
|
|
|
114
|
-
### Multiple typeahead with
|
|
115
|
-
A multiple typeahead can be used to allow users to select multiple options from a list. Additionally, you can render a chip group to be placed in the select toggle.
|
|
116
|
-
|
|
117
|
-
A multiple typeahead can be used to allow users to select multiple options from a list. Additionally, you can render a chip group to be placed in the select toggle.
|
|
118
|
-
|
|
119
|
-
When more items than the allowed limit are selected, overflowing items will be hidden under a "more" button. The following example hides items after more than 3 are selected. To show hidden items, select the “more” button. Select "show less" to hide extra items again.
|
|
102
|
+
### Multiple typeahead with labels
|
|
120
103
|
|
|
121
|
-
A multiple typeahead can be used to allow users to select multiple options from a list. Additionally, you can render a
|
|
104
|
+
A multiple typeahead can be used to allow users to select multiple options from a list. Additionally, you can render a label group to be placed in the select toggle.
|
|
122
105
|
|
|
123
106
|
When more items than the allowed limit are selected, overflowing items will be hidden under a "more" button. The following example hides items after more than 3 are selected. To show hidden items, select the “more” button. Select "show less" to hide extra items again.
|
|
124
107
|
|
|
@@ -127,20 +110,14 @@ When more items than the allowed limit are selected, overflowing items will be h
|
|
|
127
110
|
```
|
|
128
111
|
|
|
129
112
|
### Multiple typeahead with create option
|
|
130
|
-
If the text that is entered into a typeahead doesn't match a menu item, users can choose to create a new option that matches the text input. You can also combine this create functionality with a chip group to display created items as chips."
|
|
131
113
|
|
|
132
|
-
If the text that is entered into a typeahead doesn't match a menu item, users can choose to create a new option that matches the text input. You can also combine this create functionality with a
|
|
133
|
-
|
|
134
|
-
If the text that is entered into a typeahead doesn't match a menu item, users can choose to create a new option that matches the text input. You can also combine this create functionality with a chip group to display created items as chips."
|
|
114
|
+
If the text that is entered into a typeahead doesn't match a menu item, users can choose to create a new option that matches the text input. You can also combine this create functionality with a label group to display created items as labels.
|
|
135
115
|
|
|
136
116
|
```ts file="./SelectMultiTypeaheadCreatable.tsx"
|
|
137
117
|
|
|
138
118
|
```
|
|
139
119
|
|
|
140
120
|
### Multiple typeahead with checkboxes
|
|
141
|
-
By default, a multiple typeahead select allows you to select multiple menu items, placing a checkmark beside selected items. Like basic checkbox select menus, you can add checkboxes to your menu items. This approach may be more accurate and comprehensive for more complex menu scenarios like filtering.
|
|
142
|
-
|
|
143
|
-
By default, a multiple typeahead select allows you to select multiple menu items, placing a checkmark beside selected items. Like basic checkbox select menus, you can add checkboxes to your menu items. This approach may be more accurate and comprehensive for more complex menu scenarios like filtering.
|
|
144
121
|
|
|
145
122
|
By default, a multiple typeahead select allows you to select multiple menu items, placing a checkmark beside selected items. Like basic checkbox select menus, you can add checkboxes to your menu items. This approach may be more accurate and comprehensive for more complex menu scenarios like filtering.
|
|
146
123
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import { Skeleton } from '@patternfly/react-core';
|
|
3
|
-
/* eslint-disable camelcase */
|
|
4
3
|
import t_global_font_size_4xl from '@patternfly/react-tokens/dist/esm/t_global_font_size_4xl';
|
|
5
4
|
import t_global_font_size_3xl from '@patternfly/react-tokens/dist/esm/t_global_font_size_3xl';
|
|
6
5
|
import t_global_font_size_2xl from '@patternfly/react-tokens/dist/esm/t_global_font_size_2xl';
|
|
@@ -8,6 +8,31 @@ import { TabsContext } from './TabsContext';
|
|
|
8
8
|
import { TabProps } from './Tab';
|
|
9
9
|
import { TabTitleText } from './TabTitleText';
|
|
10
10
|
|
|
11
|
+
export interface HorizontalOverflowPopperProps {
|
|
12
|
+
/** Vertical direction of the popper. If enableFlip is set to true, this will set the initial direction before the popper flips. */
|
|
13
|
+
direction?: 'up' | 'down';
|
|
14
|
+
/** Horizontal position of the popper */
|
|
15
|
+
position?: 'right' | 'left' | 'center' | 'start' | 'end';
|
|
16
|
+
/** Custom width of the popper. If the value is "trigger", it will set the width to the select toggle's width */
|
|
17
|
+
width?: string | 'trigger';
|
|
18
|
+
/** Minimum width of the popper. If the value is "trigger", it will set the min width to the select toggle's width */
|
|
19
|
+
minWidth?: string | 'trigger';
|
|
20
|
+
/** Maximum width of the popper. If the value is "trigger", it will set the max width to the select toggle's width */
|
|
21
|
+
maxWidth?: string | 'trigger';
|
|
22
|
+
/** Enable to flip the popper when it reaches the boundary */
|
|
23
|
+
enableFlip?: boolean;
|
|
24
|
+
/** The container to append the select to. Defaults to document.body.
|
|
25
|
+
* If your select is being cut off you can append it to an element higher up the DOM tree.
|
|
26
|
+
* Some examples:
|
|
27
|
+
* appendTo="inline"
|
|
28
|
+
* appendTo={() => document.body}
|
|
29
|
+
* appendTo={document.getElementById('target')}
|
|
30
|
+
*/
|
|
31
|
+
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
32
|
+
/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */
|
|
33
|
+
preventOverflow?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
11
36
|
export interface OverflowTabProps extends React.HTMLProps<HTMLLIElement> {
|
|
12
37
|
/** Additional classes added to the overflow tab */
|
|
13
38
|
className?: string;
|
|
@@ -25,6 +50,8 @@ export interface OverflowTabProps extends React.HTMLProps<HTMLLIElement> {
|
|
|
25
50
|
shouldPreventScrollOnItemFocus?: boolean;
|
|
26
51
|
/** Time in ms to wait before firing the toggles' focus event. Defaults to 0 */
|
|
27
52
|
focusTimeoutDelay?: number;
|
|
53
|
+
/** Additional props to spread to the popper menu. */
|
|
54
|
+
popperProps?: HorizontalOverflowPopperProps;
|
|
28
55
|
}
|
|
29
56
|
|
|
30
57
|
export const OverflowTab: React.FunctionComponent<OverflowTabProps> = ({
|
|
@@ -36,6 +63,7 @@ export const OverflowTab: React.FunctionComponent<OverflowTabProps> = ({
|
|
|
36
63
|
zIndex = 9999,
|
|
37
64
|
shouldPreventScrollOnItemFocus = true,
|
|
38
65
|
focusTimeoutDelay = 0,
|
|
66
|
+
popperProps,
|
|
39
67
|
...props
|
|
40
68
|
}: OverflowTabProps) => {
|
|
41
69
|
const menuRef = useRef<HTMLDivElement>(undefined);
|
|
@@ -148,6 +176,7 @@ export const OverflowTab: React.FunctionComponent<OverflowTabProps> = ({
|
|
|
148
176
|
minWidth="revert"
|
|
149
177
|
appendTo={overflowLIRef.current}
|
|
150
178
|
zIndex={zIndex}
|
|
179
|
+
{...popperProps}
|
|
151
180
|
/>
|
|
152
181
|
</Fragment>
|
|
153
182
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useContext, forwardRef } from 'react';
|
|
1
|
+
import { useContext, forwardRef, useEffect } from 'react';
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Tabs/tabs';
|
|
3
3
|
import { OUIAProps } from '../../helpers';
|
|
4
4
|
import { TabButton } from './TabButton';
|
|
@@ -75,7 +75,7 @@ const TabBase: React.FunctionComponent<TabProps> = ({
|
|
|
75
75
|
}),
|
|
76
76
|
{}
|
|
77
77
|
);
|
|
78
|
-
const { mountOnEnter, localActiveKey, unmountOnExit, uniqueId, handleTabClick, handleTabClose } =
|
|
78
|
+
const { mountOnEnter, localActiveKey, unmountOnExit, uniqueId, setAccentStyles, handleTabClick, handleTabClose } =
|
|
79
79
|
useContext(TabsContext);
|
|
80
80
|
let ariaControls = tabContentId ? `${tabContentId}` : `pf-tab-section-${eventKey}-${childId || uniqueId}`;
|
|
81
81
|
if ((mountOnEnter || unmountOnExit) && eventKey !== localActiveKey) {
|
|
@@ -116,6 +116,10 @@ const TabBase: React.FunctionComponent<TabProps> = ({
|
|
|
116
116
|
</TabButton>
|
|
117
117
|
);
|
|
118
118
|
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
setAccentStyles(true);
|
|
121
|
+
}, [title, actions]);
|
|
122
|
+
|
|
119
123
|
return (
|
|
120
124
|
<li
|
|
121
125
|
className={css(
|
|
@@ -5,20 +5,27 @@ import { PickOptional } from '../../helpers/typeUtils';
|
|
|
5
5
|
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
6
6
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
7
7
|
import PlusIcon from '@patternfly/react-icons/dist/esm/icons/plus-icon';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
getUniqueId,
|
|
10
|
+
isElementInView,
|
|
11
|
+
formatBreakpointMods,
|
|
12
|
+
getLanguageDirection,
|
|
13
|
+
getInlineStartProperty
|
|
14
|
+
} from '../../helpers/util';
|
|
9
15
|
import { TabContent } from './TabContent';
|
|
10
16
|
import { TabProps } from './Tab';
|
|
11
17
|
import { TabsContextProvider } from './TabsContext';
|
|
12
|
-
import { OverflowTab } from './OverflowTab';
|
|
18
|
+
import { OverflowTab, HorizontalOverflowPopperProps } from './OverflowTab';
|
|
13
19
|
import { Button } from '../Button';
|
|
14
20
|
import { getOUIAProps, OUIAProps, getDefaultOUIAId, canUseDOM } from '../../helpers';
|
|
15
21
|
import { GenerateId } from '../../helpers/GenerateId/GenerateId';
|
|
22
|
+
import linkAccentLength from '@patternfly/react-tokens/dist/esm/c_tabs_link_accent_length';
|
|
23
|
+
import linkAccentStart from '@patternfly/react-tokens/dist/esm/c_tabs_link_accent_start';
|
|
16
24
|
|
|
17
25
|
export enum TabsComponent {
|
|
18
26
|
div = 'div',
|
|
19
27
|
nav = 'nav'
|
|
20
28
|
}
|
|
21
|
-
|
|
22
29
|
export interface HorizontalOverflowObject {
|
|
23
30
|
/** Flag which shows the count of overflowing tabs when enabled */
|
|
24
31
|
showTabCount?: boolean;
|
|
@@ -26,6 +33,8 @@ export interface HorizontalOverflowObject {
|
|
|
26
33
|
defaultTitleText?: string;
|
|
27
34
|
/** The aria label applied to the button which toggles the tab overflow menu */
|
|
28
35
|
toggleAriaLabel?: string;
|
|
36
|
+
/** Additional props to spread to the popper menu. */
|
|
37
|
+
popperProps?: HorizontalOverflowPopperProps;
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
type TabElement = React.ReactElement<TabProps, React.JSXElementConstructor<TabProps>>;
|
|
@@ -139,6 +148,9 @@ interface TabsState {
|
|
|
139
148
|
uncontrolledIsExpandedLocal: boolean;
|
|
140
149
|
ouiaStateId: string;
|
|
141
150
|
overflowingTabCount: number;
|
|
151
|
+
isInitializingAccent: boolean;
|
|
152
|
+
currentLinkAccentLength: string;
|
|
153
|
+
currentLinkAccentStart: string;
|
|
142
154
|
}
|
|
143
155
|
|
|
144
156
|
class Tabs extends Component<TabsProps, TabsState> {
|
|
@@ -158,7 +170,10 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
158
170
|
uncontrolledActiveKey: this.props.defaultActiveKey,
|
|
159
171
|
uncontrolledIsExpandedLocal: this.props.defaultIsExpanded,
|
|
160
172
|
ouiaStateId: getDefaultOUIAId(Tabs.displayName),
|
|
161
|
-
overflowingTabCount: 0
|
|
173
|
+
overflowingTabCount: 0,
|
|
174
|
+
isInitializingAccent: true,
|
|
175
|
+
currentLinkAccentLength: linkAccentLength.value,
|
|
176
|
+
currentLinkAccentStart: linkAccentStart.value
|
|
162
177
|
};
|
|
163
178
|
|
|
164
179
|
if (this.props.isVertical && this.props.expandable !== undefined) {
|
|
@@ -328,21 +343,49 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
328
343
|
}
|
|
329
344
|
};
|
|
330
345
|
|
|
346
|
+
setAccentStyles = (shouldInitializeStyle?: boolean) => {
|
|
347
|
+
const currentItem = this.tabList.current.querySelector('li.pf-m-current') as HTMLElement;
|
|
348
|
+
if (!currentItem) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
const { isVertical } = this.props;
|
|
353
|
+
const { offsetWidth, offsetHeight, offsetTop } = currentItem;
|
|
354
|
+
const lengthValue = isVertical ? offsetHeight : offsetWidth;
|
|
355
|
+
const startValue = isVertical ? offsetTop : getInlineStartProperty(currentItem, this.tabList.current);
|
|
356
|
+
this.setState({
|
|
357
|
+
currentLinkAccentLength: `${lengthValue}px`,
|
|
358
|
+
currentLinkAccentStart: `${startValue}px`,
|
|
359
|
+
...(shouldInitializeStyle && { isInitializingAccent: true })
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
setTimeout(() => {
|
|
363
|
+
this.setState({ isInitializingAccent: false });
|
|
364
|
+
}, 0);
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
handleResize = () => {
|
|
368
|
+
this.handleScrollButtons();
|
|
369
|
+
this.setAccentStyles();
|
|
370
|
+
};
|
|
371
|
+
|
|
331
372
|
componentDidMount() {
|
|
332
373
|
if (!this.props.isVertical) {
|
|
333
374
|
if (canUseDOM) {
|
|
334
|
-
window.addEventListener('resize', this.
|
|
375
|
+
window.addEventListener('resize', this.handleResize, false);
|
|
335
376
|
}
|
|
336
377
|
this.direction = getLanguageDirection(this.tabList.current);
|
|
337
378
|
// call the handle resize function to check if scroll buttons should be shown
|
|
338
379
|
this.handleScrollButtons();
|
|
339
380
|
}
|
|
381
|
+
|
|
382
|
+
this.setAccentStyles(true);
|
|
340
383
|
}
|
|
341
384
|
|
|
342
385
|
componentWillUnmount() {
|
|
343
386
|
if (!this.props.isVertical) {
|
|
344
387
|
if (canUseDOM) {
|
|
345
|
-
window.removeEventListener('resize', this.
|
|
388
|
+
window.removeEventListener('resize', this.handleResize, false);
|
|
346
389
|
}
|
|
347
390
|
}
|
|
348
391
|
clearTimeout(this.scrollTimeout);
|
|
@@ -350,8 +393,18 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
350
393
|
}
|
|
351
394
|
|
|
352
395
|
componentDidUpdate(prevProps: TabsProps, prevState: TabsState) {
|
|
353
|
-
|
|
354
|
-
const {
|
|
396
|
+
this.direction = getLanguageDirection(this.tabList.current);
|
|
397
|
+
const { activeKey, mountOnEnter, isOverflowHorizontal, children, defaultActiveKey } = this.props;
|
|
398
|
+
const { shownKeys, overflowingTabCount, enableScrollButtons, uncontrolledActiveKey } = this.state;
|
|
399
|
+
const isOnCloseUpdate = !!prevProps.onClose !== !!this.props.onClose;
|
|
400
|
+
if (
|
|
401
|
+
(defaultActiveKey !== undefined && prevState.uncontrolledActiveKey !== uncontrolledActiveKey) ||
|
|
402
|
+
(defaultActiveKey === undefined && prevProps.activeKey !== activeKey) ||
|
|
403
|
+
isOnCloseUpdate
|
|
404
|
+
) {
|
|
405
|
+
this.setAccentStyles(isOnCloseUpdate);
|
|
406
|
+
}
|
|
407
|
+
|
|
355
408
|
if (prevProps.activeKey !== activeKey && mountOnEnter && shownKeys.indexOf(activeKey) < 0) {
|
|
356
409
|
this.setState({
|
|
357
410
|
shownKeys: shownKeys.concat(activeKey)
|
|
@@ -364,6 +417,7 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
364
417
|
Children.toArray(prevProps.children).length !== Children.toArray(children).length
|
|
365
418
|
) {
|
|
366
419
|
this.handleScrollButtons();
|
|
420
|
+
this.setAccentStyles(true);
|
|
367
421
|
}
|
|
368
422
|
|
|
369
423
|
const currentOverflowingTabCount = this.countOverflowingElements(this.tabList.current);
|
|
@@ -380,8 +434,6 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
380
434
|
} else if (prevState.enableScrollButtons && !enableScrollButtons) {
|
|
381
435
|
this.setState({ showScrollButtons: false });
|
|
382
436
|
}
|
|
383
|
-
|
|
384
|
-
this.direction = getLanguageDirection(this.tabList.current);
|
|
385
437
|
}
|
|
386
438
|
|
|
387
439
|
static getDerivedStateFromProps(nextProps: TabsProps, prevState: TabsState) {
|
|
@@ -450,7 +502,10 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
450
502
|
shownKeys,
|
|
451
503
|
uncontrolledActiveKey,
|
|
452
504
|
uncontrolledIsExpandedLocal,
|
|
453
|
-
overflowingTabCount
|
|
505
|
+
overflowingTabCount,
|
|
506
|
+
isInitializingAccent,
|
|
507
|
+
currentLinkAccentLength,
|
|
508
|
+
currentLinkAccentStart
|
|
454
509
|
} = this.state;
|
|
455
510
|
const filteredChildren = Children.toArray(children)
|
|
456
511
|
.filter((child): child is TabElement => isValidElement(child))
|
|
@@ -485,6 +540,7 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
485
540
|
unmountOnExit,
|
|
486
541
|
localActiveKey,
|
|
487
542
|
uniqueId,
|
|
543
|
+
setAccentStyles: this.setAccentStyles,
|
|
488
544
|
handleTabClick: (...args) => this.handleTabClick(...args),
|
|
489
545
|
handleTabClose: onClose
|
|
490
546
|
}}
|
|
@@ -493,6 +549,7 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
493
549
|
aria-label={ariaLabel}
|
|
494
550
|
className={css(
|
|
495
551
|
styles.tabs,
|
|
552
|
+
styles.modifiers.animateCurrent,
|
|
496
553
|
isFilled && styles.modifiers.fill,
|
|
497
554
|
isSubtab && styles.modifiers.subtab,
|
|
498
555
|
isVertical && styles.modifiers.vertical,
|
|
@@ -505,10 +562,12 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
505
562
|
formatBreakpointMods(inset, styles),
|
|
506
563
|
variantStyle[variant],
|
|
507
564
|
hasOverflowTab && styles.modifiers.overflow,
|
|
565
|
+
isInitializingAccent && styles.modifiers.initializingAccent,
|
|
508
566
|
className
|
|
509
567
|
)}
|
|
510
568
|
{...getOUIAProps(Tabs.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)}
|
|
511
569
|
id={id && id}
|
|
570
|
+
style={{ [linkAccentLength.name]: currentLinkAccentLength, [linkAccentStart.name]: currentLinkAccentStart }}
|
|
512
571
|
{...props}
|
|
513
572
|
>
|
|
514
573
|
{expandable && isVertical && (
|
|
@@ -6,6 +6,7 @@ export interface TabsContextProps {
|
|
|
6
6
|
unmountOnExit: boolean;
|
|
7
7
|
localActiveKey: string | number;
|
|
8
8
|
uniqueId: string;
|
|
9
|
+
setAccentStyles: (shouldInitializeStyles?: boolean) => void;
|
|
9
10
|
handleTabClick: (
|
|
10
11
|
event: React.MouseEvent<HTMLElement, MouseEvent>,
|
|
11
12
|
eventKey: number | string,
|
|
@@ -24,6 +25,7 @@ export const TabsContext = createContext<TabsContextProps>({
|
|
|
24
25
|
unmountOnExit: false,
|
|
25
26
|
localActiveKey: '',
|
|
26
27
|
uniqueId: '',
|
|
28
|
+
setAccentStyles: () => null,
|
|
27
29
|
handleTabClick: () => null,
|
|
28
30
|
handleTabClose: undefined
|
|
29
31
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react';
|
|
1
|
+
import { render, screen, act } from '@testing-library/react';
|
|
2
2
|
import { Tabs } from '../Tabs';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/Tabs/tabs';
|
|
3
4
|
import { Tab } from '../Tab';
|
|
4
5
|
import { TabTitleText } from '../TabTitleText';
|
|
5
6
|
import { TabTitleIcon } from '../TabTitleIcon';
|
|
@@ -8,6 +9,47 @@ import { TabContentBody } from '../TabContentBody';
|
|
|
8
9
|
|
|
9
10
|
jest.mock('../../../helpers/GenerateId/GenerateId');
|
|
10
11
|
|
|
12
|
+
test(`Renders with classes ${styles.tabs} and ${styles.modifiers.animateCurrent} by default`, () => {
|
|
13
|
+
render(
|
|
14
|
+
<Tabs role="region">
|
|
15
|
+
<Tab title="Test title" eventKey={0}>
|
|
16
|
+
Tab Content
|
|
17
|
+
</Tab>
|
|
18
|
+
</Tabs>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
expect(screen.getByRole('region')).toHaveClass(`${styles.tabs} ${styles.modifiers.animateCurrent}`);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test(`Renders with class ${styles.modifiers.initializingAccent} when component initially mounts`, () => {
|
|
25
|
+
render(
|
|
26
|
+
<Tabs role="region">
|
|
27
|
+
<Tab title="Test title" eventKey={0}>
|
|
28
|
+
Tab Content
|
|
29
|
+
</Tab>
|
|
30
|
+
</Tabs>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
expect(screen.getByRole('region')).toHaveClass(styles.modifiers.initializingAccent);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test(`Does not render with class ${styles.modifiers.initializingAccent} when component is finished mounting`, () => {
|
|
37
|
+
jest.useFakeTimers();
|
|
38
|
+
render(
|
|
39
|
+
<Tabs role="region">
|
|
40
|
+
<Tab title="Test title" eventKey={0}>
|
|
41
|
+
Tab Content
|
|
42
|
+
</Tab>
|
|
43
|
+
</Tabs>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
act(() => {
|
|
47
|
+
jest.advanceTimersByTime(500);
|
|
48
|
+
});
|
|
49
|
+
expect(screen.getByRole('region')).not.toHaveClass(styles.modifiers.initializingAccent);
|
|
50
|
+
jest.useRealTimers();
|
|
51
|
+
});
|
|
52
|
+
|
|
11
53
|
test('should render simple tabs', () => {
|
|
12
54
|
const { asFragment } = render(
|
|
13
55
|
<Tabs id="simpleTabs">
|