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.
Files changed (240) hide show
  1. package/README.md +1 -1
  2. package/cjs/AbstractModalHeader.js +1 -0
  3. package/cjs/AbstractNav.d.ts +15 -0
  4. package/cjs/AbstractNavItem.d.ts +19 -0
  5. package/cjs/Accordion.js +1 -0
  6. package/cjs/AccordionBody.js +1 -0
  7. package/cjs/AccordionButton.js +1 -0
  8. package/cjs/AccordionCollapse.js +1 -0
  9. package/cjs/AccordionContext.js +1 -0
  10. package/cjs/AccordionHeader.js +1 -0
  11. package/cjs/AccordionItem.js +1 -0
  12. package/cjs/AccordionItemContext.js +1 -0
  13. package/cjs/AccordionToggle.d.ts +11 -0
  14. package/cjs/Alert.d.ts +1 -1
  15. package/cjs/Alert.js +1 -0
  16. package/cjs/Badge.js +1 -0
  17. package/cjs/Breadcrumb.js +1 -0
  18. package/cjs/BreadcrumbItem.js +1 -0
  19. package/cjs/Button.js +1 -0
  20. package/cjs/ButtonGroup.js +1 -0
  21. package/cjs/ButtonToolbar.js +1 -0
  22. package/cjs/Card.d.ts +2 -2
  23. package/cjs/Card.js +1 -0
  24. package/cjs/CardColumns.d.ts +2 -0
  25. package/cjs/CardContext.d.ts +6 -0
  26. package/cjs/CardDeck.d.ts +2 -0
  27. package/cjs/CardHeader.js +1 -0
  28. package/cjs/CardHeaderContext.js +1 -0
  29. package/cjs/CardImg.js +1 -0
  30. package/cjs/Carousel.js +1 -0
  31. package/cjs/CarouselItem.js +1 -0
  32. package/cjs/Col.js +1 -0
  33. package/cjs/Container.js +1 -0
  34. package/cjs/Dropdown.js +1 -0
  35. package/cjs/DropdownContext.js +1 -0
  36. package/cjs/DropdownItem.js +1 -0
  37. package/cjs/DropdownMenu.js +1 -0
  38. package/cjs/DropdownToggle.js +1 -0
  39. package/cjs/FloatingLabel.js +1 -0
  40. package/cjs/Form.d.ts +10 -4
  41. package/cjs/FormCheck.js +1 -0
  42. package/cjs/FormCheckInput.js +1 -0
  43. package/cjs/FormCheckLabel.js +1 -0
  44. package/cjs/FormContext.js +1 -0
  45. package/cjs/FormControl.js +1 -0
  46. package/cjs/FormFile.d.ts +23 -0
  47. package/cjs/FormFileInput.d.ts +10 -0
  48. package/cjs/FormFileLabel.d.ts +7 -0
  49. package/cjs/FormLabel.js +1 -0
  50. package/cjs/FormRange.js +1 -0
  51. package/cjs/FormSelect.js +1 -0
  52. package/cjs/FormText.js +1 -0
  53. package/cjs/Image.js +1 -0
  54. package/cjs/InputGroup.js +1 -0
  55. package/cjs/InputGroupContext.js +1 -0
  56. package/cjs/Jumbotron.d.ts +7 -0
  57. package/cjs/ListGroup.js +1 -0
  58. package/cjs/ListGroupItem.js +1 -0
  59. package/cjs/Media.d.ts +8 -0
  60. package/cjs/Modal.d.ts +1 -1
  61. package/cjs/Modal.js +1 -0
  62. package/cjs/ModalContext.js +1 -0
  63. package/cjs/ModalDialog.js +1 -0
  64. package/cjs/ModalHeader.js +1 -0
  65. package/cjs/ModalTitle.d.ts +1 -1
  66. package/cjs/Nav.d.ts +1 -1
  67. package/cjs/Nav.js +1 -0
  68. package/cjs/NavContext.js +1 -0
  69. package/cjs/NavDropdown.js +1 -0
  70. package/cjs/NavLink.js +1 -0
  71. package/cjs/Navbar.d.ts +1 -1
  72. package/cjs/Navbar.js +1 -0
  73. package/cjs/NavbarBrand.js +1 -0
  74. package/cjs/NavbarCollapse.js +1 -0
  75. package/cjs/NavbarContext.js +1 -0
  76. package/cjs/NavbarOffcanvas.d.ts +1 -1
  77. package/cjs/NavbarOffcanvas.js +1 -0
  78. package/cjs/NavbarToggle.js +1 -0
  79. package/cjs/Offcanvas.d.ts +1 -1
  80. package/cjs/Offcanvas.js +1 -0
  81. package/cjs/OffcanvasHeader.js +1 -0
  82. package/cjs/OffcanvasTitle.d.ts +1 -1
  83. package/cjs/OffcanvasToggling.js +1 -0
  84. package/cjs/Overlay.js +1 -0
  85. package/cjs/OverlayTrigger.js +1 -0
  86. package/cjs/PageItem.d.ts +2 -0
  87. package/cjs/PageItem.js +4 -1
  88. package/cjs/Pagination.js +1 -0
  89. package/cjs/Popover.js +1 -0
  90. package/cjs/PopoverContent.d.ts +5 -0
  91. package/cjs/PopoverTitle.d.ts +5 -0
  92. package/cjs/ProgressBar.js +1 -0
  93. package/cjs/Ratio.js +1 -0
  94. package/cjs/ResponsiveEmbed.d.ts +9 -0
  95. package/cjs/Row.js +1 -0
  96. package/cjs/SafeAnchor.d.ts +17 -0
  97. package/cjs/SelectableContext.d.ts +5 -0
  98. package/cjs/Spinner.js +1 -0
  99. package/cjs/Stack.js +1 -0
  100. package/cjs/Tab.js +0 -6
  101. package/cjs/TabContext.d.ts +12 -0
  102. package/cjs/TabPane.js +1 -0
  103. package/cjs/Table.js +1 -0
  104. package/cjs/Tabs.d.ts +1 -1
  105. package/cjs/ThemeProvider.js +1 -0
  106. package/cjs/Toast.js +1 -0
  107. package/cjs/ToastContainer.js +1 -0
  108. package/cjs/ToastContext.js +1 -0
  109. package/cjs/ToastHeader.js +1 -0
  110. package/cjs/ToggleButton.js +1 -0
  111. package/cjs/Tooltip.d.ts +4 -2
  112. package/cjs/Tooltip.js +6 -1
  113. package/cjs/TransitionWrapper.d.ts +3 -3
  114. package/cjs/TransitionWrapper.js +4 -1
  115. package/cjs/createWithBsPrefix.js +1 -0
  116. package/cjs/divWithClassName.d.ts +1 -1
  117. package/cjs/useOverlayOffset.js +16 -5
  118. package/cjs/usePlaceholder.js +1 -0
  119. package/cjs/usePopperMarginModifiers.d.ts +4 -0
  120. package/dist/react-bootstrap.js +312 -216
  121. package/dist/react-bootstrap.min.js +1 -1
  122. package/esm/AbstractModalHeader.js +2 -0
  123. package/esm/AbstractNav.d.ts +15 -0
  124. package/esm/AbstractNavItem.d.ts +19 -0
  125. package/esm/Accordion.js +2 -0
  126. package/esm/AccordionBody.js +2 -0
  127. package/esm/AccordionButton.js +2 -0
  128. package/esm/AccordionCollapse.js +2 -0
  129. package/esm/AccordionContext.js +2 -0
  130. package/esm/AccordionHeader.js +2 -0
  131. package/esm/AccordionItem.js +2 -0
  132. package/esm/AccordionItemContext.js +2 -0
  133. package/esm/AccordionToggle.d.ts +11 -0
  134. package/esm/Alert.d.ts +1 -1
  135. package/esm/Alert.js +2 -0
  136. package/esm/Badge.js +2 -0
  137. package/esm/Breadcrumb.js +2 -0
  138. package/esm/BreadcrumbItem.js +2 -0
  139. package/esm/Button.js +2 -0
  140. package/esm/ButtonGroup.js +2 -0
  141. package/esm/ButtonToolbar.js +2 -0
  142. package/esm/Card.d.ts +2 -2
  143. package/esm/Card.js +2 -0
  144. package/esm/CardColumns.d.ts +2 -0
  145. package/esm/CardContext.d.ts +6 -0
  146. package/esm/CardDeck.d.ts +2 -0
  147. package/esm/CardHeader.js +2 -0
  148. package/esm/CardHeaderContext.js +2 -0
  149. package/esm/CardImg.js +2 -0
  150. package/esm/Carousel.js +2 -0
  151. package/esm/CarouselItem.js +2 -0
  152. package/esm/Col.js +2 -0
  153. package/esm/Container.js +2 -0
  154. package/esm/Dropdown.js +2 -0
  155. package/esm/DropdownContext.js +2 -0
  156. package/esm/DropdownItem.js +2 -0
  157. package/esm/DropdownMenu.js +2 -0
  158. package/esm/DropdownToggle.js +2 -0
  159. package/esm/FloatingLabel.js +2 -0
  160. package/esm/Form.d.ts +10 -4
  161. package/esm/FormCheck.js +2 -0
  162. package/esm/FormCheckInput.js +2 -0
  163. package/esm/FormCheckLabel.js +2 -0
  164. package/esm/FormContext.js +2 -0
  165. package/esm/FormControl.js +2 -0
  166. package/esm/FormFile.d.ts +23 -0
  167. package/esm/FormFileInput.d.ts +10 -0
  168. package/esm/FormFileLabel.d.ts +7 -0
  169. package/esm/FormLabel.js +2 -0
  170. package/esm/FormRange.js +2 -0
  171. package/esm/FormSelect.js +2 -0
  172. package/esm/FormText.js +2 -0
  173. package/esm/Image.js +2 -0
  174. package/esm/InputGroup.js +2 -0
  175. package/esm/InputGroupContext.js +2 -0
  176. package/esm/Jumbotron.d.ts +7 -0
  177. package/esm/ListGroup.js +2 -0
  178. package/esm/ListGroupItem.js +2 -0
  179. package/esm/Media.d.ts +8 -0
  180. package/esm/Modal.d.ts +1 -1
  181. package/esm/Modal.js +2 -0
  182. package/esm/ModalContext.js +2 -0
  183. package/esm/ModalDialog.js +2 -0
  184. package/esm/ModalHeader.js +2 -0
  185. package/esm/ModalTitle.d.ts +1 -1
  186. package/esm/Nav.d.ts +1 -1
  187. package/esm/Nav.js +2 -0
  188. package/esm/NavContext.js +2 -0
  189. package/esm/NavDropdown.js +2 -0
  190. package/esm/NavLink.js +2 -0
  191. package/esm/Navbar.d.ts +1 -1
  192. package/esm/Navbar.js +2 -0
  193. package/esm/NavbarBrand.js +2 -0
  194. package/esm/NavbarCollapse.js +2 -0
  195. package/esm/NavbarContext.js +2 -0
  196. package/esm/NavbarOffcanvas.d.ts +1 -1
  197. package/esm/NavbarOffcanvas.js +2 -0
  198. package/esm/NavbarToggle.js +2 -0
  199. package/esm/Offcanvas.d.ts +1 -1
  200. package/esm/Offcanvas.js +2 -0
  201. package/esm/OffcanvasHeader.js +2 -0
  202. package/esm/OffcanvasTitle.d.ts +1 -1
  203. package/esm/OffcanvasToggling.js +2 -0
  204. package/esm/Overlay.js +2 -0
  205. package/esm/OverlayTrigger.js +2 -0
  206. package/esm/PageItem.d.ts +2 -0
  207. package/esm/PageItem.js +4 -1
  208. package/esm/Pagination.js +2 -0
  209. package/esm/Popover.js +2 -0
  210. package/esm/PopoverContent.d.ts +5 -0
  211. package/esm/PopoverTitle.d.ts +5 -0
  212. package/esm/ProgressBar.js +2 -0
  213. package/esm/Ratio.js +2 -0
  214. package/esm/ResponsiveEmbed.d.ts +9 -0
  215. package/esm/Row.js +2 -0
  216. package/esm/SafeAnchor.d.ts +17 -0
  217. package/esm/SelectableContext.d.ts +5 -0
  218. package/esm/Spinner.js +2 -0
  219. package/esm/Stack.js +2 -0
  220. package/esm/Tab.js +0 -5
  221. package/esm/TabContext.d.ts +12 -0
  222. package/esm/TabPane.js +2 -0
  223. package/esm/Table.js +2 -0
  224. package/esm/Tabs.d.ts +1 -1
  225. package/esm/ThemeProvider.js +2 -0
  226. package/esm/Toast.js +2 -0
  227. package/esm/ToastContainer.js +2 -0
  228. package/esm/ToastContext.js +2 -0
  229. package/esm/ToastHeader.js +2 -0
  230. package/esm/ToggleButton.js +2 -0
  231. package/esm/Tooltip.d.ts +4 -2
  232. package/esm/Tooltip.js +7 -1
  233. package/esm/TransitionWrapper.d.ts +3 -3
  234. package/esm/TransitionWrapper.js +5 -1
  235. package/esm/createWithBsPrefix.js +2 -0
  236. package/esm/divWithClassName.d.ts +1 -1
  237. package/esm/useOverlayOffset.js +17 -5
  238. package/esm/usePlaceholder.js +2 -0
  239. package/esm/usePopperMarginModifiers.d.ts +4 -0
  240. package/package.json +4 -4
