react-bootstrap 1.5.2 → 1.6.3

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 (265) hide show
  1. package/cjs/AbstractModalHeader.d.ts +10 -0
  2. package/cjs/AbstractNav.js +7 -3
  3. package/cjs/AbstractNavItem.d.ts +2 -1
  4. package/cjs/AbstractNavItem.js +7 -3
  5. package/cjs/Accordion.js +3 -1
  6. package/cjs/AccordionBody.d.ts +6 -0
  7. package/cjs/AccordionButton.d.ts +8 -0
  8. package/cjs/AccordionCollapse.js +7 -3
  9. package/cjs/AccordionHeader.d.ts +6 -0
  10. package/cjs/AccordionItem.d.ts +7 -0
  11. package/cjs/AccordionItemContext.d.ts +6 -0
  12. package/cjs/AccordionToggle.js +7 -3
  13. package/cjs/Alert.js +2 -1
  14. package/cjs/Anchor.d.ts +3 -0
  15. package/cjs/Badge.js +2 -1
  16. package/cjs/Breadcrumb.js +2 -1
  17. package/cjs/BreadcrumbItem.js +2 -1
  18. package/cjs/Button.js +2 -1
  19. package/cjs/ButtonGroup.js +2 -1
  20. package/cjs/ButtonToolbar.js +2 -1
  21. package/cjs/Card.js +7 -3
  22. package/cjs/CardHeader.d.ts +6 -0
  23. package/cjs/CardHeaderContext.d.ts +6 -0
  24. package/cjs/CardImg.js +2 -1
  25. package/cjs/Carousel.js +7 -3
  26. package/cjs/CarouselItem.js +3 -1
  27. package/cjs/CloseButton.js +2 -1
  28. package/cjs/Col.js +2 -1
  29. package/cjs/Collapse.d.ts +1 -2
  30. package/cjs/Collapse.js +7 -3
  31. package/cjs/Container.js +2 -1
  32. package/cjs/Dropdown.js +7 -3
  33. package/cjs/DropdownButton.js +7 -3
  34. package/cjs/DropdownContext.d.ts +10 -0
  35. package/cjs/DropdownItem.d.ts +2 -1
  36. package/cjs/DropdownItem.js +8 -5
  37. package/cjs/DropdownMenu.js +7 -3
  38. package/cjs/DropdownToggle.d.ts +0 -1
  39. package/cjs/DropdownToggle.js +3 -1
  40. package/cjs/Fade.js +7 -3
  41. package/cjs/Feedback.js +2 -1
  42. package/cjs/FigureImage.js +7 -3
  43. package/cjs/FloatingLabel.d.ts +9 -0
  44. package/cjs/Form.js +2 -1
  45. package/cjs/FormCheck.js +7 -3
  46. package/cjs/FormCheckInput.js +7 -3
  47. package/cjs/FormCheckLabel.js +7 -3
  48. package/cjs/FormControl.js +7 -3
  49. package/cjs/FormFile.js +7 -3
  50. package/cjs/FormFileInput.js +7 -3
  51. package/cjs/FormFileLabel.js +7 -3
  52. package/cjs/FormFloating.d.ts +2 -0
  53. package/cjs/FormGroup.js +7 -3
  54. package/cjs/FormLabel.js +8 -3
  55. package/cjs/FormRange.d.ts +6 -0
  56. package/cjs/FormSelect.d.ts +10 -0
  57. package/cjs/FormText.js +3 -1
  58. package/cjs/Image.js +2 -1
  59. package/cjs/InputGroup.js +2 -1
  60. package/cjs/InputGroupContext.d.ts +3 -0
  61. package/cjs/Jumbotron.js +2 -1
  62. package/cjs/ListGroup.d.ts +3 -2
  63. package/cjs/ListGroup.js +2 -1
  64. package/cjs/ListGroupItem.d.ts +2 -2
  65. package/cjs/ListGroupItem.js +8 -9
  66. package/cjs/Media.js +2 -1
  67. package/cjs/Modal.d.ts +3 -2
  68. package/cjs/Modal.js +23 -34
  69. package/cjs/ModalDialog.js +3 -1
  70. package/cjs/ModalHeader.js +7 -3
  71. package/cjs/Nav.d.ts +4 -2
  72. package/cjs/Nav.js +9 -4
  73. package/cjs/NavDropdown.js +3 -1
  74. package/cjs/NavItem.js +3 -1
  75. package/cjs/NavLink.d.ts +2 -1
  76. package/cjs/NavLink.js +2 -1
  77. package/cjs/Navbar.js +7 -3
  78. package/cjs/NavbarBrand.js +3 -1
  79. package/cjs/NavbarCollapse.js +3 -1
  80. package/cjs/NavbarToggle.js +7 -3
  81. package/cjs/Offcanvas.d.ts +16 -0
  82. package/cjs/OffcanvasBody.d.ts +2 -0
  83. package/cjs/OffcanvasHeader.d.ts +7 -0
  84. package/cjs/OffcanvasTitle.d.ts +3 -0
  85. package/cjs/OffcanvasToggling.d.ts +15 -0
  86. package/cjs/Overlay.js +9 -4
  87. package/cjs/OverlayTrigger.js +7 -3
  88. package/cjs/PageItem.js +4 -3
  89. package/cjs/Pagination.js +7 -3
  90. package/cjs/Placeholder.d.ts +8 -0
  91. package/cjs/PlaceholderButton.d.ts +8 -0
  92. package/cjs/Popover.js +2 -1
  93. package/cjs/PopoverBody.d.ts +2 -0
  94. package/cjs/PopoverContent.js +3 -1
  95. package/cjs/PopoverHeader.d.ts +2 -0
  96. package/cjs/PopoverTitle.js +3 -1
  97. package/cjs/ProgressBar.js +11 -5
  98. package/cjs/Ratio.d.ts +9 -0
  99. package/cjs/ResponsiveEmbed.js +2 -1
  100. package/cjs/Row.js +2 -1
  101. package/cjs/SafeAnchor.d.ts +0 -1
  102. package/cjs/SafeAnchor.js +3 -1
  103. package/cjs/SelectableContext.d.ts +1 -1
  104. package/cjs/Spinner.d.ts +0 -1
  105. package/cjs/Spinner.js +3 -1
  106. package/cjs/SplitButton.js +2 -1
  107. package/cjs/Tab.d.ts +4 -2
  108. package/cjs/TabContainer.d.ts +5 -4
  109. package/cjs/TabContainer.js +4 -2
  110. package/cjs/TabContent.js +3 -1
  111. package/cjs/TabPane.d.ts +2 -1
  112. package/cjs/TabPane.js +9 -4
  113. package/cjs/Table.js +3 -1
  114. package/cjs/Tabs.d.ts +3 -2
  115. package/cjs/Tabs.js +2 -1
  116. package/cjs/ThemeProvider.js +4 -2
  117. package/cjs/Toast.js +7 -3
  118. package/cjs/ToastContainer.d.ts +8 -0
  119. package/cjs/ToastHeader.js +7 -3
  120. package/cjs/ToggleButton.js +7 -3
  121. package/cjs/ToggleButtonGroup.js +2 -1
  122. package/cjs/Tooltip.js +2 -1
  123. package/cjs/TransitionWrapper.d.ts +8 -0
  124. package/cjs/createWithBsPrefix.js +3 -1
  125. package/cjs/getTabTransitionComponent.d.ts +3 -0
  126. package/cjs/index.js +5 -3
  127. package/cjs/safeFindDOMNode.d.ts +2 -0
  128. package/cjs/types.d.ts +1 -0
  129. package/cjs/types.js +3 -1
  130. package/cjs/useOverlayOffset.d.ts +6 -0
  131. package/cjs/usePlaceholder.d.ts +10 -0
  132. package/cjs/usePopperMarginModifiers.js +51 -13
  133. package/dist/react-bootstrap.js +899 -630
  134. package/dist/react-bootstrap.min.js +1 -1
  135. package/dist/react-bootstrap.min.js.LICENSE.txt +1 -1
  136. package/esm/AbstractModalHeader.d.ts +10 -0
  137. package/esm/AbstractNav.js +2 -1
  138. package/esm/AbstractNavItem.d.ts +2 -1
  139. package/esm/AbstractNavItem.js +2 -1
  140. package/esm/Accordion.js +2 -1
  141. package/esm/AccordionBody.d.ts +6 -0
  142. package/esm/AccordionButton.d.ts +8 -0
  143. package/esm/AccordionCollapse.js +2 -1
  144. package/esm/AccordionHeader.d.ts +6 -0
  145. package/esm/AccordionItem.d.ts +7 -0
  146. package/esm/AccordionItemContext.d.ts +6 -0
  147. package/esm/AccordionToggle.js +2 -1
  148. package/esm/Alert.js +2 -1
  149. package/esm/Anchor.d.ts +3 -0
  150. package/esm/Badge.js +2 -1
  151. package/esm/Breadcrumb.js +2 -1
  152. package/esm/BreadcrumbItem.js +2 -1
  153. package/esm/Button.js +2 -1
  154. package/esm/ButtonGroup.js +2 -1
  155. package/esm/ButtonToolbar.js +2 -1
  156. package/esm/Card.js +2 -1
  157. package/esm/CardHeader.d.ts +6 -0
  158. package/esm/CardHeaderContext.d.ts +6 -0
  159. package/esm/CardImg.js +2 -1
  160. package/esm/Carousel.js +2 -1
  161. package/esm/CarouselItem.js +2 -1
  162. package/esm/CloseButton.js +2 -1
  163. package/esm/Col.js +2 -1
  164. package/esm/Collapse.d.ts +1 -2
  165. package/esm/Collapse.js +2 -1
  166. package/esm/Container.js +2 -1
  167. package/esm/Dropdown.js +2 -1
  168. package/esm/DropdownButton.js +2 -1
  169. package/esm/DropdownContext.d.ts +10 -0
  170. package/esm/DropdownItem.d.ts +2 -1
  171. package/esm/DropdownItem.js +3 -3
  172. package/esm/DropdownMenu.js +2 -1
  173. package/esm/DropdownToggle.d.ts +0 -1
  174. package/esm/DropdownToggle.js +2 -1
  175. package/esm/Fade.js +2 -1
  176. package/esm/Feedback.js +2 -1
  177. package/esm/FigureImage.js +2 -1
  178. package/esm/FloatingLabel.d.ts +9 -0
  179. package/esm/Form.js +2 -1
  180. package/esm/FormCheck.js +2 -1
  181. package/esm/FormCheckInput.js +2 -1
  182. package/esm/FormCheckLabel.js +2 -1
  183. package/esm/FormControl.js +2 -1
  184. package/esm/FormFile.js +2 -1
  185. package/esm/FormFileInput.js +2 -1
  186. package/esm/FormFileLabel.js +2 -1
  187. package/esm/FormFloating.d.ts +2 -0
  188. package/esm/FormGroup.js +2 -1
  189. package/esm/FormLabel.js +3 -1
  190. package/esm/FormRange.d.ts +6 -0
  191. package/esm/FormSelect.d.ts +10 -0
  192. package/esm/FormText.js +2 -1
  193. package/esm/Image.js +2 -1
  194. package/esm/InputGroup.js +2 -1
  195. package/esm/InputGroupContext.d.ts +3 -0
  196. package/esm/Jumbotron.js +2 -1
  197. package/esm/ListGroup.d.ts +3 -2
  198. package/esm/ListGroup.js +2 -1
  199. package/esm/ListGroupItem.d.ts +2 -2
  200. package/esm/ListGroupItem.js +3 -6
  201. package/esm/Media.js +2 -1
  202. package/esm/Modal.d.ts +3 -2
  203. package/esm/Modal.js +17 -31
  204. package/esm/ModalDialog.js +2 -1
  205. package/esm/ModalHeader.js +2 -1
  206. package/esm/Nav.d.ts +4 -2
  207. package/esm/Nav.js +4 -2
  208. package/esm/NavDropdown.js +2 -1
  209. package/esm/NavItem.js +2 -1
  210. package/esm/NavLink.d.ts +2 -1
  211. package/esm/NavLink.js +2 -1
  212. package/esm/Navbar.js +2 -1
  213. package/esm/NavbarBrand.js +2 -1
  214. package/esm/NavbarCollapse.js +2 -1
  215. package/esm/NavbarToggle.js +2 -1
  216. package/esm/Offcanvas.d.ts +16 -0
  217. package/esm/OffcanvasBody.d.ts +2 -0
  218. package/esm/OffcanvasHeader.d.ts +7 -0
  219. package/esm/OffcanvasTitle.d.ts +3 -0
  220. package/esm/OffcanvasToggling.d.ts +15 -0
  221. package/esm/Overlay.js +4 -2
  222. package/esm/OverlayTrigger.js +2 -1
  223. package/esm/PageItem.js +4 -2
  224. package/esm/Pagination.js +2 -1
  225. package/esm/Placeholder.d.ts +8 -0
  226. package/esm/PlaceholderButton.d.ts +8 -0
  227. package/esm/Popover.js +2 -1
  228. package/esm/PopoverBody.d.ts +2 -0
  229. package/esm/PopoverContent.js +2 -1
  230. package/esm/PopoverHeader.d.ts +2 -0
  231. package/esm/PopoverTitle.js +2 -1
  232. package/esm/ProgressBar.js +6 -3
  233. package/esm/Ratio.d.ts +9 -0
  234. package/esm/ResponsiveEmbed.js +2 -1
  235. package/esm/Row.js +2 -1
  236. package/esm/SafeAnchor.d.ts +0 -1
  237. package/esm/SafeAnchor.js +2 -1
  238. package/esm/SelectableContext.d.ts +1 -1
  239. package/esm/Spinner.d.ts +0 -1
  240. package/esm/Spinner.js +2 -1
  241. package/esm/SplitButton.js +2 -1
  242. package/esm/Tab.d.ts +4 -2
  243. package/esm/TabContainer.d.ts +5 -4
  244. package/esm/TabContent.js +2 -1
  245. package/esm/TabPane.d.ts +2 -1
  246. package/esm/TabPane.js +4 -2
  247. package/esm/Table.js +2 -1
  248. package/esm/Tabs.d.ts +3 -2
  249. package/esm/Tabs.js +2 -1
  250. package/esm/Toast.js +2 -1
  251. package/esm/ToastContainer.d.ts +8 -0
  252. package/esm/ToastHeader.js +2 -1
  253. package/esm/ToggleButton.js +2 -1
  254. package/esm/ToggleButtonGroup.js +2 -1
  255. package/esm/Tooltip.js +2 -1
  256. package/esm/TransitionWrapper.d.ts +8 -0
  257. package/esm/createWithBsPrefix.js +2 -1
  258. package/esm/getTabTransitionComponent.d.ts +3 -0
  259. package/esm/safeFindDOMNode.d.ts +2 -0
  260. package/esm/types.d.ts +1 -0
  261. package/esm/types.js +1 -0
  262. package/esm/useOverlayOffset.d.ts +6 -0
  263. package/esm/usePlaceholder.d.ts +10 -0
  264. package/esm/usePopperMarginModifiers.js +51 -13
  265. package/package.json +6 -12
