react-bootstrap 2.10.9 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1374 -0
- package/cjs/AbstractModalHeader.d.ts +23 -5
- package/cjs/AbstractModalHeader.js +2 -1
- package/cjs/Accordion.d.ts +43 -14
- package/cjs/Accordion.js +3 -3
- package/cjs/AccordionBody.d.ts +12 -4
- package/cjs/AccordionBody.js +3 -3
- package/cjs/AccordionButton.d.ts +11 -5
- package/cjs/AccordionButton.js +7 -34
- package/cjs/AccordionCollapse.d.ts +16 -6
- package/cjs/AccordionCollapse.js +3 -3
- package/cjs/AccordionContext.d.ts +2 -2
- package/cjs/AccordionContext.js +1 -1
- package/cjs/AccordionHeader.d.ts +11 -3
- package/cjs/AccordionHeader.js +3 -3
- package/cjs/AccordionItem.d.ts +14 -3
- package/cjs/AccordionItem.js +3 -3
- package/cjs/AccordionItemContext.js +1 -1
- package/cjs/Alert.d.ts +51 -13
- package/cjs/Alert.js +3 -3
- package/cjs/AlertHeading.d.ts +11 -3
- package/cjs/AlertHeading.js +3 -3
- package/cjs/AlertLink.d.ts +11 -3
- package/cjs/AlertLink.js +3 -3
- package/cjs/Anchor.d.ts +1 -1
- package/cjs/Badge.d.ts +28 -7
- package/cjs/Badge.js +3 -3
- package/cjs/BootstrapModalManager.d.ts +1 -1
- package/cjs/BootstrapModalManager.js +1 -2
- package/cjs/Breadcrumb.d.ts +21 -6
- package/cjs/Breadcrumb.js +3 -3
- package/cjs/BreadcrumbItem.d.ts +36 -9
- package/cjs/BreadcrumbItem.js +3 -3
- package/cjs/Button.d.ts +42 -8
- package/cjs/Button.js +3 -3
- package/cjs/ButtonGroup.d.ts +25 -5
- package/cjs/ButtonGroup.js +3 -3
- package/cjs/ButtonToolbar.d.ts +11 -2
- package/cjs/ButtonToolbar.js +3 -3
- package/cjs/Card.d.ts +44 -17
- package/cjs/Card.js +3 -3
- package/cjs/CardBody.d.ts +11 -3
- package/cjs/CardBody.js +3 -3
- package/cjs/CardFooter.d.ts +11 -3
- package/cjs/CardFooter.js +3 -3
- package/cjs/CardGroup.d.ts +11 -3
- package/cjs/CardGroup.js +3 -3
- package/cjs/CardHeader.d.ts +11 -3
- package/cjs/CardHeader.js +3 -3
- package/cjs/CardHeaderContext.js +1 -1
- package/cjs/CardImg.d.ts +14 -3
- package/cjs/CardImg.js +3 -3
- package/cjs/CardImgOverlay.d.ts +11 -3
- package/cjs/CardImgOverlay.js +3 -3
- package/cjs/CardLink.d.ts +11 -3
- package/cjs/CardLink.js +3 -3
- package/cjs/CardSubtitle.d.ts +11 -3
- package/cjs/CardSubtitle.js +3 -3
- package/cjs/CardText.d.ts +11 -3
- package/cjs/CardText.js +3 -3
- package/cjs/CardTitle.d.ts +11 -3
- package/cjs/CardTitle.js +3 -3
- package/cjs/Carousel.d.ts +127 -27
- package/cjs/Carousel.js +8 -8
- package/cjs/CarouselCaption.d.ts +11 -3
- package/cjs/CarouselCaption.js +3 -3
- package/cjs/CarouselItem.d.ts +15 -4
- package/cjs/CarouselItem.js +3 -3
- package/cjs/CloseButton.d.ts +10 -1
- package/cjs/CloseButton.js +3 -17
- package/cjs/Col.d.ts +41 -21
- package/cjs/Col.js +7 -48
- package/cjs/Collapse.d.ts +45 -10
- package/cjs/Collapse.js +6 -7
- package/cjs/Container.d.ts +15 -4
- package/cjs/Container.js +3 -3
- package/cjs/Dropdown.d.ts +10 -17
- package/cjs/Dropdown.js +3 -4
- package/cjs/DropdownButton.d.ts +42 -11
- package/cjs/DropdownButton.js +1 -56
- package/cjs/DropdownContext.d.ts +1 -1
- package/cjs/DropdownContext.js +1 -1
- package/cjs/DropdownDivider.d.ts +15 -3
- package/cjs/DropdownDivider.js +3 -3
- package/cjs/DropdownHeader.d.ts +15 -3
- package/cjs/DropdownHeader.js +3 -3
- package/cjs/DropdownItem.d.ts +28 -4
- package/cjs/DropdownItem.js +3 -3
- package/cjs/DropdownItemText.d.ts +11 -3
- package/cjs/DropdownItemText.js +3 -3
- package/cjs/DropdownMenu.d.ts +55 -12
- package/cjs/DropdownMenu.js +3 -4
- package/cjs/DropdownToggle.d.ts +20 -4
- package/cjs/DropdownToggle.js +3 -3
- package/cjs/ElementChildren.js +2 -2
- package/cjs/Fade.d.ts +31 -7
- package/cjs/Fade.js +3 -3
- package/cjs/Feedback.d.ts +15 -6
- package/cjs/Feedback.js +3 -16
- package/cjs/Figure.d.ts +12 -4
- package/cjs/Figure.js +3 -3
- package/cjs/FigureCaption.d.ts +11 -3
- package/cjs/FigureCaption.js +3 -3
- package/cjs/FigureImage.d.ts +1 -1
- package/cjs/FigureImage.js +4 -5
- package/cjs/FloatingLabel.d.ts +19 -5
- package/cjs/FloatingLabel.js +3 -3
- package/cjs/Form.d.ts +159 -135
- package/cjs/Form.js +3 -22
- package/cjs/FormCheck.d.ts +81 -15
- package/cjs/FormCheck.js +3 -3
- package/cjs/FormCheckInput.d.ts +27 -6
- package/cjs/FormCheckInput.js +3 -3
- package/cjs/FormCheckLabel.d.ts +9 -2
- package/cjs/FormCheckLabel.js +3 -3
- package/cjs/FormContext.js +1 -1
- package/cjs/FormControl.d.ts +59 -14
- package/cjs/FormControl.js +3 -3
- package/cjs/FormFloating.d.ts +11 -3
- package/cjs/FormFloating.js +3 -3
- package/cjs/FormGroup.d.ts +11 -4
- package/cjs/FormGroup.js +1 -1
- package/cjs/FormLabel.d.ts +29 -6
- package/cjs/FormLabel.js +9 -13
- package/cjs/FormRange.d.ts +13 -2
- package/cjs/FormRange.js +3 -3
- package/cjs/FormSelect.d.ts +39 -7
- package/cjs/FormSelect.js +3 -3
- package/cjs/FormText.d.ts +16 -4
- package/cjs/FormText.js +3 -3
- package/cjs/Image.d.ts +7 -15
- package/cjs/Image.js +6 -29
- package/cjs/InputGroup.d.ts +24 -8
- package/cjs/InputGroup.js +3 -3
- package/cjs/InputGroupContext.js +1 -1
- package/cjs/InputGroupText.d.ts +11 -3
- package/cjs/InputGroupText.js +3 -3
- package/cjs/ListGroup.d.ts +35 -10
- package/cjs/ListGroup.js +3 -3
- package/cjs/ListGroupItem.d.ts +34 -7
- package/cjs/ListGroupItem.js +3 -5
- package/cjs/Modal.d.ts +53 -16
- package/cjs/Modal.js +4 -7
- package/cjs/ModalBody.d.ts +11 -3
- package/cjs/ModalBody.js +3 -3
- package/cjs/ModalContext.js +2 -2
- package/cjs/ModalDialog.d.ts +29 -6
- package/cjs/ModalDialog.js +4 -4
- package/cjs/ModalFooter.d.ts +11 -3
- package/cjs/ModalFooter.js +3 -3
- package/cjs/ModalHeader.d.ts +6 -3
- package/cjs/ModalHeader.js +3 -3
- package/cjs/ModalTitle.d.ts +11 -3
- package/cjs/ModalTitle.js +3 -3
- package/cjs/Nav.d.ts +49 -15
- package/cjs/Nav.js +3 -3
- package/cjs/NavContext.d.ts +1 -1
- package/cjs/NavContext.js +1 -1
- package/cjs/NavDropdown.d.ts +44 -15
- package/cjs/NavDropdown.js +3 -3
- package/cjs/NavItem.d.ts +11 -3
- package/cjs/NavItem.js +3 -3
- package/cjs/NavLink.d.ts +33 -4
- package/cjs/NavLink.js +3 -3
- package/cjs/Navbar.d.ts +103 -17
- package/cjs/Navbar.js +3 -3
- package/cjs/NavbarBrand.d.ts +15 -4
- package/cjs/NavbarBrand.js +3 -3
- package/cjs/NavbarCollapse.d.ts +6 -3
- package/cjs/NavbarCollapse.js +1 -1
- package/cjs/NavbarContext.js +1 -1
- package/cjs/NavbarOffcanvas.d.ts +3 -2
- package/cjs/NavbarOffcanvas.js +1 -2
- package/cjs/NavbarText.d.ts +11 -3
- package/cjs/NavbarText.js +3 -3
- package/cjs/NavbarToggle.d.ts +19 -4
- package/cjs/NavbarToggle.js +3 -3
- package/cjs/Offcanvas.d.ts +27 -12
- package/cjs/Offcanvas.js +46 -43
- package/cjs/OffcanvasBody.d.ts +11 -3
- package/cjs/OffcanvasBody.js +3 -3
- package/cjs/OffcanvasHeader.d.ts +6 -3
- package/cjs/OffcanvasHeader.js +3 -3
- package/cjs/OffcanvasTitle.d.ts +11 -3
- package/cjs/OffcanvasTitle.js +3 -3
- package/cjs/OffcanvasToggling.d.ts +32 -8
- package/cjs/OffcanvasToggling.js +3 -3
- package/cjs/Overlay.d.ts +24 -7
- package/cjs/Overlay.js +5 -6
- package/cjs/OverlayTrigger.d.ts +50 -12
- package/cjs/OverlayTrigger.js +4 -11
- package/cjs/PageItem.d.ts +31 -9
- package/cjs/PageItem.js +4 -6
- package/cjs/Pagination.d.ts +14 -4
- package/cjs/Pagination.js +3 -3
- package/cjs/Placeholder.d.ts +14 -5
- package/cjs/Placeholder.js +1 -1
- package/cjs/PlaceholderButton.d.ts +19 -5
- package/cjs/PlaceholderButton.js +1 -1
- package/cjs/Popover.d.ts +41 -12
- package/cjs/Popover.js +4 -3
- package/cjs/PopoverBody.d.ts +11 -3
- package/cjs/PopoverBody.js +3 -3
- package/cjs/PopoverHeader.d.ts +11 -3
- package/cjs/PopoverHeader.js +3 -3
- package/cjs/ProgressBar.d.ts +44 -11
- package/cjs/ProgressBar.js +4 -34
- package/cjs/Ratio.d.ts +13 -3
- package/cjs/Ratio.js +4 -3
- package/cjs/Row.d.ts +41 -9
- package/cjs/Row.js +3 -3
- package/cjs/Spinner.d.ts +30 -7
- package/cjs/Spinner.js +3 -3
- package/cjs/SplitButton.d.ts +38 -12
- package/cjs/SplitButton.js +1 -59
- package/cjs/Stack.d.ts +27 -7
- package/cjs/Stack.js +4 -4
- package/cjs/Switch.d.ts +4 -4
- package/cjs/Switch.js +1 -1
- package/cjs/Tab.d.ts +19 -17
- package/cjs/Tab.js +0 -22
- package/cjs/TabContainer.d.ts +51 -57
- package/cjs/TabContainer.js +0 -3
- package/cjs/TabContent.d.ts +11 -3
- package/cjs/TabContent.js +3 -3
- package/cjs/TabPane.d.ts +36 -9
- package/cjs/TabPane.js +3 -3
- package/cjs/Table.d.ts +42 -9
- package/cjs/Table.js +4 -3
- package/cjs/Tabs.d.ts +10 -4
- package/cjs/Tabs.js +1 -1
- package/cjs/ThemeProvider.d.ts +25 -6
- package/cjs/ThemeProvider.js +1 -1
- package/cjs/Toast.d.ts +47 -13
- package/cjs/Toast.js +3 -3
- package/cjs/ToastBody.d.ts +11 -3
- package/cjs/ToastBody.js +3 -3
- package/cjs/ToastContainer.d.ts +19 -5
- package/cjs/ToastContainer.js +3 -3
- package/cjs/ToastContext.js +2 -2
- package/cjs/ToastFade.d.ts +1 -1
- package/cjs/ToastFade.js +1 -1
- package/cjs/ToastHeader.d.ts +20 -6
- package/cjs/ToastHeader.js +3 -3
- package/cjs/ToggleButton.d.ts +38 -7
- package/cjs/ToggleButton.js +3 -3
- package/cjs/ToggleButtonGroup.d.ts +51 -3
- package/cjs/ToggleButtonGroup.js +2 -1
- package/cjs/Tooltip.d.ts +35 -7
- package/cjs/Tooltip.js +3 -3
- package/cjs/TransitionWrapper.d.ts +1 -1
- package/cjs/TransitionWrapper.js +4 -11
- package/cjs/createChainedFunction.js +2 -2
- package/cjs/createUtilityClasses.d.ts +0 -2
- package/cjs/createUtilityClasses.js +2 -14
- package/cjs/createWithBsPrefix.d.ts +2 -2
- package/cjs/createWithBsPrefix.js +3 -3
- package/cjs/divWithClassName.js +7 -4
- package/cjs/getTabTransitionComponent.d.ts +1 -1
- package/cjs/helpers.d.ts +0 -20
- package/cjs/helpers.js +0 -8
- package/cjs/index.d.ts +2 -3
- package/cjs/index.js +5 -8
- package/cjs/package.json +1 -0
- package/cjs/types.d.ts +338 -3
- package/cjs/types.js +1 -16
- package/cjs/useAccordionButton.d.ts +4 -0
- package/cjs/useAccordionButton.js +37 -0
- package/cjs/useCol.d.ts +7 -0
- package/cjs/useCol.js +49 -0
- package/cjs/useOverlayOffset.d.ts +1 -1
- package/cjs/usePlaceholder.d.ts +16 -5
- package/cjs/usePlaceholder.js +4 -4
- package/cjs/useWrappedRefWithWarning.js +1 -1
- package/lib/AbstractModalHeader.d.ts +28 -0
- package/{esm → lib}/AbstractModalHeader.js +2 -2
- package/lib/Accordion.d.ts +47 -0
- package/{esm → lib}/Accordion.js +2 -2
- package/lib/AccordionBody.d.ts +15 -0
- package/{esm → lib}/AccordionBody.js +2 -2
- package/lib/AccordionButton.d.ts +14 -0
- package/{esm → lib}/AccordionButton.js +3 -30
- package/lib/AccordionCollapse.d.ts +22 -0
- package/{esm → lib}/AccordionCollapse.js +2 -2
- package/{esm → lib}/AccordionContext.d.ts +2 -2
- package/lib/AccordionHeader.d.ts +14 -0
- package/{esm → lib}/AccordionHeader.js +2 -2
- package/lib/AccordionItem.d.ts +18 -0
- package/{esm → lib}/AccordionItem.js +2 -2
- package/lib/Alert.d.ts +57 -0
- package/{esm → lib}/Alert.js +3 -4
- package/lib/AlertHeading.d.ts +14 -0
- package/{esm → lib}/AlertHeading.js +2 -2
- package/lib/AlertLink.d.ts +14 -0
- package/{esm → lib}/AlertLink.js +2 -2
- package/lib/Anchor.d.ts +3 -0
- package/lib/Badge.d.ts +31 -0
- package/{esm → lib}/Badge.js +2 -2
- package/{esm → lib}/BootstrapModalManager.d.ts +1 -1
- package/{esm → lib}/BootstrapModalManager.js +1 -2
- package/lib/Breadcrumb.d.ts +25 -0
- package/{esm → lib}/Breadcrumb.js +2 -2
- package/lib/BreadcrumbItem.d.ts +39 -0
- package/{esm → lib}/BreadcrumbItem.js +2 -2
- package/lib/Button.d.ts +45 -0
- package/{esm → lib}/Button.js +2 -2
- package/lib/ButtonGroup.d.ts +28 -0
- package/{esm → lib}/ButtonGroup.js +2 -2
- package/lib/ButtonToolbar.d.ts +15 -0
- package/{esm → lib}/ButtonToolbar.js +2 -2
- package/lib/Card.d.ts +48 -0
- package/{esm → lib}/Card.js +2 -2
- package/lib/CardBody.d.ts +14 -0
- package/{esm → lib}/CardBody.js +2 -2
- package/lib/CardFooter.d.ts +14 -0
- package/{esm → lib}/CardFooter.js +2 -2
- package/lib/CardGroup.d.ts +14 -0
- package/{esm → lib}/CardGroup.js +2 -2
- package/lib/CardHeader.d.ts +14 -0
- package/{esm → lib}/CardHeader.js +2 -2
- package/lib/CardImg.d.ts +18 -0
- package/{esm → lib}/CardImg.js +2 -2
- package/lib/CardImgOverlay.d.ts +14 -0
- package/{esm → lib}/CardImgOverlay.js +2 -2
- package/lib/CardLink.d.ts +14 -0
- package/{esm → lib}/CardLink.js +2 -2
- package/lib/CardSubtitle.d.ts +14 -0
- package/{esm → lib}/CardSubtitle.js +2 -2
- package/lib/CardText.d.ts +14 -0
- package/{esm → lib}/CardText.js +2 -2
- package/lib/CardTitle.d.ts +14 -0
- package/{esm → lib}/CardTitle.js +2 -2
- package/lib/Carousel.d.ts +136 -0
- package/{esm → lib}/Carousel.js +8 -10
- package/lib/CarouselCaption.d.ts +14 -0
- package/{esm → lib}/CarouselCaption.js +2 -2
- package/lib/CarouselItem.d.ts +18 -0
- package/{esm → lib}/CarouselItem.js +2 -2
- package/{esm → lib}/CloseButton.d.ts +10 -1
- package/lib/CloseButton.js +17 -0
- package/lib/Col.d.ts +48 -0
- package/lib/Col.js +23 -0
- package/lib/Collapse.d.ts +52 -0
- package/{esm → lib}/Collapse.js +5 -7
- package/lib/Container.d.ts +18 -0
- package/{esm → lib}/Container.js +2 -2
- package/lib/Dropdown.d.ts +14 -0
- package/{esm → lib}/Dropdown.js +2 -3
- package/lib/DropdownButton.d.ts +55 -0
- package/lib/DropdownButton.js +51 -0
- package/{esm → lib}/DropdownContext.d.ts +1 -1
- package/lib/DropdownDivider.d.ts +18 -0
- package/{esm → lib}/DropdownDivider.js +2 -2
- package/lib/DropdownHeader.d.ts +18 -0
- package/{esm → lib}/DropdownHeader.js +2 -2
- package/lib/DropdownItem.d.ts +30 -0
- package/{esm → lib}/DropdownItem.js +2 -2
- package/lib/DropdownItemText.d.ts +14 -0
- package/{esm → lib}/DropdownItemText.js +2 -2
- package/lib/DropdownMenu.d.ts +61 -0
- package/{esm → lib}/DropdownMenu.js +2 -3
- package/lib/DropdownToggle.d.ts +28 -0
- package/{esm → lib}/DropdownToggle.js +2 -2
- package/{esm → lib}/ElementChildren.js +1 -1
- package/lib/Fade.d.ts +39 -0
- package/{esm → lib}/Fade.js +2 -2
- package/lib/Feedback.d.ts +19 -0
- package/{esm → lib}/Feedback.js +2 -15
- package/lib/Figure.d.ts +17 -0
- package/{esm → lib}/Figure.js +2 -2
- package/lib/FigureCaption.d.ts +14 -0
- package/{esm → lib}/FigureCaption.js +2 -2
- package/{esm → lib}/FigureImage.d.ts +1 -1
- package/{esm → lib}/FigureImage.js +3 -4
- package/lib/FloatingLabel.d.ts +23 -0
- package/{esm → lib}/FloatingLabel.js +3 -4
- package/{esm → lib}/Form.d.ts +159 -135
- package/{esm → lib}/Form.js +2 -21
- package/lib/FormCheck.d.ts +88 -0
- package/{esm → lib}/FormCheck.js +3 -5
- package/lib/FormCheckInput.d.ts +31 -0
- package/{esm → lib}/FormCheckInput.js +2 -2
- package/{esm → lib}/FormCheckLabel.d.ts +9 -2
- package/{esm → lib}/FormCheckLabel.js +2 -2
- package/lib/FormControl.d.ts +64 -0
- package/{esm → lib}/FormControl.js +2 -2
- package/lib/FormFloating.d.ts +14 -0
- package/{esm → lib}/FormFloating.js +2 -2
- package/lib/FormGroup.d.ts +14 -0
- package/lib/FormLabel.d.ts +39 -0
- package/{esm → lib}/FormLabel.js +8 -12
- package/lib/FormRange.d.ts +17 -0
- package/{esm → lib}/FormRange.js +2 -2
- package/lib/FormSelect.d.ts +42 -0
- package/{esm → lib}/FormSelect.js +2 -2
- package/lib/FormText.d.ts +19 -0
- package/{esm → lib}/FormText.js +2 -2
- package/lib/Image.d.ts +25 -0
- package/lib/Image.js +24 -0
- package/lib/InputGroup.d.ts +29 -0
- package/{esm → lib}/InputGroup.js +2 -2
- package/lib/InputGroupText.d.ts +14 -0
- package/{esm → lib}/InputGroupText.js +2 -2
- package/lib/ListGroup.d.ts +38 -0
- package/{esm → lib}/ListGroup.js +2 -2
- package/lib/ListGroupItem.d.ts +38 -0
- package/{esm → lib}/ListGroupItem.js +2 -4
- package/lib/Modal.d.ts +63 -0
- package/{esm → lib}/Modal.js +3 -6
- package/lib/ModalBody.d.ts +14 -0
- package/{esm → lib}/ModalBody.js +2 -2
- package/{esm → lib}/ModalContext.js +1 -1
- package/lib/ModalDialog.d.ts +34 -0
- package/{esm → lib}/ModalDialog.js +3 -3
- package/lib/ModalFooter.d.ts +14 -0
- package/{esm → lib}/ModalFooter.js +2 -2
- package/{esm → lib}/ModalHeader.d.ts +6 -3
- package/{esm → lib}/ModalHeader.js +2 -2
- package/lib/ModalTitle.d.ts +14 -0
- package/{esm → lib}/ModalTitle.js +2 -2
- package/lib/Nav.d.ts +52 -0
- package/{esm → lib}/Nav.js +2 -2
- package/{esm → lib}/NavContext.d.ts +1 -1
- package/lib/NavDropdown.d.ts +49 -0
- package/{esm → lib}/NavDropdown.js +3 -4
- package/lib/NavItem.d.ts +14 -0
- package/{esm → lib}/NavItem.js +2 -2
- package/lib/NavLink.d.ts +35 -0
- package/{esm → lib}/NavLink.js +2 -2
- package/lib/Navbar.d.ts +108 -0
- package/{esm → lib}/Navbar.js +2 -2
- package/lib/NavbarBrand.d.ts +18 -0
- package/{esm → lib}/NavbarBrand.js +2 -2
- package/{esm → lib}/NavbarCollapse.d.ts +6 -3
- package/{esm → lib}/NavbarOffcanvas.d.ts +3 -2
- package/{esm → lib}/NavbarOffcanvas.js +0 -1
- package/lib/NavbarText.d.ts +14 -0
- package/{esm → lib}/NavbarText.js +2 -2
- package/lib/NavbarToggle.d.ts +22 -0
- package/{esm → lib}/NavbarToggle.js +2 -2
- package/lib/Offcanvas.d.ts +33 -0
- package/{esm → lib}/Offcanvas.js +46 -45
- package/lib/OffcanvasBody.d.ts +14 -0
- package/{esm → lib}/OffcanvasBody.js +2 -2
- package/{esm → lib}/OffcanvasHeader.d.ts +6 -3
- package/{esm → lib}/OffcanvasHeader.js +2 -2
- package/lib/OffcanvasTitle.d.ts +14 -0
- package/{esm → lib}/OffcanvasTitle.js +2 -2
- package/lib/OffcanvasToggling.d.ts +39 -0
- package/{esm → lib}/OffcanvasToggling.js +2 -2
- package/lib/Overlay.d.ts +41 -0
- package/{esm → lib}/Overlay.js +4 -5
- package/lib/OverlayTrigger.d.ts +67 -0
- package/{esm → lib}/OverlayTrigger.js +4 -13
- package/lib/PageItem.d.ts +39 -0
- package/{esm → lib}/PageItem.js +4 -6
- package/{esm → lib}/Pagination.d.ts +14 -4
- package/{esm → lib}/Pagination.js +2 -2
- package/lib/Placeholder.d.ts +17 -0
- package/lib/PlaceholderButton.d.ts +22 -0
- package/lib/Popover.d.ts +48 -0
- package/{esm → lib}/Popover.js +4 -4
- package/lib/PopoverBody.d.ts +14 -0
- package/{esm → lib}/PopoverBody.js +2 -2
- package/lib/PopoverHeader.d.ts +14 -0
- package/{esm → lib}/PopoverHeader.js +2 -2
- package/lib/ProgressBar.d.ts +48 -0
- package/{esm → lib}/ProgressBar.js +3 -33
- package/lib/Ratio.d.ts +19 -0
- package/{esm → lib}/Ratio.js +3 -2
- package/lib/Row.d.ts +49 -0
- package/{esm → lib}/Row.js +2 -2
- package/lib/Spinner.d.ts +33 -0
- package/{esm → lib}/Spinner.js +2 -2
- package/lib/SplitButton.d.ts +53 -0
- package/lib/SplitButton.js +67 -0
- package/lib/Stack.d.ts +31 -0
- package/{esm → lib}/Stack.js +3 -3
- package/{esm → lib}/Switch.d.ts +4 -4
- package/lib/Tab.d.ts +29 -0
- package/lib/Tab.js +11 -0
- package/lib/TabContainer.d.ts +56 -0
- package/{esm → lib}/TabContainer.js +0 -1
- package/lib/TabContent.d.ts +14 -0
- package/{esm → lib}/TabContent.js +2 -2
- package/lib/TabPane.d.ts +39 -0
- package/{esm → lib}/TabPane.js +2 -2
- package/lib/Table.d.ts +46 -0
- package/{esm → lib}/Table.js +3 -2
- package/lib/Tabs.d.ts +15 -0
- package/{esm → lib}/Tabs.js +1 -2
- package/{esm → lib}/ThemeProvider.d.ts +25 -6
- package/lib/Toast.d.ts +52 -0
- package/{esm → lib}/Toast.js +2 -2
- package/lib/ToastBody.d.ts +14 -0
- package/{esm → lib}/ToastBody.js +2 -2
- package/lib/ToastContainer.d.ts +23 -0
- package/{esm → lib}/ToastContainer.js +2 -2
- package/{esm → lib}/ToastContext.js +1 -1
- package/{esm → lib}/ToastFade.d.ts +1 -1
- package/lib/ToastHeader.d.ts +24 -0
- package/{esm → lib}/ToastHeader.js +3 -4
- package/lib/ToggleButton.d.ts +46 -0
- package/{esm → lib}/ToggleButton.js +3 -5
- package/lib/ToggleButtonGroup.d.ts +71 -0
- package/{esm → lib}/ToggleButtonGroup.js +1 -0
- package/lib/Tooltip.d.ts +43 -0
- package/{esm → lib}/Tooltip.js +3 -4
- package/{esm → lib}/TransitionWrapper.d.ts +1 -1
- package/{esm → lib}/TransitionWrapper.js +3 -10
- package/{esm → lib}/createChainedFunction.js +2 -2
- package/{esm → lib}/createUtilityClasses.d.ts +0 -2
- package/{esm → lib}/createUtilityClasses.js +0 -11
- package/{esm → lib}/createWithBsPrefix.d.ts +2 -2
- package/{esm → lib}/createWithBsPrefix.js +2 -2
- package/lib/divWithClassName.js +11 -0
- package/{esm → lib}/getTabTransitionComponent.d.ts +1 -1
- package/lib/helpers.d.ts +4 -0
- package/{esm → lib}/helpers.js +0 -5
- package/{esm → lib}/index.d.ts +2 -3
- package/{esm → lib}/index.js +3 -3
- package/lib/package.json +1 -0
- package/lib/types.d.ts +364 -0
- package/lib/types.js +1 -0
- package/lib/useAccordionButton.d.ts +4 -0
- package/lib/useAccordionButton.js +32 -0
- package/lib/useCol.d.ts +7 -0
- package/{esm/Col.js → lib/useCol.js} +4 -25
- package/{esm → lib}/useOverlayOffset.d.ts +1 -1
- package/lib/usePlaceholder.d.ts +21 -0
- package/{esm → lib}/usePlaceholder.js +3 -3
- package/{esm → lib}/useWrappedRefWithWarning.js +1 -1
- package/package.json +94 -17
- package/AbstractModalHeader/package.json +0 -7
- package/Accordion/package.json +0 -7
- package/AccordionBody/package.json +0 -7
- package/AccordionButton/package.json +0 -7
- package/AccordionCollapse/package.json +0 -7
- package/AccordionContext/package.json +0 -7
- package/AccordionHeader/package.json +0 -7
- package/AccordionItem/package.json +0 -7
- package/AccordionItemContext/package.json +0 -7
- package/Alert/package.json +0 -7
- package/AlertHeading/package.json +0 -7
- package/AlertLink/package.json +0 -7
- package/Anchor/package.json +0 -7
- package/Badge/package.json +0 -7
- package/BootstrapModalManager/package.json +0 -7
- package/Breadcrumb/package.json +0 -7
- package/BreadcrumbItem/package.json +0 -7
- package/Button/package.json +0 -7
- package/ButtonGroup/package.json +0 -7
- package/ButtonToolbar/package.json +0 -7
- package/Card/package.json +0 -7
- package/CardBody/package.json +0 -7
- package/CardFooter/package.json +0 -7
- package/CardGroup/package.json +0 -7
- package/CardHeader/package.json +0 -7
- package/CardHeaderContext/package.json +0 -7
- package/CardImg/package.json +0 -7
- package/CardImgOverlay/package.json +0 -7
- package/CardLink/package.json +0 -7
- package/CardSubtitle/package.json +0 -7
- package/CardText/package.json +0 -7
- package/CardTitle/package.json +0 -7
- package/Carousel/package.json +0 -7
- package/CarouselCaption/package.json +0 -7
- package/CarouselItem/package.json +0 -7
- package/CloseButton/package.json +0 -7
- package/Col/package.json +0 -7
- package/Collapse/package.json +0 -7
- package/Container/package.json +0 -7
- package/Dropdown/package.json +0 -7
- package/DropdownButton/package.json +0 -7
- package/DropdownContext/package.json +0 -7
- package/DropdownDivider/package.json +0 -7
- package/DropdownHeader/package.json +0 -7
- package/DropdownItem/package.json +0 -7
- package/DropdownItemText/package.json +0 -7
- package/DropdownMenu/package.json +0 -7
- package/DropdownToggle/package.json +0 -7
- package/ElementChildren/package.json +0 -7
- package/Fade/package.json +0 -7
- package/Feedback/package.json +0 -7
- package/Figure/package.json +0 -7
- package/FigureCaption/package.json +0 -7
- package/FigureImage/package.json +0 -7
- package/FloatingLabel/package.json +0 -7
- package/Form/package.json +0 -7
- package/FormCheck/package.json +0 -7
- package/FormCheckInput/package.json +0 -7
- package/FormCheckLabel/package.json +0 -7
- package/FormContext/package.json +0 -7
- package/FormControl/package.json +0 -7
- package/FormFloating/package.json +0 -7
- package/FormGroup/package.json +0 -7
- package/FormLabel/package.json +0 -7
- package/FormRange/package.json +0 -7
- package/FormSelect/package.json +0 -7
- package/FormText/package.json +0 -7
- package/Image/package.json +0 -7
- package/InputGroup/package.json +0 -7
- package/InputGroupContext/package.json +0 -7
- package/InputGroupText/package.json +0 -7
- package/ListGroup/package.json +0 -7
- package/ListGroupItem/package.json +0 -7
- package/Modal/package.json +0 -7
- package/ModalBody/package.json +0 -7
- package/ModalContext/package.json +0 -7
- package/ModalDialog/package.json +0 -7
- package/ModalFooter/package.json +0 -7
- package/ModalHeader/package.json +0 -7
- package/ModalTitle/package.json +0 -7
- package/Nav/package.json +0 -7
- package/NavContext/package.json +0 -7
- package/NavDropdown/package.json +0 -7
- package/NavItem/package.json +0 -7
- package/NavLink/package.json +0 -7
- package/Navbar/package.json +0 -7
- package/NavbarBrand/package.json +0 -7
- package/NavbarCollapse/package.json +0 -7
- package/NavbarContext/package.json +0 -7
- package/NavbarOffcanvas/package.json +0 -7
- package/NavbarText/package.json +0 -7
- package/NavbarToggle/package.json +0 -7
- package/Offcanvas/package.json +0 -7
- package/OffcanvasBody/package.json +0 -7
- package/OffcanvasHeader/package.json +0 -7
- package/OffcanvasTitle/package.json +0 -7
- package/OffcanvasToggling/package.json +0 -7
- package/Overlay/package.json +0 -7
- package/OverlayTrigger/package.json +0 -7
- package/PageItem/package.json +0 -7
- package/Pagination/package.json +0 -7
- package/Placeholder/package.json +0 -7
- package/PlaceholderButton/package.json +0 -7
- package/Popover/package.json +0 -7
- package/PopoverBody/package.json +0 -7
- package/PopoverHeader/package.json +0 -7
- package/ProgressBar/package.json +0 -7
- package/Ratio/package.json +0 -7
- package/Row/package.json +0 -7
- package/SSRProvider/package.json +0 -7
- package/Spinner/package.json +0 -7
- package/SplitButton/package.json +0 -7
- package/Stack/package.json +0 -7
- package/Switch/package.json +0 -7
- package/Tab/package.json +0 -7
- package/TabContainer/package.json +0 -7
- package/TabContent/package.json +0 -7
- package/TabPane/package.json +0 -7
- package/Table/package.json +0 -7
- package/Tabs/package.json +0 -7
- package/ThemeProvider/package.json +0 -7
- package/Toast/package.json +0 -7
- package/ToastBody/package.json +0 -7
- package/ToastContainer/package.json +0 -7
- package/ToastContext/package.json +0 -7
- package/ToastFade/package.json +0 -7
- package/ToastHeader/package.json +0 -7
- package/ToggleButton/package.json +0 -7
- package/ToggleButtonGroup/package.json +0 -7
- package/Tooltip/package.json +0 -7
- package/TransitionWrapper/package.json +0 -7
- package/cjs/SSRProvider.d.ts +0 -4
- package/cjs/SSRProvider.js +0 -7
- package/cjs/safeFindDOMNode.d.ts +0 -1
- package/cjs/safeFindDOMNode.js +0 -13
- package/createChainedFunction/package.json +0 -7
- package/createUtilityClasses/package.json +0 -7
- package/createWithBsPrefix/package.json +0 -7
- package/dist/react-bootstrap.js +0 -16932
- package/dist/react-bootstrap.min.js +0 -2
- package/dist/react-bootstrap.min.js.LICENSE.txt +0 -15
- package/divWithClassName/package.json +0 -7
- package/esm/AbstractModalHeader.d.ts +0 -10
- package/esm/Accordion.d.ts +0 -18
- package/esm/AccordionBody.d.ts +0 -7
- package/esm/AccordionButton.d.ts +0 -8
- package/esm/AccordionCollapse.d.ts +0 -12
- package/esm/AccordionHeader.d.ts +0 -6
- package/esm/AccordionItem.d.ts +0 -7
- package/esm/Alert.d.ts +0 -19
- package/esm/AlertHeading.d.ts +0 -6
- package/esm/AlertLink.d.ts +0 -6
- package/esm/Anchor.d.ts +0 -3
- package/esm/Badge.d.ts +0 -10
- package/esm/Breadcrumb.d.ts +0 -10
- package/esm/BreadcrumbItem.d.ts +0 -12
- package/esm/Button.d.ts +0 -11
- package/esm/ButtonGroup.d.ts +0 -8
- package/esm/ButtonToolbar.d.ts +0 -6
- package/esm/Card.d.ts +0 -21
- package/esm/CardBody.d.ts +0 -6
- package/esm/CardFooter.d.ts +0 -6
- package/esm/CardGroup.d.ts +0 -6
- package/esm/CardHeader.d.ts +0 -6
- package/esm/CardImg.d.ts +0 -7
- package/esm/CardImgOverlay.d.ts +0 -6
- package/esm/CardLink.d.ts +0 -6
- package/esm/CardSubtitle.d.ts +0 -6
- package/esm/CardText.d.ts +0 -6
- package/esm/CardTitle.d.ts +0 -6
- package/esm/Carousel.d.ts +0 -36
- package/esm/CarouselCaption.d.ts +0 -6
- package/esm/CarouselItem.d.ts +0 -7
- package/esm/CloseButton.js +0 -31
- package/esm/Col.d.ts +0 -28
- package/esm/Collapse.d.ts +0 -17
- package/esm/Container.d.ts +0 -7
- package/esm/Dropdown.d.ts +0 -21
- package/esm/DropdownButton.d.ts +0 -24
- package/esm/DropdownButton.js +0 -107
- package/esm/DropdownDivider.d.ts +0 -6
- package/esm/DropdownHeader.d.ts +0 -6
- package/esm/DropdownItem.d.ts +0 -6
- package/esm/DropdownItemText.d.ts +0 -6
- package/esm/DropdownMenu.d.ts +0 -18
- package/esm/DropdownToggle.d.ts +0 -12
- package/esm/Fade.d.ts +0 -15
- package/esm/Feedback.d.ts +0 -10
- package/esm/Figure.d.ts +0 -9
- package/esm/FigureCaption.d.ts +0 -6
- package/esm/FloatingLabel.d.ts +0 -9
- package/esm/FormCheck.d.ts +0 -22
- package/esm/FormCheckInput.d.ts +0 -10
- package/esm/FormControl.d.ts +0 -19
- package/esm/FormFloating.d.ts +0 -6
- package/esm/FormGroup.d.ts +0 -7
- package/esm/FormLabel.d.ts +0 -16
- package/esm/FormRange.d.ts +0 -6
- package/esm/FormSelect.d.ts +0 -10
- package/esm/FormText.d.ts +0 -7
- package/esm/Image.d.ts +0 -33
- package/esm/Image.js +0 -48
- package/esm/InputGroup.d.ts +0 -13
- package/esm/InputGroupText.d.ts +0 -6
- package/esm/ListGroup.d.ts +0 -13
- package/esm/ListGroupItem.d.ts +0 -11
- package/esm/Modal.d.ts +0 -26
- package/esm/ModalBody.d.ts +0 -6
- package/esm/ModalDialog.d.ts +0 -11
- package/esm/ModalFooter.d.ts +0 -6
- package/esm/ModalTitle.d.ts +0 -6
- package/esm/Nav.d.ts +0 -18
- package/esm/NavDropdown.d.ts +0 -20
- package/esm/NavItem.d.ts +0 -6
- package/esm/NavLink.d.ts +0 -6
- package/esm/Navbar.d.ts +0 -22
- package/esm/NavbarBrand.d.ts +0 -7
- package/esm/NavbarText.d.ts +0 -6
- package/esm/NavbarToggle.d.ts +0 -7
- package/esm/Offcanvas.d.ts +0 -18
- package/esm/OffcanvasBody.d.ts +0 -6
- package/esm/OffcanvasTitle.d.ts +0 -6
- package/esm/OffcanvasToggling.d.ts +0 -15
- package/esm/Overlay.d.ts +0 -24
- package/esm/OverlayTrigger.d.ts +0 -29
- package/esm/PageItem.d.ts +0 -17
- package/esm/Placeholder.d.ts +0 -8
- package/esm/PlaceholderButton.d.ts +0 -8
- package/esm/Popover.d.ts +0 -19
- package/esm/PopoverBody.d.ts +0 -6
- package/esm/PopoverHeader.d.ts +0 -6
- package/esm/ProgressBar.d.ts +0 -15
- package/esm/Ratio.d.ts +0 -9
- package/esm/Row.d.ts +0 -17
- package/esm/SSRProvider.d.ts +0 -4
- package/esm/SSRProvider.js +0 -2
- package/esm/Spinner.d.ts +0 -10
- package/esm/SplitButton.d.ts +0 -27
- package/esm/SplitButton.js +0 -126
- package/esm/Stack.d.ts +0 -11
- package/esm/Tab.d.ts +0 -27
- package/esm/Tab.js +0 -33
- package/esm/TabContainer.d.ts +0 -62
- package/esm/TabContent.d.ts +0 -6
- package/esm/TabPane.d.ts +0 -12
- package/esm/Table.d.ts +0 -13
- package/esm/Tabs.d.ts +0 -9
- package/esm/Toast.d.ts +0 -18
- package/esm/ToastBody.d.ts +0 -6
- package/esm/ToastContainer.d.ts +0 -9
- package/esm/ToastHeader.d.ts +0 -10
- package/esm/ToggleButton.d.ts +0 -15
- package/esm/ToggleButtonGroup.d.ts +0 -23
- package/esm/Tooltip.d.ts +0 -15
- package/esm/divWithClassName.js +0 -8
- package/esm/helpers.d.ts +0 -24
- package/esm/safeFindDOMNode.d.ts +0 -1
- package/esm/safeFindDOMNode.js +0 -7
- package/esm/types.d.ts +0 -29
- package/esm/types.js +0 -13
- package/esm/usePlaceholder.d.ts +0 -10
- package/getInitialPopperStyles/package.json +0 -7
- package/getTabTransitionComponent/package.json +0 -7
- package/helpers/package.json +0 -7
- package/safeFindDOMNode/package.json +0 -7
- package/transitionEndListener/package.json +0 -7
- package/triggerBrowserReflow/package.json +0 -7
- package/types/package.json +0 -7
- package/useOverlayOffset/package.json +0 -7
- package/usePlaceholder/package.json +0 -7
- package/useWrappedRefWithWarning/package.json +0 -7
- /package/{esm → lib}/AccordionContext.js +0 -0
- /package/{esm → lib}/AccordionItemContext.d.ts +0 -0
- /package/{esm → lib}/AccordionItemContext.js +0 -0
- /package/{esm → lib}/Anchor.js +0 -0
- /package/{esm → lib}/CardHeaderContext.d.ts +0 -0
- /package/{esm → lib}/CardHeaderContext.js +0 -0
- /package/{esm → lib}/DropdownContext.js +0 -0
- /package/{esm → lib}/ElementChildren.d.ts +0 -0
- /package/{esm → lib}/FormContext.d.ts +0 -0
- /package/{esm → lib}/FormContext.js +0 -0
- /package/{esm → lib}/FormGroup.js +0 -0
- /package/{esm → lib}/InputGroupContext.d.ts +0 -0
- /package/{esm → lib}/InputGroupContext.js +0 -0
- /package/{esm → lib}/ModalContext.d.ts +0 -0
- /package/{esm → lib}/NavContext.js +0 -0
- /package/{esm → lib}/NavbarCollapse.js +0 -0
- /package/{esm → lib}/NavbarContext.d.ts +0 -0
- /package/{esm → lib}/NavbarContext.js +0 -0
- /package/{esm → lib}/Placeholder.js +0 -0
- /package/{esm → lib}/PlaceholderButton.js +0 -0
- /package/{esm → lib}/Switch.js +0 -0
- /package/{esm → lib}/ThemeProvider.js +0 -0
- /package/{esm → lib}/ToastContext.d.ts +0 -0
- /package/{esm → lib}/ToastFade.js +0 -0
- /package/{esm → lib}/createChainedFunction.d.ts +0 -0
- /package/{esm → lib}/divWithClassName.d.ts +0 -0
- /package/{esm → lib}/getInitialPopperStyles.d.ts +0 -0
- /package/{esm → lib}/getInitialPopperStyles.js +0 -0
- /package/{esm → lib}/getTabTransitionComponent.js +0 -0
- /package/{esm → lib}/transitionEndListener.d.ts +0 -0
- /package/{esm → lib}/transitionEndListener.js +0 -0
- /package/{esm → lib}/triggerBrowserReflow.d.ts +0 -0
- /package/{esm → lib}/triggerBrowserReflow.js +0 -0
- /package/{esm → lib}/useOverlayOffset.js +0 -0
- /package/{esm → lib}/useWrappedRefWithWarning.d.ts +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { CollapseProps } from './Collapse';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { type CollapseProps } from './Collapse';
|
|
3
|
+
export interface NavbarCollapseProps extends Omit<CollapseProps, 'children'>, React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* @default 'navbar-collapse'
|
|
6
|
+
*/
|
|
7
|
+
bsPrefix?: string | undefined;
|
|
5
8
|
}
|
|
6
9
|
declare const NavbarCollapse: React.ForwardRefExoticComponent<NavbarCollapseProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
10
|
export default NavbarCollapse;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { ModalHandle } from '@restart/ui/Modal';
|
|
3
|
+
import { type OffcanvasProps } from './Offcanvas';
|
|
3
4
|
export type NavbarOffcanvasProps = Omit<OffcanvasProps, 'show'>;
|
|
4
|
-
declare const NavbarOffcanvas: React.ForwardRefExoticComponent<Omit<NavbarOffcanvasProps, "ref"> & React.RefAttributes<
|
|
5
|
+
declare const NavbarOffcanvas: React.ForwardRefExoticComponent<Omit<NavbarOffcanvasProps, "ref"> & React.RefAttributes<ModalHandle>>;
|
|
5
6
|
export default NavbarOffcanvas;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DynamicRefForwardingComponent } from '@restart/ui/types';
|
|
3
|
+
export interface NavbarTextProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Element used to render the component.
|
|
6
|
+
*/
|
|
7
|
+
as?: React.ElementType | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @default 'navbar-text'
|
|
10
|
+
*/
|
|
11
|
+
bsPrefix?: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
declare const NavbarText: DynamicRefForwardingComponent<'span', NavbarTextProps>;
|
|
14
|
+
export default NavbarText;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const NavbarText = /*#__PURE__*/React.forwardRef(({
|
|
@@ -13,7 +13,7 @@ const NavbarText = /*#__PURE__*/React.forwardRef(({
|
|
|
13
13
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-text');
|
|
14
14
|
return /*#__PURE__*/_jsx(Component, {
|
|
15
15
|
ref: ref,
|
|
16
|
-
className:
|
|
16
|
+
className: clsx(className, bsPrefix),
|
|
17
17
|
...props
|
|
18
18
|
});
|
|
19
19
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DynamicRefForwardingComponent } from '@restart/ui/types';
|
|
3
|
+
export interface NavbarToggleProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Element used to render the component.
|
|
6
|
+
*/
|
|
7
|
+
as?: React.ElementType | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @default 'navbar-toggler'
|
|
10
|
+
*/
|
|
11
|
+
bsPrefix?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* An accessible ARIA label for the toggler button.
|
|
14
|
+
*/
|
|
15
|
+
label?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The toggle content. When empty, the default toggle will be rendered.
|
|
18
|
+
*/
|
|
19
|
+
children?: React.ReactNode | undefined;
|
|
20
|
+
}
|
|
21
|
+
declare const NavbarToggle: DynamicRefForwardingComponent<'button', NavbarToggleProps>;
|
|
22
|
+
export default NavbarToggle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import clsx from 'clsx';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useContext } from 'react';
|
|
6
6
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
@@ -34,7 +34,7 @@ const NavbarToggle = /*#__PURE__*/React.forwardRef(({
|
|
|
34
34
|
ref: ref,
|
|
35
35
|
onClick: handleClick,
|
|
36
36
|
"aria-label": label,
|
|
37
|
-
className:
|
|
37
|
+
className: clsx(className, bsPrefix, !expanded && 'collapsed'),
|
|
38
38
|
children: children || /*#__PURE__*/_jsx("span", {
|
|
39
39
|
className: `${bsPrefix}-icon`
|
|
40
40
|
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ModalHandle } from '@restart/ui/Modal';
|
|
3
|
+
import type { BaseModalProps } from './types';
|
|
4
|
+
export type OffcanvasPlacement = 'start' | 'end' | 'top' | 'bottom';
|
|
5
|
+
export interface OffcanvasProps extends BaseModalProps {
|
|
6
|
+
/**
|
|
7
|
+
* @default 'offcanvas'
|
|
8
|
+
*/
|
|
9
|
+
bsPrefix?: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Add an optional extra class name to .offcanvas-backdrop.
|
|
12
|
+
*/
|
|
13
|
+
backdropClassName?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Allow body scrolling while offcanvas is open.
|
|
16
|
+
*/
|
|
17
|
+
scroll?: boolean | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Which side of the viewport the offcanvas will appear from.
|
|
20
|
+
*/
|
|
21
|
+
placement?: OffcanvasPlacement | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Hide content outside the viewport from a specified breakpoint and down.
|
|
24
|
+
*/
|
|
25
|
+
responsive?: 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | string | undefined;
|
|
26
|
+
[other: string]: any;
|
|
27
|
+
}
|
|
28
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<OffcanvasProps, "ref"> & React.RefAttributes<ModalHandle>> & {
|
|
29
|
+
Body: import("@restart/ui/types").DynamicRefForwardingComponent<"div", import("./OffcanvasBody").OffcanvasBodyProps>;
|
|
30
|
+
Header: React.ForwardRefExoticComponent<import("./OffcanvasHeader").OffcanvasHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
Title: import("@restart/ui/types").DynamicRefForwardingComponent<"div", import("./OffcanvasTitle").OffcanvasTitleProps>;
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
package/{esm → lib}/Offcanvas.js
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import useDebouncedCallback from '@restart/hooks/useDebouncedCallback';
|
|
5
5
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
6
|
+
import useEventListener from '@restart/hooks/useEventListener';
|
|
6
7
|
import * as React from 'react';
|
|
7
|
-
import { useCallback,
|
|
8
|
+
import { useCallback, useMemo, useRef } from 'react';
|
|
8
9
|
import BaseModal from '@restart/ui/Modal';
|
|
9
10
|
import Fade from './Fade';
|
|
10
11
|
import OffcanvasBody from './OffcanvasBody';
|
|
@@ -15,8 +16,6 @@ import OffcanvasTitle from './OffcanvasTitle';
|
|
|
15
16
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
16
17
|
import BootstrapModalManager, { getSharedManager } from './BootstrapModalManager';
|
|
17
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
function DialogTransition(props) {
|
|
21
20
|
return /*#__PURE__*/_jsx(OffcanvasToggling, {
|
|
22
21
|
...props
|
|
@@ -56,19 +55,19 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
56
55
|
onExited,
|
|
57
56
|
backdropClassName,
|
|
58
57
|
manager: propsManager,
|
|
59
|
-
renderStaticNode = false,
|
|
60
58
|
...props
|
|
61
59
|
}, ref) => {
|
|
62
|
-
const
|
|
60
|
+
const offcanvasRef = useRef(null);
|
|
61
|
+
const modalManager = useRef(null);
|
|
63
62
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas');
|
|
64
|
-
const [showOffcanvas, setShowOffcanvas] = useState(false);
|
|
65
63
|
const handleHide = useEventCallback(onHide);
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
const debouncedResizeHandler = useDebouncedCallback(() => {
|
|
65
|
+
if (show && responsive && offcanvasRef.current && getComputedStyle(offcanvasRef.current).position !== 'fixed') {
|
|
66
|
+
handleHide();
|
|
67
|
+
}
|
|
68
|
+
}, 300);
|
|
69
|
+
const getWindowTarget = useCallback(() => window, []);
|
|
70
|
+
useEventListener(getWindowTarget, 'resize', debouncedResizeHandler);
|
|
72
71
|
const modalContext = useMemo(() => ({
|
|
73
72
|
onHide: handleHide
|
|
74
73
|
}), [handleHide]);
|
|
@@ -94,44 +93,46 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
94
93
|
};
|
|
95
94
|
const renderBackdrop = useCallback(backdropProps => /*#__PURE__*/_jsx("div", {
|
|
96
95
|
...backdropProps,
|
|
97
|
-
className:
|
|
96
|
+
className: clsx(`${bsPrefix}-backdrop`, backdropClassName)
|
|
98
97
|
}), [backdropClassName, bsPrefix]);
|
|
99
98
|
const renderDialog = dialogProps => /*#__PURE__*/_jsx("div", {
|
|
100
99
|
...dialogProps,
|
|
101
100
|
...props,
|
|
102
|
-
className:
|
|
101
|
+
className: clsx(className, responsive ? `${bsPrefix}-${responsive}` : bsPrefix, `${bsPrefix}-${placement}`),
|
|
103
102
|
"aria-labelledby": ariaLabelledby,
|
|
103
|
+
ref: offcanvasRef,
|
|
104
104
|
children: children
|
|
105
105
|
});
|
|
106
|
-
return /*#__PURE__*/
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
106
|
+
return /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
107
|
+
value: modalContext,
|
|
108
|
+
children: /*#__PURE__*/_jsx(BaseModal, {
|
|
109
|
+
show: show,
|
|
110
|
+
ref: ref,
|
|
111
|
+
backdrop: backdrop,
|
|
112
|
+
container: container,
|
|
113
|
+
keyboard: keyboard,
|
|
114
|
+
autoFocus: autoFocus,
|
|
115
|
+
enforceFocus: enforceFocus && !scroll,
|
|
116
|
+
restoreFocus: restoreFocus,
|
|
117
|
+
restoreFocusOptions: restoreFocusOptions,
|
|
118
|
+
onEscapeKeyDown: onEscapeKeyDown,
|
|
119
|
+
onShow: onShow,
|
|
120
|
+
onHide: handleHide,
|
|
121
|
+
onEnter: handleEnter,
|
|
122
|
+
onEntering: onEntering,
|
|
123
|
+
onEntered: onEntered,
|
|
124
|
+
onExit: onExit,
|
|
125
|
+
onExiting: onExiting,
|
|
126
|
+
onExited: handleExited,
|
|
127
|
+
manager: getModalManager(),
|
|
128
|
+
transition: DialogTransition,
|
|
129
|
+
backdropTransition: BackdropTransition,
|
|
130
|
+
renderBackdrop: renderBackdrop,
|
|
131
|
+
renderDialog: renderDialog,
|
|
132
|
+
mountDialogOnEnter: false,
|
|
133
|
+
unmountDialogOnExit: false,
|
|
134
|
+
portal: false
|
|
135
|
+
})
|
|
135
136
|
});
|
|
136
137
|
});
|
|
137
138
|
Offcanvas.displayName = 'Offcanvas';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DynamicRefForwardingComponent } from '@restart/ui/types';
|
|
3
|
+
export interface OffcanvasBodyProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Element used to render the component.
|
|
6
|
+
*/
|
|
7
|
+
as?: React.ElementType | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @default 'offcanvas-body'
|
|
10
|
+
*/
|
|
11
|
+
bsPrefix?: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
declare const OffcanvasBody: DynamicRefForwardingComponent<'div', OffcanvasBodyProps>;
|
|
14
|
+
export default OffcanvasBody;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const OffcanvasBody = /*#__PURE__*/React.forwardRef(({
|
|
@@ -13,7 +13,7 @@ const OffcanvasBody = /*#__PURE__*/React.forwardRef(({
|
|
|
13
13
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas-body');
|
|
14
14
|
return /*#__PURE__*/_jsx(Component, {
|
|
15
15
|
ref: ref,
|
|
16
|
-
className:
|
|
16
|
+
className: clsx(className, bsPrefix),
|
|
17
17
|
...props
|
|
18
18
|
});
|
|
19
19
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AbstractModalHeaderProps } from './AbstractModalHeader';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { type AbstractModalHeaderProps } from './AbstractModalHeader';
|
|
3
|
+
export interface OffcanvasHeaderProps extends AbstractModalHeaderProps {
|
|
4
|
+
/**
|
|
5
|
+
* @default 'offcanvas-header'
|
|
6
|
+
*/
|
|
7
|
+
bsPrefix?: string | undefined;
|
|
5
8
|
}
|
|
6
9
|
declare const OffcanvasHeader: React.ForwardRefExoticComponent<OffcanvasHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
10
|
export default OffcanvasHeader;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import clsx from 'clsx';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
6
6
|
import AbstractModalHeader from './AbstractModalHeader';
|
|
@@ -16,7 +16,7 @@ const OffcanvasHeader = /*#__PURE__*/React.forwardRef(({
|
|
|
16
16
|
return /*#__PURE__*/_jsx(AbstractModalHeader, {
|
|
17
17
|
ref: ref,
|
|
18
18
|
...props,
|
|
19
|
-
className:
|
|
19
|
+
className: clsx(className, bsPrefix),
|
|
20
20
|
closeLabel: closeLabel,
|
|
21
21
|
closeButton: closeButton
|
|
22
22
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DynamicRefForwardingComponent } from '@restart/ui/types';
|
|
3
|
+
export interface OffcanvasTitleProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Element used to render the component.
|
|
6
|
+
*/
|
|
7
|
+
as?: React.ElementType | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @default 'offcanvas-title'
|
|
10
|
+
*/
|
|
11
|
+
bsPrefix?: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
declare const OffcanvasTitle: DynamicRefForwardingComponent<'div', OffcanvasTitleProps>;
|
|
14
|
+
export default OffcanvasTitle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
import divWithClassName from './divWithClassName';
|
|
6
6
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -15,7 +15,7 @@ const OffcanvasTitle = /*#__PURE__*/React.forwardRef(({
|
|
|
15
15
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas-title');
|
|
16
16
|
return /*#__PURE__*/_jsx(Component, {
|
|
17
17
|
ref: ref,
|
|
18
|
-
className:
|
|
18
|
+
className: clsx(className, bsPrefix),
|
|
19
19
|
...props
|
|
20
20
|
});
|
|
21
21
|
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Transition from 'react-transition-group/Transition';
|
|
3
|
+
import type { TransitionCallbacks } from './types';
|
|
4
|
+
export interface OffcanvasTogglingProps extends TransitionCallbacks {
|
|
5
|
+
/**
|
|
6
|
+
* @default 'offcanvas'
|
|
7
|
+
*/
|
|
8
|
+
bsPrefix?: string | undefined;
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Show the component; triggers the fade in or fade out animation
|
|
12
|
+
*/
|
|
13
|
+
in?: boolean | string;
|
|
14
|
+
/**
|
|
15
|
+
* Wait until the first "enter" transition to mount the component (add it to the DOM)
|
|
16
|
+
*/
|
|
17
|
+
mountOnEnter?: boolean | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Unmount the component (remove it from the DOM) when it is faded out
|
|
20
|
+
*/
|
|
21
|
+
unmountOnExit?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Run the fade in animation when the component mounts, if it is initially
|
|
24
|
+
* shown
|
|
25
|
+
*/
|
|
26
|
+
appear?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Duration of the fade animation in milliseconds, to ensure that finishing
|
|
29
|
+
* callbacks are fired even if the original browser transition end events are
|
|
30
|
+
* canceled
|
|
31
|
+
*/
|
|
32
|
+
timeout?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* You must provide a single JSX child element to this component and that element cannot be a \<React.Fragment\>
|
|
35
|
+
*/
|
|
36
|
+
children: React.ReactElement;
|
|
37
|
+
}
|
|
38
|
+
declare const OffcanvasToggling: React.ForwardRefExoticComponent<OffcanvasTogglingProps & React.RefAttributes<Transition<any>>>;
|
|
39
|
+
export default OffcanvasToggling;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import clsx from 'clsx';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ENTERED, ENTERING, EXITING } from 'react-transition-group/Transition';
|
|
6
6
|
import { getChildRef } from '@restart/ui/utils';
|
|
@@ -34,7 +34,7 @@ const OffcanvasToggling = /*#__PURE__*/React.forwardRef(({
|
|
|
34
34
|
childRef: getChildRef(children),
|
|
35
35
|
children: (status, innerProps) => /*#__PURE__*/React.cloneElement(children, {
|
|
36
36
|
...innerProps,
|
|
37
|
-
className:
|
|
37
|
+
className: clsx(className, children.props.className, (status === ENTERING || status === EXITING) && `${bsPrefix}-toggling`, transitionStyles[status])
|
|
38
38
|
})
|
|
39
39
|
});
|
|
40
40
|
});
|
package/lib/Overlay.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OverlayArrowProps } from '@restart/ui/Overlay';
|
|
3
|
+
import type { TransitionType } from './helpers';
|
|
4
|
+
import type { BaseOverlayProps, Placement, PopperRef, RootCloseEvent } from './types';
|
|
5
|
+
export interface OverlayInjectedProps {
|
|
6
|
+
ref: React.RefCallback<HTMLElement>;
|
|
7
|
+
style: React.CSSProperties;
|
|
8
|
+
'aria-labelledby'?: string;
|
|
9
|
+
arrowProps: Partial<OverlayArrowProps>;
|
|
10
|
+
show: boolean;
|
|
11
|
+
placement: Placement | undefined;
|
|
12
|
+
popper: PopperRef;
|
|
13
|
+
hasDoneInitialMeasure?: boolean;
|
|
14
|
+
[prop: string]: any;
|
|
15
|
+
}
|
|
16
|
+
export type OverlayChildren = React.ReactElement<OverlayInjectedProps> | ((injected: OverlayInjectedProps) => React.ReactNode);
|
|
17
|
+
export interface OverlayProps extends BaseOverlayProps {
|
|
18
|
+
/**
|
|
19
|
+
* A component instance, DOM node, or function that returns either.
|
|
20
|
+
*/
|
|
21
|
+
children: OverlayChildren;
|
|
22
|
+
/**
|
|
23
|
+
* Animate the entering and exiting of the Overlay. `true` will use the `<Fade>` transition,
|
|
24
|
+
* or a custom react-transition-group `<Transition>` component can be provided.
|
|
25
|
+
*
|
|
26
|
+
* @default Fade
|
|
27
|
+
*/
|
|
28
|
+
transition?: TransitionType | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The placement of the Overlay in relation to it's `target`.
|
|
31
|
+
*
|
|
32
|
+
* @type {Placement | undefined}
|
|
33
|
+
*/
|
|
34
|
+
placement?: Placement | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Specify event for triggering a "root close" toggle.
|
|
37
|
+
*/
|
|
38
|
+
rootCloseEvent?: RootCloseEvent | undefined;
|
|
39
|
+
}
|
|
40
|
+
declare const Overlay: React.ForwardRefExoticComponent<OverlayProps & React.RefAttributes<HTMLElement>>;
|
|
41
|
+
export default Overlay;
|
package/{esm → lib}/Overlay.js
RENAMED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
import BaseOverlay from '@restart/ui/Overlay';
|
|
7
7
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
8
8
|
import useIsomorphicEffect from '@restart/hooks/useIsomorphicEffect';
|
|
9
9
|
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
10
10
|
import useOverlayOffset from './useOverlayOffset';
|
|
11
11
|
import Fade from './Fade';
|
|
12
|
-
import safeFindDOMNode from './safeFindDOMNode';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
13
|
function wrapRefs(props, arrowProps) {
|
|
15
14
|
const {
|
|
@@ -18,8 +17,8 @@ function wrapRefs(props, arrowProps) {
|
|
|
18
17
|
const {
|
|
19
18
|
ref: aRef
|
|
20
19
|
} = arrowProps;
|
|
21
|
-
props.ref = ref.__wrapped || (ref.__wrapped = r => ref(
|
|
22
|
-
arrowProps.ref = aRef.__wrapped || (aRef.__wrapped = r => aRef(
|
|
20
|
+
props.ref = ref.__wrapped || (ref.__wrapped = r => ref(r));
|
|
21
|
+
arrowProps.ref = aRef.__wrapped || (aRef.__wrapped = r => aRef(r));
|
|
23
22
|
}
|
|
24
23
|
const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
25
24
|
children: overlay,
|
|
@@ -96,7 +95,7 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
96
95
|
arrowProps,
|
|
97
96
|
popper,
|
|
98
97
|
hasDoneInitialMeasure,
|
|
99
|
-
className:
|
|
98
|
+
className: clsx(overlay.props.className, !transition && show && 'show'),
|
|
100
99
|
style: {
|
|
101
100
|
...overlay.props.style,
|
|
102
101
|
...overlayProps.style
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type OverlayChildren, type OverlayProps } from './Overlay';
|
|
3
|
+
import type { Placement } from './types';
|
|
4
|
+
export type OverlayTriggerType = 'hover' | 'click' | 'focus';
|
|
5
|
+
export type OverlayDelay = number | {
|
|
6
|
+
show: number;
|
|
7
|
+
hide: number;
|
|
8
|
+
};
|
|
9
|
+
export type OverlayInjectedProps = {
|
|
10
|
+
onFocus?: (...args: any[]) => any;
|
|
11
|
+
};
|
|
12
|
+
export type OverlayTriggerRenderProps = OverlayInjectedProps & {
|
|
13
|
+
ref: React.Ref<any>;
|
|
14
|
+
};
|
|
15
|
+
export interface OverlayTriggerProps extends Omit<OverlayProps, 'children' | 'target' | 'onHide'> {
|
|
16
|
+
children: React.ReactElement | ((props: OverlayTriggerRenderProps) => React.ReactNode);
|
|
17
|
+
/**
|
|
18
|
+
* Specify which action or actions trigger Overlay visibility
|
|
19
|
+
*
|
|
20
|
+
* The `click` trigger ignores the configured `delay`.
|
|
21
|
+
*/
|
|
22
|
+
trigger?: OverlayTriggerType | OverlayTriggerType[] | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* A millisecond delay amount to show and hide the Overlay once triggered
|
|
25
|
+
*/
|
|
26
|
+
delay?: OverlayDelay | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The visibility of the Overlay. `show` is a _controlled_ prop so should be paired
|
|
29
|
+
* with `onToggle` to avoid breaking user interactions.
|
|
30
|
+
*
|
|
31
|
+
* Manually toggling `show` does **not** wait for `delay` to change the visibility.
|
|
32
|
+
*
|
|
33
|
+
* @controllable onToggle
|
|
34
|
+
*/
|
|
35
|
+
show?: boolean | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The initial visibility state of the Overlay.
|
|
38
|
+
*/
|
|
39
|
+
defaultShow?: boolean | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* A callback that fires when the user triggers a change in tooltip visibility.
|
|
42
|
+
*
|
|
43
|
+
* `onToggle` is called with the desired next `show`, and generally should be passed
|
|
44
|
+
* back to the `show` prop. `onToggle` fires _after_ the configured `delay`
|
|
45
|
+
*
|
|
46
|
+
* @type {((nextShow: boolean) => void) | undefined}
|
|
47
|
+
* @controllable `show`
|
|
48
|
+
*/
|
|
49
|
+
onToggle?: ((nextShow: boolean) => void) | undefined;
|
|
50
|
+
/**
|
|
51
|
+
The initial flip state of the Overlay. If `placement` is specified and is anything
|
|
52
|
+
other than "auto", this prop will default to `false`, otherwise the default is `true`.
|
|
53
|
+
*/
|
|
54
|
+
flip?: boolean | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* An element or text to overlay next to the target.
|
|
57
|
+
*
|
|
58
|
+
* @type {React.ReactElement<OverlayInjectedProps> | ((injected: OverlayInjectedProps) => React.ReactNode)}
|
|
59
|
+
*/
|
|
60
|
+
overlay: OverlayChildren;
|
|
61
|
+
/**
|
|
62
|
+
* The placement of the Overlay in relation to it's `target`.
|
|
63
|
+
*/
|
|
64
|
+
placement?: Placement | undefined;
|
|
65
|
+
}
|
|
66
|
+
declare const OverlayTrigger: React.FC<OverlayTriggerProps>;
|
|
67
|
+
export default OverlayTrigger;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import contains from 'dom-helpers/contains';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
import { cloneElement, useCallback, useRef } from 'react';
|
|
7
6
|
import useTimeout from '@restart/hooks/useTimeout';
|
|
@@ -10,10 +9,7 @@ import { useUncontrolledProp } from 'uncontrollable';
|
|
|
10
9
|
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
11
10
|
import { getChildRef } from '@restart/ui/utils';
|
|
12
11
|
import Overlay from './Overlay';
|
|
13
|
-
import
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
13
|
function normalizeDelay(delay) {
|
|
18
14
|
return delay && typeof delay === 'object' ? delay : {
|
|
19
15
|
show: delay,
|
|
@@ -25,9 +21,7 @@ function normalizeDelay(delay) {
|
|
|
25
21
|
// React's built version is broken: https://github.com/facebook/react/issues/4251
|
|
26
22
|
// for cases when the trigger is disabled and mouseOut/Over can cause flicker
|
|
27
23
|
// moving from one child element to another.
|
|
28
|
-
function handleMouseOverOut(
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
30
|
-
handler, args, relatedNative) {
|
|
24
|
+
function handleMouseOverOut(handler, args, relatedNative) {
|
|
31
25
|
const [e] = args;
|
|
32
26
|
const target = e.currentTarget;
|
|
33
27
|
const related = e.relatedTarget || e.nativeEvent[relatedNative];
|
|
@@ -35,7 +29,6 @@ handler, args, relatedNative) {
|
|
|
35
29
|
handler(...args);
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
|
-
const triggerType = PropTypes.oneOf(['click', 'hover', 'focus']);
|
|
39
32
|
const OverlayTrigger = ({
|
|
40
33
|
trigger = ['hover', 'focus'],
|
|
41
34
|
overlay,
|
|
@@ -60,9 +53,6 @@ const OverlayTrigger = ({
|
|
|
60
53
|
onBlur,
|
|
61
54
|
onClick
|
|
62
55
|
} = typeof children !== 'function' ? React.Children.only(children).props : {};
|
|
63
|
-
const attachRef = r => {
|
|
64
|
-
mergedRef(safeFindDOMNode(r));
|
|
65
|
-
};
|
|
66
56
|
const handleShow = useCallback(() => {
|
|
67
57
|
timeout.clear();
|
|
68
58
|
hoverStateRef.current = 'show';
|
|
@@ -105,7 +95,7 @@ const OverlayTrigger = ({
|
|
|
105
95
|
}, [handleHide]);
|
|
106
96
|
const triggers = trigger == null ? [] : [].concat(trigger);
|
|
107
97
|
const triggerProps = {
|
|
108
|
-
ref:
|
|
98
|
+
ref: mergedRef
|
|
109
99
|
};
|
|
110
100
|
if (triggers.indexOf('click') !== -1) {
|
|
111
101
|
triggerProps.onClick = handleClick;
|
|
@@ -132,4 +122,5 @@ const OverlayTrigger = ({
|
|
|
132
122
|
})]
|
|
133
123
|
});
|
|
134
124
|
};
|
|
125
|
+
OverlayTrigger.displayName = 'OverlayTrigger';
|
|
135
126
|
export default OverlayTrigger;
|