package/esm/NavLink.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 Anchor from '@restart/ui/Anchor';
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<Pick<import("./NavbarOffcanvas").NavbarOffcanvasProps, keyof import("./Offcanvas").OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
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
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import * as React from 'react';
3
5
  import { useCallback, useMemo } from 'react';
@@ -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 } from './ThemeProvider';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
  import { useContext } from 'react';
3
5
  import Collapse from './Collapse';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
 
3
5
  // TODO: check
@@ -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<Pick<NavbarOffcanvasProps, keyof OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const NavbarOffcanvas: React.ForwardRefExoticComponent<Omit<NavbarOffcanvasProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
5
  export default NavbarOffcanvas;
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
  import { useContext } from 'react';
3
5
  import Offcanvas from './Offcanvas';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import * as React from 'react';
3
5
  import { useContext } from 'react';
@@ -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<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>, unknown>;
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
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import useBreakpoint from '@restart/hooks/useBreakpoint';
3
5
  import useEventCallback from '@restart/hooks/useEventCallback';
@@ -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 } from './ThemeProvider';
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare const _default: import("./helpers").BsPrefixRefForwardingComponent<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>, unknown>;
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;
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import * as React from 'react';
3
5
  import { ENTERED, ENTERING, EXITING } from 'react-transition-group/Transition';