package/esm/Tabs.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { SelectCallback, TransitionType } from './helpers';
3
+ import { EventKey } from './types';
3
4
  export interface TabsProps extends React.PropsWithChildren<unknown> {
4
- activeKey?: unknown;
5
- defaultActiveKey?: unknown;
5
+ activeKey?: EventKey;
6
+ defaultActiveKey?: EventKey;
6
7
  onSelect?: SelectCallback;
7
8
  variant?: 'tabs' | 'pills';
8
9
  transition?: TransitionType;
package/esm/Tabs.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ var _excluded = ["id", "onSelect", "transition", "mountOnEnter", "unmountOnExit", "children", "activeKey"];
3
4
  import React from 'react';
4
5
  import requiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
5
6
  import { useUncontrolled } from 'uncontrollable';
@@ -59,7 +60,7 @@ var Tabs = function Tabs(props) {
59
60
  children = _useUncontrolled.children,
60
61
  _useUncontrolled$acti = _useUncontrolled.activeKey,
61
62
  activeKey = _useUncontrolled$acti === void 0 ? getDefaultActiveKey(children) : _useUncontrolled$acti,
62
- controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, ["id", "onSelect", "transition", "mountOnEnter", "unmountOnExit", "children", "activeKey"]);
63
+ controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded);
63
64
 
