react-bootstrap 2.7.4 → 2.9.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cjs/AbstractModalHeader.js +1 -0
- package/cjs/AbstractNav.d.ts +15 -0
- package/cjs/AbstractNavItem.d.ts +19 -0
- package/cjs/Accordion.js +1 -0
- package/cjs/AccordionBody.js +1 -0
- package/cjs/AccordionButton.js +1 -0
- package/cjs/AccordionCollapse.js +1 -0
- package/cjs/AccordionContext.js +1 -0
- package/cjs/AccordionHeader.js +1 -0
- package/cjs/AccordionItem.js +1 -0
- package/cjs/AccordionItemContext.js +1 -0
- package/cjs/AccordionToggle.d.ts +11 -0
- package/cjs/Alert.d.ts +1 -1
- package/cjs/Alert.js +1 -0
- package/cjs/Badge.js +1 -0
- package/cjs/Breadcrumb.js +1 -0
- package/cjs/BreadcrumbItem.js +1 -0
- package/cjs/Button.js +1 -0
- package/cjs/ButtonGroup.js +1 -0
- package/cjs/ButtonToolbar.js +1 -0
- package/cjs/Card.d.ts +2 -2
- package/cjs/Card.js +1 -0
- package/cjs/CardColumns.d.ts +2 -0
- package/cjs/CardContext.d.ts +6 -0
- package/cjs/CardDeck.d.ts +2 -0
- package/cjs/CardHeader.js +1 -0
- package/cjs/CardHeaderContext.js +1 -0
- package/cjs/CardImg.js +1 -0
- package/cjs/Carousel.js +1 -0
- package/cjs/CarouselItem.js +1 -0
- package/cjs/Col.js +1 -0
- package/cjs/Container.js +1 -0
- package/cjs/Dropdown.js +1 -0
- package/cjs/DropdownContext.js +1 -0
- package/cjs/DropdownItem.js +1 -0
- package/cjs/DropdownMenu.js +1 -0
- package/cjs/DropdownToggle.js +1 -0
- package/cjs/FloatingLabel.js +1 -0
- package/cjs/Form.d.ts +10 -4
- package/cjs/FormCheck.js +1 -0
- package/cjs/FormCheckInput.js +1 -0
- package/cjs/FormCheckLabel.js +1 -0
- package/cjs/FormContext.js +1 -0
- package/cjs/FormControl.js +1 -0
- package/cjs/FormFile.d.ts +23 -0
- package/cjs/FormFileInput.d.ts +10 -0
- package/cjs/FormFileLabel.d.ts +7 -0
- package/cjs/FormLabel.js +1 -0
- package/cjs/FormRange.js +1 -0
- package/cjs/FormSelect.js +1 -0
- package/cjs/FormText.js +1 -0
- package/cjs/Image.js +1 -0
- package/cjs/InputGroup.js +1 -0
- package/cjs/InputGroupContext.js +1 -0
- package/cjs/Jumbotron.d.ts +7 -0
- package/cjs/ListGroup.js +1 -0
- package/cjs/ListGroupItem.js +1 -0
- package/cjs/Media.d.ts +8 -0
- package/cjs/Modal.d.ts +1 -1
- package/cjs/Modal.js +1 -0
- package/cjs/ModalContext.js +1 -0
- package/cjs/ModalDialog.js +1 -0
- package/cjs/ModalHeader.js +1 -0
- package/cjs/ModalTitle.d.ts +1 -1
- package/cjs/Nav.d.ts +1 -1
- package/cjs/Nav.js +1 -0
- package/cjs/NavContext.js +1 -0
- package/cjs/NavDropdown.js +1 -0
- package/cjs/NavLink.js +1 -0
- package/cjs/Navbar.d.ts +1 -1
- package/cjs/Navbar.js +1 -0
- package/cjs/NavbarBrand.js +1 -0
- package/cjs/NavbarCollapse.js +1 -0
- package/cjs/NavbarContext.js +1 -0
- package/cjs/NavbarOffcanvas.d.ts +1 -1
- package/cjs/NavbarOffcanvas.js +1 -0
- package/cjs/NavbarToggle.js +1 -0
- package/cjs/Offcanvas.d.ts +1 -1
- package/cjs/Offcanvas.js +1 -0
- package/cjs/OffcanvasHeader.js +1 -0
- package/cjs/OffcanvasTitle.d.ts +1 -1
- package/cjs/OffcanvasToggling.js +1 -0
- package/cjs/Overlay.js +1 -0
- package/cjs/OverlayTrigger.js +1 -0
- package/cjs/PageItem.d.ts +2 -0
- package/cjs/PageItem.js +4 -1
- package/cjs/Pagination.js +1 -0
- package/cjs/Popover.js +1 -0
- package/cjs/PopoverContent.d.ts +5 -0
- package/cjs/PopoverTitle.d.ts +5 -0
- package/cjs/ProgressBar.js +1 -0
- package/cjs/Ratio.js +1 -0
- package/cjs/ResponsiveEmbed.d.ts +9 -0
- package/cjs/Row.js +1 -0
- package/cjs/SafeAnchor.d.ts +17 -0
- package/cjs/SelectableContext.d.ts +5 -0
- package/cjs/Spinner.js +1 -0
- package/cjs/Stack.js +1 -0
- package/cjs/Tab.js +0 -6
- package/cjs/TabContext.d.ts +12 -0
- package/cjs/TabPane.js +1 -0
- package/cjs/Table.js +1 -0
- package/cjs/Tabs.d.ts +1 -1
- package/cjs/ThemeProvider.js +1 -0
- package/cjs/Toast.js +1 -0
- package/cjs/ToastContainer.js +1 -0
- package/cjs/ToastContext.js +1 -0
- package/cjs/ToastHeader.js +1 -0
- package/cjs/ToggleButton.js +1 -0
- package/cjs/Tooltip.d.ts +4 -2
- package/cjs/Tooltip.js +6 -1
- package/cjs/TransitionWrapper.d.ts +3 -3
- package/cjs/TransitionWrapper.js +4 -1
- package/cjs/createWithBsPrefix.js +1 -0
- package/cjs/divWithClassName.d.ts +1 -1
- package/cjs/useOverlayOffset.js +16 -5
- package/cjs/usePlaceholder.js +1 -0
- package/cjs/usePopperMarginModifiers.d.ts +4 -0
- package/dist/react-bootstrap.js +312 -216
- package/dist/react-bootstrap.min.js +1 -1
- package/esm/AbstractModalHeader.js +2 -0
- package/esm/AbstractNav.d.ts +15 -0
- package/esm/AbstractNavItem.d.ts +19 -0
- package/esm/Accordion.js +2 -0
- package/esm/AccordionBody.js +2 -0
- package/esm/AccordionButton.js +2 -0
- package/esm/AccordionCollapse.js +2 -0
- package/esm/AccordionContext.js +2 -0
- package/esm/AccordionHeader.js +2 -0
- package/esm/AccordionItem.js +2 -0
- package/esm/AccordionItemContext.js +2 -0
- package/esm/AccordionToggle.d.ts +11 -0
- package/esm/Alert.d.ts +1 -1
- package/esm/Alert.js +2 -0
- package/esm/Badge.js +2 -0
- package/esm/Breadcrumb.js +2 -0
- package/esm/BreadcrumbItem.js +2 -0
- package/esm/Button.js +2 -0
- package/esm/ButtonGroup.js +2 -0
- package/esm/ButtonToolbar.js +2 -0
- package/esm/Card.d.ts +2 -2
- package/esm/Card.js +2 -0
- package/esm/CardColumns.d.ts +2 -0
- package/esm/CardContext.d.ts +6 -0
- package/esm/CardDeck.d.ts +2 -0
- package/esm/CardHeader.js +2 -0
- package/esm/CardHeaderContext.js +2 -0
- package/esm/CardImg.js +2 -0
- package/esm/Carousel.js +2 -0
- package/esm/CarouselItem.js +2 -0
- package/esm/Col.js +2 -0
- package/esm/Container.js +2 -0
- package/esm/Dropdown.js +2 -0
- package/esm/DropdownContext.js +2 -0
- package/esm/DropdownItem.js +2 -0
- package/esm/DropdownMenu.js +2 -0
- package/esm/DropdownToggle.js +2 -0
- package/esm/FloatingLabel.js +2 -0
- package/esm/Form.d.ts +10 -4
- package/esm/FormCheck.js +2 -0
- package/esm/FormCheckInput.js +2 -0
- package/esm/FormCheckLabel.js +2 -0
- package/esm/FormContext.js +2 -0
- package/esm/FormControl.js +2 -0
- package/esm/FormFile.d.ts +23 -0
- package/esm/FormFileInput.d.ts +10 -0
- package/esm/FormFileLabel.d.ts +7 -0
- package/esm/FormLabel.js +2 -0
- package/esm/FormRange.js +2 -0
- package/esm/FormSelect.js +2 -0
- package/esm/FormText.js +2 -0
- package/esm/Image.js +2 -0
- package/esm/InputGroup.js +2 -0
- package/esm/InputGroupContext.js +2 -0
- package/esm/Jumbotron.d.ts +7 -0
- package/esm/ListGroup.js +2 -0
- package/esm/ListGroupItem.js +2 -0
- package/esm/Media.d.ts +8 -0
- package/esm/Modal.d.ts +1 -1
- package/esm/Modal.js +2 -0
- package/esm/ModalContext.js +2 -0
- package/esm/ModalDialog.js +2 -0
- package/esm/ModalHeader.js +2 -0
- package/esm/ModalTitle.d.ts +1 -1
- package/esm/Nav.d.ts +1 -1
- package/esm/Nav.js +2 -0
- package/esm/NavContext.js +2 -0
- package/esm/NavDropdown.js +2 -0
- package/esm/NavLink.js +2 -0
- package/esm/Navbar.d.ts +1 -1
- package/esm/Navbar.js +2 -0
- package/esm/NavbarBrand.js +2 -0
- package/esm/NavbarCollapse.js +2 -0
- package/esm/NavbarContext.js +2 -0
- package/esm/NavbarOffcanvas.d.ts +1 -1
- package/esm/NavbarOffcanvas.js +2 -0
- package/esm/NavbarToggle.js +2 -0
- package/esm/Offcanvas.d.ts +1 -1
- package/esm/Offcanvas.js +2 -0
- package/esm/OffcanvasHeader.js +2 -0
- package/esm/OffcanvasTitle.d.ts +1 -1
- package/esm/OffcanvasToggling.js +2 -0
- package/esm/Overlay.js +2 -0
- package/esm/OverlayTrigger.js +2 -0
- package/esm/PageItem.d.ts +2 -0
- package/esm/PageItem.js +4 -1
- package/esm/Pagination.js +2 -0
- package/esm/Popover.js +2 -0
- package/esm/PopoverContent.d.ts +5 -0
- package/esm/PopoverTitle.d.ts +5 -0
- package/esm/ProgressBar.js +2 -0
- package/esm/Ratio.js +2 -0
- package/esm/ResponsiveEmbed.d.ts +9 -0
- package/esm/Row.js +2 -0
- package/esm/SafeAnchor.d.ts +17 -0
- package/esm/SelectableContext.d.ts +5 -0
- package/esm/Spinner.js +2 -0
- package/esm/Stack.js +2 -0
- package/esm/Tab.js +0 -5
- package/esm/TabContext.d.ts +12 -0
- package/esm/TabPane.js +2 -0
- package/esm/Table.js +2 -0
- package/esm/Tabs.d.ts +1 -1
- package/esm/ThemeProvider.js +2 -0
- package/esm/Toast.js +2 -0
- package/esm/ToastContainer.js +2 -0
- package/esm/ToastContext.js +2 -0
- package/esm/ToastHeader.js +2 -0
- package/esm/ToggleButton.js +2 -0
- package/esm/Tooltip.d.ts +4 -2
- package/esm/Tooltip.js +7 -1
- package/esm/TransitionWrapper.d.ts +3 -3
- package/esm/TransitionWrapper.js +5 -1
- package/esm/createWithBsPrefix.js +2 -0
- package/esm/divWithClassName.d.ts +1 -1
- package/esm/useOverlayOffset.js +17 -5
- package/esm/usePlaceholder.js +2 -0
- package/esm/usePopperMarginModifiers.d.ts +4 -0
- package/package.json +4 -4
package/esm/NavLink.js
CHANGED
package/esm/Navbar.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface NavbarProps extends BsPrefixProps, Omit<React.HTMLAttributes<HT
|
|
|
15
15
|
declare const _default: BsPrefixRefForwardingComponent<"nav", NavbarProps> & {
|
|
16
16
|
Brand: BsPrefixRefForwardingComponent<"a", import("./NavbarBrand").NavbarBrandProps>;
|
|
17
17
|
Collapse: React.ForwardRefExoticComponent<import("./NavbarCollapse").NavbarCollapseProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
-
Offcanvas: React.ForwardRefExoticComponent<
|
|
18
|
+
Offcanvas: React.ForwardRefExoticComponent<Omit<import("./NavbarOffcanvas").NavbarOffcanvasProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
19
|
Text: BsPrefixRefForwardingComponent<"span", unknown>;
|
|
20
20
|
Toggle: BsPrefixRefForwardingComponent<"button", import("./NavbarToggle").NavbarToggleProps>;
|
|
21
21
|
};
|
package/esm/Navbar.js
CHANGED
package/esm/NavbarBrand.js
CHANGED
package/esm/NavbarCollapse.js
CHANGED
package/esm/NavbarContext.js
CHANGED
package/esm/NavbarOffcanvas.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OffcanvasProps } from './Offcanvas';
|
|
3
3
|
export type NavbarOffcanvasProps = Omit<OffcanvasProps, 'show'>;
|
|
4
|
-
declare const NavbarOffcanvas: React.ForwardRefExoticComponent<
|
|
4
|
+
declare const NavbarOffcanvas: React.ForwardRefExoticComponent<Omit<NavbarOffcanvasProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default NavbarOffcanvas;
|
package/esm/NavbarOffcanvas.js
CHANGED
package/esm/NavbarToggle.js
CHANGED
package/esm/Offcanvas.d.ts
CHANGED
|
@@ -13,6 +13,6 @@ export interface OffcanvasProps extends Omit<BaseModalProps, 'role' | 'renderBac
|
|
|
13
13
|
declare const _default: BsPrefixRefForwardingComponent<"div", OffcanvasProps> & {
|
|
14
14
|
Body: BsPrefixRefForwardingComponent<"div", unknown>;
|
|
15
15
|
Header: React.ForwardRefExoticComponent<import("./OffcanvasHeader").OffcanvasHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
-
Title: BsPrefixRefForwardingComponent<React.ForwardRefExoticComponent<
|
|
16
|
+
Title: BsPrefixRefForwardingComponent<React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>, unknown>;
|
|
17
17
|
};
|
|
18
18
|
export default _default;
|
package/esm/Offcanvas.js
CHANGED
package/esm/OffcanvasHeader.js
CHANGED
package/esm/OffcanvasTitle.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<import("react").ForwardRefExoticComponent<
|
|
2
|
+
declare const _default: import("./helpers").BsPrefixRefForwardingComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>, unknown>;
|
|
3
3
|
export default _default;
|
package/esm/OffcanvasToggling.js
CHANGED
package/esm/Overlay.js
CHANGED
package/esm/OverlayTrigger.js
CHANGED
package/esm/PageItem.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export interface PageItemProps extends React.HTMLAttributes<HTMLElement>, BsPref
|
|
|
5
5
|
active?: boolean;
|
|
6
6
|
activeLabel?: string;
|
|
7
7
|
href?: string;
|
|
8
|
+
linkStyle?: React.CSSProperties;
|
|
9
|
+
linkClassName?: string;
|
|
8
10
|
}
|
|
9
11
|
declare const PageItem: BsPrefixRefForwardingComponent<'li', PageItemProps>;
|
|
10
12
|
export default PageItem;
|
package/esm/PageItem.js
CHANGED
|
@@ -11,6 +11,8 @@ const PageItem = /*#__PURE__*/React.forwardRef(({
|
|
|
11
11
|
style,
|
|
12
12
|
activeLabel = '(current)',
|
|
13
13
|
children,
|
|
14
|
+
linkStyle,
|
|
15
|
+
linkClassName,
|
|
14
16
|
...props
|
|
15
17
|
}, ref) => {
|
|
16
18
|
const Component = active || disabled ? 'span' : Anchor;
|
|
@@ -22,7 +24,8 @@ const PageItem = /*#__PURE__*/React.forwardRef(({
|
|
|
22
24
|
disabled
|
|
23
25
|
}),
|
|
24
26
|
children: /*#__PURE__*/_jsxs(Component, {
|
|
25
|
-
className:
|
|
27
|
+
className: classNames('page-link', linkClassName),
|
|
28
|
+
style: linkStyle,
|
|
26
29
|
...props,
|
|
27
30
|
children: [children, active && activeLabel && /*#__PURE__*/_jsx("span", {
|
|
28
31
|
className: "visually-hidden",
|
package/esm/Pagination.js
CHANGED
package/esm/Popover.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
|
|
2
|
+
declare type PopoverContentProps = BsPrefixPropsWithChildren;
|
|
3
|
+
declare type PopoverContent = BsPrefixRefForwardingComponent<'div', PopoverContentProps>;
|
|
4
|
+
declare const PopoverContent: PopoverContent;
|
|
5
|
+
export default PopoverContent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
|
|
2
|
+
declare type PopoverTitleProps = BsPrefixPropsWithChildren;
|
|
3
|
+
declare type PopoverTitle = BsPrefixRefForwardingComponent<'div', PopoverTitleProps>;
|
|
4
|
+
declare const PopoverTitle: PopoverTitle;
|
|
5
|
+
export default PopoverTitle;
|
package/esm/ProgressBar.js
CHANGED
package/esm/Ratio.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
|
+
export interface ResponsiveEmbedProps extends BsPrefixPropsWithChildren {
|
|
4
|
+
children: React.ReactChild;
|
|
5
|
+
aspectRatio?: '21by9' | '16by9' | '4by3' | '1by1';
|
|
6
|
+
}
|
|
7
|
+
declare type ResponsiveEmbed = BsPrefixRefForwardingComponent<'div', ResponsiveEmbedProps>;
|
|
8
|
+
declare const ResponsiveEmbed: ResponsiveEmbed;
|
|
9
|
+
export default ResponsiveEmbed;
|
package/esm/Row.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
|
+
export interface SafeAnchorProps extends React.HTMLAttributes<HTMLElement>, BsPrefixProps {
|
|
4
|
+
href?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
tabIndex?: number;
|
|
7
|
+
}
|
|
8
|
+
declare type SafeAnchor = BsPrefixRefForwardingComponent<'a', SafeAnchorProps>;
|
|
9
|
+
/**
|
|
10
|
+
* There are situations due to browser quirks or Bootstrap CSS where
|
|
11
|
+
* an anchor tag is needed, when semantically a button tag is the
|
|
12
|
+
* better choice. SafeAnchor ensures that when an anchor is used like a
|
|
13
|
+
* button its accessible. It also emulates input `disabled` behavior for
|
|
14
|
+
* links, which is usually desirable for Buttons, NavItems, DropdownItems, etc.
|
|
15
|
+
*/
|
|
16
|
+
declare const SafeAnchor: SafeAnchor;
|
|
17
|
+
export default SafeAnchor;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type SelectableContextType = (key: string | null, event: any) => void;
|
|
3
|
+
declare const SelectableContext: React.Context<SelectableContextType | null>;
|
|
4
|
+
export declare const makeEventKey: (eventKey?: string | number | null | undefined, href?: string | null) => string | null;
|
|
5
|
+
export default SelectableContext;
|
package/esm/Spinner.js
CHANGED
package/esm/Stack.js
CHANGED
package/esm/Tab.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
import TabContainer from './TabContainer';
|
|
4
3
|
import TabContent from './TabContent';
|
|
5
4
|
import TabPane from './TabPane';
|
|
6
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
5
|
/* eslint-disable react/no-unused-prop-types */
|
|
9
6
|
const propTypes = {
|
|
10
7
|
eventKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -27,8 +24,6 @@ const propTypes = {
|
|
|
27
24
|
};
|
|
28
25
|
const Tab = () => {
|
|
29
26
|
throw new Error('ReactBootstrap: The `Tab` component is not meant to be rendered! ' + "It's an abstract component that is only valid as a direct Child of the `Tabs` Component. " + 'For custom tabs components use TabPane and TabsContainer directly');
|
|
30
|
-
// Needed otherwise docs error out.
|
|
31
|
-
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
32
27
|
};
|
|
33
28
|
Tab.propTypes = propTypes;
|
|
34
29
|
export default Object.assign(Tab, {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TabContextType {
|
|
3
|
+
onSelect: any;
|
|
4
|
+
activeKey: any;
|
|
5
|
+
transition: any;
|
|
6
|
+
mountOnEnter: boolean;
|
|
7
|
+
unmountOnExit: boolean;
|
|
8
|
+
getControlledId: (key: any) => any;
|
|
9
|
+
getControllerId: (key: any) => any;
|
|
10
|
+
}
|
|
11
|
+
declare const TabContext: React.Context<TabContextType | null>;
|
|
12
|
+
export default TabContext;
|
package/esm/TabPane.js
CHANGED
package/esm/Table.js
CHANGED
package/esm/Tabs.d.ts
CHANGED
package/esm/ThemeProvider.js
CHANGED
package/esm/Toast.js
CHANGED
package/esm/ToastContainer.js
CHANGED
package/esm/ToastContext.js
CHANGED
package/esm/ToastHeader.js
CHANGED
package/esm/ToggleButton.js
CHANGED
package/esm/Tooltip.d.ts
CHANGED
|
@@ -9,5 +9,7 @@ export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement>, BsPr
|
|
|
9
9
|
popper?: PopperRef;
|
|
10
10
|
hasDoneInitialMeasure?: boolean;
|
|
11
11
|
}
|
|
12
|
-
declare const
|
|
13
|
-
|
|
12
|
+
declare const _default: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>> & {
|
|
13
|
+
TOOLTIP_OFFSET: number[];
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
package/esm/Tooltip.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import classNames from 'classnames';
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useBootstrapPrefix, useIsRTL } from './ThemeProvider';
|
|
@@ -45,4 +47,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
45
47
|
});
|
|
46
48
|
});
|
|
47
49
|
Tooltip.displayName = 'Tooltip';
|
|
48
|
-
export default Tooltip
|
|
50
|
+
export default Object.assign(Tooltip, {
|
|
51
|
+
// Default tooltip offset.
|
|
52
|
+
// https://github.com/twbs/bootstrap/blob/beca2a6c7f6bc88b6449339fc76edcda832c59e5/js/src/tooltip.js#L65
|
|
53
|
+
TOOLTIP_OFFSET: [0, 6]
|
|
54
|
+
});
|
|
@@ -4,11 +4,11 @@ export type TransitionWrapperProps = TransitionProps & {
|
|
|
4
4
|
childRef?: React.Ref<unknown>;
|
|
5
5
|
children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
6
6
|
};
|
|
7
|
-
declare const TransitionWrapper: React.ForwardRefExoticComponent<(
|
|
7
|
+
declare const TransitionWrapper: React.ForwardRefExoticComponent<(Omit<import("react-transition-group/Transition").TimeoutProps<undefined> & {
|
|
8
8
|
childRef?: React.Ref<unknown> | undefined;
|
|
9
9
|
children: React.ReactElement<any, string | React.JSXElementConstructor<any>> | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
10
|
-
},
|
|
10
|
+
}, "ref"> | Omit<import("react-transition-group/Transition").EndListenerProps<undefined> & {
|
|
11
11
|
childRef?: React.Ref<unknown> | undefined;
|
|
12
12
|
children: React.ReactElement<any, string | React.JSXElementConstructor<any>> | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
13
|
-
},
|
|
13
|
+
}, "ref">) & React.RefAttributes<Transition<any>>>;
|
|
14
14
|
export default TransitionWrapper;
|
package/esm/TransitionWrapper.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import React, { useCallback, useRef } from 'react';
|
|
2
4
|
import Transition from 'react-transition-group/Transition';
|
|
3
5
|
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
@@ -48,7 +50,9 @@ const TransitionWrapper = /*#__PURE__*/React.forwardRef(({
|
|
|
48
50
|
onExiting: handleExiting,
|
|
49
51
|
addEndListener: handleAddEndListener,
|
|
50
52
|
nodeRef: nodeRef,
|
|
51
|
-
children: typeof children === 'function' ? (status, innerProps) =>
|
|
53
|
+
children: typeof children === 'function' ? (status, innerProps) =>
|
|
54
|
+
// TODO: Types for RTG missing innerProps, so need to cast.
|
|
55
|
+
children(status, {
|
|
52
56
|
...innerProps,
|
|
53
57
|
ref: attachRef
|
|
54
58
|
}) : /*#__PURE__*/React.cloneElement(children, {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const _default: (className: string) => React.ForwardRefExoticComponent<
|
|
2
|
+
declare const _default: (className: string) => React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
3
|
export default _default;
|
package/esm/useOverlayOffset.js
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import { useMemo, useRef } from 'react';
|
|
2
4
|
import hasClass from 'dom-helpers/hasClass';
|
|
3
5
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
4
6
|
import Popover from './Popover';
|
|
7
|
+
import Tooltip from './Tooltip';
|
|
5
8
|
|
|
6
9
|
// This is meant for internal use.
|
|
7
|
-
// This applies a custom offset to the overlay if it's a popover.
|
|
10
|
+
// This applies a custom offset to the overlay if it's a popover or tooltip.
|
|
8
11
|
export default function useOverlayOffset(customOffset) {
|
|
9
12
|
const overlayRef = useRef(null);
|
|
10
13
|
const popoverClass = useBootstrapPrefix(undefined, 'popover');
|
|
14
|
+
const tooltipClass = useBootstrapPrefix(undefined, 'tooltip');
|
|
11
15
|
const offset = useMemo(() => ({
|
|
12
16
|
name: 'offset',
|
|
13
17
|
options: {
|
|
14
18
|
offset: () => {
|
|
15
|
-
if (
|
|
16
|
-
return customOffset
|
|
19
|
+
if (customOffset) {
|
|
20
|
+
return customOffset;
|
|
21
|
+
}
|
|
22
|
+
if (overlayRef.current) {
|
|
23
|
+
if (hasClass(overlayRef.current, popoverClass)) {
|
|
24
|
+
return Popover.POPPER_OFFSET;
|
|
25
|
+
}
|
|
26
|
+
if (hasClass(overlayRef.current, tooltipClass)) {
|
|
27
|
+
return Tooltip.TOOLTIP_OFFSET;
|
|
28
|
+
}
|
|
17
29
|
}
|
|
18
|
-
return
|
|
30
|
+
return [0, 0];
|
|
19
31
|
}
|
|
20
32
|
}
|
|
21
|
-
}), [customOffset, popoverClass]);
|
|
33
|
+
}), [customOffset, popoverClass, tooltipClass]);
|
|
22
34
|
return [overlayRef, [offset]];
|
|
23
35
|
}
|
package/esm/usePlaceholder.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-bootstrap",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0-beta.0",
|
|
4
4
|
"description": "Bootstrap 5 components built with React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bootstrap",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"trailingComma": "all"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@babel/runtime": "^7.
|
|
38
|
+
"@babel/runtime": "^7.22.5",
|
|
39
39
|
"@restart/hooks": "^0.4.9",
|
|
40
|
-
"@restart/ui": "^1.6.
|
|
41
|
-
"@types/react-transition-group": "^4.4.
|
|
40
|
+
"@restart/ui": "^1.6.6",
|
|
41
|
+
"@types/react-transition-group": "^4.4.6",
|
|
42
42
|
"classnames": "^2.3.2",
|
|
43
43
|
"dom-helpers": "^5.2.1",
|
|
44
44
|
"invariant": "^2.2.4",
|