package/esm/Overlay.js CHANGED
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
  import { useEffect, useRef, useState } from 'react';
3
5
  import classNames from 'classnames';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import contains from 'dom-helpers/contains';
2
4
  import * as React from 'react';
3
5
  import { cloneElement, useCallback, useRef } from 'react';
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: "page-link",
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
@@ -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 } from './ThemeProvider';
package/esm/Popover.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';
@@ -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;
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import * as React from 'react';
3
5
  import { cloneElement } from 'react';
package/esm/Ratio.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 } from './ThemeProvider';
@@ -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
@@ -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, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';
@@ -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
@@ -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 } from './ThemeProvider';
package/esm/Stack.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, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';
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
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import * as React from 'react';
3
5
  import SelectableContext from '@restart/ui/SelectableContext';
package/esm/Table.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 } from './ThemeProvider';
package/esm/Tabs.d.ts CHANGED
@@ -20,7 +20,7 @@ declare const Tabs: {
20
20
  /**
21
21
  * Navigation style
22
22
  *
23
- * @type {('tabs'| 'pills')}
23
+ * @type {('tabs'| 'pills' | 'underline')}
24
24
  */
25
25
  variant: PropTypes.Requireable<string>;
26
26
  /**
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
  import { useContext, useMemo } from 'react';
3
5
  import { jsx as _jsx } from "react/jsx-runtime";
package/esm/Toast.js CHANGED
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
  import { useEffect, useMemo, useRef, useCallback } from 'react';
3
5
  import classNames from 'classnames';
@@ -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 } from './ThemeProvider';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
  const ToastContext = /*#__PURE__*/React.createContext({
3
5
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import * as React from 'react';
3
5
  import { useContext } from 'react';
@@ -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 } from './ThemeProvider';
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 Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
13
- export default Tooltip;
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<(Pick<import("react-transition-group/Transition").TimeoutProps<undefined> & {
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
- }, keyof import("react-transition-group/Transition").TimeoutProps<undefined>> | Pick<import("react-transition-group/Transition").EndListenerProps<undefined> & {
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
- }, keyof import("react-transition-group/Transition").EndListenerProps<undefined>>) & React.RefAttributes<Transition<any>>>;
13
+ }, "ref">) & React.RefAttributes<Transition<any>>>;
14
14
  export default TransitionWrapper;