64
65
  return /*#__PURE__*/React.createElement(TabContainer, {
65
66
  id: id,
package/esm/Toast.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ var _excluded = ["bsPrefix", "className", "children", "transition", "show", "animation", "delay", "autohide", "onClose"];
3
4
  import React, { useEffect, useMemo, useRef, useCallback } from 'react';
4
5
  import classNames from 'classnames';
5
6
  import useTimeout from '@restart/hooks/useTimeout';
@@ -23,7 +24,7 @@ var Toast = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23
24
  _ref$autohide = _ref.autohide,
24
25
  autohide = _ref$autohide === void 0 ? false : _ref$autohide,
25
26
  onClose = _ref.onClose,
26
- props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "children", "transition", "show", "animation", "delay", "autohide", "onClose"]);
27
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
27
28
 
28
29
  bsPrefix = useBootstrapPrefix(bsPrefix, 'toast'); // We use refs for these, because we don't want to restart the autohide
29
30
  // timer in case these values change.
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
3
+ export declare type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'middle-start' | 'middle-center' | 'middle-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
4
+ export interface ToastContainerProps extends BsPrefixProps, React.HTMLAttributes<HTMLElement> {
5
+ position?: ToastPosition;
6
+ }
7
+ declare const ToastContainer: BsPrefixRefForwardingComponent<'div', ToastContainerProps>;
8
+ export default ToastContainer;
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ var _excluded = ["bsPrefix", "closeLabel", "closeButton", "className", "children"];
3
4
  import classNames from 'classnames';
