@patternfly/react-core 5.2.0-prerelease.9 → 6.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +129 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/Chip/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/DragDrop/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/Text/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/Tile/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
- package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
- package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
- package/dist/dynamic/deprecated/components/Select/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/favorites/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/next/components/package.json +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +15 -39
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
- package/dist/esm/components/Chip/Chip.js +2 -2
- package/dist/esm/components/Chip/Chip.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js +2 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js +4 -4
- package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.js +1 -51
- package/dist/esm/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/esm/components/Masthead/Masthead.d.ts +0 -2
- package/dist/esm/components/Masthead/Masthead.d.ts.map +1 -1
- package/dist/esm/components/Masthead/Masthead.js +3 -3
- package/dist/esm/components/Masthead/Masthead.js.map +1 -1
- package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
- package/dist/esm/components/Menu/Menu.js +2 -1
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/MenuContainer.d.ts +2 -0
- package/dist/esm/components/Menu/MenuContainer.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuContainer.js.map +1 -1
- package/dist/esm/components/Nav/NavExpandable.d.ts +3 -3
- package/dist/esm/components/Nav/NavExpandable.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavExpandable.js +2 -2
- package/dist/esm/components/Nav/NavExpandable.js.map +1 -1
- package/dist/esm/components/Nav/NavItem.d.ts +2 -0
- package/dist/esm/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavItem.js +2 -2
- package/dist/esm/components/Nav/NavItem.js.map +1 -1
- package/dist/esm/components/Nav/NavList.js +3 -3
- package/dist/esm/components/Nav/NavList.js.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/esm/components/Page/PageSection.d.ts +2 -5
- package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSection.js +1 -7
- package/dist/esm/components/Page/PageSection.js.map +1 -1
- package/dist/esm/components/Page/PageSidebar.d.ts +0 -2
- package/dist/esm/components/Page/PageSidebar.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSidebar.js +2 -2
- package/dist/esm/components/Page/PageSidebar.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts +2 -0
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +2 -2
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +2 -0
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
- package/dist/esm/components/Slider/Slider.js +2 -1
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +3 -3
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/demos/DashboardWrapper.js +1 -1
- package/dist/esm/demos/DashboardWrapper.js.map +1 -1
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts +0 -2
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts.map +1 -1
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.js +2 -2
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.js.map +1 -1
- package/dist/esm/helpers/Popper/Popper.d.ts +2 -1
- package/dist/esm/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/esm/helpers/Popper/Popper.js +7 -16
- package/dist/esm/helpers/Popper/Popper.js.map +1 -1
- package/dist/esm/helpers/datetimeUtils.d.ts +1 -1
- package/dist/esm/helpers/datetimeUtils.d.ts.map +1 -1
- package/dist/esm/helpers/datetimeUtils.js.map +1 -1
- package/dist/esm/helpers/util.d.ts +9 -0
- package/dist/esm/helpers/util.d.ts.map +1 -1
- package/dist/esm/helpers/util.js +18 -0
- package/dist/esm/helpers/util.js.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +15 -39
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/Chip/Chip.d.ts.map +1 -1
- package/dist/js/components/Chip/Chip.js +2 -2
- package/dist/js/components/Chip/Chip.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js +2 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js +3 -3
- package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/js/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.js +1 -51
- package/dist/js/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/js/components/Masthead/Masthead.d.ts +0 -2
- package/dist/js/components/Masthead/Masthead.d.ts.map +1 -1
- package/dist/js/components/Masthead/Masthead.js +3 -3
- package/dist/js/components/Masthead/Masthead.js.map +1 -1
- package/dist/js/components/Menu/Menu.d.ts.map +1 -1
- package/dist/js/components/Menu/Menu.js +2 -1
- package/dist/js/components/Menu/Menu.js.map +1 -1
- package/dist/js/components/Menu/MenuContainer.d.ts +2 -0
- package/dist/js/components/Menu/MenuContainer.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuContainer.js.map +1 -1
- package/dist/js/components/Nav/NavExpandable.d.ts +3 -3
- package/dist/js/components/Nav/NavExpandable.d.ts.map +1 -1
- package/dist/js/components/Nav/NavExpandable.js +2 -2
- package/dist/js/components/Nav/NavExpandable.js.map +1 -1
- package/dist/js/components/Nav/NavItem.d.ts +2 -0
- package/dist/js/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/js/components/Nav/NavItem.js +2 -2
- package/dist/js/components/Nav/NavItem.js.map +1 -1
- package/dist/js/components/Nav/NavList.js +2 -2
- package/dist/js/components/Nav/NavList.js.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/js/components/Page/PageSection.d.ts +2 -5
- package/dist/js/components/Page/PageSection.d.ts.map +1 -1
- package/dist/js/components/Page/PageSection.js +1 -7
- package/dist/js/components/Page/PageSection.js.map +1 -1
- package/dist/js/components/Page/PageSidebar.d.ts +0 -2
- package/dist/js/components/Page/PageSidebar.d.ts.map +1 -1
- package/dist/js/components/Page/PageSidebar.js +2 -2
- package/dist/js/components/Page/PageSidebar.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts +2 -0
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js +2 -2
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +2 -0
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Slider/Slider.d.ts.map +1 -1
- package/dist/js/components/Slider/Slider.js +2 -1
- package/dist/js/components/Slider/Slider.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +2 -2
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/demos/DashboardWrapper.js +1 -1
- package/dist/js/demos/DashboardWrapper.js.map +1 -1
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts +0 -2
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts.map +1 -1
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.js +2 -2
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.js.map +1 -1
- package/dist/js/helpers/Popper/Popper.d.ts +2 -1
- package/dist/js/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/js/helpers/Popper/Popper.js +9 -19
- package/dist/js/helpers/Popper/Popper.js.map +1 -1
- package/dist/js/helpers/datetimeUtils.d.ts +1 -1
- package/dist/js/helpers/datetimeUtils.d.ts.map +1 -1
- package/dist/js/helpers/datetimeUtils.js.map +1 -1
- package/dist/js/helpers/util.d.ts +9 -0
- package/dist/js/helpers/util.d.ts.map +1 -1
- package/dist/js/helpers/util.js +20 -1
- package/dist/js/helpers/util.js.map +1 -1
- package/dist/styles/assets/images/logo__pf--reverse-on-md.svg +1 -1
- package/dist/styles/assets/images/pf-c-brand__logo-on-sm.svg +1 -1
- package/dist/styles/base-no-reset.css +849 -0
- package/dist/styles/base.css +861 -13
- package/dist/umd/react-core.min.js +1 -1
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +8 -7
- package/src/components/CalendarMonth/CalendarMonth.tsx +18 -43
- package/src/components/Checkbox/__tests__/Checkbox.test.tsx +223 -69
- package/src/components/Checkbox/__tests__/__snapshots__/Checkbox.test.tsx.snap +3 -198
- package/src/components/Chip/Chip.tsx +2 -1
- package/src/components/Chip/__tests__/Chip.test.tsx +249 -32
- package/src/components/Chip/__tests__/ChipGroup.test.tsx +288 -61
- package/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap +9 -209
- package/src/components/Chip/__tests__/__snapshots__/ChipGroup.test.tsx.snap +2 -313
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +1 -1
- package/src/components/ClipboardCopy/ClipboardCopyButton.tsx +2 -0
- package/src/components/ClipboardCopy/ClipboardCopyToggle.tsx +1 -1
- package/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx +344 -0
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyAction.test.tsx +37 -0
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyButton.test.tsx +136 -19
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyExpanded.test.tsx +71 -14
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyToggle.test.tsx +78 -34
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopy.test.tsx.snap +57 -0
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyAction.test.tsx.snap +11 -0
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyButton.test.tsx.snap +50 -24
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyExpanded.test.tsx.snap +3 -23
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap +5 -6
- package/src/components/Drawer/DrawerPanelContent.tsx +4 -4
- package/src/components/Dropdown/Dropdown.tsx +2 -0
- package/src/components/ExpandableSection/ExpandableSection.tsx +1 -1
- package/src/components/InputGroup/InputGroup.tsx +1 -53
- package/src/components/InputGroup/__tests__/InputGroup.test.tsx +7 -44
- package/src/components/Masthead/Masthead.tsx +0 -5
- package/src/components/Masthead/examples/Masthead.md +0 -44
- package/src/components/Menu/Menu.tsx +2 -1
- package/src/components/Menu/MenuContainer.tsx +2 -0
- package/src/components/Nav/NavExpandable.tsx +5 -5
- package/src/components/Nav/NavItem.tsx +4 -1
- package/src/components/Nav/NavList.tsx +3 -3
- package/src/components/Nav/examples/Nav.md +8 -0
- package/src/components/Nav/examples/NavExpandableThirdLevel.tsx +1 -1
- package/src/components/Nav/examples/NavLinkText.tsx +109 -0
- package/src/components/Nav/examples/nav.css +1 -0
- package/src/components/NotificationBadge/NotificationBadge.tsx +1 -1
- package/src/components/NumberInput/__tests__/NumberInput.test.tsx +0 -1
- package/src/components/Page/PageSection.tsx +3 -9
- package/src/components/Page/PageSidebar.tsx +0 -4
- package/src/components/Page/__tests__/Generated/PageSidebar.test.tsx +1 -1
- package/src/components/Page/__tests__/Page.test.tsx +1 -40
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +0 -195
- package/src/components/Page/examples/PageGroupSection.tsx +3 -4
- package/src/components/Page/examples/PageHorizontalNav.tsx +3 -4
- package/src/components/Page/examples/PageMainSectionPadding.tsx +2 -7
- package/src/components/Page/examples/PageMultipleSidebarBody.tsx +3 -4
- package/src/components/Page/examples/PageTertiaryNav.tsx +3 -4
- package/src/components/Page/examples/PageUncontrolledNav.tsx +3 -4
- package/src/components/Page/examples/PageVerticalNav.tsx +3 -4
- package/src/components/SearchInput/SearchInput.tsx +5 -1
- package/src/components/SearchInput/__tests__/SearchInput.test.tsx +8 -0
- package/src/components/Select/Select.tsx +2 -0
- package/src/components/Slider/Slider.tsx +2 -1
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/demos/Banner.md +2 -4
- package/src/demos/CardView/examples/CardView.tsx +2 -8
- package/src/demos/DashboardWrapper.tsx +1 -1
- package/src/demos/JumpLinks.md +1 -1
- package/src/demos/Nav.md +10 -1673
- package/src/demos/NotificationDrawer/examples/NotificationDrawerBasic.tsx +2 -3
- package/src/demos/NotificationDrawer/examples/NotificationDrawerGrouped.tsx +2 -3
- package/src/demos/PrimaryDetail.md +4 -7
- package/src/demos/Tabs.md +6 -8
- package/src/demos/Wizard/WizardDemo.md +6 -761
- package/src/demos/examples/AlertGroup/AlertGroupToastWithNotificationDrawer.tsx +4 -5
- package/src/demos/examples/BackToTop/BackToTopNameDemo.tsx +1 -2
- package/src/demos/examples/DashboardWrapper.js +127 -0
- package/src/demos/examples/JumpLinks/JumpLinksWithDrawer.js +3 -4
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +1 -2
- package/src/demos/examples/Nav/NavDefault.tsx +97 -0
- package/src/demos/examples/Nav/NavDrilldown.tsx +2 -0
- package/src/demos/examples/Nav/NavExpandable.tsx +123 -0
- package/src/demos/examples/Nav/NavFlyout.tsx +277 -0
- package/src/demos/examples/Nav/NavGrouped.tsx +98 -0
- package/src/demos/examples/Nav/NavHorizontal.tsx +236 -0
- package/src/demos/examples/Nav/NavHorizontalWithSubnav.tsx +296 -0
- package/src/demos/examples/Nav/NavManual.tsx +272 -0
- package/src/demos/examples/Nav/NavWithSubnav.tsx +141 -0
- package/src/demos/examples/Nav/deprecated/NavLight.tsx +95 -0
- package/src/demos/examples/Nav/deprecated/NavTertiary.tsx +91 -0
- package/src/demos/examples/Page/PageStickySectionBreadcrumb.tsx +1 -2
- package/src/demos/examples/Page/PageStickySectionGroup.tsx +1 -2
- package/src/demos/examples/Page/PageStickySectionGroupAlternate.tsx +1 -2
- package/src/demos/examples/PrimaryDetail/PrimaryDetailContentPadding.tsx +1 -2
- package/src/demos/examples/PrimaryDetail/PrimaryDetailFullPage.tsx +2 -3
- package/src/demos/examples/PrimaryDetail/PrimaryDetailInlineModifier.tsx +2 -3
- package/src/demos/examples/Tabs/ModalTabs.tsx +1 -2
- package/src/demos/examples/Tabs/NestedUnindentedTabs.tsx +2 -2
- package/src/demos/examples/Tabs/TabsAndTable.tsx +2 -3
- package/src/demos/examples/Toolbar/ConsoleLogViewerToolbar.tsx +1 -2
- package/src/demos/examples/Wizard/InModal.tsx +75 -0
- package/src/demos/examples/Wizard/InModalWithDrawer.tsx +115 -0
- package/src/demos/examples/Wizard/InModalWithDrawerInformationalStep.tsx +122 -0
- package/src/demos/examples/Wizard/InPage.tsx +35 -0
- package/src/demos/examples/Wizard/InPageWithDrawer.tsx +195 -0
- package/src/demos/examples/Wizard/InPageWithDrawerInformationalStep.tsx +200 -0
- package/src/deprecated/components/PageHeader/PageHeaderToolsItem.tsx +0 -4
- package/src/deprecated/components/PageHeader/examples/PageVerticalNavUsingPageHeaderComponent.tsx +4 -4
- package/src/deprecated/components/PageHeader/tests/PageHeaderToolsItem.test.tsx +1 -3
- package/src/deprecated/components/PageHeader/tests/__snapshots__/PageHeaderToolsItem.test.tsx.snap +1 -1
- package/src/helpers/Popper/Popper.tsx +10 -19
- package/src/helpers/__mocks__/util.ts +2 -0
- package/src/helpers/datetimeUtils.ts +1 -1
- package/src/helpers/util.ts +22 -0
- package/dist/styles/assets/images/pf-c-brand__logo-on-lg-white.svg +0 -32
- package/dist/styles/assets/images/pf-c-brand__logo-on-md-white.svg +0 -42
- package/dist/styles/assets/images/pf-c-brand__logo-on-sm-white.svg +0 -17
- package/dist/styles/assets/images/pf-c-brand__logo-on-xl-white.svg +0 -39
- package/dist/styles/assets/images/pf_logo_white.hbs +0 -35
- package/dist/styles/assets/images/pf_logo_white.svg +0 -38
- package/src/components/ClipboardCopy/__tests__/Generated/ClipboardCopy.test.tsx +0 -40
- package/src/components/ClipboardCopy/__tests__/Generated/__snapshots__/ClipboardCopy.test.tsx.snap +0 -55
|
@@ -1,212 +1,17 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Matches snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
6
|
class="pf-v5-c-check pf-m-standalone"
|
|
7
7
|
>
|
|
8
8
|
<input
|
|
9
9
|
aria-invalid="false"
|
|
10
|
-
aria-label="check"
|
|
11
10
|
class="pf-v5-c-check__input"
|
|
12
|
-
data-ouia-component-id="
|
|
11
|
+
data-ouia-component-id="ouia-id"
|
|
13
12
|
data-ouia-component-type="PF5/Checkbox"
|
|
14
13
|
data-ouia-safe="true"
|
|
15
|
-
id="
|
|
16
|
-
type="checkbox"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
</DocumentFragment>
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
exports[`Checkbox controlled 1`] = `
|
|
23
|
-
<DocumentFragment>
|
|
24
|
-
<div
|
|
25
|
-
class="pf-v5-c-check pf-m-standalone"
|
|
26
|
-
>
|
|
27
|
-
<input
|
|
28
|
-
aria-invalid="false"
|
|
29
|
-
aria-label="check"
|
|
30
|
-
checked=""
|
|
31
|
-
class="pf-v5-c-check__input"
|
|
32
|
-
data-ouia-component-id="OUIA-Generated-Checkbox-1"
|
|
33
|
-
data-ouia-component-type="PF5/Checkbox"
|
|
34
|
-
data-ouia-safe="true"
|
|
35
|
-
id="check"
|
|
36
|
-
type="checkbox"
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
</DocumentFragment>
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
exports[`Checkbox isDisabled 1`] = `
|
|
43
|
-
<DocumentFragment>
|
|
44
|
-
<div
|
|
45
|
-
class="pf-v5-c-check pf-m-standalone"
|
|
46
|
-
>
|
|
47
|
-
<input
|
|
48
|
-
aria-invalid="false"
|
|
49
|
-
aria-label="check"
|
|
50
|
-
class="pf-v5-c-check__input"
|
|
51
|
-
data-ouia-component-id="OUIA-Generated-Checkbox-4"
|
|
52
|
-
data-ouia-component-type="PF5/Checkbox"
|
|
53
|
-
data-ouia-safe="true"
|
|
54
|
-
disabled=""
|
|
55
|
-
id="check"
|
|
56
|
-
type="checkbox"
|
|
57
|
-
/>
|
|
58
|
-
</div>
|
|
59
|
-
</DocumentFragment>
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
exports[`Checkbox label is function 1`] = `
|
|
63
|
-
<DocumentFragment>
|
|
64
|
-
<div
|
|
65
|
-
class="pf-v5-c-check"
|
|
66
|
-
>
|
|
67
|
-
<input
|
|
68
|
-
aria-invalid="false"
|
|
69
|
-
aria-label="check"
|
|
70
|
-
checked=""
|
|
71
|
-
class="pf-v5-c-check__input"
|
|
72
|
-
data-ouia-component-id="OUIA-Generated-Checkbox-6"
|
|
73
|
-
data-ouia-component-type="PF5/Checkbox"
|
|
74
|
-
data-ouia-safe="true"
|
|
75
|
-
id="check"
|
|
76
|
-
type="checkbox"
|
|
77
|
-
/>
|
|
78
|
-
<label
|
|
79
|
-
class="pf-v5-c-check__label"
|
|
80
|
-
for="check"
|
|
81
|
-
>
|
|
82
|
-
<h1>
|
|
83
|
-
Header
|
|
84
|
-
</h1>
|
|
85
|
-
</label>
|
|
86
|
-
</div>
|
|
87
|
-
</DocumentFragment>
|
|
88
|
-
`;
|
|
89
|
-
|
|
90
|
-
exports[`Checkbox label is node 1`] = `
|
|
91
|
-
<DocumentFragment>
|
|
92
|
-
<div
|
|
93
|
-
class="pf-v5-c-check"
|
|
94
|
-
>
|
|
95
|
-
<input
|
|
96
|
-
aria-invalid="false"
|
|
97
|
-
aria-label="check"
|
|
98
|
-
checked=""
|
|
99
|
-
class="pf-v5-c-check__input"
|
|
100
|
-
data-ouia-component-id="OUIA-Generated-Checkbox-7"
|
|
101
|
-
data-ouia-component-type="PF5/Checkbox"
|
|
102
|
-
data-ouia-safe="true"
|
|
103
|
-
id="check"
|
|
104
|
-
type="checkbox"
|
|
105
|
-
/>
|
|
106
|
-
<label
|
|
107
|
-
class="pf-v5-c-check__label"
|
|
108
|
-
for="check"
|
|
109
|
-
>
|
|
110
|
-
<h1>
|
|
111
|
-
Header
|
|
112
|
-
</h1>
|
|
113
|
-
</label>
|
|
114
|
-
</div>
|
|
115
|
-
</DocumentFragment>
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
exports[`Checkbox label is string 1`] = `
|
|
119
|
-
<DocumentFragment>
|
|
120
|
-
<div
|
|
121
|
-
class="pf-v5-c-check"
|
|
122
|
-
>
|
|
123
|
-
<input
|
|
124
|
-
aria-invalid="false"
|
|
125
|
-
aria-label="check"
|
|
126
|
-
checked=""
|
|
127
|
-
class="pf-v5-c-check__input"
|
|
128
|
-
data-ouia-component-id="OUIA-Generated-Checkbox-5"
|
|
129
|
-
data-ouia-component-type="PF5/Checkbox"
|
|
130
|
-
data-ouia-safe="true"
|
|
131
|
-
id="check"
|
|
132
|
-
type="checkbox"
|
|
133
|
-
/>
|
|
134
|
-
<label
|
|
135
|
-
class="pf-v5-c-check__label"
|
|
136
|
-
for="check"
|
|
137
|
-
>
|
|
138
|
-
Label
|
|
139
|
-
</label>
|
|
140
|
-
</div>
|
|
141
|
-
</DocumentFragment>
|
|
142
|
-
`;
|
|
143
|
-
|
|
144
|
-
exports[`Checkbox passing HTML attribute 1`] = `
|
|
145
|
-
<DocumentFragment>
|
|
146
|
-
<div
|
|
147
|
-
class="pf-v5-c-check"
|
|
148
|
-
>
|
|
149
|
-
<input
|
|
150
|
-
aria-invalid="false"
|
|
151
|
-
aria-label="check"
|
|
152
|
-
aria-labelledby="labelId"
|
|
153
|
-
checked=""
|
|
154
|
-
class="pf-v5-c-check__input"
|
|
155
|
-
data-ouia-component-id="OUIA-Generated-Checkbox-9"
|
|
156
|
-
data-ouia-component-type="PF5/Checkbox"
|
|
157
|
-
data-ouia-safe="true"
|
|
158
|
-
id="check"
|
|
159
|
-
type="checkbox"
|
|
160
|
-
/>
|
|
161
|
-
<label
|
|
162
|
-
class="pf-v5-c-check__label"
|
|
163
|
-
for="check"
|
|
164
|
-
>
|
|
165
|
-
label
|
|
166
|
-
</label>
|
|
167
|
-
</div>
|
|
168
|
-
</DocumentFragment>
|
|
169
|
-
`;
|
|
170
|
-
|
|
171
|
-
exports[`Checkbox passing class 1`] = `
|
|
172
|
-
<DocumentFragment>
|
|
173
|
-
<div
|
|
174
|
-
class="pf-v5-c-check class-123"
|
|
175
|
-
>
|
|
176
|
-
<input
|
|
177
|
-
aria-invalid="false"
|
|
178
|
-
aria-label="check"
|
|
179
|
-
checked=""
|
|
180
|
-
class="pf-v5-c-check__input"
|
|
181
|
-
data-ouia-component-id="OUIA-Generated-Checkbox-8"
|
|
182
|
-
data-ouia-component-type="PF5/Checkbox"
|
|
183
|
-
data-ouia-safe="true"
|
|
184
|
-
id="check"
|
|
185
|
-
type="checkbox"
|
|
186
|
-
/>
|
|
187
|
-
<label
|
|
188
|
-
class="pf-v5-c-check__label"
|
|
189
|
-
for="check"
|
|
190
|
-
>
|
|
191
|
-
label
|
|
192
|
-
</label>
|
|
193
|
-
</div>
|
|
194
|
-
</DocumentFragment>
|
|
195
|
-
`;
|
|
196
|
-
|
|
197
|
-
exports[`Checkbox uncontrolled 1`] = `
|
|
198
|
-
<DocumentFragment>
|
|
199
|
-
<div
|
|
200
|
-
class="pf-v5-c-check pf-m-standalone"
|
|
201
|
-
>
|
|
202
|
-
<input
|
|
203
|
-
aria-invalid="false"
|
|
204
|
-
aria-label="check"
|
|
205
|
-
class="pf-v5-c-check__input"
|
|
206
|
-
data-ouia-component-id="OUIA-Generated-Checkbox-3"
|
|
207
|
-
data-ouia-component-type="PF5/Checkbox"
|
|
208
|
-
data-ouia-safe="true"
|
|
209
|
-
id="check"
|
|
14
|
+
id="test-id"
|
|
210
15
|
type="checkbox"
|
|
211
16
|
/>
|
|
212
17
|
</div>
|
|
@@ -140,12 +140,13 @@ class Chip extends React.Component<ChipProps, ChipState> {
|
|
|
140
140
|
tooltipPosition,
|
|
141
141
|
component,
|
|
142
142
|
ouiaId,
|
|
143
|
+
textMaxWidth,
|
|
143
144
|
...props
|
|
144
145
|
} = this.props;
|
|
145
146
|
const Component = component as any;
|
|
146
147
|
return (
|
|
147
148
|
<Component
|
|
148
|
-
{...(
|
|
149
|
+
{...(textMaxWidth && {
|
|
149
150
|
style: this.setChipStyle()
|
|
150
151
|
})}
|
|
151
152
|
className={css(styles.chip, className)}
|
|
@@ -1,59 +1,276 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import { Chip } from '../Chip';
|
|
5
|
+
import styles from '@patternfly/react-styles/css/components/Chip/chip';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
7
|
+
jest.mock('../../Tooltip', () => ({
|
|
8
|
+
Tooltip: ({ content, position }) => (
|
|
9
|
+
<div data-testid="tooltip-mock">
|
|
10
|
+
<p>{`content: ${content}`}</p>
|
|
11
|
+
<p>{`position: ${position}`}</p>
|
|
12
|
+
</div>
|
|
13
|
+
)
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
['default chip', 'overflow chip'].forEach((chipType) => {
|
|
17
|
+
const isOverflowChip = chipType === 'overflow chip';
|
|
18
|
+
|
|
19
|
+
test(`Renders without children for ${chipType}`, () => {
|
|
20
|
+
render(
|
|
21
|
+
<div data-testid="container">
|
|
22
|
+
<Chip isOverflowChip={isOverflowChip} />
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
expect(screen.getByTestId('container').firstChild).toBeVisible();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test(`Renders with class ${styles.chip} on the ${chipType} container element`, () => {
|
|
30
|
+
render(
|
|
31
|
+
<Chip isOverflowChip={isOverflowChip} data-testid="container">
|
|
32
|
+
Chip text
|
|
33
|
+
</Chip>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// Only a non-overflow chip will have exactly the class "pf-v5-c-chip", we test for
|
|
37
|
+
// additional classes on overflow chips elsewhere in the suite
|
|
38
|
+
expect(screen.getByTestId('container')).toHaveClass(styles.chip, { exact: !isOverflowChip });
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test(`Renders with class ${styles.chipContent} around the ${chipType} content`, () => {
|
|
42
|
+
render(
|
|
43
|
+
<Chip isOverflowChip={isOverflowChip} data-testid="container">
|
|
44
|
+
Chip text
|
|
10
45
|
</Chip>
|
|
11
46
|
);
|
|
12
|
-
|
|
47
|
+
|
|
48
|
+
expect(screen.getByTestId('container').firstChild).toHaveClass(styles.chipContent, { exact: true });
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test(`Renders ${chipType} children with class ${styles.chipText}`, () => {
|
|
52
|
+
render(<Chip isOverflowChip={isOverflowChip}>Chip text</Chip>);
|
|
53
|
+
|
|
54
|
+
expect(screen.getByText('Chip text')).toHaveClass(styles.chipText, { exact: true });
|
|
13
55
|
});
|
|
14
56
|
|
|
15
|
-
test(
|
|
16
|
-
|
|
17
|
-
<Chip
|
|
18
|
-
Chip
|
|
57
|
+
test(`Renders with custom class on the ${chipType} container element`, () => {
|
|
58
|
+
render(
|
|
59
|
+
<Chip isOverflowChip={isOverflowChip} data-testid="container" className="custom-class">
|
|
60
|
+
Chip text
|
|
19
61
|
</Chip>
|
|
20
62
|
);
|
|
21
|
-
|
|
63
|
+
|
|
64
|
+
expect(screen.getByTestId('container')).toHaveClass('custom-class');
|
|
22
65
|
});
|
|
23
66
|
|
|
24
|
-
test(
|
|
25
|
-
|
|
26
|
-
<Chip
|
|
27
|
-
|
|
67
|
+
test(`Renders a badge when badge prop is passed to ${chipType}`, () => {
|
|
68
|
+
render(
|
|
69
|
+
<Chip isOverflowChip={isOverflowChip} badge={<div>Badge content</div>}>
|
|
70
|
+
Chip text
|
|
28
71
|
</Chip>
|
|
29
72
|
);
|
|
30
|
-
|
|
73
|
+
|
|
74
|
+
expect(screen.getByText('Badge content')).toBeVisible();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test(`Renders with div container on ${chipType} by default`, () => {
|
|
78
|
+
render(
|
|
79
|
+
<Chip isOverflowChip={isOverflowChip} data-testid="container">
|
|
80
|
+
Chip text
|
|
81
|
+
</Chip>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
expect(screen.getByTestId('container').tagName).toBe('DIV');
|
|
31
85
|
});
|
|
32
86
|
|
|
33
|
-
test(
|
|
34
|
-
|
|
35
|
-
<Chip
|
|
36
|
-
|
|
87
|
+
test(`Renders with custom container on ${chipType} when component prop is passed`, () => {
|
|
88
|
+
render(
|
|
89
|
+
<Chip component="li" isOverflowChip={isOverflowChip}>
|
|
90
|
+
Chip text
|
|
37
91
|
</Chip>
|
|
38
92
|
);
|
|
39
|
-
|
|
93
|
+
|
|
94
|
+
expect(screen.getByRole('listitem')).toBeVisible();
|
|
40
95
|
});
|
|
41
96
|
|
|
42
|
-
test(
|
|
43
|
-
|
|
44
|
-
<Chip
|
|
45
|
-
|
|
97
|
+
test(`Renders maxWidth css var in style attribute when textMaxWidth is passed for ${chipType}`, () => {
|
|
98
|
+
render(
|
|
99
|
+
<Chip isOverflowChip={isOverflowChip} data-testid="container" textMaxWidth="10px">
|
|
100
|
+
Chip text
|
|
46
101
|
</Chip>
|
|
47
102
|
);
|
|
48
|
-
|
|
103
|
+
|
|
104
|
+
expect(screen.getByTestId('container')).toHaveAttribute('style', '--pf-v5-c-chip__text--MaxWidth: 10px;');
|
|
49
105
|
});
|
|
50
106
|
|
|
51
|
-
test(
|
|
52
|
-
|
|
53
|
-
<Chip
|
|
54
|
-
|
|
107
|
+
test(`Spreads additional props to container for ${chipType}`, () => {
|
|
108
|
+
render(
|
|
109
|
+
<Chip isOverflowChip={isOverflowChip} data-testid="container" role="button">
|
|
110
|
+
Chip text
|
|
55
111
|
</Chip>
|
|
56
112
|
);
|
|
57
|
-
|
|
113
|
+
|
|
114
|
+
expect(screen.getByTestId('container')).toHaveAttribute('role', 'button');
|
|
58
115
|
});
|
|
59
116
|
});
|
|
117
|
+
|
|
118
|
+
test(`Renders id prop on ${styles.chipText} container for default chip`, () => {
|
|
119
|
+
render(<Chip id="custom-id">Chip text</Chip>);
|
|
120
|
+
|
|
121
|
+
expect(screen.getByText('Chip text')).toHaveAttribute('id', 'custom-id');
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test(`Does not render id prop on ${styles.chipText} container for overflow chip`, () => {
|
|
125
|
+
render(
|
|
126
|
+
<Chip isOverflowChip id="custom-id">
|
|
127
|
+
Chip text
|
|
128
|
+
</Chip>
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
expect(screen.getByText('Chip text')).not.toHaveAttribute('id');
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
test(`Renders actions container with class ${styles.chipActions} when isReadOnly is false`, () => {
|
|
135
|
+
render(<Chip>Chip text</Chip>);
|
|
136
|
+
|
|
137
|
+
expect(screen.getByRole('button').parentElement).toHaveClass(styles.chipActions);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test(`Renders aria-labelledby on action close button by default`, () => {
|
|
141
|
+
render(<Chip>Chip text</Chip>);
|
|
142
|
+
|
|
143
|
+
expect(screen.getByRole('button')).toHaveAccessibleName('close Chip text');
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test(`Renders aria-labelledby on action close button with custom id passed`, () => {
|
|
147
|
+
render(<Chip id="custom-id">Chip text</Chip>);
|
|
148
|
+
|
|
149
|
+
expect(screen.getByRole('button')).toHaveAccessibleName('close Chip text');
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test(`Renders concatenated aria-label on action close button by default`, () => {
|
|
153
|
+
render(<Chip>Chip text</Chip>);
|
|
154
|
+
|
|
155
|
+
expect(screen.getByRole('button')).toHaveAccessibleName('close Chip text');
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
test(`Renders custom aria-label on action close button when closeBtnAriaLabel is passed`, () => {
|
|
159
|
+
render(<Chip closeBtnAriaLabel="custom label">Chip text</Chip>);
|
|
160
|
+
|
|
161
|
+
expect(screen.getByRole('button')).toHaveAccessibleName('custom label Chip text');
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
test(`Does not render close button action when isOverflowChip is true`, () => {
|
|
165
|
+
render(<Chip isOverflowChip>Chip text</Chip>);
|
|
166
|
+
|
|
167
|
+
// Because overflow chip renders as a button, we need to add the accessible name to the query
|
|
168
|
+
expect(screen.queryByRole('button', { name: 'close Chip text' })).not.toBeInTheDocument();
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test(`Does not render close button action when isReadOnly is true`, () => {
|
|
172
|
+
render(<Chip isReadOnly>Chip text</Chip>);
|
|
173
|
+
|
|
174
|
+
expect(screen.queryByRole('button')).not.toBeInTheDocument();
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
test(`Does not render with class ${styles.modifiers.overflow} when isOverflowChip is not passed`, () => {
|
|
178
|
+
render(<Chip data-testid="container">Chip text</Chip>);
|
|
179
|
+
|
|
180
|
+
expect(screen.getByTestId('container')).not.toHaveClass(styles.modifiers.overflow);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test(`Renders with class ${styles.modifiers.overflow} when isOverflowChip is true`, () => {
|
|
184
|
+
render(
|
|
185
|
+
<Chip isOverflowChip data-testid="container">
|
|
186
|
+
Chip text
|
|
187
|
+
</Chip>
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
expect(screen.getByTestId('container')).toHaveClass(styles.modifiers.overflow);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
test(`Calls onClick when close button action is clicked for default chip`, async () => {
|
|
194
|
+
const user = userEvent.setup();
|
|
195
|
+
const onClickMock = jest.fn();
|
|
196
|
+
|
|
197
|
+
render(<Chip onClick={onClickMock}>Chip text</Chip>);
|
|
198
|
+
|
|
199
|
+
await user.click(screen.getByRole('button', { name: 'close Chip text' }));
|
|
200
|
+
|
|
201
|
+
expect(onClickMock).toHaveBeenCalledTimes(1);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
test(`Does not call onClick when close button action is not clicked for default chip`, async () => {
|
|
205
|
+
const user = userEvent.setup();
|
|
206
|
+
const onClickMock = jest.fn();
|
|
207
|
+
|
|
208
|
+
render(
|
|
209
|
+
<>
|
|
210
|
+
<Chip onClick={onClickMock}>Chip text</Chip>
|
|
211
|
+
<button>Test clicker</button>
|
|
212
|
+
</>
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
await user.click(screen.getByRole('button', { name: 'Test clicker' }));
|
|
216
|
+
|
|
217
|
+
expect(onClickMock).not.toHaveBeenCalled();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
test(`Calls onClick when chip is clicked for overflow chip`, async () => {
|
|
221
|
+
const user = userEvent.setup();
|
|
222
|
+
const onClickMock = jest.fn();
|
|
223
|
+
|
|
224
|
+
render(
|
|
225
|
+
<Chip isOverflowChip component="button" onClick={onClickMock}>
|
|
226
|
+
Chip text
|
|
227
|
+
</Chip>
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
await user.click(screen.getByRole('button', { name: 'Chip text' }));
|
|
231
|
+
|
|
232
|
+
expect(onClickMock).toHaveBeenCalledTimes(1);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
test(`Does not call onClick when chip is not clicked for overflow chip`, async () => {
|
|
236
|
+
const user = userEvent.setup();
|
|
237
|
+
const onClickMock = jest.fn();
|
|
238
|
+
|
|
239
|
+
render(
|
|
240
|
+
<>
|
|
241
|
+
<Chip isOverflowChip component="button" onClick={onClickMock}>
|
|
242
|
+
Chip text
|
|
243
|
+
</Chip>
|
|
244
|
+
<button>Test clicker</button>
|
|
245
|
+
</>
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
await user.click(screen.getByRole('button', { name: 'Test clicker' }));
|
|
249
|
+
|
|
250
|
+
expect(onClickMock).not.toHaveBeenCalled();
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
test('Passes position to Tooltip', () => {
|
|
254
|
+
Object.defineProperty(HTMLElement.prototype, 'scrollWidth', { configurable: true, value: 500 });
|
|
255
|
+
render(<Chip tooltipPosition="bottom">Test chip text</Chip>);
|
|
256
|
+
|
|
257
|
+
expect(screen.getByText('position: bottom')).toBeVisible();
|
|
258
|
+
Object.defineProperty(HTMLElement.prototype, 'scrollWidth', { configurable: true, value: 0 });
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
test('Passes content to Tooltip', () => {
|
|
262
|
+
Object.defineProperty(HTMLElement.prototype, 'scrollWidth', { configurable: true, value: 500 });
|
|
263
|
+
render(<Chip>Test chip text</Chip>);
|
|
264
|
+
|
|
265
|
+
expect(screen.getByText(`content: Test chip text`)).toBeVisible();
|
|
266
|
+
Object.defineProperty(HTMLElement.prototype, 'scrollWidth', { configurable: true, value: 0 });
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
test('Matches snapshot', () => {
|
|
270
|
+
const { asFragment } = render(
|
|
271
|
+
<Chip id="snapshot-test" ouiaId="snapshot-test">
|
|
272
|
+
Chip text
|
|
273
|
+
</Chip>
|
|
274
|
+
);
|
|
275
|
+
expect(asFragment()).toMatchSnapshot();
|
|
276
|
+
});
|