@@ -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) => children(status, {
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,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import camelize from 'dom-helpers/camelize';
3
5
  import * as React from 'react';
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
- declare const _default: (className: string) => React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
2
+ declare const _default: (className: string) => React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
3
3
  export default _default;
@@ -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 (overlayRef.current && hasClass(overlayRef.current, popoverClass)) {
16
- return customOffset || Popover.POPPER_OFFSET;
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 customOffset || [0, 0];
30
+ return [0, 0];
19
31
  }
20
32
  }
21
- }), [customOffset, popoverClass]);
33
+ }), [customOffset, popoverClass, tooltipClass]);
22
34
  return [overlayRef, [offset]];
23
35
  }
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import classNames from 'classnames';
2
4
  import { useBootstrapPrefix } from './ThemeProvider';
3
5
  import { useCol } from './Col';
@@ -0,0 +1,4 @@
1
+ export default function usePopperMarginModifiers(): [
2
+ (overlay: HTMLDivElement) => void,
3
+ Array<Record<string, unknown>>
4
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap",
3
- "version": "2.7.4",
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.21.0",
38
+ "@babel/runtime": "^7.22.5",
39
39
  "@restart/hooks": "^0.4.9",
40
- "@restart/ui": "^1.6.3",
41
- "@types/react-transition-group": "^4.4.5",
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",