@patternfly/react-core 5.3.0-prerelease.9 → 5.3.0
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 +99 -0
- package/README.md +1 -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/DualListSelector/package.json +1 -1
- package/dist/dynamic/next/components/Modal/package.json +1 -1
- package/dist/dynamic/next/components/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +30 -12
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/esm/components/Card/Card.d.ts +13 -5
- package/dist/esm/components/Card/Card.d.ts.map +1 -1
- package/dist/esm/components/Card/Card.js +7 -3
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.d.ts +3 -1
- package/dist/esm/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/esm/components/Card/CardHeader.js +10 -10
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +2 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +10 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.d.ts +4 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js +4 -3
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/Label/Label.d.ts +2 -0
- package/dist/esm/components/Label/Label.d.ts.map +1 -1
- package/dist/esm/components/Label/Label.js +9 -8
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts +9 -0
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js +29 -3
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggleCheckbox.js +2 -2
- package/dist/esm/components/MenuToggle/MenuToggleCheckbox.js.map +1 -1
- package/dist/esm/components/TextArea/TextArea.d.ts +0 -4
- package/dist/esm/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/esm/components/TextArea/TextArea.js.map +1 -1
- package/dist/esm/helpers/GenerateId/GenerateId.d.ts +5 -1
- package/dist/esm/helpers/GenerateId/GenerateId.d.ts.map +1 -1
- package/dist/esm/helpers/GenerateId/GenerateId.js +14 -2
- package/dist/esm/helpers/GenerateId/GenerateId.js.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +30 -12
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/Card/Card.d.ts +13 -5
- package/dist/js/components/Card/Card.d.ts.map +1 -1
- package/dist/js/components/Card/Card.js +7 -3
- package/dist/js/components/Card/Card.js.map +1 -1
- package/dist/js/components/Card/CardHeader.d.ts +3 -1
- package/dist/js/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/js/components/Card/CardHeader.js +10 -10
- package/dist/js/components/Card/CardHeader.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +2 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +10 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +4 -0
- package/dist/js/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.js +4 -3
- package/dist/js/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/components/Label/Label.d.ts +2 -0
- package/dist/js/components/Label/Label.d.ts.map +1 -1
- package/dist/js/components/Label/Label.js +9 -8
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts +9 -0
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js +30 -4
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggleCheckbox.js +2 -2
- package/dist/js/components/MenuToggle/MenuToggleCheckbox.js.map +1 -1
- package/dist/js/components/TextArea/TextArea.d.ts +0 -4
- package/dist/js/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/js/components/TextArea/TextArea.js.map +1 -1
- package/dist/js/helpers/GenerateId/GenerateId.d.ts +5 -1
- package/dist/js/helpers/GenerateId/GenerateId.d.ts.map +1 -1
- package/dist/js/helpers/GenerateId/GenerateId.js +14 -2
- package/dist/js/helpers/GenerateId/GenerateId.js.map +1 -1
- 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 +6 -6
- package/src/components/CalendarMonth/CalendarMonth.tsx +38 -13
- package/src/components/Card/Card.tsx +24 -7
- package/src/components/Card/CardHeader.tsx +11 -10
- package/src/components/Card/examples/Card.md +11 -9
- package/src/components/Card/examples/CardClickableSelectable.tsx +11 -8
- package/src/components/Card/examples/CardSelectable.tsx +3 -6
- package/src/components/Card/examples/CardSingleSelectable.tsx +14 -6
- package/src/components/Chip/__tests__/ChipGroup.test.tsx +3 -1
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +17 -3
- package/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx +2 -0
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopy.test.tsx.snap +1 -1
- package/src/components/DragDrop/examples/DragDrop.md +1 -0
- package/src/components/Drawer/__tests__/Drawer.test.tsx +2 -0
- package/src/components/Drawer/__tests__/DrawerPanelContent.test.tsx +2 -0
- package/src/components/Drawer/__tests__/Generated/DrawerPanelContent.test.tsx +2 -0
- package/src/components/Drawer/__tests__/Generated/__snapshots__/DrawerPanelContent.test.tsx.snap +1 -1
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap +8 -8
- package/src/components/Dropdown/Dropdown.tsx +12 -2
- package/src/components/Form/__tests__/FormFieldGroup.test.tsx +2 -0
- package/src/components/Form/__tests__/FormSection.test.tsx +2 -0
- package/src/components/Form/__tests__/__snapshots__/FormFieldGroup.test.tsx.snap +2 -2
- package/src/components/Form/__tests__/__snapshots__/FormSection.test.tsx.snap +2 -2
- package/src/components/Label/Label.tsx +16 -5
- package/src/components/Label/__tests__/LabelGroup.test.tsx +2 -0
- package/src/components/Label/__tests__/__snapshots__/LabelGroup.test.tsx.snap +8 -8
- package/src/components/Label/examples/LabelCompact.tsx +19 -1
- package/src/components/Label/examples/LabelFilled.tsx +106 -16
- package/src/components/Label/examples/LabelOutline.tsx +168 -16
- package/src/components/MenuToggle/MenuToggle.tsx +35 -0
- package/src/components/MenuToggle/MenuToggleCheckbox.tsx +2 -2
- package/src/components/MenuToggle/__tests__/MenuToggle.test.tsx +15 -0
- package/src/components/MenuToggle/examples/MenuToggle.md +39 -14
- package/src/components/MenuToggle/examples/MenuToggleSplitButtonCheckboxWithToggleText.tsx +51 -0
- package/src/components/MenuToggle/examples/MenuToggleStatus.tsx +20 -0
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUpload.test.tsx +2 -0
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatus.test.tsx +2 -0
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatus.test.tsx.snap +16 -16
- package/src/components/SearchInput/__tests__/SearchInput.test.tsx +1 -0
- package/src/components/SearchInput/__tests__/__snapshots__/SearchInput.test.tsx.snap +2 -2
- package/src/components/Select/examples/Select.md +30 -11
- package/src/components/Select/examples/SelectMultiTypeaheadCheckbox.tsx +6 -1
- package/src/components/Select/examples/SelectValidated.tsx +74 -0
- package/src/components/Tabs/__tests__/Tabs.test.tsx +2 -0
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +3 -3
- package/src/components/TextArea/TextArea.tsx +0 -4
- package/src/components/Toolbar/__tests__/Toolbar.test.tsx +2 -0
- package/src/components/Toolbar/__tests__/__snapshots__/Toolbar.test.tsx.snap +11 -11
- package/src/demos/AlertGroup.md +2 -0
- package/src/demos/BackToTop.md +1 -0
- package/src/demos/Banner.md +5 -4
- package/src/demos/CardView/CardView.md +2 -0
- package/src/demos/CardView/examples/CardView.tsx +1 -1
- package/src/demos/DataList/examples/DataListBasic.tsx +1 -1
- package/src/demos/DataList/examples/DataListExpandableControlInToolbar.tsx +1 -1
- package/src/demos/DataListDemo.md +1 -0
- package/src/demos/Filters/examples/FilterAttributeSearch.tsx +1 -1
- package/src/demos/Filters/examples/FilterCheckboxSelect.tsx +1 -1
- package/src/demos/Filters/examples/FilterFaceted.tsx +1 -1
- package/src/demos/Filters/examples/FilterMixedSelectGroup.tsx +1 -1
- package/src/demos/Filters/examples/FilterSameSelectGroup.tsx +1 -1
- package/src/demos/Filters/examples/FilterSearchInput.tsx +1 -1
- package/src/demos/Filters/examples/FilterSingleSelect.tsx +1 -1
- package/src/demos/JumpLinks.md +2 -1
- package/src/demos/Nav.md +2 -0
- package/src/demos/PrimaryDetail.md +1 -0
- package/src/demos/RTL/RTL.md +1 -1
- package/src/demos/RTL/examples/{PaginatedTable.jsx → PaginatedTable.tsx} +48 -22
- package/src/demos/Tabs.md +5 -2
- package/src/demos/Toolbar.md +1 -0
- package/src/demos/Wizard/WizardDemo.md +1 -0
- package/src/demos/examples/AlertGroup/AlertGroupToastWithNotificationDrawer.tsx +2 -2
- package/src/demos/examples/BackToTop/BackToTopNameDemo.tsx +1 -1
- package/src/demos/examples/Card/CardStatus.tsx +1 -1
- package/src/demos/examples/JumpLinks/JumpLinksWithDrawer.js +1 -1
- package/src/demos/examples/Nav/NavDefault.tsx +2 -2
- package/src/demos/examples/Nav/NavDrilldown.tsx +1 -1
- package/src/demos/examples/Nav/NavExpandable.tsx +2 -2
- package/src/demos/examples/Nav/NavGrouped.tsx +1 -1
- package/src/demos/examples/Nav/NavHorizontal.tsx +1 -1
- package/src/demos/examples/Nav/NavHorizontalWithSubnav.tsx +1 -1
- package/src/demos/examples/Nav/NavWithSubnav.tsx +2 -2
- package/src/demos/examples/Nav/deprecated/NavLight.tsx +1 -1
- package/src/demos/examples/Nav/deprecated/NavTertiary.tsx +2 -2
- package/src/demos/examples/PrimaryDetail/PrimaryDetailCardView.tsx +1 -1
- package/src/demos/examples/PrimaryDetail/PrimaryDetailContentPadding.tsx +1 -1
- package/src/demos/examples/PrimaryDetail/PrimaryDetailDataListInCard.tsx +1 -1
- package/src/demos/examples/PrimaryDetail/PrimaryDetailFullPage.tsx +1 -1
- package/src/demos/examples/PrimaryDetail/PrimaryDetailInlineModifier.tsx +1 -1
- package/src/demos/examples/PrimaryDetail/PrimaryDetailSimpleListInCard.tsx +1 -1
- package/src/demos/examples/Tabs/ModalTabs.tsx +1 -1
- package/src/demos/examples/Tabs/NestedTabs.tsx +1 -1
- package/src/demos/examples/Tabs/NestedUnindentedTabs.tsx +1 -1
- package/src/demos/examples/Tabs/TabsAndTable.tsx +2 -2
- package/src/demos/examples/Toolbar/ConsoleLogViewerToolbar.tsx +1 -1
- package/src/demos/examples/Wizard/InModal.tsx +1 -1
- package/src/demos/examples/Wizard/InPage.tsx +1 -1
- package/src/deprecated/components/Select/__tests__/Select.test.tsx +2 -0
- package/src/deprecated/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +25 -25
- package/src/helpers/GenerateId/GenerateId.ts +17 -3
- package/src/helpers/GenerateId/__mocks__/GenerateId.ts +11 -0
- package/src/helpers/GenerateId/__tests__/GenerateId.test.tsx +3 -1
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"5.3.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"5.3.0-prerelease.26","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"5.3.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"5.3.0-prerelease.26","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"5.3.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"5.3.0-prerelease.26","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "5.3.0
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"clean:exports": "node scripts/cleanDistExports.js"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@patternfly/react-icons": "^5.3.0
|
|
50
|
-
"@patternfly/react-styles": "^5.3.0
|
|
51
|
-
"@patternfly/react-tokens": "^5.3.0
|
|
49
|
+
"@patternfly/react-icons": "^5.3.0",
|
|
50
|
+
"@patternfly/react-styles": "^5.3.0",
|
|
51
|
+
"@patternfly/react-tokens": "^5.3.0",
|
|
52
52
|
"focus-trap": "7.5.2",
|
|
53
53
|
"react-dropzone": "^14.2.3",
|
|
54
54
|
"tslib": "^2.5.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@patternfly/patternfly": "5.
|
|
57
|
+
"@patternfly/patternfly": "5.3.0-prerelease.5",
|
|
58
58
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
59
59
|
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
60
60
|
"@rollup/plugin-replace": "^5.0.2",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"react": "^17 || ^18",
|
|
73
73
|
"react-dom": "^17 || ^18"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "87cf08d11f9da9abc85b554b4e6766f86b424904"
|
|
76
76
|
}
|
|
@@ -83,9 +83,6 @@ export interface CalendarProps extends CalendarFormat, Omit<React.HTMLProps<HTML
|
|
|
83
83
|
validators?: ((date: Date) => boolean)[];
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// Must be numeric given current header design
|
|
87
|
-
const yearFormat = (date: Date) => date.getFullYear();
|
|
88
|
-
|
|
89
86
|
const buildCalendar = (year: number, month: number, weekStart: number, validators: ((date: Date) => boolean)[]) => {
|
|
90
87
|
const defaultDate = new Date(year, month);
|
|
91
88
|
|
|
@@ -164,6 +161,13 @@ export const CalendarMonth = ({
|
|
|
164
161
|
};
|
|
165
162
|
const initialDate = getInitialDate();
|
|
166
163
|
const [focusedDate, setFocusedDate] = React.useState(initialDate);
|
|
164
|
+
|
|
165
|
+
// Must be numeric given current header design
|
|
166
|
+
const yearFormat = (date: Date) => date.getFullYear();
|
|
167
|
+
//
|
|
168
|
+
const yearFormatted = yearFormat(focusedDate);
|
|
169
|
+
const [yearInput, setYearInput] = React.useState(yearFormatted.toString());
|
|
170
|
+
|
|
167
171
|
const [hoveredDate, setHoveredDate] = React.useState(new Date(focusedDate));
|
|
168
172
|
const focusRef = React.useRef<HTMLButtonElement>();
|
|
169
173
|
const [hiddenMonthId] = React.useState(getUniqueId('hidden-month-span'));
|
|
@@ -191,6 +195,7 @@ export const CalendarMonth = ({
|
|
|
191
195
|
setHoveredDate(newDate);
|
|
192
196
|
setShouldFocus(false);
|
|
193
197
|
onMonthChange(ev, newDate);
|
|
198
|
+
setYearInput(yearFormat(newDate).toString());
|
|
194
199
|
};
|
|
195
200
|
|
|
196
201
|
const onKeyDown = (ev: React.KeyboardEvent<HTMLTableSectionElement>) => {
|
|
@@ -217,6 +222,34 @@ export const CalendarMonth = ({
|
|
|
217
222
|
const changeMonth = (newMonth: number, newYear?: number) =>
|
|
218
223
|
new Date(newYear ?? focusedDate.getFullYear(), newMonth, 1);
|
|
219
224
|
|
|
225
|
+
const MIN_YEAR = 1900;
|
|
226
|
+
const MAX_YEAR = 2100;
|
|
227
|
+
|
|
228
|
+
const handleYearInputChange = (event: React.FormEvent<HTMLInputElement>, yearStr: string) => {
|
|
229
|
+
if (!/^\d{0,4}$/.test(yearStr)) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
setYearInput(yearStr);
|
|
234
|
+
|
|
235
|
+
if (yearStr.length === 4) {
|
|
236
|
+
const yearNum = Number(yearStr);
|
|
237
|
+
|
|
238
|
+
if (yearNum >= MIN_YEAR && yearNum <= MAX_YEAR) {
|
|
239
|
+
const newDate = changeYear(yearNum);
|
|
240
|
+
setFocusedDate(newDate);
|
|
241
|
+
setHoveredDate(newDate);
|
|
242
|
+
setShouldFocus(false);
|
|
243
|
+
|
|
244
|
+
// We need to manually focus the year input in FireFox when the scroll buttons are clicked, as FireFox doesn't place focus automatically
|
|
245
|
+
(event.target as HTMLElement).focus();
|
|
246
|
+
onMonthChange(event, newDate);
|
|
247
|
+
} else {
|
|
248
|
+
setYearInput(yearFormatted.toString());
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
|
|
220
253
|
const addMonth = (toAdd: -1 | 1) => {
|
|
221
254
|
let newMonth = focusedDate.getMonth() + toAdd;
|
|
222
255
|
let newYear = focusedDate.getFullYear();
|
|
@@ -254,7 +287,6 @@ export const CalendarMonth = ({
|
|
|
254
287
|
}
|
|
255
288
|
const isHoveredDateValid = isValidated(hoveredDate);
|
|
256
289
|
const monthFormatted = monthFormat(focusedDate);
|
|
257
|
-
const yearFormatted = yearFormat(focusedDate);
|
|
258
290
|
|
|
259
291
|
const calendarToRender = (
|
|
260
292
|
<div className={css(styles.calendarMonth, className)} {...props}>
|
|
@@ -321,15 +353,8 @@ export const CalendarMonth = ({
|
|
|
321
353
|
<TextInput
|
|
322
354
|
aria-label={yearInputAriaLabel}
|
|
323
355
|
type="number"
|
|
324
|
-
value={
|
|
325
|
-
onChange={
|
|
326
|
-
const newDate = changeYear(Number(year));
|
|
327
|
-
setFocusedDate(newDate);
|
|
328
|
-
setHoveredDate(newDate);
|
|
329
|
-
setShouldFocus(false);
|
|
330
|
-
focusRef.current?.blur(); // will unfocus a date when changing year via up/down arrows
|
|
331
|
-
onMonthChange(ev, newDate);
|
|
332
|
-
}}
|
|
356
|
+
value={yearInput}
|
|
357
|
+
onChange={handleYearInputChange}
|
|
333
358
|
/>
|
|
334
359
|
</div>
|
|
335
360
|
</InputGroupItem>
|
|
@@ -14,15 +14,21 @@ export interface CardProps extends React.HTMLProps<HTMLElement>, OUIAProps {
|
|
|
14
14
|
component?: keyof JSX.IntrinsicElements;
|
|
15
15
|
/** Modifies the card to include compact styling. Should not be used with isLarge. */
|
|
16
16
|
isCompact?: boolean;
|
|
17
|
-
/**
|
|
17
|
+
/** Flag indicating that the card is selectable. */
|
|
18
18
|
isSelectable?: boolean;
|
|
19
19
|
/** @deprecated Specifies the card is selectable, and applies raised styling on hover and select */
|
|
20
20
|
isSelectableRaised?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
isSelected?: boolean;
|
|
23
|
-
/** Modifies the card to include clickable styling */
|
|
21
|
+
/** Flag indicating that the card is clickable and contains some action that triggers on click. */
|
|
24
22
|
isClickable?: boolean;
|
|
25
|
-
/**
|
|
23
|
+
/** Flag indicating whether a card that is either selectable only or both clickable and selectable is
|
|
24
|
+
* currently selected and has selected styling.
|
|
25
|
+
*/
|
|
26
|
+
isSelected?: boolean;
|
|
27
|
+
/** Flag indicating whether a card that is either only clickable or that is both clickable and selectable
|
|
28
|
+
* is currently clicked and has clicked styling.
|
|
29
|
+
*/
|
|
30
|
+
isClicked?: boolean;
|
|
31
|
+
/** Flag indicating that a clickable or selectable card is disabled. */
|
|
26
32
|
isDisabled?: boolean;
|
|
27
33
|
/** @deprecated Modifies a raised selectable card to have disabled styling */
|
|
28
34
|
isDisabledRaised?: boolean;
|
|
@@ -56,6 +62,8 @@ interface CardContextProps {
|
|
|
56
62
|
isExpanded: boolean;
|
|
57
63
|
isClickable: boolean;
|
|
58
64
|
isSelectable: boolean;
|
|
65
|
+
isSelected: boolean;
|
|
66
|
+
isClicked: boolean;
|
|
59
67
|
isDisabled: boolean;
|
|
60
68
|
// TODO: Remove hasSelectableInput when deprecated prop is removed
|
|
61
69
|
hasSelectableInput: boolean;
|
|
@@ -72,6 +80,8 @@ export const CardContext = React.createContext<Partial<CardContextProps>>({
|
|
|
72
80
|
isExpanded: false,
|
|
73
81
|
isClickable: false,
|
|
74
82
|
isSelectable: false,
|
|
83
|
+
isSelected: false,
|
|
84
|
+
isClicked: false,
|
|
75
85
|
isDisabled: false
|
|
76
86
|
});
|
|
77
87
|
|
|
@@ -86,6 +96,7 @@ export const Card: React.FunctionComponent<CardProps> = ({
|
|
|
86
96
|
isDisabled = false,
|
|
87
97
|
isSelectableRaised = false,
|
|
88
98
|
isSelected = false,
|
|
99
|
+
isClicked = false,
|
|
89
100
|
isDisabledRaised = false,
|
|
90
101
|
isFlat = false,
|
|
91
102
|
isExpanded = false,
|
|
@@ -119,7 +130,11 @@ export const Card: React.FunctionComponent<CardProps> = ({
|
|
|
119
130
|
return css(styles.modifiers.selectableRaised, isSelected && styles.modifiers.selectedRaised);
|
|
120
131
|
}
|
|
121
132
|
if (isSelectable && isClickable) {
|
|
122
|
-
return css(
|
|
133
|
+
return css(
|
|
134
|
+
styles.modifiers.selectable,
|
|
135
|
+
styles.modifiers.clickable,
|
|
136
|
+
(isSelected || isClicked) && styles.modifiers.current
|
|
137
|
+
);
|
|
123
138
|
}
|
|
124
139
|
|
|
125
140
|
if (isSelectable) {
|
|
@@ -127,7 +142,7 @@ export const Card: React.FunctionComponent<CardProps> = ({
|
|
|
127
142
|
}
|
|
128
143
|
|
|
129
144
|
if (isClickable) {
|
|
130
|
-
return css(styles.modifiers.clickable,
|
|
145
|
+
return css(styles.modifiers.clickable, isClicked && styles.modifiers.current);
|
|
131
146
|
}
|
|
132
147
|
|
|
133
148
|
return '';
|
|
@@ -162,6 +177,8 @@ export const Card: React.FunctionComponent<CardProps> = ({
|
|
|
162
177
|
isExpanded,
|
|
163
178
|
isClickable,
|
|
164
179
|
isSelectable,
|
|
180
|
+
isSelected,
|
|
181
|
+
isClicked,
|
|
165
182
|
isDisabled,
|
|
166
183
|
// TODO: Remove hasSelectableInput when deprecated prop is removed
|
|
167
184
|
hasSelectableInput
|
|
@@ -44,7 +44,9 @@ export interface CardHeaderSelectableActionsObject {
|
|
|
44
44
|
isExternalLink?: boolean;
|
|
45
45
|
/** Name for the input element of a clickable or selectable card. */
|
|
46
46
|
name?: string;
|
|
47
|
-
/** Flag indicating whether the selectable card input is checked
|
|
47
|
+
/** @deprecated Flag indicating whether the selectable card input is checked. We recommend using
|
|
48
|
+
* the isSelected prop on the card component instead.
|
|
49
|
+
*/
|
|
48
50
|
isChecked?: boolean;
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -80,7 +82,7 @@ export const CardHeader: React.FunctionComponent<CardHeaderProps> = ({
|
|
|
80
82
|
}: CardHeaderProps) => (
|
|
81
83
|
<CardContext.Consumer>
|
|
82
84
|
{/* TODO: Remove hasSelectableInput when deprecated props are removed */}
|
|
83
|
-
{({ cardId, isClickable, isSelectable, isDisabled: isCardDisabled, hasSelectableInput }) => {
|
|
85
|
+
{({ cardId, isClickable, isSelectable, isSelected, isClicked, isDisabled: isCardDisabled, hasSelectableInput }) => {
|
|
84
86
|
const cardHeaderToggle = (
|
|
85
87
|
<div className={css(styles.cardHeaderToggle)}>
|
|
86
88
|
<Button
|
|
@@ -112,12 +114,10 @@ export const CardHeader: React.FunctionComponent<CardHeaderProps> = ({
|
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
const handleActionClick = (event: React.FormEvent<HTMLInputElement> | React.MouseEvent) => {
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
window.open(selectableActions.to, selectableActions.isExternalLink ? '_blank' : '_self');
|
|
120
|
-
}
|
|
117
|
+
if (selectableActions?.onClickAction) {
|
|
118
|
+
selectableActions.onClickAction(event);
|
|
119
|
+
} else if (selectableActions?.to) {
|
|
120
|
+
window.open(selectableActions.to, selectableActions.isExternalLink ? '_blank' : '_self');
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
|
|
@@ -132,12 +132,13 @@ export const CardHeader: React.FunctionComponent<CardHeaderProps> = ({
|
|
|
132
132
|
name: selectableActions.name,
|
|
133
133
|
isDisabled: isCardDisabled
|
|
134
134
|
};
|
|
135
|
+
const isSelectableInputChecked = selectableActions.isChecked ?? isSelected;
|
|
135
136
|
|
|
136
137
|
if (isClickable && !isSelectable) {
|
|
137
|
-
return { ...baseProps, onClick: handleActionClick };
|
|
138
|
+
return { ...baseProps, onClick: handleActionClick, isChecked: isClicked };
|
|
138
139
|
}
|
|
139
140
|
if (isSelectable) {
|
|
140
|
-
return { ...baseProps, onChange: selectableActions.onChange, isChecked:
|
|
141
|
+
return { ...baseProps, onChange: selectableActions.onChange, isChecked: isSelectableInputChecked };
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
return baseProps;
|
|
@@ -109,9 +109,9 @@ A common use case of this is to set all but one body section to `isFilled={false
|
|
|
109
109
|
|
|
110
110
|
### Selectable
|
|
111
111
|
|
|
112
|
-
A card can be selected by clicking anywhere within the card.
|
|
112
|
+
A selectable card can be selected by clicking anywhere within the card.
|
|
113
113
|
|
|
114
|
-
You must avoid rendering any other interactive content within the `<Card>` when it is meant to be selectable only. Refer to our [
|
|
114
|
+
You must avoid rendering any other interactive content within the `<Card>` when it is meant to be selectable only. Refer to our [actionable and selectable example](#clickable-and-selectable-cards) if you need a card that is both selectable and has other interactive, actionable content.
|
|
115
115
|
|
|
116
116
|
```ts file='./CardSelectable.tsx'
|
|
117
117
|
|
|
@@ -119,27 +119,29 @@ You must avoid rendering any other interactive content within the `<Card>` when
|
|
|
119
119
|
|
|
120
120
|
### Single selectable
|
|
121
121
|
|
|
122
|
-
When a group of single selectable cards are related, you
|
|
122
|
+
When a group of single selectable cards are related, you must pass the same `name` property to each card's `selectableActions` property.
|
|
123
123
|
|
|
124
124
|
```ts file='./CardSingleSelectable.tsx'
|
|
125
125
|
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
###
|
|
128
|
+
### Actionable
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
An actionable card can perform an action or navigate to a link by clicking anywhere within the card. To open a link in a new tab or window, pass the `isExternalLink` property to `selectableActions`.
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
You can pass the `isClicked` property to `<Card>` to convey that a card is the currently clicked one, such as when clicking a card would open a [primary-detail view](/patterns/primary-detail). This must not be used simply for "selection" of a card, and you should instead use our [selectable card](#selectable) or [single selectable card](#single-selectable).
|
|
133
|
+
|
|
134
|
+
When a card is meant to be actionable only, you must avoid rendering any other interactive content within the `<Card>`, similar to selectable cards.
|
|
133
135
|
|
|
134
136
|
```ts file='./CardClickable.tsx'
|
|
135
137
|
|
|
136
138
|
```
|
|
137
139
|
|
|
138
|
-
###
|
|
140
|
+
### Actionable and selectable
|
|
139
141
|
|
|
140
|
-
A card can be selectable and have additional interactive content by passing both the `isClickable` and `isSelectable` properties to `<Card>`. The following example shows how the
|
|
142
|
+
A card can be selectable and have additional interactive content by passing both the `isClickable` and `isSelectable` properties to `<Card>`. The following example shows how the actionable functionality can be rendered anywhere within a selectable card.
|
|
141
143
|
|
|
142
|
-
When passing interactive content to
|
|
144
|
+
When passing interactive content to an actionable and selectable card that is disabled, you should also ensure the interactive content is disabled as well, if applicable.
|
|
143
145
|
|
|
144
146
|
```ts file='./CardClickableSelectable.tsx'
|
|
145
147
|
|
|
@@ -5,14 +5,14 @@ export const CardClickable: React.FunctionComponent = () => {
|
|
|
5
5
|
const [isChecked1, setIsChecked1] = React.useState(false);
|
|
6
6
|
const [isChecked2, setIsChecked2] = React.useState(false);
|
|
7
7
|
const [isChecked3, setIsChecked3] = React.useState(false);
|
|
8
|
-
const [
|
|
8
|
+
const [isClicked, setIsClicked] = React.useState(false);
|
|
9
9
|
|
|
10
10
|
const id1 = 'clickable-selectable-card-input-1';
|
|
11
11
|
const id2 = 'clickable-selectable-card-input-2';
|
|
12
12
|
const id3 = 'clickable-selectable-card-input-3';
|
|
13
13
|
|
|
14
14
|
const onClick = () => {
|
|
15
|
-
|
|
15
|
+
setIsClicked((prevState) => !prevState);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const onChange = (event: React.FormEvent<HTMLInputElement>, checked: boolean) => {
|
|
@@ -33,13 +33,18 @@ export const CardClickable: React.FunctionComponent = () => {
|
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<React.Fragment>
|
|
36
|
-
<Card
|
|
36
|
+
<Card
|
|
37
|
+
id="clickable-selectable-card-example-1"
|
|
38
|
+
isClickable
|
|
39
|
+
isClicked={isClicked}
|
|
40
|
+
isSelectable
|
|
41
|
+
isSelected={isChecked1}
|
|
42
|
+
>
|
|
37
43
|
<CardHeader
|
|
38
44
|
selectableActions={{
|
|
39
45
|
selectableActionId: id1,
|
|
40
46
|
selectableActionAriaLabelledby: 'clickable-selectable-card-example-1',
|
|
41
47
|
name: id1,
|
|
42
|
-
isChecked: isChecked1,
|
|
43
48
|
onChange
|
|
44
49
|
}}
|
|
45
50
|
>
|
|
@@ -51,13 +56,12 @@ export const CardClickable: React.FunctionComponent = () => {
|
|
|
51
56
|
</CardHeader>
|
|
52
57
|
<CardBody>This card performs an action upon clicking the card title and is selectable.</CardBody>
|
|
53
58
|
</Card>
|
|
54
|
-
<Card id="clickable-selectable-card-example-2" isClickable isSelectable>
|
|
59
|
+
<Card id="clickable-selectable-card-example-2" isClickable isSelectable isSelected={isChecked2}>
|
|
55
60
|
<CardHeader
|
|
56
61
|
selectableActions={{
|
|
57
62
|
selectableActionId: id2,
|
|
58
63
|
selectableActionAriaLabelledby: 'clickable-selectable-card-example-2',
|
|
59
64
|
name: id2,
|
|
60
|
-
isChecked: isChecked2,
|
|
61
65
|
onChange
|
|
62
66
|
}}
|
|
63
67
|
>
|
|
@@ -71,13 +75,12 @@ export const CardClickable: React.FunctionComponent = () => {
|
|
|
71
75
|
.
|
|
72
76
|
</CardBody>
|
|
73
77
|
</Card>
|
|
74
|
-
<Card id="clickable-selectable-card-example-3" isClickable isSelectable isDisabled>
|
|
78
|
+
<Card id="clickable-selectable-card-example-3" isClickable isSelectable isDisabled isSelected={isChecked3}>
|
|
75
79
|
<CardHeader
|
|
76
80
|
selectableActions={{
|
|
77
81
|
selectableActionId: id3,
|
|
78
82
|
selectableActionAriaLabelledby: 'clickable-selectable-card-example-3',
|
|
79
83
|
name: id3,
|
|
80
|
-
isChecked: isChecked3,
|
|
81
84
|
onChange
|
|
82
85
|
}}
|
|
83
86
|
>
|
|
@@ -28,13 +28,12 @@ export const SelectableCard: React.FunctionComponent = () => {
|
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<React.Fragment>
|
|
31
|
-
<Card id="selectable-card-example-1" isSelectable>
|
|
31
|
+
<Card id="selectable-card-example-1" isSelectable isSelected={isChecked1}>
|
|
32
32
|
<CardHeader
|
|
33
33
|
selectableActions={{
|
|
34
34
|
selectableActionId: id1,
|
|
35
35
|
selectableActionAriaLabelledby: 'selectable-card-example-1',
|
|
36
36
|
name: id1,
|
|
37
|
-
isChecked: isChecked1,
|
|
38
37
|
onChange
|
|
39
38
|
}}
|
|
40
39
|
>
|
|
@@ -42,13 +41,12 @@ export const SelectableCard: React.FunctionComponent = () => {
|
|
|
42
41
|
</CardHeader>
|
|
43
42
|
<CardBody>This card is selectable.</CardBody>
|
|
44
43
|
</Card>
|
|
45
|
-
<Card id="selectable-card-example-2" isSelectable>
|
|
44
|
+
<Card id="selectable-card-example-2" isSelectable isSelected={isChecked2}>
|
|
46
45
|
<CardHeader
|
|
47
46
|
selectableActions={{
|
|
48
47
|
selectableActionId: id2,
|
|
49
48
|
selectableActionAriaLabelledby: 'selectable-card-example-2',
|
|
50
49
|
name: id2,
|
|
51
|
-
isChecked: isChecked2,
|
|
52
50
|
onChange
|
|
53
51
|
}}
|
|
54
52
|
>
|
|
@@ -56,13 +54,12 @@ export const SelectableCard: React.FunctionComponent = () => {
|
|
|
56
54
|
</CardHeader>
|
|
57
55
|
<CardBody>This card is selectable.</CardBody>
|
|
58
56
|
</Card>
|
|
59
|
-
<Card id="selectable-card-example-3" isSelectable isDisabled>
|
|
57
|
+
<Card id="selectable-card-example-3" isSelectable isDisabled isSelected={isChecked3}>
|
|
60
58
|
<CardHeader
|
|
61
59
|
selectableActions={{
|
|
62
60
|
selectableActionId: id3,
|
|
63
61
|
selectableActionAriaLabelledby: 'selectable-card-example-3',
|
|
64
62
|
name: id3,
|
|
65
|
-
isChecked: isChecked3,
|
|
66
63
|
onChange
|
|
67
64
|
}}
|
|
68
65
|
>
|
|
@@ -2,45 +2,53 @@ import React from 'react';
|
|
|
2
2
|
import { Card, CardHeader, CardTitle, CardBody } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const SingleSelectableCard: React.FunctionComponent = () => {
|
|
5
|
+
const [isChecked, setIsChecked] = React.useState('');
|
|
5
6
|
const id1 = 'single-selectable-card-input-1';
|
|
6
7
|
const id2 = 'single-selectable-card-input-2';
|
|
7
8
|
const id3 = 'single-selectable-card-input-3';
|
|
8
9
|
|
|
10
|
+
const onChange = (event: React.FormEvent<HTMLInputElement>) => {
|
|
11
|
+
setIsChecked(event.currentTarget.id);
|
|
12
|
+
};
|
|
13
|
+
|
|
9
14
|
return (
|
|
10
15
|
<React.Fragment>
|
|
11
|
-
<Card id="single-selectable-card-example-1" isSelectable>
|
|
16
|
+
<Card id="single-selectable-card-example-1" isSelectable isSelected={isChecked === id1}>
|
|
12
17
|
<CardHeader
|
|
13
18
|
selectableActions={{
|
|
14
19
|
selectableActionId: id1,
|
|
15
20
|
selectableActionAriaLabelledby: 'single-selectable-card-example-1',
|
|
16
21
|
name: 'single-selectable-card-example',
|
|
17
|
-
variant: 'single'
|
|
22
|
+
variant: 'single',
|
|
23
|
+
onChange
|
|
18
24
|
}}
|
|
19
25
|
>
|
|
20
26
|
<CardTitle>First card</CardTitle>
|
|
21
27
|
</CardHeader>
|
|
22
28
|
<CardBody>This card is single selectable.</CardBody>
|
|
23
29
|
</Card>
|
|
24
|
-
<Card id="single-selectable-card-example-2" isSelectable>
|
|
30
|
+
<Card id="single-selectable-card-example-2" isSelectable isSelected={isChecked === id2}>
|
|
25
31
|
<CardHeader
|
|
26
32
|
selectableActions={{
|
|
27
33
|
selectableActionId: id2,
|
|
28
34
|
selectableActionAriaLabelledby: 'single-selectable-card-example-2',
|
|
29
35
|
name: 'single-selectable-card-example',
|
|
30
|
-
variant: 'single'
|
|
36
|
+
variant: 'single',
|
|
37
|
+
onChange
|
|
31
38
|
}}
|
|
32
39
|
>
|
|
33
40
|
<CardTitle>Second card</CardTitle>
|
|
34
41
|
</CardHeader>
|
|
35
42
|
<CardBody>This card is single selectable.</CardBody>
|
|
36
43
|
</Card>
|
|
37
|
-
<Card id="single-selectable-card-example-3" isSelectable isDisabled>
|
|
44
|
+
<Card id="single-selectable-card-example-3" isSelectable isDisabled isSelected={isChecked === id3}>
|
|
38
45
|
<CardHeader
|
|
39
46
|
selectableActions={{
|
|
40
47
|
selectableActionId: id3,
|
|
41
48
|
selectableActionAriaLabelledby: 'single-selectable-card-example-3',
|
|
42
49
|
name: 'single-selectable-card-example',
|
|
43
|
-
variant: 'single'
|
|
50
|
+
variant: 'single',
|
|
51
|
+
onChange
|
|
44
52
|
}}
|
|
45
53
|
>
|
|
46
54
|
<CardTitle>Third card</CardTitle>
|
|
@@ -7,6 +7,8 @@ import { ChipGroup } from '../index';
|
|
|
7
7
|
import { Chip } from '../../Chip';
|
|
8
8
|
import styles from '@patternfly/react-styles/css/components/Chip/chip-group';
|
|
9
9
|
|
|
10
|
+
jest.mock('../../../helpers/GenerateId/GenerateId');
|
|
11
|
+
|
|
10
12
|
test('chip group default', () => {
|
|
11
13
|
render(
|
|
12
14
|
<ChipGroup>
|
|
@@ -71,7 +73,7 @@ test('chip group has aria-labelledby attribute', () => {
|
|
|
71
73
|
<Chip>1.1</Chip>
|
|
72
74
|
</ChipGroup>
|
|
73
75
|
);
|
|
74
|
-
expect(screen.getByRole('group')).toHaveAttribute('aria-labelledby', expect.stringContaining(`
|
|
76
|
+
expect(screen.getByRole('group')).toHaveAttribute('aria-labelledby', expect.stringContaining(`generated-id`));
|
|
75
77
|
});
|
|
76
78
|
|
|
77
79
|
test('chip group has aria-labelledby attribute set to ID value', () => {
|
|
@@ -10,8 +10,22 @@ import { ClipboardCopyToggle } from './ClipboardCopyToggle';
|
|
|
10
10
|
import { ClipboardCopyExpanded } from './ClipboardCopyExpanded';
|
|
11
11
|
import { getOUIAProps, OUIAProps } from '../../helpers';
|
|
12
12
|
|
|
13
|
-
export const clipboardCopyFunc = (
|
|
14
|
-
|
|
13
|
+
export const clipboardCopyFunc = (_event: React.ClipboardEvent<HTMLDivElement>, text?: React.ReactNode) => {
|
|
14
|
+
try {
|
|
15
|
+
navigator.clipboard.writeText(text.toString());
|
|
16
|
+
} catch (error) {
|
|
17
|
+
// eslint-disable-next-line no-console
|
|
18
|
+
console.warn(
|
|
19
|
+
"Clipboard API not found, this copy function will not work. This is likely because you're using an",
|
|
20
|
+
"unsupported browser or you're not using HTTPS. \n\nIf you're a developer building an application which needs",
|
|
21
|
+
"to support copying to the clipboard without the clipboard API, you'll have to create your own copy",
|
|
22
|
+
'function and pass it to the ClipboardCopy component as the onCopy prop. For more information see',
|
|
23
|
+
'https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard'
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.error(error);
|
|
28
|
+
}
|
|
15
29
|
};
|
|
16
30
|
|
|
17
31
|
export enum ClipboardCopyVariant {
|
|
@@ -70,7 +84,7 @@ export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>
|
|
|
70
84
|
exitDelay?: number;
|
|
71
85
|
/** Delay in ms before the tooltip appears. */
|
|
72
86
|
entryDelay?: number;
|
|
73
|
-
/** A function that is triggered on clicking the copy button. */
|
|
87
|
+
/** A function that is triggered on clicking the copy button. This will replace the existing clipboard copy functionality entirely. */
|
|
74
88
|
onCopy?: (event: React.ClipboardEvent<HTMLDivElement>, text?: React.ReactNode) => void;
|
|
75
89
|
/** A function that is triggered on changing the text. */
|
|
76
90
|
onChange?: (event: React.FormEvent, text?: string) => void;
|
|
@@ -4,6 +4,8 @@ import { ClipboardCopy } from '../ClipboardCopy';
|
|
|
4
4
|
import styles from '@patternfly/react-styles/css/components/ClipboardCopy/clipboard-copy';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
|
|
7
|
+
jest.mock('../../../helpers/GenerateId/GenerateId');
|
|
8
|
+
|
|
7
9
|
jest.mock('../ClipboardCopyButton', () => ({
|
|
8
10
|
ClipboardCopyButton: ({ 'aria-label': ariaLabel, children, entryDelay, exitDelay, maxWidth, position, onClick }) => (
|
|
9
11
|
<div data-testid="clipboardCopyButton-mock">
|
|
@@ -21,7 +21,7 @@ exports[`Matches snapshot 1`] = `
|
|
|
21
21
|
data-ouia-component-id="OUIA-Generated-TextInputBase-26"
|
|
22
22
|
data-ouia-component-type="PF5/TextInput"
|
|
23
23
|
data-ouia-safe="true"
|
|
24
|
-
id="text-input-
|
|
24
|
+
id="text-input-generated-id"
|
|
25
25
|
type="text"
|
|
26
26
|
value="Copyable text"
|
|
27
27
|
/>
|
|
@@ -3,6 +3,7 @@ id: Drag and drop
|
|
|
3
3
|
section: components
|
|
4
4
|
propComponents: [DragDrop, Draggable, Droppable, DraggableItemPosition]
|
|
5
5
|
title: Drag and drop
|
|
6
|
+
deprecated: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
You can use the `<DragDrop>` component to move items in or between lists. The `<DragDrop>` component should contain `<Droppable>` components which contain `<Draggable>` components.
|
|
@@ -14,6 +14,8 @@ import { render } from '@testing-library/react';
|
|
|
14
14
|
import userEvent from '@testing-library/user-event';
|
|
15
15
|
import { KeyTypes } from '../../../helpers';
|
|
16
16
|
|
|
17
|
+
jest.mock('../../../helpers/GenerateId/GenerateId');
|
|
18
|
+
|
|
17
19
|
Object.values([
|
|
18
20
|
{ isExpanded: true, isInline: false, isStatic: false },
|
|
19
21
|
{ isExpanded: false, isInline: false, isStatic: false },
|
|
@@ -3,6 +3,8 @@ import { render, screen } from '@testing-library/react';
|
|
|
3
3
|
import { DrawerPanelContent } from '../DrawerPanelContent';
|
|
4
4
|
import { Drawer } from '../Drawer';
|
|
5
5
|
|
|
6
|
+
jest.mock('../../../helpers/GenerateId/GenerateId');
|
|
7
|
+
|
|
6
8
|
test('Does not render with aria-labelledby by default', () => {
|
|
7
9
|
render(
|
|
8
10
|
<Drawer isExpanded>
|
|
@@ -7,6 +7,8 @@ import { DrawerPanelContent } from '../../DrawerPanelContent';
|
|
|
7
7
|
// any missing imports can usually be resolved by adding them here
|
|
8
8
|
import {} from '../..';
|
|
9
9
|
|
|
10
|
+
jest.mock('../../../../helpers/GenerateId/GenerateId');
|
|
11
|
+
|
|
10
12
|
it('DrawerPanelContent should match snapshot (auto-generated)', () => {
|
|
11
13
|
const { asFragment } = render(<DrawerPanelContent className={"''"} children={<div>ReactNode</div>} />);
|
|
12
14
|
expect(asFragment()).toMatchSnapshot();
|