4
5
  import React, { useContext } from 'react';
5
6
  import useEventCallback from '@restart/hooks/useEventCallback';
@@ -16,7 +17,7 @@ var ToastHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
16
17
  closeButton = _ref.closeButton,
17
18
  className = _ref.className,
18
19
  children = _ref.children,
19
- props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "closeLabel", "closeButton", "className", "children"]);
20
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
20
21
 
21
22
  bsPrefix = useBootstrapPrefix(bsPrefix, 'toast-header');
22
23
  var context = useContext(ToastContext);
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ var _excluded = ["children", "name", "className", "checked", "type", "onChange", "value", "disabled", "inputRef"];
3
4
  import classNames from 'classnames';
4
5
  import React, { useCallback, useState } from 'react';
5
6
  import Button from './Button';
@@ -18,7 +19,7 @@ var ToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18
19
  value = _ref.value,
19
20
  disabled = _ref.disabled,
20
21
  inputRef = _ref.inputRef,
21
- props = _objectWithoutPropertiesLoose(_ref, ["children", "name", "className", "checked", "type", "onChange", "value", "disabled", "inputRef"]);
22
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
22
23
 
23
24
  var _useState = useState(false),
24
25
  focused = _useState[0],
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ var _excluded = ["children", "type", "name", "value", "onChange"];
3
4
  import React from 'react';
