@patternfly/react-core 6.0.0-alpha.19 → 6.0.0-alpha.20
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 +162 -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/Modal/package.json +1 -0
- package/dist/dynamic/next/components/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -0
- package/dist/esm/components/Accordion/Accordion.d.ts +2 -0
- package/dist/esm/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js +4 -3
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Accordion/AccordionContext.d.ts +1 -0
- package/dist/esm/components/Accordion/AccordionContext.d.ts.map +1 -1
- package/dist/esm/components/Accordion/AccordionContext.js.map +1 -1
- package/dist/esm/components/Accordion/AccordionToggle.d.ts.map +1 -1
- package/dist/esm/components/Accordion/AccordionToggle.js +7 -4
- package/dist/esm/components/Accordion/AccordionToggle.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.d.ts +9 -3
- package/dist/esm/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +16 -8
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
- package/dist/esm/components/Chip/Chip.js +3 -1
- package/dist/esm/components/Chip/Chip.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +2 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/esm/components/DragDrop/index.d.ts +1 -0
- package/dist/esm/components/DragDrop/index.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/index.js +1 -0
- package/dist/esm/components/DragDrop/index.js.map +1 -1
- package/dist/esm/components/Dropdown/DropdownItem.d.ts +1 -1
- package/dist/esm/components/DualListSelector/index.d.ts +2 -0
- package/dist/esm/components/DualListSelector/index.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/index.js +2 -0
- package/dist/esm/components/DualListSelector/index.js.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.d.ts +2 -0
- package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.js +3 -3
- package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +4 -4
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Radio/Radio.d.ts +7 -5
- package/dist/esm/components/Radio/Radio.d.ts.map +1 -1
- package/dist/esm/components/Radio/Radio.js +13 -20
- package/dist/esm/components/Radio/Radio.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.js +1 -4
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.js +1 -3
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts +2 -3
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.js +1 -4
- package/dist/esm/components/Toolbar/ToolbarGroup.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts +1 -13
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarItem.js +2 -20
- package/dist/esm/components/Toolbar/ToolbarItem.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.js +1 -3
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -1
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/next/components/Modal/Modal.d.ts +73 -0
- package/dist/esm/next/components/Modal/Modal.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/Modal.js +114 -0
- package/dist/esm/next/components/Modal/Modal.js.map +1 -0
- package/dist/esm/next/components/Modal/ModalBody.d.ts +19 -0
- package/dist/esm/next/components/Modal/ModalBody.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/ModalBody.js +11 -0
- package/dist/esm/next/components/Modal/ModalBody.js.map +1 -0
- package/dist/esm/next/components/Modal/ModalBox.d.ts +21 -0
- package/dist/esm/next/components/Modal/ModalBox.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/ModalBox.js +15 -0
- package/dist/esm/next/components/Modal/ModalBox.js.map +1 -0
- package/dist/esm/next/components/Modal/ModalBoxCloseButton.d.ts +14 -0
- package/dist/esm/next/components/Modal/ModalBoxCloseButton.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/ModalBoxCloseButton.js +14 -0
- package/dist/esm/next/components/Modal/ModalBoxCloseButton.js.map +1 -0
- package/dist/esm/next/components/Modal/ModalBoxDescription.d.ts +11 -0
- package/dist/esm/next/components/Modal/ModalBoxDescription.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/ModalBoxDescription.js +10 -0
- package/dist/esm/next/components/Modal/ModalBoxDescription.js.map +1 -0
- package/dist/esm/next/components/Modal/ModalBoxTitle.d.ts +17 -0
- package/dist/esm/next/components/Modal/ModalBoxTitle.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/ModalBoxTitle.js +38 -0
- package/dist/esm/next/components/Modal/ModalBoxTitle.js.map +1 -0
- package/dist/esm/next/components/Modal/ModalContent.d.ts +42 -0
- package/dist/esm/next/components/Modal/ModalContent.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/ModalContent.js +45 -0
- package/dist/esm/next/components/Modal/ModalContent.js.map +1 -0
- package/dist/esm/next/components/Modal/ModalFooter.d.ts +10 -0
- package/dist/esm/next/components/Modal/ModalFooter.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/ModalFooter.js +10 -0
- package/dist/esm/next/components/Modal/ModalFooter.js.map +1 -0
- package/dist/esm/next/components/Modal/ModalHeader.d.ts +25 -0
- package/dist/esm/next/components/Modal/ModalHeader.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/ModalHeader.js +21 -0
- package/dist/esm/next/components/Modal/ModalHeader.js.map +1 -0
- package/dist/esm/next/components/Modal/index.d.ts +5 -0
- package/dist/esm/next/components/Modal/index.d.ts.map +1 -0
- package/dist/esm/next/components/Modal/index.js +5 -0
- package/dist/esm/next/components/Modal/index.js.map +1 -0
- package/dist/esm/next/components/index.d.ts +1 -1
- package/dist/esm/next/components/index.d.ts.map +1 -1
- package/dist/esm/next/components/index.js +1 -1
- package/dist/esm/next/components/index.js.map +1 -1
- package/dist/esm/styles/index.d.ts +2 -0
- package/dist/esm/styles/index.d.ts.map +1 -0
- package/dist/esm/styles/index.js +2 -0
- package/dist/esm/styles/index.js.map +1 -0
- package/dist/js/components/Accordion/Accordion.d.ts +2 -0
- package/dist/js/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/js/components/Accordion/Accordion.js +4 -3
- package/dist/js/components/Accordion/Accordion.js.map +1 -1
- package/dist/js/components/Accordion/AccordionContext.d.ts +1 -0
- package/dist/js/components/Accordion/AccordionContext.d.ts.map +1 -1
- package/dist/js/components/Accordion/AccordionContext.js.map +1 -1
- package/dist/js/components/Accordion/AccordionToggle.d.ts.map +1 -1
- package/dist/js/components/Accordion/AccordionToggle.js +7 -4
- package/dist/js/components/Accordion/AccordionToggle.js.map +1 -1
- package/dist/js/components/Checkbox/Checkbox.d.ts +9 -3
- package/dist/js/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/js/components/Checkbox/Checkbox.js +16 -8
- package/dist/js/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/js/components/Chip/Chip.d.ts.map +1 -1
- package/dist/js/components/Chip/Chip.js +3 -1
- package/dist/js/components/Chip/Chip.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +2 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/js/components/DragDrop/index.d.ts +1 -0
- package/dist/js/components/DragDrop/index.d.ts.map +1 -1
- package/dist/js/components/DragDrop/index.js +1 -0
- package/dist/js/components/DragDrop/index.js.map +1 -1
- package/dist/js/components/Dropdown/DropdownItem.d.ts +1 -1
- package/dist/js/components/DualListSelector/index.d.ts +2 -0
- package/dist/js/components/DualListSelector/index.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/index.js +2 -0
- package/dist/js/components/DualListSelector/index.js.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.d.ts +2 -0
- package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.js +3 -3
- package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/js/components/Popover/Popover.js +4 -4
- package/dist/js/components/Popover/Popover.js.map +1 -1
- package/dist/js/components/Radio/Radio.d.ts +7 -5
- package/dist/js/components/Radio/Radio.d.ts.map +1 -1
- package/dist/js/components/Radio/Radio.js +13 -20
- package/dist/js/components/Radio/Radio.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.js +1 -4
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarExpandableContent.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarExpandableContent.js +1 -3
- package/dist/js/components/Toolbar/ToolbarExpandableContent.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts +2 -3
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.js +1 -4
- package/dist/js/components/Toolbar/ToolbarGroup.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarItem.d.ts +1 -13
- package/dist/js/components/Toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarItem.js +2 -20
- package/dist/js/components/Toolbar/ToolbarItem.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.js +1 -3
- package/dist/js/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/js/components/index.d.ts +1 -1
- package/dist/js/components/index.d.ts.map +1 -1
- package/dist/js/components/index.js +1 -1
- package/dist/js/components/index.js.map +1 -1
- package/dist/js/index.d.ts +1 -1
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +1 -4
- package/dist/js/index.js.map +1 -1
- package/dist/js/next/components/Modal/Modal.d.ts +73 -0
- package/dist/js/next/components/Modal/Modal.d.ts.map +1 -0
- package/dist/js/next/components/Modal/Modal.js +117 -0
- package/dist/js/next/components/Modal/Modal.js.map +1 -0
- package/dist/js/next/components/Modal/ModalBody.d.ts +19 -0
- package/dist/js/next/components/Modal/ModalBody.d.ts.map +1 -0
- package/dist/js/next/components/Modal/ModalBody.js +15 -0
- package/dist/js/next/components/Modal/ModalBody.js.map +1 -0
- package/dist/js/next/components/Modal/ModalBox.d.ts +21 -0
- package/dist/js/next/components/Modal/ModalBox.d.ts.map +1 -0
- package/dist/js/next/components/Modal/ModalBox.js +19 -0
- package/dist/js/next/components/Modal/ModalBox.js.map +1 -0
- package/dist/js/next/components/Modal/ModalBoxCloseButton.d.ts +14 -0
- package/dist/js/next/components/Modal/ModalBoxCloseButton.d.ts.map +1 -0
- package/dist/js/next/components/Modal/ModalBoxCloseButton.js +18 -0
- package/dist/js/next/components/Modal/ModalBoxCloseButton.js.map +1 -0
- package/dist/js/next/components/Modal/ModalBoxDescription.d.ts +11 -0
- package/dist/js/next/components/Modal/ModalBoxDescription.d.ts.map +1 -0
- package/dist/js/next/components/Modal/ModalBoxDescription.js +14 -0
- package/dist/js/next/components/Modal/ModalBoxDescription.js.map +1 -0
- package/dist/js/next/components/Modal/ModalBoxTitle.d.ts +17 -0
- package/dist/js/next/components/Modal/ModalBoxTitle.d.ts.map +1 -0
- package/dist/js/next/components/Modal/ModalBoxTitle.js +43 -0
- package/dist/js/next/components/Modal/ModalBoxTitle.js.map +1 -0
- package/dist/js/next/components/Modal/ModalContent.d.ts +42 -0
- package/dist/js/next/components/Modal/ModalContent.d.ts.map +1 -0
- package/dist/js/next/components/Modal/ModalContent.js +49 -0
- package/dist/js/next/components/Modal/ModalContent.js.map +1 -0
- package/dist/js/next/components/Modal/ModalFooter.d.ts +10 -0
- package/dist/js/next/components/Modal/ModalFooter.d.ts.map +1 -0
- package/dist/js/next/components/Modal/ModalFooter.js +14 -0
- package/dist/js/next/components/Modal/ModalFooter.js.map +1 -0
- package/dist/js/next/components/Modal/ModalHeader.d.ts +25 -0
- package/dist/js/next/components/Modal/ModalHeader.d.ts.map +1 -0
- package/dist/js/next/components/Modal/ModalHeader.js +25 -0
- package/dist/js/next/components/Modal/ModalHeader.js.map +1 -0
- package/dist/js/next/components/Modal/index.d.ts +5 -0
- package/dist/js/next/components/Modal/index.d.ts.map +1 -0
- package/dist/js/next/components/Modal/index.js +8 -0
- package/dist/js/next/components/Modal/index.js.map +1 -0
- package/dist/js/next/components/index.d.ts +1 -1
- package/dist/js/next/components/index.d.ts.map +1 -1
- package/dist/js/next/components/index.js +1 -1
- package/dist/js/next/components/index.js.map +1 -1
- package/dist/js/styles/index.d.ts +2 -0
- package/dist/js/styles/index.d.ts.map +1 -0
- package/dist/js/styles/index.js +5 -0
- package/dist/js/styles/index.js.map +1 -0
- 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 +5 -5
- package/single-packages.config.json +4 -4
- package/src/components/Accordion/Accordion.tsx +6 -1
- package/src/components/Accordion/AccordionContext.ts +1 -0
- package/src/components/Accordion/AccordionToggle.tsx +11 -5
- package/src/components/Accordion/__tests__/Accordion.test.tsx +12 -0
- package/src/components/Accordion/__tests__/AccordionToggle.test.tsx +28 -0
- package/src/components/Accordion/examples/Accordion.md +5 -0
- package/src/components/Accordion/examples/AccordionToggleIconAtStart.tsx +102 -0
- package/src/components/Checkbox/Checkbox.tsx +63 -29
- package/src/components/Checkbox/__tests__/Checkbox.test.tsx +41 -0
- package/src/components/Chip/Chip.tsx +2 -0
- package/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap +0 -1
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +2 -1
- package/src/components/DataList/__tests__/__snapshots__/DataListAction.test.tsx.snap~HEAD +11 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListAction.test.tsx.snap~main +11 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListItemCells.test.tsx.snap~HEAD +9 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListItemCells.test.tsx.snap~main +9 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListItemRow.test.tsx.snap~HEAD +9 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListItemRow.test.tsx.snap~main +9 -0
- package/src/components/DataList/examples/DataList.md +2 -2
- package/src/components/DragDrop/examples/DragDrop.md +4 -2
- package/src/components/DragDrop/examples/DragDropBasic.tsx +4 -4
- package/src/components/DragDrop/examples/DragDropMultipleLists.tsx +7 -2
- package/src/components/DragDrop/index.ts +1 -0
- package/src/components/DualListSelector/examples/DualListSelector.md +3 -1
- package/src/components/DualListSelector/index.ts +2 -0
- package/src/components/FileUpload/FileUploadField.tsx +4 -2
- package/src/components/FileUpload/__tests__/__snapshots__/FileUpload.test.tsx.snap +0 -1
- package/src/components/FileUpload/__tests__/__snapshots__/FileUploadField.test.tsx.snap +0 -1
- package/src/components/Popover/Popover.tsx +4 -4
- package/src/components/Radio/Radio.tsx +39 -38
- package/src/components/Radio/__tests__/Radio.test.tsx +41 -0
- package/src/components/Toolbar/ToolbarChipGroupContent.tsx +1 -7
- package/src/components/Toolbar/ToolbarExpandableContent.tsx +0 -1
- package/src/components/Toolbar/ToolbarGroup.tsx +2 -4
- package/src/components/Toolbar/ToolbarItem.tsx +2 -41
- package/src/components/Toolbar/ToolbarToggleGroup.tsx +0 -1
- package/src/components/Toolbar/__tests__/ToolbarItem.test.tsx +0 -14
- package/src/components/Toolbar/examples/Toolbar.md +0 -10
- package/src/components/Toolbar/examples/ToolbarComponentManagedToggleGroups.tsx +1 -1
- package/src/components/Toolbar/examples/ToolbarConsumerManagedToggleGroups.tsx +1 -1
- package/src/components/Toolbar/examples/ToolbarGroups.tsx +1 -1
- package/src/components/Toolbar/examples/ToolbarItems.tsx +1 -1
- package/src/components/Toolbar/examples/ToolbarStacked.tsx +2 -2
- package/src/components/Toolbar/examples/ToolbarWithFilters.tsx +1 -1
- package/src/components/TreeView/examples/TreeViewWithSearch.tsx +1 -1
- package/src/components/index.ts +1 -1
- package/src/demos/CardView/examples/CardView.tsx +2 -2
- package/src/demos/DataList/examples/DataListBasic.tsx +2 -2
- package/src/demos/ExpandableSection/ExpandableSection.md +17 -0
- package/src/demos/ExpandableSection/examples/ExpandableTextDemo.tsx +30 -0
- package/src/demos/Filters/examples/FilterSearchInput.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/next/components/Modal/Modal.tsx +202 -0
- package/src/next/components/Modal/ModalBody.tsx +42 -0
- package/src/next/components/Modal/ModalBox.tsx +63 -0
- package/src/next/components/Modal/ModalBoxCloseButton.tsx +38 -0
- package/src/next/components/Modal/ModalBoxDescription.tsx +24 -0
- package/src/next/components/Modal/ModalBoxTitle.tsx +75 -0
- package/src/next/components/Modal/ModalContent.tsx +131 -0
- package/src/next/components/Modal/ModalFooter.tsx +23 -0
- package/src/next/components/Modal/ModalHeader.tsx +71 -0
- package/src/next/components/Modal/__tests__/Modal.test.tsx +145 -0
- package/src/next/components/Modal/__tests__/ModalBody.test.tsx +60 -0
- package/src/next/components/Modal/__tests__/ModalBox.test.tsx +58 -0
- package/src/next/components/Modal/__tests__/ModalBoxCloseButton.test.tsx +18 -0
- package/src/next/components/Modal/__tests__/ModalBoxDescription.test.tsx +8 -0
- package/src/next/components/Modal/__tests__/ModalBoxHeader.test.tsx +21 -0
- package/src/next/components/Modal/__tests__/ModalBoxTitle.test.tsx +37 -0
- package/src/next/components/Modal/__tests__/ModalContent.test.tsx +46 -0
- package/src/next/components/Modal/__tests__/ModalFooter.test.tsx +8 -0
- package/src/next/components/Modal/__tests__/__snapshots__/ModalBody.test.tsx.snap +12 -0
- package/src/next/components/Modal/__tests__/__snapshots__/ModalBox.test.tsx.snap +86 -0
- package/src/next/components/Modal/__tests__/__snapshots__/ModalBoxDescription.test.tsx.snap +12 -0
- package/src/next/components/Modal/__tests__/__snapshots__/ModalBoxHeader.test.tsx.snap +46 -0
- package/src/next/components/Modal/__tests__/__snapshots__/ModalBoxTitle.test.tsx.snap +218 -0
- package/src/next/components/Modal/__tests__/__snapshots__/ModalContent.test.tsx.snap +128 -0
- package/src/next/components/Modal/__tests__/__snapshots__/ModalFooter.test.tsx.snap +11 -0
- package/src/next/components/Modal/examples/Modal.md +148 -0
- package/src/next/components/Modal/examples/ModalBasic.tsx +43 -0
- package/src/next/components/Modal/examples/ModalCustomFocus.tsx +43 -0
- package/src/next/components/Modal/examples/ModalCustomHeader.tsx +58 -0
- package/src/next/components/Modal/examples/ModalCustomTitleIcon.tsx +54 -0
- package/src/next/components/Modal/examples/ModalCustomWidth.tsx +43 -0
- package/src/next/components/Modal/examples/ModalNoHeaderFooter.tsx +40 -0
- package/src/next/components/Modal/examples/ModalSize.tsx +63 -0
- package/src/next/components/Modal/examples/ModalTitleIcon.tsx +48 -0
- package/src/next/components/Modal/examples/ModalTopAligned.tsx +43 -0
- package/src/next/components/Modal/examples/ModalWithDescription.tsx +80 -0
- package/src/next/components/Modal/examples/ModalWithDropdown.tsx +105 -0
- package/src/next/components/Modal/examples/ModalWithForm.tsx +211 -0
- package/src/next/components/Modal/examples/ModalWithHelp.tsx +63 -0
- package/src/next/components/Modal/examples/ModalWithOverflowingContent.tsx +75 -0
- package/src/next/components/Modal/examples/ModalWithWizard.tsx +59 -0
- package/src/next/components/Modal/index.ts +4 -0
- package/src/next/components/index.ts +1 -1
- package/src/styles/index.ts +1 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.test.tsx.snap +0 -12
- package/src/components/Toolbar/examples/ToolbarWidths.tsx +0 -30
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Expandable section
|
|
3
|
+
section: components
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Demos
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Expandable text with character truncation
|
|
10
|
+
|
|
11
|
+
You can truncate long sections of text and add a "Show more" link that allows users to expand and view the full text content.
|
|
12
|
+
|
|
13
|
+
To specify the number of characters shown prior to truncation, use a `<Truncate>` component and pass a `maxWidth` to the `style` attribute.
|
|
14
|
+
|
|
15
|
+
```ts file='./examples/ExpandableTextDemo.tsx'
|
|
16
|
+
|
|
17
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExpandableSection, ExpandableSectionVariant, Truncate } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ExpandableTextDemo: React.FunctionComponent = () => {
|
|
5
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
6
|
+
|
|
7
|
+
const onToggle = (_event: React.MouseEvent, isExpanded: boolean) => {
|
|
8
|
+
setIsExpanded(isExpanded);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const content = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque nec dignissim turpis, et tristique purus.
|
|
12
|
+
Phasellus efficitur ante quis dolor viverra imperdiet. Orci varius natoque penatibus et magnis dis parturient
|
|
13
|
+
montes, nascetur ridiculus mus. Pellentesque laoreet, sem ac elementum semper, lectus mauris vestibulum nulla,
|
|
14
|
+
eget volutpat massa neque vel turpis. Donec finibus enim eu leo accumsan consectetur. Praesent massa diam,
|
|
15
|
+
tincidunt eu dui ac, ullamcorper elementum est. Phasellus metus felis, venenatis vitae semper nec, porta a metus.
|
|
16
|
+
Vestibulum justo nisi, imperdiet id eleifend at, varius nec lorem. Fusce porttitor mollis nibh, ut elementum ante
|
|
17
|
+
commodo tincidunt. Integer tincidunt at ipsum non aliquet.`;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<ExpandableSection
|
|
21
|
+
variant={ExpandableSectionVariant.truncate}
|
|
22
|
+
toggleText={isExpanded ? 'Show less' : 'Show more'}
|
|
23
|
+
onToggle={onToggle}
|
|
24
|
+
isExpanded={isExpanded}
|
|
25
|
+
truncateMaxLines={-1}
|
|
26
|
+
>
|
|
27
|
+
{isExpanded ? content : <Truncate content={content} style={{ maxWidth: '10ch' }} />}
|
|
28
|
+
</ExpandableSection>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -265,7 +265,7 @@ export const FilterSearchInput: React.FunctionComponent = () => {
|
|
|
265
265
|
<Toolbar id="search-input-filter-toolbar">
|
|
266
266
|
<ToolbarContent>
|
|
267
267
|
<ToolbarItem>{toolbarBulkSelect}</ToolbarItem>
|
|
268
|
-
<ToolbarItem
|
|
268
|
+
<ToolbarItem>{searchInput}</ToolbarItem>
|
|
269
269
|
<ToolbarItem variant="pagination">{toolbarPagination}</ToolbarItem>
|
|
270
270
|
</ToolbarContent>
|
|
271
271
|
</Toolbar>
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ReactDOM from 'react-dom';
|
|
3
|
+
import { canUseDOM, KeyTypes, PickOptional } from '../../../helpers';
|
|
4
|
+
import { css } from '@patternfly/react-styles';
|
|
5
|
+
import styles from '@patternfly/react-styles/css/components/Backdrop/backdrop';
|
|
6
|
+
import { ModalContent } from './ModalContent';
|
|
7
|
+
import { OUIAProps, getDefaultOUIAId } from '../../../helpers';
|
|
8
|
+
|
|
9
|
+
export interface ModalProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
|
|
10
|
+
/** The parent container to append the modal to. Defaults to "document.body". */
|
|
11
|
+
appendTo?: HTMLElement | (() => HTMLElement);
|
|
12
|
+
/** Id to use for the modal box description. This should match the ModalHeader labelId or descriptorId. */
|
|
13
|
+
'aria-describedby'?: string;
|
|
14
|
+
/** Adds an accessible name to the modal when there is no title in the ModalHeader. */
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
/** Id to use for the modal box label. This should include the ModalHeader labelId. */
|
|
17
|
+
'aria-labelledby'?: string;
|
|
18
|
+
/** Content rendered inside the modal. */
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
/** Additional classes added to the modal. */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Flag to disable focus trap. */
|
|
23
|
+
disableFocusTrap?: boolean;
|
|
24
|
+
/** The element to focus when the modal opens. By default the first
|
|
25
|
+
* focusable element will receive focus.
|
|
26
|
+
*/
|
|
27
|
+
elementToFocus?: HTMLElement | SVGElement | string;
|
|
28
|
+
/** An id to use for the modal box container. */
|
|
29
|
+
id?: string;
|
|
30
|
+
/** Flag to show the modal. */
|
|
31
|
+
isOpen?: boolean;
|
|
32
|
+
/** Add callback for when the close button is clicked. This prop needs to be passed to render the close button */
|
|
33
|
+
onClose?: (event: KeyboardEvent | React.MouseEvent) => void;
|
|
34
|
+
/** Modal handles pressing of the escape key and closes the modal. If you want to handle
|
|
35
|
+
* this yourself you can use this callback function. */
|
|
36
|
+
onEscapePress?: (event: KeyboardEvent) => void;
|
|
37
|
+
/** Position of the modal. By default a modal will be positioned vertically and horizontally centered. */
|
|
38
|
+
position?: 'default' | 'top';
|
|
39
|
+
/** Offset from alternate position. Can be any valid CSS length/percentage. */
|
|
40
|
+
positionOffset?: string;
|
|
41
|
+
/** Variant of the modal. */
|
|
42
|
+
variant?: 'small' | 'medium' | 'large' | 'default';
|
|
43
|
+
/** Default width of the modal. */
|
|
44
|
+
width?: number | string;
|
|
45
|
+
/** Maximum width of the modal. */
|
|
46
|
+
maxWidth?: number | string;
|
|
47
|
+
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
48
|
+
ouiaId?: number | string;
|
|
49
|
+
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
50
|
+
ouiaSafe?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export enum ModalVariant {
|
|
54
|
+
small = 'small',
|
|
55
|
+
medium = 'medium',
|
|
56
|
+
large = 'large',
|
|
57
|
+
default = 'default'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface ModalState {
|
|
61
|
+
container: HTMLElement;
|
|
62
|
+
ouiaStateId: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
class Modal extends React.Component<ModalProps, ModalState> {
|
|
66
|
+
static displayName = 'Modal';
|
|
67
|
+
static currentId = 0;
|
|
68
|
+
boxId = '';
|
|
69
|
+
|
|
70
|
+
static defaultProps: PickOptional<ModalProps> = {
|
|
71
|
+
isOpen: false,
|
|
72
|
+
variant: 'default',
|
|
73
|
+
appendTo: () => document.body,
|
|
74
|
+
ouiaSafe: true,
|
|
75
|
+
position: 'default'
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
constructor(props: ModalProps) {
|
|
79
|
+
super(props);
|
|
80
|
+
const boxIdNum = Modal.currentId++;
|
|
81
|
+
this.boxId = props.id || `pf-modal-part-${boxIdNum}`;
|
|
82
|
+
|
|
83
|
+
this.state = {
|
|
84
|
+
container: undefined,
|
|
85
|
+
ouiaStateId: getDefaultOUIAId(Modal.displayName, props.variant)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
handleEscKeyClick = (event: KeyboardEvent): void => {
|
|
90
|
+
const { onEscapePress } = this.props;
|
|
91
|
+
if (event.key === KeyTypes.Escape && this.props.isOpen) {
|
|
92
|
+
onEscapePress ? onEscapePress(event) : this.props.onClose?.(event);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
getElement = (appendTo: HTMLElement | (() => HTMLElement)) => {
|
|
97
|
+
if (typeof appendTo === 'function') {
|
|
98
|
+
return appendTo();
|
|
99
|
+
}
|
|
100
|
+
return appendTo || document.body;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
toggleSiblingsFromScreenReaders = (hide: boolean) => {
|
|
104
|
+
const { appendTo } = this.props;
|
|
105
|
+
const target: HTMLElement = this.getElement(appendTo);
|
|
106
|
+
const bodyChildren = target.children;
|
|
107
|
+
for (const child of Array.from(bodyChildren)) {
|
|
108
|
+
if (child !== this.state.container) {
|
|
109
|
+
hide ? child.setAttribute('aria-hidden', '' + hide) : child.removeAttribute('aria-hidden');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
isEmpty = (value: string | null | undefined) => value === null || value === undefined || value === '';
|
|
115
|
+
|
|
116
|
+
componentDidMount() {
|
|
117
|
+
const {
|
|
118
|
+
appendTo,
|
|
119
|
+
'aria-describedby': ariaDescribedby,
|
|
120
|
+
'aria-label': ariaLabel,
|
|
121
|
+
'aria-labelledby': ariaLabelledby
|
|
122
|
+
} = this.props;
|
|
123
|
+
const target: HTMLElement = this.getElement(appendTo);
|
|
124
|
+
const container = document.createElement('div');
|
|
125
|
+
this.setState({ container });
|
|
126
|
+
target.appendChild(container);
|
|
127
|
+
target.addEventListener('keydown', this.handleEscKeyClick, false);
|
|
128
|
+
|
|
129
|
+
if (this.props.isOpen) {
|
|
130
|
+
target.classList.add(css(styles.backdropOpen));
|
|
131
|
+
} else {
|
|
132
|
+
target.classList.remove(css(styles.backdropOpen));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (!ariaDescribedby && !ariaLabel && !ariaLabelledby) {
|
|
136
|
+
// eslint-disable-next-line no-console
|
|
137
|
+
console.error('Modal: Specify at least one of: aria-describedby, aria-label, aria-labelledby.');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
componentDidUpdate() {
|
|
142
|
+
const { appendTo } = this.props;
|
|
143
|
+
const target: HTMLElement = this.getElement(appendTo);
|
|
144
|
+
if (this.props.isOpen) {
|
|
145
|
+
target.classList.add(css(styles.backdropOpen));
|
|
146
|
+
this.toggleSiblingsFromScreenReaders(true);
|
|
147
|
+
} else {
|
|
148
|
+
target.classList.remove(css(styles.backdropOpen));
|
|
149
|
+
this.toggleSiblingsFromScreenReaders(false);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
componentWillUnmount() {
|
|
154
|
+
const { appendTo } = this.props;
|
|
155
|
+
const target: HTMLElement = this.getElement(appendTo);
|
|
156
|
+
if (this.state.container) {
|
|
157
|
+
target.removeChild(this.state.container);
|
|
158
|
+
}
|
|
159
|
+
target.removeEventListener('keydown', this.handleEscKeyClick, false);
|
|
160
|
+
target.classList.remove(css(styles.backdropOpen));
|
|
161
|
+
this.toggleSiblingsFromScreenReaders(false);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
render() {
|
|
165
|
+
const {
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
167
|
+
appendTo,
|
|
168
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
169
|
+
onEscapePress,
|
|
170
|
+
'aria-labelledby': ariaLabelledby,
|
|
171
|
+
'aria-label': ariaLabel,
|
|
172
|
+
'aria-describedby': ariaDescribedby,
|
|
173
|
+
ouiaId,
|
|
174
|
+
ouiaSafe,
|
|
175
|
+
position,
|
|
176
|
+
elementToFocus,
|
|
177
|
+
...props
|
|
178
|
+
} = this.props;
|
|
179
|
+
const { container } = this.state;
|
|
180
|
+
|
|
181
|
+
if (!canUseDOM || !container) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return ReactDOM.createPortal(
|
|
186
|
+
<ModalContent
|
|
187
|
+
boxId={this.boxId}
|
|
188
|
+
aria-label={ariaLabel}
|
|
189
|
+
aria-describedby={ariaDescribedby}
|
|
190
|
+
aria-labelledby={ariaLabelledby}
|
|
191
|
+
ouiaId={ouiaId !== undefined ? ouiaId : this.state.ouiaStateId}
|
|
192
|
+
ouiaSafe={ouiaSafe}
|
|
193
|
+
position={position}
|
|
194
|
+
elementToFocus={elementToFocus}
|
|
195
|
+
{...props}
|
|
196
|
+
/>,
|
|
197
|
+
container
|
|
198
|
+
) as React.ReactElement;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export { Modal };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';
|
|
4
|
+
|
|
5
|
+
/** Renders content in the body of the modal */
|
|
6
|
+
|
|
7
|
+
export interface ModalBodyProps extends React.HTMLProps<HTMLDivElement> {
|
|
8
|
+
/** Content rendered inside the modal body. */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
/** Additional classes added to the modal body. */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Accessible label applied to the modal body. This should be used to communicate
|
|
13
|
+
* important information about the modal body div element if needed, such as when it is scrollable.
|
|
14
|
+
*/
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
/** Accessible role applied to the modal body. This will default to "region" if the
|
|
17
|
+
* aria-label property is passed in. Set to a more appropriate role as applicable
|
|
18
|
+
* based on the modal content and context.
|
|
19
|
+
*/
|
|
20
|
+
role?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ModalBody: React.FunctionComponent<ModalBodyProps> = ({
|
|
24
|
+
children,
|
|
25
|
+
className,
|
|
26
|
+
'aria-label': ariaLabel,
|
|
27
|
+
role,
|
|
28
|
+
...props
|
|
29
|
+
}: ModalBodyProps) => {
|
|
30
|
+
const defaultModalBodyRole = ariaLabel ? 'region' : undefined;
|
|
31
|
+
return (
|
|
32
|
+
<div
|
|
33
|
+
aria-label={ariaLabel}
|
|
34
|
+
role={role || defaultModalBodyRole}
|
|
35
|
+
className={css(styles.modalBoxBody, className)}
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
ModalBody.displayName = 'ModalBody';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';
|
|
4
|
+
import topSpacer from '@patternfly/react-tokens/dist/esm/c_modal_box_m_align_top_spacer';
|
|
5
|
+
|
|
6
|
+
export interface ModalBoxProps extends React.HTMLProps<HTMLDivElement> {
|
|
7
|
+
/** Id to use for the modal box description. This should match the ModalHeader labelId or descriptorId */
|
|
8
|
+
'aria-describedby'?: string;
|
|
9
|
+
/** Adds an accessible name to the modal when there is no title in the ModalHeader. */
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
/** Id to use for the modal box label. */
|
|
12
|
+
'aria-labelledby'?: string;
|
|
13
|
+
/** Content rendered inside the modal box. */
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/** Additional classes added to the modal box. */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Position of the modal. By default a modal will be positioned vertically and horizontally centered. */
|
|
18
|
+
position?: 'default' | 'top';
|
|
19
|
+
/** Offset from alternate position. Can be any valid CSS length/percentage. */
|
|
20
|
+
positionOffset?: string;
|
|
21
|
+
/** Variant of the modal. */
|
|
22
|
+
variant?: 'small' | 'medium' | 'large' | 'default';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const ModalBox: React.FunctionComponent<ModalBoxProps> = ({
|
|
26
|
+
children,
|
|
27
|
+
className,
|
|
28
|
+
variant = 'default',
|
|
29
|
+
position,
|
|
30
|
+
positionOffset,
|
|
31
|
+
'aria-labelledby': ariaLabelledby,
|
|
32
|
+
'aria-label': ariaLabel,
|
|
33
|
+
'aria-describedby': ariaDescribedby,
|
|
34
|
+
style,
|
|
35
|
+
...props
|
|
36
|
+
}: ModalBoxProps) => {
|
|
37
|
+
if (positionOffset) {
|
|
38
|
+
style = style || {};
|
|
39
|
+
(style as any)[topSpacer.name] = positionOffset;
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
role="dialog"
|
|
44
|
+
aria-label={ariaLabel || null}
|
|
45
|
+
aria-labelledby={ariaLabelledby || null}
|
|
46
|
+
aria-describedby={ariaDescribedby}
|
|
47
|
+
aria-modal="true"
|
|
48
|
+
className={css(
|
|
49
|
+
styles.modalBox,
|
|
50
|
+
className,
|
|
51
|
+
position === 'top' && styles.modifiers.alignTop,
|
|
52
|
+
variant === 'large' && styles.modifiers.lg,
|
|
53
|
+
variant === 'small' && styles.modifiers.sm,
|
|
54
|
+
variant === 'medium' && styles.modifiers.md
|
|
55
|
+
)}
|
|
56
|
+
style={style}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
{children}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
ModalBox.displayName = 'ModalBox';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';
|
|
4
|
+
import { Button } from '../../../components/Button';
|
|
5
|
+
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
6
|
+
import { OUIAProps } from '../../../helpers';
|
|
7
|
+
|
|
8
|
+
export interface ModalBoxCloseButtonProps extends OUIAProps {
|
|
9
|
+
/** Additional classes added to the close button. */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** A callback for when the close button is clicked. */
|
|
12
|
+
onClose?: (event: KeyboardEvent | React.MouseEvent) => void;
|
|
13
|
+
/** Accessible descriptor of the close button. */
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
/** Value to set the data-ouia-component-id.*/
|
|
16
|
+
ouiaId?: number | string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const ModalBoxCloseButton: React.FunctionComponent<ModalBoxCloseButtonProps> = ({
|
|
20
|
+
className,
|
|
21
|
+
onClose,
|
|
22
|
+
'aria-label': ariaLabel = 'Close',
|
|
23
|
+
ouiaId,
|
|
24
|
+
...props
|
|
25
|
+
}: ModalBoxCloseButtonProps) => (
|
|
26
|
+
<div className={css(styles.modalBoxClose, className)}>
|
|
27
|
+
<Button
|
|
28
|
+
variant="plain"
|
|
29
|
+
onClick={(event) => onClose(event)}
|
|
30
|
+
aria-label={ariaLabel}
|
|
31
|
+
{...(ouiaId && { ouiaId: `${ouiaId}-${ModalBoxCloseButton.displayName}` })}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<TimesIcon />
|
|
35
|
+
</Button>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
ModalBoxCloseButton.displayName = 'ModalBoxCloseButton';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';
|
|
4
|
+
|
|
5
|
+
export interface ModalBoxDescriptionProps {
|
|
6
|
+
/** Content rendered inside the description. */
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Additional classes added to the description. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Id of the description. */
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ModalBoxDescription: React.FunctionComponent<ModalBoxDescriptionProps> = ({
|
|
15
|
+
children = null,
|
|
16
|
+
className = '',
|
|
17
|
+
id = '',
|
|
18
|
+
...props
|
|
19
|
+
}: ModalBoxDescriptionProps) => (
|
|
20
|
+
<div {...props} id={id} className={css(styles.modalBoxDescription, className)}>
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
ModalBoxDescription.displayName = 'ModalBoxDescription';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import modalStyles from '@patternfly/react-styles/css/components/ModalBox/modal-box';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { capitalize } from '../../../helpers';
|
|
5
|
+
import { Tooltip } from '../../../components/Tooltip';
|
|
6
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
7
|
+
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
8
|
+
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';
|
|
9
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
10
|
+
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
11
|
+
import { useIsomorphicLayoutEffect } from '../../../helpers';
|
|
12
|
+
|
|
13
|
+
export const isVariantIcon = (icon: any): icon is string =>
|
|
14
|
+
['success', 'danger', 'warning', 'info', 'custom'].includes(icon as string);
|
|
15
|
+
|
|
16
|
+
export interface ModalBoxTitleProps {
|
|
17
|
+
/** Additional classes added to the modal box title. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Id of the modal box title. */
|
|
20
|
+
id?: string;
|
|
21
|
+
/** Content rendered inside the modal box title. */
|
|
22
|
+
title: React.ReactNode;
|
|
23
|
+
/** Optional alert icon (or other) to show before the title. When the predefined alert types
|
|
24
|
+
* are used the default styling will be automatically applied. */
|
|
25
|
+
titleIconVariant?: 'success' | 'danger' | 'warning' | 'info' | 'custom' | React.ComponentType<any>;
|
|
26
|
+
/** Optional title label text for screen readers. */
|
|
27
|
+
titleScreenReaderText?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const ModalBoxTitle: React.FunctionComponent<ModalBoxTitleProps> = ({
|
|
31
|
+
className,
|
|
32
|
+
id,
|
|
33
|
+
title,
|
|
34
|
+
titleIconVariant,
|
|
35
|
+
titleScreenReaderText,
|
|
36
|
+
...props
|
|
37
|
+
}: ModalBoxTitleProps) => {
|
|
38
|
+
const [hasTooltip, setHasTooltip] = React.useState(false);
|
|
39
|
+
const h1 = React.useRef<HTMLHeadingElement>(null);
|
|
40
|
+
const label =
|
|
41
|
+
titleScreenReaderText ||
|
|
42
|
+
(isVariantIcon(titleIconVariant) ? `${capitalize(titleIconVariant)} alert:` : titleScreenReaderText);
|
|
43
|
+
const variantIcons = {
|
|
44
|
+
success: <CheckCircleIcon />,
|
|
45
|
+
danger: <ExclamationCircleIcon />,
|
|
46
|
+
warning: <ExclamationTriangleIcon />,
|
|
47
|
+
info: <InfoCircleIcon />,
|
|
48
|
+
custom: <BellIcon />
|
|
49
|
+
};
|
|
50
|
+
const CustomIcon = !isVariantIcon(titleIconVariant) && titleIconVariant;
|
|
51
|
+
|
|
52
|
+
useIsomorphicLayoutEffect(() => {
|
|
53
|
+
setHasTooltip(h1.current && h1.current.offsetWidth < h1.current.scrollWidth);
|
|
54
|
+
}, []);
|
|
55
|
+
|
|
56
|
+
const content = (
|
|
57
|
+
<h1
|
|
58
|
+
id={id}
|
|
59
|
+
ref={h1}
|
|
60
|
+
className={css(modalStyles.modalBoxTitle, titleIconVariant && modalStyles.modifiers.icon, className)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
{titleIconVariant && (
|
|
64
|
+
<span className={css(modalStyles.modalBoxTitleIcon)}>
|
|
65
|
+
{isVariantIcon(titleIconVariant) ? variantIcons[titleIconVariant] : <CustomIcon />}
|
|
66
|
+
</span>
|
|
67
|
+
)}
|
|
68
|
+
{label && <span className="pf-v5-screen-reader">{label}</span>}
|
|
69
|
+
<span className={css(modalStyles.modalBoxTitleText)}>{title}</span>
|
|
70
|
+
</h1>
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return hasTooltip ? <Tooltip content={title}>{content}</Tooltip> : content;
|
|
74
|
+
};
|
|
75
|
+
ModalBoxTitle.displayName = 'ModalBoxTitle';
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FocusTrap } from '../../../helpers';
|
|
3
|
+
import bullsEyeStyles from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';
|
|
4
|
+
import { css } from '@patternfly/react-styles';
|
|
5
|
+
import { getOUIAProps, OUIAProps } from '../../../helpers';
|
|
6
|
+
import { Backdrop } from '../../../components/Backdrop';
|
|
7
|
+
import { ModalBoxCloseButton } from './ModalBoxCloseButton';
|
|
8
|
+
import { ModalBox } from './ModalBox';
|
|
9
|
+
|
|
10
|
+
export interface ModalContentProps extends OUIAProps {
|
|
11
|
+
/** Id to use for the modal box description. This should match the ModalHeader labelId or descriptorId. */
|
|
12
|
+
'aria-describedby'?: string;
|
|
13
|
+
/** Accessible descriptor of the modal. */
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
/** Id to use for the modal box label. This should include the ModalHeader labelId. */
|
|
16
|
+
'aria-labelledby'?: string;
|
|
17
|
+
/** Id of the modal box container. */
|
|
18
|
+
boxId: string;
|
|
19
|
+
/** Content rendered inside the modal. */
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/** Additional classes added to the modal box. */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Flag to disable focus trap. */
|
|
24
|
+
disableFocusTrap?: boolean;
|
|
25
|
+
/** The element to focus when the modal opens. By default the first
|
|
26
|
+
* focusable element will receive focus.
|
|
27
|
+
*/
|
|
28
|
+
elementToFocus?: HTMLElement | SVGElement | string;
|
|
29
|
+
/** Flag to show the modal. */
|
|
30
|
+
isOpen?: boolean;
|
|
31
|
+
/** A callback for when the close button is clicked. */
|
|
32
|
+
onClose?: (event: KeyboardEvent | React.MouseEvent) => void;
|
|
33
|
+
/** Position of the modal. By default a modal will be positioned vertically and horizontally centered. */
|
|
34
|
+
position?: 'default' | 'top';
|
|
35
|
+
/** Offset from alternate position. Can be any valid CSS length/percentage. */
|
|
36
|
+
positionOffset?: string;
|
|
37
|
+
/** Variant of the modal. */
|
|
38
|
+
variant?: 'small' | 'medium' | 'large' | 'default';
|
|
39
|
+
/** Default width of the modal. */
|
|
40
|
+
width?: number | string;
|
|
41
|
+
/** Maximum width of the modal. */
|
|
42
|
+
maxWidth?: number | string;
|
|
43
|
+
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
44
|
+
ouiaId?: number | string;
|
|
45
|
+
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
46
|
+
ouiaSafe?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
|
|
50
|
+
children,
|
|
51
|
+
className,
|
|
52
|
+
isOpen = false,
|
|
53
|
+
'aria-label': ariaLabel,
|
|
54
|
+
'aria-describedby': ariaDescribedby,
|
|
55
|
+
'aria-labelledby': ariaLabelledby,
|
|
56
|
+
onClose,
|
|
57
|
+
variant = 'default',
|
|
58
|
+
position,
|
|
59
|
+
positionOffset,
|
|
60
|
+
width,
|
|
61
|
+
maxWidth,
|
|
62
|
+
boxId,
|
|
63
|
+
disableFocusTrap = false,
|
|
64
|
+
ouiaId,
|
|
65
|
+
ouiaSafe = true,
|
|
66
|
+
elementToFocus,
|
|
67
|
+
...props
|
|
68
|
+
}: ModalContentProps) => {
|
|
69
|
+
if (!isOpen) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const ariaLabelledbyFormatted = (): string => {
|
|
74
|
+
const idRefList: string[] = [];
|
|
75
|
+
if (ariaLabel && boxId) {
|
|
76
|
+
idRefList.push(ariaLabel && boxId);
|
|
77
|
+
}
|
|
78
|
+
if (ariaLabelledby) {
|
|
79
|
+
idRefList.push(ariaLabelledby);
|
|
80
|
+
}
|
|
81
|
+
if (idRefList.length === 0) {
|
|
82
|
+
return undefined;
|
|
83
|
+
} else {
|
|
84
|
+
return idRefList.join(' ');
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const modalBox = (
|
|
89
|
+
<ModalBox
|
|
90
|
+
className={css(className)}
|
|
91
|
+
variant={variant}
|
|
92
|
+
position={position}
|
|
93
|
+
positionOffset={positionOffset}
|
|
94
|
+
aria-label={ariaLabel}
|
|
95
|
+
aria-labelledby={ariaLabelledbyFormatted()}
|
|
96
|
+
aria-describedby={ariaDescribedby}
|
|
97
|
+
{...getOUIAProps(ModalContent.displayName, ouiaId, ouiaSafe)}
|
|
98
|
+
style={
|
|
99
|
+
{
|
|
100
|
+
...(width && { '--pf-v5-c-modal-box--Width': typeof width !== 'number' ? width : `${width}px` }),
|
|
101
|
+
...(maxWidth && {
|
|
102
|
+
'--pf-v5-c-modal-box--MaxWidth': typeof maxWidth !== 'number' ? maxWidth : `${maxWidth}px`
|
|
103
|
+
})
|
|
104
|
+
} as React.CSSProperties
|
|
105
|
+
}
|
|
106
|
+
{...props}
|
|
107
|
+
id={boxId}
|
|
108
|
+
>
|
|
109
|
+
{onClose && <ModalBoxCloseButton onClose={(event) => onClose(event)} ouiaId={ouiaId} />}
|
|
110
|
+
{children}
|
|
111
|
+
</ModalBox>
|
|
112
|
+
);
|
|
113
|
+
return (
|
|
114
|
+
<Backdrop>
|
|
115
|
+
<FocusTrap
|
|
116
|
+
active={!disableFocusTrap}
|
|
117
|
+
focusTrapOptions={{
|
|
118
|
+
clickOutsideDeactivates: true,
|
|
119
|
+
tabbableOptions: { displayCheck: 'none' },
|
|
120
|
+
// FocusTrap's initialFocus can accept false as a value to prevent initial focus.
|
|
121
|
+
// We want to prevent this in case false is ever passed in.
|
|
122
|
+
initialFocus: elementToFocus || undefined
|
|
123
|
+
}}
|
|
124
|
+
className={css(bullsEyeStyles.bullseye)}
|
|
125
|
+
>
|
|
126
|
+
{modalBox}
|
|
127
|
+
</FocusTrap>
|
|
128
|
+
</Backdrop>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
ModalContent.displayName = 'ModalContent';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';
|
|
4
|
+
|
|
5
|
+
/** Renders content in the footer of the modal */
|
|
6
|
+
|
|
7
|
+
export interface ModalFooterProps {
|
|
8
|
+
/** Content rendered inside the modal footer. */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
/** Additional classes added to the modal footer. */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ModalFooter: React.FunctionComponent<ModalFooterProps> = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: ModalFooterProps) => (
|
|
19
|
+
<footer {...props} className={css(styles.modalBoxFooter, className)}>
|
|
20
|
+
{children}
|
|
21
|
+
</footer>
|
|
22
|
+
);
|
|
23
|
+
ModalFooter.displayName = 'ModalFooter';
|