@patternfly/react-core 5.1.1-prerelease.8 → 6.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -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/BackToTop/BackToTop.js +1 -1
- package/dist/esm/components/BackToTop/BackToTop.js.map +1 -1
- package/dist/esm/components/Button/Button.d.ts +2 -2
- package/dist/esm/components/Button/Button.d.ts.map +1 -1
- package/dist/esm/components/Button/Button.js +3 -3
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js +5 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
- package/dist/esm/components/DragDrop/Draggable.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/Draggable.js +1 -0
- package/dist/esm/components/DragDrop/Draggable.js.map +1 -1
- package/dist/esm/components/Drawer/Drawer.d.ts +3 -3
- package/dist/esm/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/esm/components/Drawer/Drawer.js +3 -3
- package/dist/esm/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js +77 -26
- package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.d.ts +3 -1
- 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/Icon/Icon.d.ts +4 -0
- package/dist/esm/components/Icon/Icon.d.ts.map +1 -1
- package/dist/esm/components/Icon/Icon.js +2 -2
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Label/Label.d.ts +4 -2
- package/dist/esm/components/Label/Label.d.ts.map +1 -1
- package/dist/esm/components/Label/Label.js +19 -4
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/Menu/MenuContainer.d.ts +1 -1
- package/dist/esm/components/Menu/MenuContainer.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalContent.js +3 -1
- package/dist/esm/components/Modal/ModalContent.js.map +1 -1
- package/dist/esm/components/Nav/NavItem.d.ts +1 -1
- package/dist/esm/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavList.d.ts +10 -4
- package/dist/esm/components/Nav/NavList.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavList.js +29 -8
- package/dist/esm/components/Nav/NavList.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +4 -2
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +9 -1
- 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 +8 -4
- package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
- package/dist/esm/components/Slider/Slider.js +62 -16
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/components/Slider/SliderStep.d.ts.map +1 -1
- package/dist/esm/components/Slider/SliderStep.js +2 -1
- package/dist/esm/components/Slider/SliderStep.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.d.ts +11 -6
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +35 -16
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/TextInput/TextInput.d.ts +3 -1
- package/dist/esm/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/esm/components/TextInput/TextInput.js +8 -7
- package/dist/esm/components/TextInput/TextInput.js.map +1 -1
- package/dist/esm/components/Timestamp/Timestamp.d.ts +4 -0
- package/dist/esm/components/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/esm/components/Timestamp/Timestamp.js +7 -4
- package/dist/esm/components/Timestamp/Timestamp.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 +27 -5
- package/dist/esm/helpers/Popper/Popper.js.map +1 -1
- package/dist/js/components/BackToTop/BackToTop.js +1 -1
- package/dist/js/components/BackToTop/BackToTop.js.map +1 -1
- package/dist/js/components/Button/Button.d.ts +2 -2
- package/dist/js/components/Button/Button.d.ts.map +1 -1
- package/dist/js/components/Button/Button.js +3 -3
- package/dist/js/components/Button/Button.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.js +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js +5 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
- package/dist/js/components/DragDrop/Draggable.d.ts.map +1 -1
- package/dist/js/components/DragDrop/Draggable.js +1 -0
- package/dist/js/components/DragDrop/Draggable.js.map +1 -1
- package/dist/js/components/Drawer/Drawer.d.ts +3 -3
- package/dist/js/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/js/components/Drawer/Drawer.js +3 -3
- package/dist/js/components/Drawer/Drawer.js.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js +77 -26
- package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +3 -1
- 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/Icon/Icon.d.ts +4 -0
- package/dist/js/components/Icon/Icon.d.ts.map +1 -1
- package/dist/js/components/Icon/Icon.js +2 -2
- package/dist/js/components/Icon/Icon.js.map +1 -1
- package/dist/js/components/Label/Label.d.ts +4 -2
- package/dist/js/components/Label/Label.d.ts.map +1 -1
- package/dist/js/components/Label/Label.js +19 -4
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/js/components/Menu/MenuContainer.d.ts +1 -1
- package/dist/js/components/Menu/MenuContainer.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalContent.js +3 -1
- package/dist/js/components/Modal/ModalContent.js.map +1 -1
- package/dist/js/components/Nav/NavItem.d.ts +1 -1
- package/dist/js/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/js/components/Nav/NavList.d.ts +10 -4
- package/dist/js/components/Nav/NavList.d.ts.map +1 -1
- package/dist/js/components/Nav/NavList.js +29 -8
- package/dist/js/components/Nav/NavList.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js +4 -2
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +9 -1
- 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 +8 -4
- package/dist/js/components/Slider/Slider.d.ts.map +1 -1
- package/dist/js/components/Slider/Slider.js +62 -16
- package/dist/js/components/Slider/Slider.js.map +1 -1
- package/dist/js/components/Slider/SliderStep.d.ts.map +1 -1
- package/dist/js/components/Slider/SliderStep.js +2 -1
- package/dist/js/components/Slider/SliderStep.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts +11 -6
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +35 -16
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/components/TextInput/TextInput.d.ts +3 -1
- package/dist/js/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/js/components/TextInput/TextInput.js +8 -7
- package/dist/js/components/TextInput/TextInput.js.map +1 -1
- package/dist/js/components/Timestamp/Timestamp.d.ts +4 -0
- package/dist/js/components/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/js/components/Timestamp/Timestamp.js +7 -4
- package/dist/js/components/Timestamp/Timestamp.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 +29 -6
- package/dist/js/helpers/Popper/Popper.js.map +1 -1
- 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 +8 -7
- package/src/components/BackToTop/BackToTop.tsx +1 -1
- package/src/components/BackToTop/__tests__/BackToTop.test.tsx +1 -1
- package/src/components/BackToTop/__tests__/__snapshots__/BackToTop.test.tsx.snap +1 -1
- package/src/components/BackgroundImage/__tests__/BackgroundImage.test.tsx +21 -7
- package/src/components/BackgroundImage/__tests__/__snapshots__/BackgroundImage.test.tsx.snap +11 -0
- package/src/components/Brand/__tests__/Brand.test.tsx +105 -30
- package/src/components/Breadcrumb/examples/BreadcrumbDropdown.tsx +25 -3
- package/src/components/Button/Button.tsx +5 -5
- package/src/components/Button/examples/ButtonVariations.tsx +1 -1
- package/src/components/Checkbox/examples/Checkbox.md +8 -2
- package/src/components/Checkbox/examples/CheckboxControlled.tsx +18 -16
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +1 -0
- package/src/components/ClipboardCopy/ClipboardCopyExpanded.tsx +1 -1
- package/src/components/ClipboardCopy/ClipboardCopyToggle.tsx +5 -2
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyExpanded.test.tsx.snap +3 -1
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap +16 -12
- package/src/components/DragDrop/Draggable.tsx +1 -0
- package/src/components/Drawer/Drawer.tsx +6 -6
- package/src/components/Drawer/DrawerPanelContent.tsx +72 -26
- package/src/components/Drawer/examples/Drawer.md +12 -12
- package/src/components/Drawer/examples/{DrawerInlinePanelRight.tsx → DrawerInlinePanelEnd.tsx} +1 -1
- package/src/components/Drawer/examples/{DrawerInlinePanelLeft.tsx → DrawerInlinePanelStart.tsx} +2 -2
- package/src/components/Drawer/examples/{DrawerPanelLeft.tsx → DrawerPanelEnd.tsx} +2 -2
- package/src/components/Drawer/examples/{DrawerPanelRight.tsx → DrawerPanelStart.tsx} +2 -2
- package/src/components/Drawer/examples/{DrawerResizableOnRight.tsx → DrawerResizableAtEnd.tsx} +3 -3
- package/src/components/Drawer/examples/{DrawerResizableOnLeft.tsx → DrawerResizableAtStart.tsx} +2 -2
- package/src/components/Dropdown/Dropdown.tsx +3 -1
- package/src/components/Icon/Icon.tsx +15 -1
- package/src/components/Icon/__tests__/Icon.test.tsx +16 -0
- package/src/components/Label/Label.tsx +29 -3
- package/src/components/Label/__tests__/Label.test.tsx +35 -0
- package/src/components/Label/__tests__/__snapshots__/Label.test.tsx.snap +1 -0
- package/src/components/Label/examples/LabelFilled.tsx +220 -168
- package/src/components/Label/examples/LabelOutline.tsx +280 -226
- package/src/components/Menu/MenuContainer.tsx +1 -1
- package/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx +32 -15
- package/src/components/Modal/ModalContent.tsx +4 -6
- package/src/components/Nav/NavItem.tsx +1 -1
- package/src/components/Nav/NavList.tsx +44 -12
- package/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap +10 -10
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +6 -6
- package/src/components/SearchInput/SearchInput.tsx +5 -2
- package/src/components/SearchInput/__tests__/__snapshots__/SearchInput.test.tsx.snap +105 -65
- package/src/components/SearchInput/examples/SearchInputAdvanced.tsx +1 -1
- package/src/components/Select/Select.tsx +9 -1
- package/src/components/Slider/Slider.tsx +69 -20
- package/src/components/Slider/SliderStep.tsx +2 -1
- package/src/components/Slider/_tests_/Slider.test.tsx +3 -3
- package/src/components/Slider/examples/SliderActions.tsx +3 -3
- package/src/components/Tabs/Tabs.tsx +50 -26
- package/src/components/Tabs/examples/Tabs.md +1 -3
- package/src/components/TextInput/TextInput.tsx +11 -7
- package/src/components/TextInput/__tests__/TextInput.test.tsx +16 -1
- package/src/components/TextInput/__tests__/__snapshots__/TextInput.test.tsx.snap +2 -1
- package/src/components/TextInput/examples/TextInput.md +2 -2
- package/src/components/TextInput/examples/{TextInputLeftTruncated.tsx → TextInputStartTruncated.tsx} +3 -3
- package/src/components/Timestamp/Timestamp.tsx +12 -3
- package/src/components/Timestamp/__tests__/Timestamp.test.tsx +6 -0
- package/src/components/Timestamp/examples/Timestamp.md +8 -0
- package/src/components/Timestamp/examples/TimestampDefault.tsx +7 -1
- package/src/components/Timestamp/examples/TimestampDefaultTooltip.tsx +1 -1
- package/src/components/Toolbar/examples/Toolbar.md +0 -6
- package/src/demos/Card/Card.md +3 -664
- package/src/demos/Card/examples/CardView.tsx +575 -0
- package/src/demos/CardDemos.md +4 -4
- package/src/demos/CustomMenus/examples/ApplicationLauncherDemo.tsx +1 -1
- package/src/demos/DataListDemo.md +7 -4
- package/src/demos/PrimaryDetail.md +3 -4
- package/src/deprecated/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap +42 -26
- package/src/helpers/Popper/Popper.tsx +43 -6
- package/src/components/Brand/__tests__/__snapshots__/Brand.test.tsx.snap +0 -11
- package/src/components/Checkbox/examples/checkbox.css +0 -3
- package/src/components/Toolbar/examples/Test.tsx +0 -258
- /package/src/demos/Card/{CardData.jsx → examples/CardData.jsx} +0 -0
|
@@ -46,16 +46,18 @@ export interface SliderProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onCh
|
|
|
46
46
|
inputAriaLabel?: string;
|
|
47
47
|
/** Text label that is place after the input field. */
|
|
48
48
|
inputLabel?: string | number;
|
|
49
|
-
/** Position of the input. */
|
|
50
|
-
inputPosition?: 'aboveThumb' | 'right';
|
|
49
|
+
/** Position of the input. Note "right" is deprecated. Use "end" instead*/
|
|
50
|
+
inputPosition?: 'aboveThumb' | 'right' | 'end';
|
|
51
51
|
/** Value displayed in the input field. */
|
|
52
52
|
inputValue?: number;
|
|
53
53
|
/** Adds disabled styling, and disables the slider and the input component if present. */
|
|
54
54
|
isDisabled?: boolean;
|
|
55
55
|
/** Flag to show value input field. */
|
|
56
56
|
isInputVisible?: boolean;
|
|
57
|
-
/** Actions placed
|
|
57
|
+
/** @deprecated Use startActions instead. Actions placed at the start of the slider. */
|
|
58
58
|
leftActions?: React.ReactNode;
|
|
59
|
+
/** Actions placed at the start of the slider. */
|
|
60
|
+
startActions?: React.ReactNode;
|
|
59
61
|
/** The maximum permitted value. */
|
|
60
62
|
max?: number;
|
|
61
63
|
/** The minimum permitted value. */
|
|
@@ -67,8 +69,10 @@ export interface SliderProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onCh
|
|
|
67
69
|
inputValue?: number,
|
|
68
70
|
setLocalInputValue?: React.Dispatch<React.SetStateAction<number>>
|
|
69
71
|
) => void;
|
|
70
|
-
/** Actions placed to the right of the slider. */
|
|
72
|
+
/** @deprecated Use endActions instead. Actions placed to the right of the slider. */
|
|
71
73
|
rightActions?: React.ReactNode;
|
|
74
|
+
/** Actions placed at the end of the slider. */
|
|
75
|
+
endActions?: React.ReactNode;
|
|
72
76
|
/** Flag to indicate if boundaries should be shown for slider that does not have custom steps. */
|
|
73
77
|
showBoundaries?: boolean;
|
|
74
78
|
/** Flag to indicate if ticks should be shown for slider that does not have custom steps. */
|
|
@@ -95,10 +99,12 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
95
99
|
inputAriaLabel = 'Slider value input',
|
|
96
100
|
thumbAriaLabel = 'Value',
|
|
97
101
|
hasTooltipOverThumb = false,
|
|
98
|
-
inputPosition = '
|
|
102
|
+
inputPosition = 'end',
|
|
99
103
|
onChange,
|
|
100
104
|
leftActions,
|
|
105
|
+
startActions,
|
|
101
106
|
rightActions,
|
|
107
|
+
endActions,
|
|
102
108
|
step = 1,
|
|
103
109
|
min = 0,
|
|
104
110
|
max = 100,
|
|
@@ -114,6 +120,12 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
114
120
|
const [localValue, setValue] = useState(value);
|
|
115
121
|
const [localInputValue, setLocalInputValue] = useState(inputValue);
|
|
116
122
|
|
|
123
|
+
let isRTL: boolean;
|
|
124
|
+
|
|
125
|
+
React.useEffect(() => {
|
|
126
|
+
isRTL = window.getComputedStyle(sliderRailRef.current).getPropertyValue('direction') === 'rtl';
|
|
127
|
+
});
|
|
128
|
+
|
|
117
129
|
React.useEffect(() => {
|
|
118
130
|
setValue(value);
|
|
119
131
|
}, [value]);
|
|
@@ -182,7 +194,11 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
182
194
|
e.stopPropagation();
|
|
183
195
|
e.preventDefault();
|
|
184
196
|
|
|
185
|
-
|
|
197
|
+
if (isRTL) {
|
|
198
|
+
diff = thumbRef.current.getBoundingClientRect().right - e.clientX;
|
|
199
|
+
} else {
|
|
200
|
+
diff = e.clientX - thumbRef.current.getBoundingClientRect().left;
|
|
201
|
+
}
|
|
186
202
|
|
|
187
203
|
document.addEventListener('mousemove', callbackThumbMove);
|
|
188
204
|
document.addEventListener('mouseup', callbackThumbUp);
|
|
@@ -191,7 +207,11 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
191
207
|
const handleTouchStart = (e: React.TouchEvent) => {
|
|
192
208
|
e.stopPropagation();
|
|
193
209
|
|
|
194
|
-
|
|
210
|
+
if (isRTL) {
|
|
211
|
+
diff = thumbRef.current.getBoundingClientRect().right - e.touches[0].clientX;
|
|
212
|
+
} else {
|
|
213
|
+
diff = e.touches[0].clientX - thumbRef.current.getBoundingClientRect().left;
|
|
214
|
+
}
|
|
195
215
|
|
|
196
216
|
document.addEventListener('touchmove', callbackThumbMove, { passive: false });
|
|
197
217
|
document.addEventListener('touchend', callbackThumbUp);
|
|
@@ -216,8 +236,13 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
216
236
|
}
|
|
217
237
|
|
|
218
238
|
const clientPosition = e.touches && e.touches.length ? e.touches[0].clientX : e.clientX;
|
|
239
|
+
let newPosition;
|
|
219
240
|
|
|
220
|
-
|
|
241
|
+
if (isRTL) {
|
|
242
|
+
newPosition = sliderRailRef.current.getBoundingClientRect().right - clientPosition - diff;
|
|
243
|
+
} else {
|
|
244
|
+
newPosition = clientPosition - diff - sliderRailRef.current.getBoundingClientRect().left;
|
|
245
|
+
}
|
|
221
246
|
|
|
222
247
|
const end = sliderRailRef.current.offsetWidth - thumbRef.current.offsetWidth;
|
|
223
248
|
|
|
@@ -288,21 +313,43 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
288
313
|
if (!areCustomStepsContinuous && customSteps) {
|
|
289
314
|
const stepIndex = customSteps.findIndex((stepObj) => stepObj.value === localValue);
|
|
290
315
|
if (key === 'ArrowRight') {
|
|
291
|
-
if (
|
|
292
|
-
{
|
|
293
|
-
newValue = customSteps[stepIndex
|
|
316
|
+
if (isRTL) {
|
|
317
|
+
if (stepIndex - 1 >= 0) {
|
|
318
|
+
newValue = customSteps[stepIndex - 1].value;
|
|
319
|
+
}
|
|
320
|
+
} else {
|
|
321
|
+
if (stepIndex + 1 < customSteps.length) {
|
|
322
|
+
{
|
|
323
|
+
newValue = customSteps[stepIndex + 1].value;
|
|
324
|
+
}
|
|
294
325
|
}
|
|
295
326
|
}
|
|
296
327
|
} else if (key === 'ArrowLeft') {
|
|
297
|
-
if (
|
|
298
|
-
|
|
328
|
+
if (isRTL) {
|
|
329
|
+
if (stepIndex + 1 < customSteps.length) {
|
|
330
|
+
{
|
|
331
|
+
newValue = customSteps[stepIndex + 1].value;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
if (stepIndex - 1 >= 0) {
|
|
336
|
+
newValue = customSteps[stepIndex - 1].value;
|
|
337
|
+
}
|
|
299
338
|
}
|
|
300
339
|
}
|
|
301
340
|
} else {
|
|
302
341
|
if (key === 'ArrowRight') {
|
|
303
|
-
|
|
342
|
+
if (isRTL) {
|
|
343
|
+
newValue = localValue - step >= min ? localValue - step : min;
|
|
344
|
+
} else {
|
|
345
|
+
newValue = localValue + step <= max ? localValue + step : max;
|
|
346
|
+
}
|
|
304
347
|
} else if (key === 'ArrowLeft') {
|
|
305
|
-
|
|
348
|
+
if (isRTL) {
|
|
349
|
+
newValue = localValue + step <= max ? localValue + step : max;
|
|
350
|
+
} else {
|
|
351
|
+
newValue = localValue - step >= min ? localValue - step : min;
|
|
352
|
+
}
|
|
306
353
|
}
|
|
307
354
|
}
|
|
308
355
|
|
|
@@ -347,8 +394,8 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
347
394
|
for (let i = min; i <= max; i = i + step) {
|
|
348
395
|
const stepValue = getStepValue(i, min, max);
|
|
349
396
|
|
|
350
|
-
// If
|
|
351
|
-
// so that we don't
|
|
397
|
+
// If boundaries but not ticks just generate the needed steps
|
|
398
|
+
// so that we don't pollute them DOM with empty divs
|
|
352
399
|
if (!showTicks && showBoundaries && i !== min && i !== max) {
|
|
353
400
|
continue;
|
|
354
401
|
}
|
|
@@ -394,7 +441,7 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
394
441
|
style={{ ...style, ...inputStyle }}
|
|
395
442
|
{...props}
|
|
396
443
|
>
|
|
397
|
-
{leftActions && <div className={css(styles.sliderActions)}>{leftActions}</div>}
|
|
444
|
+
{(leftActions || startActions) && <div className={css(styles.sliderActions)}>{leftActions || startActions}</div>}
|
|
398
445
|
<div className={css(styles.sliderMain)}>
|
|
399
446
|
<div className={css(styles.sliderRail)} ref={sliderRailRef} onClick={!isDisabled ? onSliderRailClick : null}>
|
|
400
447
|
<div className={css(styles.sliderRailTrack)} />
|
|
@@ -434,8 +481,10 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
|
434
481
|
<div className={css(styles.sliderValue, styles.modifiers.floating)}>{displayInput()}</div>
|
|
435
482
|
)}
|
|
436
483
|
</div>
|
|
437
|
-
{isInputVisible && inputPosition === 'right'
|
|
438
|
-
|
|
484
|
+
{isInputVisible && (inputPosition === 'right' || inputPosition === 'end') && (
|
|
485
|
+
<div className={css(styles.sliderValue)}>{displayInput()}</div>
|
|
486
|
+
)}
|
|
487
|
+
{(rightActions || endActions) && <div className={css(styles.sliderActions)}>{rightActions || endActions}</div>}
|
|
439
488
|
</div>
|
|
440
489
|
);
|
|
441
490
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Slider/slider';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import sliderStepLeft from '@patternfly/react-tokens/dist/esm/c_slider__step_Left';
|
|
4
5
|
|
|
5
6
|
export interface SliderStepProps extends Omit<React.HTMLProps<HTMLDivElement>, 'label'> {
|
|
6
7
|
/** Additional classes added to the slider step. */
|
|
@@ -26,7 +27,7 @@ export const SliderStep: React.FunctionComponent<SliderStepProps> = ({
|
|
|
26
27
|
isActive = false,
|
|
27
28
|
...props
|
|
28
29
|
}: SliderStepProps) => {
|
|
29
|
-
const style = {
|
|
30
|
+
const style = { [sliderStepLeft.name]: `${value ? value : sliderStepLeft.value}%` } as React.CSSProperties;
|
|
30
31
|
return (
|
|
31
32
|
<div className={css(styles.sliderStep, isActive && styles.modifiers.active, className)} style={style} {...props}>
|
|
32
33
|
{!isTickHidden && <div className={css(styles.sliderStepTick)} />}
|
|
@@ -46,7 +46,7 @@ describe('slider', () => {
|
|
|
46
46
|
|
|
47
47
|
test('renders slider with input', () => {
|
|
48
48
|
const { asFragment } = render(
|
|
49
|
-
<Slider value={50} isInputVisible inputValue={50} inputLabel="%" inputPosition="
|
|
49
|
+
<Slider value={50} isInputVisible inputValue={50} inputLabel="%" inputPosition="end" />
|
|
50
50
|
);
|
|
51
51
|
expect(asFragment()).toMatchSnapshot();
|
|
52
52
|
});
|
|
@@ -62,8 +62,8 @@ describe('slider', () => {
|
|
|
62
62
|
const { asFragment } = render(
|
|
63
63
|
<Slider
|
|
64
64
|
value={50}
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
startActions={<Button variant="plain" aria-label="Minus" />}
|
|
66
|
+
endActions={<Button variant="plain" aria-label="Plus" />}
|
|
67
67
|
/>
|
|
68
68
|
);
|
|
69
69
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -65,12 +65,12 @@ export const SliderActions: React.FunctionComponent = () => {
|
|
|
65
65
|
<Slider
|
|
66
66
|
value={value1}
|
|
67
67
|
onChange={onChange1}
|
|
68
|
-
|
|
68
|
+
startActions={
|
|
69
69
|
<Button variant="plain" aria-label="Minus" onClick={onMinusClick}>
|
|
70
70
|
<MinusIcon />
|
|
71
71
|
</Button>
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
endActions={
|
|
74
74
|
<Button variant="plain" aria-label="Plus" onClick={onPlusClick}>
|
|
75
75
|
<PlusIcon />
|
|
76
76
|
</Button>
|
|
@@ -85,7 +85,7 @@ export const SliderActions: React.FunctionComponent = () => {
|
|
|
85
85
|
inputLabel="%"
|
|
86
86
|
isInputVisible
|
|
87
87
|
isDisabled={isDisabled}
|
|
88
|
-
|
|
88
|
+
endActions={buildAction(isDisabled)}
|
|
89
89
|
/>
|
|
90
90
|
</>
|
|
91
91
|
);
|
|
@@ -63,10 +63,14 @@ export interface TabsProps extends Omit<React.HTMLProps<HTMLElement | HTMLDivEle
|
|
|
63
63
|
isVertical?: boolean;
|
|
64
64
|
/** Disables border bottom tab styling on tabs. Defaults to false. To remove the bottom border, set this prop to true. */
|
|
65
65
|
hasNoBorderBottom?: boolean;
|
|
66
|
-
/** Aria-label for the left scroll button */
|
|
66
|
+
/** @deprecated Please use backScrollAriaLabel. Aria-label for the left scroll button */
|
|
67
67
|
leftScrollAriaLabel?: string;
|
|
68
|
-
/** Aria-label for the right scroll button */
|
|
68
|
+
/** @deprecated Please use forwardScrollAriaLabel. Aria-label for the right scroll button */
|
|
69
69
|
rightScrollAriaLabel?: string;
|
|
70
|
+
/** Aria-label for the back scroll button */
|
|
71
|
+
backScrollAriaLabel?: string;
|
|
72
|
+
/** Aria-label for the forward scroll button */
|
|
73
|
+
forwardScrollAriaLabel?: string;
|
|
70
74
|
/** Determines what tag is used around the tabs. Use "nav" to define the tabs inside a navigation region */
|
|
71
75
|
component?: 'div' | 'nav';
|
|
72
76
|
/** Provides an accessible label for the tabs. Labels should be unique for each set of tabs that are present on a page. When component is set to nav, this prop should be defined to differentiate the tabs from other navigation regions on the page. */
|
|
@@ -127,8 +131,8 @@ interface TabsState {
|
|
|
127
131
|
* shown and rendering must be stopped after they stop being shown to preserve CSS transitions.
|
|
128
132
|
*/
|
|
129
133
|
renderScrollButtons: boolean;
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
disableBackScrollButton: boolean;
|
|
135
|
+
disableForwardScrollButton: boolean;
|
|
132
136
|
shownKeys: (string | number)[];
|
|
133
137
|
uncontrolledActiveKey: number | string;
|
|
134
138
|
uncontrolledIsExpandedLocal: boolean;
|
|
@@ -140,14 +144,15 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
140
144
|
static displayName = 'Tabs';
|
|
141
145
|
tabList = React.createRef<HTMLUListElement>();
|
|
142
146
|
leftScrollButtonRef = React.createRef<HTMLButtonElement>();
|
|
147
|
+
private direction = 'ltr';
|
|
143
148
|
constructor(props: TabsProps) {
|
|
144
149
|
super(props);
|
|
145
150
|
this.state = {
|
|
146
151
|
enableScrollButtons: false,
|
|
147
152
|
showScrollButtons: false,
|
|
148
153
|
renderScrollButtons: false,
|
|
149
|
-
|
|
150
|
-
|
|
154
|
+
disableBackScrollButton: true,
|
|
155
|
+
disableForwardScrollButton: true,
|
|
151
156
|
shownKeys: this.props.defaultActiveKey !== undefined ? [this.props.defaultActiveKey] : [this.props.activeKey], // only for mountOnEnter case
|
|
152
157
|
uncontrolledActiveKey: this.props.defaultActiveKey,
|
|
153
158
|
uncontrolledIsExpandedLocal: this.props.defaultIsExpanded,
|
|
@@ -177,7 +182,9 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
177
182
|
isBox: false,
|
|
178
183
|
hasNoBorderBottom: false,
|
|
179
184
|
leftScrollAriaLabel: 'Scroll left',
|
|
185
|
+
backScrollAriaLabel: 'Scroll back',
|
|
180
186
|
rightScrollAriaLabel: 'Scroll right',
|
|
187
|
+
forwardScrollAriaLabel: 'Scroll forward',
|
|
181
188
|
component: TabsComponent.div,
|
|
182
189
|
mountOnEnter: false,
|
|
183
190
|
unmountOnExit: false,
|
|
@@ -232,8 +239,8 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
232
239
|
clearTimeout(this.scrollTimeout);
|
|
233
240
|
this.scrollTimeout = setTimeout(() => {
|
|
234
241
|
const container = this.tabList.current;
|
|
235
|
-
let
|
|
236
|
-
let
|
|
242
|
+
let disableBackScrollButton = true;
|
|
243
|
+
let disableForwardScrollButton = true;
|
|
237
244
|
let enableScrollButtons = false;
|
|
238
245
|
let overflowingTabCount = 0;
|
|
239
246
|
|
|
@@ -246,8 +253,8 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
246
253
|
|
|
247
254
|
enableScrollButtons = overflowOnLeft || overflowOnRight;
|
|
248
255
|
|
|
249
|
-
|
|
250
|
-
|
|
256
|
+
disableBackScrollButton = !overflowOnLeft;
|
|
257
|
+
disableForwardScrollButton = !overflowOnRight;
|
|
251
258
|
}
|
|
252
259
|
|
|
253
260
|
if (isOverflowHorizontal) {
|
|
@@ -256,14 +263,14 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
256
263
|
|
|
257
264
|
this.setState({
|
|
258
265
|
enableScrollButtons,
|
|
259
|
-
|
|
260
|
-
|
|
266
|
+
disableBackScrollButton,
|
|
267
|
+
disableForwardScrollButton,
|
|
261
268
|
overflowingTabCount
|
|
262
269
|
});
|
|
263
270
|
}, 100);
|
|
264
271
|
};
|
|
265
272
|
|
|
266
|
-
|
|
273
|
+
scrollBack = () => {
|
|
267
274
|
// find first Element that is fully in view on the left, then scroll to the element before it
|
|
268
275
|
if (this.tabList.current) {
|
|
269
276
|
const container = this.tabList.current;
|
|
@@ -278,12 +285,18 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
278
285
|
}
|
|
279
286
|
}
|
|
280
287
|
if (lastElementOutOfView) {
|
|
281
|
-
|
|
288
|
+
if (this.direction === 'ltr') {
|
|
289
|
+
// LTR scrolls left to go back
|
|
290
|
+
container.scrollLeft -= lastElementOutOfView.scrollWidth;
|
|
291
|
+
} else {
|
|
292
|
+
// RTL scrolls right to go back
|
|
293
|
+
container.scrollLeft += lastElementOutOfView.scrollWidth;
|
|
294
|
+
}
|
|
282
295
|
}
|
|
283
296
|
}
|
|
284
297
|
};
|
|
285
298
|
|
|
286
|
-
|
|
299
|
+
scrollForward = () => {
|
|
287
300
|
// find last Element that is fully in view on the right, then scroll to the element after it
|
|
288
301
|
if (this.tabList.current) {
|
|
289
302
|
const container = this.tabList.current as any;
|
|
@@ -297,7 +310,13 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
297
310
|
}
|
|
298
311
|
}
|
|
299
312
|
if (firstElementOutOfView) {
|
|
300
|
-
|
|
313
|
+
if (this.direction === 'ltr') {
|
|
314
|
+
// LTR scrolls right to go forward
|
|
315
|
+
container.scrollLeft += firstElementOutOfView.scrollWidth;
|
|
316
|
+
} else {
|
|
317
|
+
// RTL scrolls left to go forward
|
|
318
|
+
container.scrollLeft -= firstElementOutOfView.scrollWidth;
|
|
319
|
+
}
|
|
301
320
|
}
|
|
302
321
|
}
|
|
303
322
|
};
|
|
@@ -314,6 +333,7 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
314
333
|
if (canUseDOM) {
|
|
315
334
|
window.addEventListener('resize', this.handleScrollButtons, false);
|
|
316
335
|
}
|
|
336
|
+
this.direction = getComputedStyle(this.tabList.current).getPropertyValue('direction');
|
|
317
337
|
// call the handle resize function to check if scroll buttons should be shown
|
|
318
338
|
this.handleScrollButtons();
|
|
319
339
|
}
|
|
@@ -360,6 +380,8 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
360
380
|
} else if (prevState.enableScrollButtons && !enableScrollButtons) {
|
|
361
381
|
this.setState({ showScrollButtons: false });
|
|
362
382
|
}
|
|
383
|
+
|
|
384
|
+
this.direction = getComputedStyle(this.tabList.current).getPropertyValue('direction');
|
|
363
385
|
}
|
|
364
386
|
|
|
365
387
|
render() {
|
|
@@ -376,6 +398,8 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
376
398
|
hasNoBorderBottom,
|
|
377
399
|
leftScrollAriaLabel,
|
|
378
400
|
rightScrollAriaLabel,
|
|
401
|
+
backScrollAriaLabel,
|
|
402
|
+
forwardScrollAriaLabel,
|
|
379
403
|
'aria-label': ariaLabel,
|
|
380
404
|
component,
|
|
381
405
|
ouiaId,
|
|
@@ -400,8 +424,8 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
400
424
|
const {
|
|
401
425
|
showScrollButtons,
|
|
402
426
|
renderScrollButtons,
|
|
403
|
-
|
|
404
|
-
|
|
427
|
+
disableBackScrollButton,
|
|
428
|
+
disableForwardScrollButton,
|
|
405
429
|
shownKeys,
|
|
406
430
|
uncontrolledActiveKey,
|
|
407
431
|
uncontrolledIsExpandedLocal,
|
|
@@ -497,10 +521,10 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
497
521
|
<button
|
|
498
522
|
type="button"
|
|
499
523
|
className={css(styles.tabsScrollButton, isSecondary && buttonStyles.modifiers.secondary)}
|
|
500
|
-
aria-label={leftScrollAriaLabel}
|
|
501
|
-
onClick={this.
|
|
502
|
-
disabled={
|
|
503
|
-
aria-hidden={
|
|
524
|
+
aria-label={backScrollAriaLabel || leftScrollAriaLabel}
|
|
525
|
+
onClick={this.scrollBack}
|
|
526
|
+
disabled={disableBackScrollButton}
|
|
527
|
+
aria-hidden={disableBackScrollButton}
|
|
504
528
|
ref={this.leftScrollButtonRef}
|
|
505
529
|
>
|
|
506
530
|
<AngleLeftIcon />
|
|
@@ -514,10 +538,10 @@ class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
514
538
|
<button
|
|
515
539
|
type="button"
|
|
516
540
|
className={css(styles.tabsScrollButton, isSecondary && buttonStyles.modifiers.secondary)}
|
|
517
|
-
aria-label={rightScrollAriaLabel}
|
|
518
|
-
onClick={this.
|
|
519
|
-
disabled={
|
|
520
|
-
aria-hidden={
|
|
541
|
+
aria-label={forwardScrollAriaLabel || rightScrollAriaLabel}
|
|
542
|
+
onClick={this.scrollForward}
|
|
543
|
+
disabled={disableForwardScrollButton}
|
|
544
|
+
aria-hidden={disableForwardScrollButton}
|
|
521
545
|
>
|
|
522
546
|
<AngleRightIcon />
|
|
523
547
|
</button>
|
|
@@ -28,7 +28,7 @@ You can adjust a tab in the following ways:
|
|
|
28
28
|
- To disable a tab, but keep it perceivable to assistive technology users, use the `isAriaDisabled` property. If a disabled tab has a tooltip, use this property instead of `isDisabled`.
|
|
29
29
|
- To add a tooltip to an aria-disabled tab, use the `tooltip` property.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Tabs can be styled as 'default' or 'boxed':
|
|
32
32
|
|
|
33
33
|
- Default tabs do not have any borders and use a bottom line to distinguish between a selected tab, a hovered tab, and an inactive tab.
|
|
34
34
|
- Boxed tabs are outlined to emphasize the area that a tab spans. To preview boxed tabs in the following examples, select the 'isBox' checkbox, which sets the `isBox` property to true.
|
|
@@ -207,8 +207,6 @@ The tab its content should only be mounted when the tab is visible.
|
|
|
207
207
|
|
|
208
208
|
To enable closeable tabs, pass the `onClose` property to the `<Tabs>` component. To enable a button that adds new tabs, pass the `onAdd` property to `<Tabs>`.
|
|
209
209
|
|
|
210
|
-
Aria labels may be controlled manually by passing the `closeButtonAriaLabel` property to a `<Tab>` and the `addButtonAriaLabel` property to `<Tabs>`.
|
|
211
|
-
|
|
212
210
|
```ts file="./TabsDynamic.tsx"
|
|
213
211
|
```
|
|
214
212
|
|
|
@@ -67,8 +67,10 @@ export interface TextInputProps
|
|
|
67
67
|
'aria-label'?: string;
|
|
68
68
|
/** @hide A reference object to attach to the text input box. */
|
|
69
69
|
innerRef?: React.RefObject<any>;
|
|
70
|
-
/** Trim text
|
|
70
|
+
/** @deprecated Use isStartTruncated instead. Trim text at start */
|
|
71
71
|
isLeftTruncated?: boolean;
|
|
72
|
+
/** Trim text at start */
|
|
73
|
+
isStartTruncated?: boolean;
|
|
72
74
|
/** Callback function when text input is focused */
|
|
73
75
|
onFocus?: (event?: any) => void;
|
|
74
76
|
/** Callback function when text input is blurred (focus leaves) */
|
|
@@ -96,6 +98,7 @@ export class TextInputBase extends React.Component<TextInputProps, TextInputStat
|
|
|
96
98
|
isExpanded: false,
|
|
97
99
|
type: TextInputTypes.text,
|
|
98
100
|
isLeftTruncated: false,
|
|
101
|
+
isStartTruncated: false,
|
|
99
102
|
onChange: (): any => undefined,
|
|
100
103
|
ouiaSafe: true
|
|
101
104
|
};
|
|
@@ -120,7 +123,7 @@ export class TextInputBase extends React.Component<TextInputProps, TextInputStat
|
|
|
120
123
|
};
|
|
121
124
|
|
|
122
125
|
componentDidMount() {
|
|
123
|
-
if (this.props.isLeftTruncated) {
|
|
126
|
+
if (this.props.isLeftTruncated || this.props.isStartTruncated) {
|
|
124
127
|
const inputRef = this.props.innerRef || this.inputRef;
|
|
125
128
|
this.observer = getResizeObserver(inputRef.current, this.handleResize, true);
|
|
126
129
|
this.handleResize();
|
|
@@ -128,7 +131,7 @@ export class TextInputBase extends React.Component<TextInputProps, TextInputStat
|
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
componentWillUnmount() {
|
|
131
|
-
if (this.props.isLeftTruncated) {
|
|
134
|
+
if (this.props.isLeftTruncated || this.props.isStartTruncated) {
|
|
132
135
|
this.observer();
|
|
133
136
|
}
|
|
134
137
|
}
|
|
@@ -149,16 +152,16 @@ export class TextInputBase extends React.Component<TextInputProps, TextInputStat
|
|
|
149
152
|
};
|
|
150
153
|
|
|
151
154
|
onFocus = (event?: any) => {
|
|
152
|
-
const { isLeftTruncated, onFocus } = this.props;
|
|
153
|
-
if (isLeftTruncated) {
|
|
155
|
+
const { isLeftTruncated, isStartTruncated, onFocus } = this.props;
|
|
156
|
+
if (isLeftTruncated || isStartTruncated) {
|
|
154
157
|
this.restoreText();
|
|
155
158
|
}
|
|
156
159
|
onFocus && onFocus(event);
|
|
157
160
|
};
|
|
158
161
|
|
|
159
162
|
onBlur = (event?: any) => {
|
|
160
|
-
const { isLeftTruncated, onBlur } = this.props;
|
|
161
|
-
if (isLeftTruncated) {
|
|
163
|
+
const { isLeftTruncated, isStartTruncated, onBlur } = this.props;
|
|
164
|
+
if (isLeftTruncated || isStartTruncated) {
|
|
162
165
|
this.handleResize();
|
|
163
166
|
}
|
|
164
167
|
onBlur && onBlur(event);
|
|
@@ -177,6 +180,7 @@ export class TextInputBase extends React.Component<TextInputProps, TextInputStat
|
|
|
177
180
|
onFocus,
|
|
178
181
|
onBlur,
|
|
179
182
|
isLeftTruncated,
|
|
183
|
+
isStartTruncated,
|
|
180
184
|
isExpanded,
|
|
181
185
|
readOnly,
|
|
182
186
|
readOnlyVariant,
|
|
@@ -5,6 +5,7 @@ import userEvent from '@testing-library/user-event';
|
|
|
5
5
|
|
|
6
6
|
import { TextInput, TextInputBase } from '../TextInput';
|
|
7
7
|
import { ValidatedOptions } from '../../../helpers/constants';
|
|
8
|
+
import * as ReactCoreUtils from '@patternfly/react-core/src/helpers/util';
|
|
8
9
|
|
|
9
10
|
const props = {
|
|
10
11
|
onChange: jest.fn(),
|
|
@@ -32,7 +33,7 @@ describe('TextInput', () => {
|
|
|
32
33
|
});
|
|
33
34
|
|
|
34
35
|
test('read only text input using isReadOnly', () => {
|
|
35
|
-
const { asFragment } = render(<TextInput
|
|
36
|
+
const { asFragment } = render(<TextInput readOnlyVariant="default" value="read only" aria-label="read only text input" />);
|
|
36
37
|
expect(asFragment()).toMatchSnapshot();
|
|
37
38
|
});
|
|
38
39
|
|
|
@@ -109,4 +110,18 @@ describe('TextInput', () => {
|
|
|
109
110
|
|
|
110
111
|
expect(myMock).not.toHaveBeenCalled();
|
|
111
112
|
});
|
|
113
|
+
|
|
114
|
+
test('trimLeft is called when isStartTruncated is true', async () => {
|
|
115
|
+
const trimLeftFn = jest.spyOn(ReactCoreUtils, 'trimLeft').mockImplementation();
|
|
116
|
+
|
|
117
|
+
render(<TextInput isStartTruncated aria-label="start truncated text input" />);
|
|
118
|
+
expect(trimLeftFn).toHaveBeenCalled();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('trimLeft is called when isLeftTruncated is true', async () => {
|
|
122
|
+
const trimLeftFn = jest.spyOn(ReactCoreUtils, 'trimLeft').mockImplementation();
|
|
123
|
+
|
|
124
|
+
render(<TextInput isLeftTruncated aria-label="start truncated text input" />);
|
|
125
|
+
expect(trimLeftFn).toHaveBeenCalled();
|
|
126
|
+
});
|
|
112
127
|
});
|
|
@@ -99,7 +99,7 @@ exports[`TextInput plain read only text input 1`] = `
|
|
|
99
99
|
exports[`TextInput read only text input using isReadOnly 1`] = `
|
|
100
100
|
<DocumentFragment>
|
|
101
101
|
<span
|
|
102
|
-
class="pf-v5-c-form-control"
|
|
102
|
+
class="pf-v5-c-form-control pf-m-readonly"
|
|
103
103
|
>
|
|
104
104
|
<input
|
|
105
105
|
aria-invalid="false"
|
|
@@ -107,6 +107,7 @@ exports[`TextInput read only text input using isReadOnly 1`] = `
|
|
|
107
107
|
data-ouia-component-id="OUIA-Generated-TextInputBase-4"
|
|
108
108
|
data-ouia-component-type="PF5/TextInput"
|
|
109
109
|
data-ouia-safe="true"
|
|
110
|
+
readonly=""
|
|
110
111
|
type="text"
|
|
111
112
|
value="read only"
|
|
112
113
|
/>
|
package/src/components/TextInput/examples/{TextInputLeftTruncated.tsx → TextInputStartTruncated.tsx}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInput } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const StartTruncatedTextInput: React.FunctionComponent = () => {
|
|
5
5
|
const [value, setValue] = React.useState(
|
|
6
6
|
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
|
|
7
7
|
);
|
|
8
8
|
return (
|
|
9
9
|
<TextInput
|
|
10
|
-
|
|
10
|
+
isStartTruncated
|
|
11
11
|
value={value}
|
|
12
12
|
type="text"
|
|
13
13
|
onChange={(_event, value) => setValue(value)}
|
|
14
|
-
aria-label="
|
|
14
|
+
aria-label="start-truncated text input example"
|
|
15
15
|
/>
|
|
16
16
|
);
|
|
17
17
|
};
|
|
@@ -64,6 +64,10 @@ export interface TimestampProps extends React.HTMLProps<HTMLSpanElement> {
|
|
|
64
64
|
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation
|
|
65
65
|
*/
|
|
66
66
|
locale?: string;
|
|
67
|
+
/** Flag indicating whether the default content should be displayed as a UTC string
|
|
68
|
+
* instead of a local string.
|
|
69
|
+
*/
|
|
70
|
+
shouldDisplayUTC?: boolean;
|
|
67
71
|
/** Determines the format of the displayed time in the timestamp and UTC tooltip. Examples:
|
|
68
72
|
* "Full" => 11:25:00 AM Eastern Daylight Time
|
|
69
73
|
* "Long" => 11:25:00 AM EDT
|
|
@@ -84,6 +88,7 @@ export const Timestamp: React.FunctionComponent<TimestampProps> = ({
|
|
|
84
88
|
displaySuffix = '',
|
|
85
89
|
is12Hour,
|
|
86
90
|
locale,
|
|
91
|
+
shouldDisplayUTC,
|
|
87
92
|
timeFormat,
|
|
88
93
|
tooltip,
|
|
89
94
|
...props
|
|
@@ -117,7 +122,6 @@ export const Timestamp: React.FunctionComponent<TimestampProps> = ({
|
|
|
117
122
|
...formatOptions,
|
|
118
123
|
...(hasTimeFormat && { timeStyle: timeFormat })
|
|
119
124
|
});
|
|
120
|
-
const defaultDisplay = `${dateAsLocaleString}${displaySuffix ? ' ' + displaySuffix : ''}`;
|
|
121
125
|
|
|
122
126
|
const utcTimeFormat = timeFormat !== 'short' ? 'medium' : 'short';
|
|
123
127
|
const convertToUTCString = (date: Date) => new Date(date).toUTCString().slice(0, -3);
|
|
@@ -125,8 +129,13 @@ export const Timestamp: React.FunctionComponent<TimestampProps> = ({
|
|
|
125
129
|
...formatOptions,
|
|
126
130
|
...(hasTimeFormat && { timeStyle: utcTimeFormat })
|
|
127
131
|
});
|
|
128
|
-
const
|
|
132
|
+
const defaultUTCSuffix = timeFormat === 'full' ? 'Coordinated Universal Time' : 'UTC';
|
|
133
|
+
const createUTCContent = (customSuffix: string) =>
|
|
134
|
+
`${utcDateString} ${customSuffix ? customSuffix : defaultUTCSuffix}`;
|
|
129
135
|
|
|
136
|
+
const defaultDisplay = shouldDisplayUTC
|
|
137
|
+
? createUTCContent(displaySuffix)
|
|
138
|
+
: `${dateAsLocaleString}${displaySuffix ? ' ' + displaySuffix : ''}`;
|
|
130
139
|
const { dateTime, ...propsWithoutDateTime } = props;
|
|
131
140
|
|
|
132
141
|
const timestamp = (
|
|
@@ -143,7 +152,7 @@ export const Timestamp: React.FunctionComponent<TimestampProps> = ({
|
|
|
143
152
|
|
|
144
153
|
return tooltip ? (
|
|
145
154
|
<Tooltip
|
|
146
|
-
content={tooltip.variant === TimestampTooltipVariant.default ?
|
|
155
|
+
content={tooltip.variant === TimestampTooltipVariant.default ? createUTCContent(tooltip.suffix) : tooltip.content}
|
|
147
156
|
{...tooltip.tooltipProps}
|
|
148
157
|
>
|
|
149
158
|
{timestamp}
|