4
5
  import invariant from 'invariant';
5
6
  import { useUncontrolled } from 'uncontrollable';
@@ -20,7 +21,7 @@ var ToggleButtonGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
20
21
  name = _useUncontrolled.name,
21
22
  value = _useUncontrolled.value,
22
23
  onChange = _useUncontrolled.onChange,
23
- controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, ["children", "type", "name", "value", "onChange"]);
24
+ controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded);
24
25
 
25
26
  var getValues = function getValues() {
26
27
  return value == null ? [] : [].concat(value);
package/esm/Tooltip.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ var _excluded = ["bsPrefix", "placement", "className", "style", "children", "arrowProps", "popper", "show"];
3
4
  import classNames from 'classnames';
4
5
  import React from 'react';
5
6
  import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
@@ -16,7 +17,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
16
17
  arrowProps = _ref.arrowProps,
17
18
  _ = _ref.popper,
18
19
  _2 = _ref.show,
19
- props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "placement", "className", "style", "children", "arrowProps", "popper", "show"]);
20
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
20
21
 
21
22
  bsPrefix = useBootstrapPrefix(bsPrefix, 'tooltip');
22
23
 
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import Transition, { TransitionProps, TransitionStatus } from 'react-transition-group/Transition';
3
+ export declare type TransitionWrapperProps = TransitionProps & {
4
+ childRef?: React.Ref<unknown>;
5
+ children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
6
+ };
7
+ declare const TransitionWrapper: React.ForwardRefExoticComponent<Pick<TransitionWrapperProps, string | number> & React.RefAttributes<Transition<any>>>;
8
+ export default TransitionWrapper;
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ var _excluded = ["className", "bsPrefix", "as"];
3
4
  import classNames from 'classnames';
4
5
  import camelize from 'dom-helpers/camelize';
5
6
  import React from 'react';
@@ -22,7 +23,7 @@ export default function createWithBsPrefix(prefix, _temp) {
22
23
  bsPrefix = _ref2.bsPrefix,
23
24
  _ref2$as = _ref2.as,
24
25
  Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,
25
- props = _objectWithoutPropertiesLoose(_ref2, ["className", "bsPrefix", "as"]);
26
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded);
26
27
 
27
28
  var resolvedPrefix = useBootstrapPrefix(bsPrefix, prefix);
28
29
  return /*#__PURE__*/React.createElement(Tag, _extends({
@@ -0,0 +1,3 @@
1
+ import { TransitionComponent } from '@restart/ui/types';
2
+ import { TransitionType } from './helpers';
3
+ export default function getTabTransitionComponent(transition?: TransitionType): TransitionComponent | undefined;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function safeFindDOMNode(componentOrElement: React.ComponentClass | Element | null | undefined): any;
package/esm/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export declare type Variant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
2
2
  export declare type ButtonVariant = Variant | 'link' | 'outline-primary' | 'outline-secondary' | 'outline-success' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-dark' | 'outline-light';
3
3
  export declare type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted';
4
+ export declare type EventKey = string | number;
package/esm/types.js CHANGED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { Options } from '@restart/ui/usePopper';
3
+ export default function useOverlayOffset(): [
4
+ React.RefObject<HTMLElement>,
5
+ Options['modifiers']
6
+ ];
@@ -0,0 +1,10 @@
1
+ import { ColProps } from './Col';
2
+ import { Variant } from './types';
3
+ export declare type PlaceholderAnimation = 'glow' | 'wave';
4
+ export declare type PlaceholderSize = 'xs' | 'sm' | 'lg';
5
+ export interface UsePlaceholderProps extends Omit<ColProps, 'as'> {
6
+ animation?: PlaceholderAnimation;
7
+ bg?: Variant;
8
+ size?: PlaceholderSize;
9
+ }
10
+ export default function usePlaceholder({ animation, bg, bsPrefix, size, ...props }: UsePlaceholderProps): any;
@@ -19,6 +19,7 @@ function getMargins(element) {
19
19
  export default function usePopperMarginModifiers() {
20
20
  var overlayRef = useRef(null);
21
21
  var margins = useRef(null);
22
+ var arrowMargins = useRef(null);
22
23
  var popoverClass = useBootstrapPrefix(undefined, 'popover');
23
24
  var dropdownMenuClass = useBootstrapPrefix(undefined, 'dropdown-menu');
24
25
  var callback = useCallback(function (overlay) {
@@ -59,32 +60,69 @@ export default function usePopperMarginModifiers() {
59
60
  }
60
61
  }
61
62
  };
62
- }, [margins]); // Converts popover arrow margin to arrow modifier padding
63
+ }, [margins]);
64
+ var arrow = useMemo(function () {
65
+ return {
66
+ name: 'arrow',
67
+ options: {
68
+ padding: function padding() {
69
+ // The options here are used for Popper 2.8.4 and up.
70
+ // For earlier version, padding is handled in popoverArrowMargins below.
71
+ if (!arrowMargins.current) {
72
+ return 0;
73
+ }
74
+
75
+ var _arrowMargins$current = arrowMargins.current,
76
+ top = _arrowMargins$current.top,
77
+ right = _arrowMargins$current.right;
78
+ var padding = top || right;
79
+ return {
80
+ top: padding,
81
+ left: padding,
82
+ right: padding,
83
+ bottom: padding
84
+ };
85
+ }
86
+ }
87
+ };
88
+ }, [arrowMargins]); // Converts popover arrow margin to arrow modifier padding
63
89
 
64
90
  var popoverArrowMargins = useMemo(function () {
65
91
  return {
66
92
  name: 'popoverArrowMargins',
67
93
  enabled: true,
68
94
  phase: 'main',
95
+ fn: function fn() {
96
+ return undefined;
97
+ },
69
98
  requiresIfExists: ['arrow'],
70
99
  effect: function effect(_ref2) {
71
100
  var state = _ref2.state;
72
101
 
73
- if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass) || !state.modifiersData['arrow#persistent']) {
102
+ if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass)) {
74
103
  return undefined;
75
104
  }
76
105
 
77
- var _getMargins = getMargins(state.elements.arrow),
78
- top = _getMargins.top,
79
- right = _getMargins.right;
106
+ if (state.modifiersData['arrow#persistent']) {
107
+ // @popperjs/core <= 2.8.3 uses arrow#persistent to pass padding to arrow modifier.
108
+ var _getMargins = getMargins(state.elements.arrow),
109
+ top = _getMargins.top,
110
+ right = _getMargins.right;
111
+
112
+ var padding = top || right;
113
+ state.modifiersData['arrow#persistent'].padding = {
114
+ top: padding,
115
+ left: padding,
116
+ right: padding,
117
+ bottom: padding
118
+ };
119
+ } else {
120
+ // @popperjs/core >= 2.8.4 gets the padding from the arrow modifier options,
121
+ // so we'll get the margins here, and let the arrow modifier above pass
122
+ // it to popper.
123
+ arrowMargins.current = getMargins(state.elements.arrow);
124
+ }
80
125
 
81
- var padding = top || right;
82
- state.modifiersData['arrow#persistent'].padding = {
83
- top: padding,
84
- left: padding,
85
- right: padding,
86
- bottom: padding
87
- };
88
126
  state.elements.arrow.style.margin = '0';
89
127
  return function () {
90
128
  if (state.elements.arrow) state.elements.arrow.style.margin = '';
@@ -92,5 +130,5 @@ export default function usePopperMarginModifiers() {
92
130
  }
93
131
  };
94
132
  }, [popoverClass]);
95
- return [callback, [offset, popoverArrowMargins]];
133
+ return [callback, [offset, arrow, popoverArrowMargins]];
96
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap",
3
- "version": "1.5.2",
3
+ "version": "1.6.3",
4
4
  "description": "Bootstrap 4 components built with React",
5
5
  "keywords": [
6
6
  "react",
@@ -25,11 +25,6 @@
25
25
  "type": "git",
26
26
  "url": "git+https://github.com/react-bootstrap/react-bootstrap.git"
27
27
  },
28
- "husky": {
29
- "hooks": {
30
- "pre-commit": "lint-staged"
31
- }
32
- },
33
28
  "lint-staged": {
34
29
  "*.{js,ts,tsx}": "eslint --fix"
35
30
  },
@@ -38,21 +33,20 @@
38
33
  "trailingComma": "all"
39
34
  },
40
35
  "dependencies": {
41
- "@babel/runtime": "^7.13.8",
36
+ "@babel/runtime": "^7.14.0",
42
37
  "@restart/context": "^2.1.4",
43
38
  "@restart/hooks": "^0.3.26",
44
- "@types/classnames": "^2.2.10",
45
39
  "@types/invariant": "^2.2.33",
46
40
  "@types/prop-types": "^15.7.3",
47
- "@types/react": ">=16.9.35",
41
+ "@types/react": ">=16.14.8",
48
42
  "@types/react-transition-group": "^4.4.1",
49
43
  "@types/warning": "^3.0.0",
50
- "classnames": "^2.2.6",
51
- "dom-helpers": "^5.1.2",
44
+ "classnames": "^2.3.1",
45
+ "dom-helpers": "^5.2.1",
52
46
  "invariant": "^2.2.4",
53
47
  "prop-types": "^15.7.2",
54
48
  "prop-types-extra": "^1.1.0",
55
- "react-overlays": "^5.0.0",
49
+ "react-overlays": "^5.1.1",
56
50
  "react-transition-group": "^4.4.1",
57
51
  "uncontrollable": "^7.2.1",
58
52
  "warning": "^4.0.3"