react-bootstrap 1.4.0 → 1.5.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 (209) hide show
  1. package/README.md +1 -1
  2. package/cjs/AbstractNav.js +1 -1
  3. package/cjs/AbstractNavItem.js +6 -2
  4. package/cjs/Accordion.js +1 -1
  5. package/cjs/AccordionCollapse.js +1 -1
  6. package/cjs/AccordionContext.js +1 -1
  7. package/cjs/AccordionToggle.js +1 -1
  8. package/cjs/Alert.js +2 -2
  9. package/cjs/Badge.js +1 -1
  10. package/cjs/Breadcrumb.js +1 -1
  11. package/cjs/BreadcrumbItem.js +1 -1
  12. package/cjs/Button.js +1 -1
  13. package/cjs/ButtonGroup.js +1 -1
  14. package/cjs/ButtonToolbar.js +1 -1
  15. package/cjs/Card.js +1 -1
  16. package/cjs/CardContext.js +1 -1
  17. package/cjs/CardImg.js +1 -1
  18. package/cjs/Carousel.d.ts +6 -0
  19. package/cjs/Carousel.js +30 -36
  20. package/cjs/CarouselItem.js +1 -1
  21. package/cjs/CloseButton.js +1 -1
  22. package/cjs/Col.js +1 -1
  23. package/cjs/Collapse.js +5 -5
  24. package/cjs/Container.js +1 -1
  25. package/cjs/Dropdown.js +1 -1
  26. package/cjs/DropdownButton.d.ts +7 -5
  27. package/cjs/DropdownButton.js +4 -3
  28. package/cjs/DropdownItem.js +1 -1
  29. package/cjs/DropdownMenu.js +5 -2
  30. package/cjs/DropdownToggle.js +1 -1
  31. package/cjs/ElementChildren.js +2 -2
  32. package/cjs/Fade.js +5 -5
  33. package/cjs/Feedback.js +1 -1
  34. package/cjs/FigureImage.js +1 -1
  35. package/cjs/Form.js +1 -1
  36. package/cjs/FormCheck.d.ts +1 -1
  37. package/cjs/FormCheck.js +1 -1
  38. package/cjs/FormCheckInput.js +1 -1
  39. package/cjs/FormCheckLabel.js +1 -1
  40. package/cjs/FormContext.js +1 -1
  41. package/cjs/FormControl.js +1 -1
  42. package/cjs/FormFile.js +1 -1
  43. package/cjs/FormFileInput.js +1 -1
  44. package/cjs/FormFileLabel.js +1 -1
  45. package/cjs/FormGroup.js +1 -1
  46. package/cjs/FormLabel.js +1 -1
  47. package/cjs/FormText.js +1 -1
  48. package/cjs/Image.js +1 -1
  49. package/cjs/InputGroup.d.ts +1 -0
  50. package/cjs/InputGroup.js +4 -3
  51. package/cjs/Jumbotron.js +1 -1
  52. package/cjs/ListGroup.js +1 -1
  53. package/cjs/ListGroupItem.d.ts +1 -1
  54. package/cjs/ListGroupItem.js +7 -1
  55. package/cjs/Media.js +1 -1
  56. package/cjs/Modal.js +2 -3
  57. package/cjs/ModalContext.js +1 -1
  58. package/cjs/ModalDialog.js +1 -1
  59. package/cjs/ModalHeader.js +1 -1
  60. package/cjs/Nav.js +1 -1
  61. package/cjs/NavContext.js +1 -1
  62. package/cjs/NavDropdown.js +10 -44
  63. package/cjs/NavItem.js +1 -1
  64. package/cjs/NavLink.js +1 -1
  65. package/cjs/Navbar.d.ts +1 -1
  66. package/cjs/Navbar.js +1 -1
  67. package/cjs/NavbarBrand.js +1 -1
  68. package/cjs/NavbarCollapse.js +1 -1
  69. package/cjs/NavbarContext.js +1 -1
  70. package/cjs/NavbarToggle.js +1 -1
  71. package/cjs/Overlay.js +7 -4
  72. package/cjs/OverlayTrigger.js +1 -1
  73. package/cjs/PageItem.js +1 -1
  74. package/cjs/Pagination.js +1 -1
  75. package/cjs/Popover.js +1 -1
  76. package/cjs/PopoverContent.js +1 -1
  77. package/cjs/PopoverTitle.js +1 -1
  78. package/cjs/ProgressBar.js +3 -3
  79. package/cjs/ResponsiveEmbed.js +2 -2
  80. package/cjs/Row.js +1 -1
  81. package/cjs/SafeAnchor.js +1 -1
  82. package/cjs/SelectableContext.js +1 -1
  83. package/cjs/Spinner.js +1 -1
  84. package/cjs/SplitButton.d.ts +14 -5
  85. package/cjs/SplitButton.js +12 -2
  86. package/cjs/Switch.js +1 -1
  87. package/cjs/TabContent.js +1 -1
  88. package/cjs/TabContext.js +1 -1
  89. package/cjs/TabPane.js +1 -1
  90. package/cjs/Table.js +1 -1
  91. package/cjs/ThemeProvider.js +2 -2
  92. package/cjs/Toast.js +1 -1
  93. package/cjs/ToastContext.js +1 -1
  94. package/cjs/ToastHeader.js +1 -1
  95. package/cjs/ToggleButton.d.ts +2 -2
  96. package/cjs/ToggleButton.js +1 -1
  97. package/cjs/ToggleButtonGroup.js +2 -2
  98. package/cjs/Tooltip.js +1 -1
  99. package/cjs/createWithBsPrefix.js +1 -1
  100. package/cjs/divWithClassName.js +1 -1
  101. package/cjs/helpers.d.ts +1 -0
  102. package/cjs/transitionEndListener.d.ts +1 -0
  103. package/cjs/transitionEndListener.js +19 -0
  104. package/dist/react-bootstrap.js +796 -652
  105. package/dist/react-bootstrap.min.js +2 -2
  106. package/esm/AbstractNav.js +1 -1
  107. package/esm/AbstractNavItem.js +6 -2
  108. package/esm/Accordion.js +1 -1
  109. package/esm/AccordionCollapse.js +1 -1
  110. package/esm/AccordionContext.js +1 -1
  111. package/esm/AccordionToggle.js +1 -1
  112. package/esm/Alert.js +2 -2
  113. package/esm/Badge.js +1 -1
  114. package/esm/Breadcrumb.js +1 -1
  115. package/esm/BreadcrumbItem.js +1 -1
  116. package/esm/Button.js +1 -1
  117. package/esm/ButtonGroup.js +1 -1
  118. package/esm/ButtonToolbar.js +1 -1
  119. package/esm/Card.js +1 -1
  120. package/esm/CardContext.js +1 -1
  121. package/esm/CardImg.js +1 -1
  122. package/esm/Carousel.d.ts +6 -0
  123. package/esm/Carousel.js +30 -36
  124. package/esm/CarouselItem.js +1 -1
  125. package/esm/CloseButton.js +1 -1
  126. package/esm/Col.js +1 -1
  127. package/esm/Collapse.js +4 -4
  128. package/esm/Container.js +1 -1
  129. package/esm/Dropdown.js +1 -1
  130. package/esm/DropdownButton.d.ts +7 -5
  131. package/esm/DropdownButton.js +4 -3
  132. package/esm/DropdownItem.js +1 -1
  133. package/esm/DropdownMenu.js +5 -2
  134. package/esm/DropdownToggle.js +1 -1
  135. package/esm/ElementChildren.js +2 -2
  136. package/esm/Fade.js +4 -4
  137. package/esm/Feedback.js +1 -1
  138. package/esm/FigureImage.js +1 -1
  139. package/esm/Form.js +1 -1
  140. package/esm/FormCheck.d.ts +1 -1
  141. package/esm/FormCheck.js +1 -1
  142. package/esm/FormCheckInput.js +1 -1
  143. package/esm/FormCheckLabel.js +1 -1
  144. package/esm/FormContext.js +1 -1
  145. package/esm/FormControl.js +1 -1
  146. package/esm/FormFile.js +1 -1
  147. package/esm/FormFileInput.js +1 -1
  148. package/esm/FormFileLabel.js +1 -1
  149. package/esm/FormGroup.js +1 -1
  150. package/esm/FormLabel.js +1 -1
  151. package/esm/FormText.js +1 -1
  152. package/esm/Image.js +1 -1
  153. package/esm/InputGroup.d.ts +1 -0
  154. package/esm/InputGroup.js +4 -3
  155. package/esm/Jumbotron.js +1 -1
  156. package/esm/ListGroup.js +1 -1
  157. package/esm/ListGroupItem.d.ts +1 -1
  158. package/esm/ListGroupItem.js +7 -1
  159. package/esm/Media.js +1 -1
  160. package/esm/Modal.js +2 -3
  161. package/esm/ModalContext.js +1 -1
  162. package/esm/ModalDialog.js +1 -1
  163. package/esm/ModalHeader.js +1 -1
  164. package/esm/Nav.js +1 -1
  165. package/esm/NavContext.js +1 -1
  166. package/esm/NavDropdown.js +8 -42
  167. package/esm/NavItem.js +1 -1
  168. package/esm/NavLink.js +1 -1
  169. package/esm/Navbar.d.ts +1 -1
  170. package/esm/Navbar.js +1 -1
  171. package/esm/NavbarBrand.js +1 -1
  172. package/esm/NavbarCollapse.js +1 -1
  173. package/esm/NavbarContext.js +1 -1
  174. package/esm/NavbarToggle.js +1 -1
  175. package/esm/Overlay.js +7 -4
  176. package/esm/OverlayTrigger.js +1 -1
  177. package/esm/PageItem.js +1 -1
  178. package/esm/Pagination.js +1 -1
  179. package/esm/Popover.js +1 -1
  180. package/esm/PopoverContent.js +1 -1
  181. package/esm/PopoverTitle.js +1 -1
  182. package/esm/ProgressBar.js +3 -3
  183. package/esm/ResponsiveEmbed.js +2 -2
  184. package/esm/Row.js +1 -1
  185. package/esm/SafeAnchor.js +1 -1
  186. package/esm/SelectableContext.js +1 -1
  187. package/esm/Spinner.js +1 -1
  188. package/esm/SplitButton.d.ts +14 -5
  189. package/esm/SplitButton.js +12 -1
  190. package/esm/Switch.js +1 -1
  191. package/esm/TabContent.js +1 -1
  192. package/esm/TabContext.js +1 -1
  193. package/esm/TabPane.js +1 -1
  194. package/esm/Table.js +1 -1
  195. package/esm/ThemeProvider.js +2 -2
  196. package/esm/Toast.js +1 -1
  197. package/esm/ToastContext.js +1 -1
  198. package/esm/ToastHeader.js +1 -1
  199. package/esm/ToggleButton.d.ts +2 -2
  200. package/esm/ToggleButton.js +1 -1
  201. package/esm/ToggleButtonGroup.js +2 -2
  202. package/esm/Tooltip.js +1 -1
  203. package/esm/createWithBsPrefix.js +1 -1
  204. package/esm/divWithClassName.js +1 -1
  205. package/esm/helpers.d.ts +1 -0
  206. package/esm/transitionEndListener.d.ts +1 -0
  207. package/esm/transitionEndListener.js +9 -0
  208. package/package.json +3 -3
  209. package/transitionEndListener/package.json +7 -0
@@ -11,7 +11,7 @@ import TabContext from './TabContext';
11
11
  // eslint-disable-next-line @typescript-eslint/no-empty-function
12
12
  var noop = function noop() {};
13
13
 
14
- var AbstractNav = React.forwardRef(function (_ref, ref) {
14
+ var AbstractNav = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
15
15
  var _ref$as = _ref.as,
16
16
  Component = _ref$as === void 0 ? 'ul' : _ref$as,
17
17
  onSelect = _ref.onSelect,
@@ -9,7 +9,7 @@ import SelectableContext, { makeEventKey } from './SelectableContext';
9
9
  var defaultProps = {
10
10
  disabled: false
11
11
  };
12
- var AbstractNavItem = React.forwardRef(function (_ref, ref) {
12
+ var AbstractNavItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
13
13
  var active = _ref.active,
14
14
  className = _ref.className,
15
15
  eventKey = _ref.eventKey,
@@ -36,7 +36,11 @@ var AbstractNavItem = React.forwardRef(function (_ref, ref) {
36
36
  }
37
37
 
38
38
  if (props.role === 'tab') {
39
- props.tabIndex = isActive ? props.tabIndex : -1;
39
+ if (props.disabled) {
40
+ props.tabIndex = -1;
41
+ props['aria-disabled'] = true;
42
+ }
43
+
40
44
  props['aria-selected'] = isActive;
41
45
  }
42
46
 
package/esm/Accordion.js CHANGED
@@ -8,7 +8,7 @@ import AccordionToggle from './AccordionToggle';
8
8
  import SelectableContext from './SelectableContext';
9
9
  import AccordionCollapse from './AccordionCollapse';
10
10
  import AccordionContext from './AccordionContext';
11
- var Accordion = React.forwardRef(function (props, ref) {
11
+ var Accordion = /*#__PURE__*/React.forwardRef(function (props, ref) {
12
12
  var _useUncontrolled = useUncontrolled(props, {
13
13
  activeKey: 'onSelect'
14
14
  }),
@@ -4,7 +4,7 @@ import React, { useContext } from 'react';
4
4
  import Collapse from './Collapse';
5
5
  import AccordionContext from './AccordionContext';
6
6
  import SelectableContext from './SelectableContext';
7
- var AccordionCollapse = React.forwardRef(function (_ref, ref) {
7
+ var AccordionCollapse = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
8
8
  var children = _ref.children,
9
9
  eventKey = _ref.eventKey,
10
10
  props = _objectWithoutPropertiesLoose(_ref, ["children", "eventKey"]);
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- var context = React.createContext(null);
2
+ var context = /*#__PURE__*/React.createContext(null);
3
3
  context.displayName = 'AccordionContext';
4
4
  export default context;
@@ -16,7 +16,7 @@ export function useAccordionToggle(eventKey, onClick) {
16
16
  if (onClick) onClick(e);
17
17
  };
18
18
  }
19
- var AccordionToggle = React.forwardRef(function (_ref, ref) {
19
+ var AccordionToggle = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
20
20
  var _ref$as = _ref.as,
21
21
  Component = _ref$as === void 0 ? 'button' : _ref$as,
22
22
  children = _ref.children,
package/esm/Alert.js CHANGED
@@ -23,7 +23,7 @@ var defaultProps = {
23
23
  transition: Fade,
24
24
  closeLabel: 'Close alert'
25
25
  };
26
- var Alert = React.forwardRef(function (uncontrolledProps, ref) {
26
+ var Alert = /*#__PURE__*/React.forwardRef(function (uncontrolledProps, ref) {
27
27
  var _useUncontrolled = useUncontrolled(uncontrolledProps, {
28
28
  show: 'onClose'
29
29
  }),
@@ -47,7 +47,7 @@ var Alert = React.forwardRef(function (uncontrolledProps, ref) {
47
47
  var Transition = transition === true ? Fade : transition;
48
48
  var alert = /*#__PURE__*/React.createElement("div", _extends({
49
49
  role: "alert"
50
- }, Transition ? props : undefined, {
50
+ }, !Transition ? props : undefined, {
51
51
  ref: ref,
52
52
  className: classNames(className, prefix, variant && prefix + "-" + variant, dismissible && prefix + "-dismissible")
53
53
  }), dismissible && /*#__PURE__*/React.createElement(CloseButton, {
package/esm/Badge.js CHANGED
@@ -6,7 +6,7 @@ import { useBootstrapPrefix } from './ThemeProvider';
6
6
  var defaultProps = {
7
7
  pill: false
8
8
  };
9
- var Badge = React.forwardRef(function (_ref, ref) {
9
+ var Badge = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
10
10
  var bsPrefix = _ref.bsPrefix,
11
11
  variant = _ref.variant,
12
12
  pill = _ref.pill,
package/esm/Breadcrumb.js CHANGED
@@ -8,7 +8,7 @@ var defaultProps = {
8
8
  label: 'breadcrumb',
9
9
  listProps: {}
10
10
  };
11
- var Breadcrumb = React.forwardRef(function (_ref, ref) {
11
+ var Breadcrumb = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12
12
  var bsPrefix = _ref.bsPrefix,
13
13
  className = _ref.className,
14
14
  listProps = _ref.listProps,
@@ -8,7 +8,7 @@ var defaultProps = {
8
8
  active: false,
9
9
  linkProps: {}
10
10
  };
11
- var BreadcrumbItem = React.forwardRef(function (_ref, ref) {
11
+ var BreadcrumbItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12
12
  var bsPrefix = _ref.bsPrefix,
13
13
  active = _ref.active,
14
14
  children = _ref.children,
package/esm/Button.js CHANGED
@@ -9,7 +9,7 @@ var defaultProps = {
9
9
  active: false,
10
10
  disabled: false
11
11
  };
12
- var Button = React.forwardRef(function (_ref, ref) {
12
+ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
13
13
  var bsPrefix = _ref.bsPrefix,
14
14
  variant = _ref.variant,
15
15
  size = _ref.size,
@@ -8,7 +8,7 @@ var defaultProps = {
8
8
  toggle: false,
9
9
  role: 'group'
10
10
  };
11
- var ButtonGroup = React.forwardRef(function (_ref, ref) {
11
+ var ButtonGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12
12
  var bsPrefix = _ref.bsPrefix,
13
13
  size = _ref.size,
14
14
  toggle = _ref.toggle,
@@ -6,7 +6,7 @@ import { useBootstrapPrefix } from './ThemeProvider';
6
6
  var defaultProps = {
7
7
  role: 'toolbar'
8
8
  };
9
- var ButtonToolbar = React.forwardRef(function (_ref, ref) {
9
+ var ButtonToolbar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
10
10
  var bsPrefix = _ref.bsPrefix,
11
11
  className = _ref.className,
12
12
  props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className"]);
package/esm/Card.js CHANGED
@@ -28,7 +28,7 @@ var CardImgOverlay = createWithBsPrefix('card-img-overlay');
28
28
  var defaultProps = {
29
29
  body: false
30
30
  };
31
- var Card = React.forwardRef(function (_ref, ref) {
31
+ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
32
32
  var bsPrefix = _ref.bsPrefix,
33
33
  className = _ref.className,
34
34
  bg = _ref.bg,
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- var context = React.createContext(null);
2
+ var context = /*#__PURE__*/React.createContext(null);
3
3
  context.displayName = 'CardContext';
4
4
  export default context;
package/esm/CardImg.js CHANGED
@@ -6,7 +6,7 @@ import { useBootstrapPrefix } from './ThemeProvider';
6
6
  var defaultProps = {
7
7
  variant: null
8
8
  };
9
- var CardImg = React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
9
+ var CardImg = /*#__PURE__*/React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
10
10
  function (_ref, ref) {
11
11
  var bsPrefix = _ref.bsPrefix,
12
12
  className = _ref.className,
package/esm/Carousel.d.ts CHANGED
@@ -2,6 +2,11 @@ import React from 'react';
2
2
  import CarouselCaption from './CarouselCaption';
3
3
  import CarouselItem from './CarouselItem';
4
4
  import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
5
+ export interface CarouselRef {
6
+ element: HTMLElement;
7
+ prev: (e?: React.SyntheticEvent) => void;
8
+ next: (e?: React.SyntheticEvent) => void;
9
+ }
5
10
  export interface CarouselProps extends BsPrefixPropsWithChildren, Pick<React.DOMAttributes<HTMLElement>, 'onKeyDown' | 'onMouseOver' | 'onMouseOut' | 'onTouchStart' | 'onTouchMove' | 'onTouchEnd'> {
6
11
  slide?: boolean;
7
12
  fade?: boolean;
@@ -21,6 +26,7 @@ export interface CarouselProps extends BsPrefixPropsWithChildren, Pick<React.DOM
21
26
  prevLabel?: React.ReactNode;
22
27
  nextIcon?: React.ReactNode;
23
28
  nextLabel?: React.ReactNode;
29
+ ref?: React.Ref<CarouselRef>;
24
30
  }
25
31
  declare type Carousel = BsPrefixRefForwardingComponent<'div', CarouselProps> & {
26
32
  Caption: typeof CarouselCaption;
package/esm/Carousel.js CHANGED
@@ -193,12 +193,16 @@ function CarouselFunc(uncontrolledProps, ref) {
193
193
  setDirection = _useState[1];
194
194
 
195
195
  var _useState2 = useState(false),
196
- isSliding = _useState2[0],
197
- setIsSliding = _useState2[1];
196
+ paused = _useState2[0],
197
+ setPaused = _useState2[1];
198
198
 
199
- var _useState3 = useState(activeIndex || 0),
200
- renderedActiveIndex = _useState3[0],
201
- setRenderedActiveIndex = _useState3[1];
199
+ var _useState3 = useState(false),
200
+ isSliding = _useState3[0],
201
+ setIsSliding = _useState3[1];
202
+
203
+ var _useState4 = useState(activeIndex || 0),
204
+ renderedActiveIndex = _useState4[0],
205
+ setRenderedActiveIndex = _useState4[1];
202
206
 
203
207
  if (!isSliding && activeIndex !== renderedActiveIndex) {
204
208
  if (nextDirectionRef.current) {
@@ -340,14 +344,9 @@ function CarouselFunc(uncontrolledProps, ref) {
340
344
  onKeyDown(event);
341
345
  }
342
346
  }, [keyboard, onKeyDown, prev, next]);
343
-
344
- var _useState4 = useState(false),
345
- pausedOnHover = _useState4[0],
346
- setPausedOnHover = _useState4[1];
347
-
348
347
  var handleMouseOver = useCallback(function (event) {
349
348
  if (pause === 'hover') {
350
- setPausedOnHover(true);
349
+ setPaused(true);
351
350
  }
352
351
 
353
352
  if (onMouseOver) {
@@ -355,7 +354,7 @@ function CarouselFunc(uncontrolledProps, ref) {
355
354
  }
356
355
  }, [pause, onMouseOver]);
357
356
  var handleMouseOut = useCallback(function (event) {
358
- setPausedOnHover(false);
357
+ setPaused(false);
359
358
 
360
359
  if (onMouseOut) {
361
360
  onMouseOut(event);
@@ -363,24 +362,19 @@ function CarouselFunc(uncontrolledProps, ref) {
363
362
  }, [onMouseOut]);
364
363
  var touchStartXRef = useRef(0);
365
364
  var touchDeltaXRef = useRef(0);
366
-
367
- var _useState5 = useState(false),
368
- pausedOnTouch = _useState5[0],
369
- setPausedOnTouch = _useState5[1];
370
-
371
365
  var touchUnpauseTimeout = useTimeout();
372
366
  var handleTouchStart = useCallback(function (event) {
373
367
  touchStartXRef.current = event.touches[0].clientX;
374
368
  touchDeltaXRef.current = 0;
375
369
 
376
- if (touch) {
377
- setPausedOnTouch(true);
370
+ if (pause === 'hover') {
371
+ setPaused(true);
378
372
  }
379
373
 
380
374
  if (onTouchStart) {
381
375
  onTouchStart(event);
382
376
  }
383
- }, [touch, onTouchStart]);
377
+ }, [pause, onTouchStart]);
384
378
  var handleTouchMove = useCallback(function (event) {
385
379
  if (event.touches && event.touches.length > 1) {
386
380
  touchDeltaXRef.current = 0;
@@ -396,26 +390,26 @@ function CarouselFunc(uncontrolledProps, ref) {
396
390
  if (touch) {
397
391
  var touchDeltaX = touchDeltaXRef.current;
398
392
 
399
- if (Math.abs(touchDeltaX) <= SWIPE_THRESHOLD) {
400
- return;
401
- }
402
-
403
- if (touchDeltaX > 0) {
404
- prev(event);
405
- } else {
406
- next(event);
393
+ if (Math.abs(touchDeltaX) > SWIPE_THRESHOLD) {
394
+ if (touchDeltaX > 0) {
395
+ prev(event);
396
+ } else {
397
+ next(event);
398
+ }
407
399
  }
408
400
  }
409
401
 
410
- touchUnpauseTimeout.set(function () {
411
- setPausedOnTouch(false);
412
- }, interval || undefined);
402
+ if (pause === 'hover') {
403
+ touchUnpauseTimeout.set(function () {
404
+ setPaused(false);
405
+ }, interval || undefined);
406
+ }
413
407
 
414
408
  if (onTouchEnd) {
415
409
  onTouchEnd(event);
416
410
  }
417
- }, [touch, prev, next, touchUnpauseTimeout, interval, onTouchEnd]);
418
- var shouldPlay = interval != null && !pausedOnHover && !pausedOnTouch && !isSliding;
411
+ }, [touch, pause, prev, next, touchUnpauseTimeout, interval, onTouchEnd]);
412
+ var shouldPlay = interval != null && !paused && !isSliding;
419
413
  var intervalHandleRef = useRef();
420
414
  useEffect(function () {
421
415
  var _ref, _activeChildIntervalR;
@@ -470,10 +464,10 @@ function CarouselFunc(uncontrolledProps, ref) {
470
464
  onEntered: isActive ? handleEntered : undefined,
471
465
  addEndListener: transitionEnd
472
466
  }, function (status) {
473
- return React.cloneElement(child, {
467
+ return /*#__PURE__*/React.cloneElement(child, {
474
468
  className: classNames(child.props.className, isActive && status !== 'entered' && orderClassName, (status === 'entered' || status === 'exiting') && 'active', (status === 'entering' || status === 'exiting') && directionalClassName)
475
469
  });
476
- }) : React.cloneElement(child, {
470
+ }) : /*#__PURE__*/React.cloneElement(child, {
477
471
  className: classNames(child.props.className, isActive && 'active')
478
472
  });
479
473
  })), controls && /*#__PURE__*/React.createElement(React.Fragment, null, (wrap || activeIndex !== 0) && /*#__PURE__*/React.createElement(SafeAnchor, {
@@ -489,7 +483,7 @@ function CarouselFunc(uncontrolledProps, ref) {
489
483
  }, nextLabel))));
490
484
  }
491
485
 
492
- var Carousel = React.forwardRef(CarouselFunc);
486
+ var Carousel = /*#__PURE__*/React.forwardRef(CarouselFunc);
493
487
  Carousel.displayName = 'Carousel';
494
488
  Carousel.propTypes = propTypes;
495
489
  Carousel.defaultProps = defaultProps;
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  import classNames from 'classnames';
4
4
  import React from 'react';
5
5
  import { useBootstrapPrefix } from './ThemeProvider';
6
- var CarouselItem = React.forwardRef(function (_ref, ref) {
6
+ var CarouselItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7
7
  var _ref$as = _ref.as,
8
8
  Component = _ref$as === void 0 ? 'div' : _ref$as,
9
9
  bsPrefix = _ref.bsPrefix,
@@ -10,7 +10,7 @@ var propTypes = {
10
10
  var defaultProps = {
11
11
  label: 'Close'
12
12
  };
13
- var CloseButton = React.forwardRef(function (_ref, ref) {
13
+ var CloseButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
14
14
  var label = _ref.label,
15
15
  onClick = _ref.onClick,
16
16
  className = _ref.className,
package/esm/Col.js CHANGED
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
  import React from 'react';
5
5
  import { useBootstrapPrefix } from './ThemeProvider';
6
6
  var DEVICE_SIZES = ['xl', 'lg', 'md', 'sm', 'xs'];
7
- var Col = React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
7
+ var Col = /*#__PURE__*/React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
8
8
  function (_ref, ref) {
9
9
  var bsPrefix = _ref.bsPrefix,
10
10
  className = _ref.className,
package/esm/Collapse.js CHANGED
@@ -5,9 +5,9 @@ var _collapseStyles;
5
5
 
6
6
  import classNames from 'classnames';
7
7
  import css from 'dom-helpers/css';
8
- import transitionEnd from 'dom-helpers/transitionEnd';
9
8
  import React, { useMemo } from 'react';
10
9
  import Transition, { ENTERED, ENTERING, EXITED, EXITING } from 'react-transition-group/Transition';
10
+ import transitionEndListener from './transitionEndListener';
11
11
  import createChainedFunction from './createChainedFunction';
12
12
  import triggerBrowserReflow from './triggerBrowserReflow';
13
13
  var MARGINS = {
@@ -33,7 +33,7 @@ var defaultProps = {
33
33
  appear: false,
34
34
  getDimensionValue: getDefaultDimensionValue
35
35
  };
36
- var Collapse = React.forwardRef(function (_ref, ref) {
36
+ var Collapse = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
37
37
  var onEnter = _ref.onEnter,
38
38
  onEntering = _ref.onEntering,
39
39
  onEntered = _ref.onEntered,
@@ -83,7 +83,7 @@ var Collapse = React.forwardRef(function (_ref, ref) {
83
83
  return /*#__PURE__*/React.createElement(Transition // @ts-ignore
84
84
  , _extends({
85
85
  ref: ref,
86
- addEndListener: transitionEnd
86
+ addEndListener: transitionEndListener
87
87
  }, props, {
88
88
  "aria-expanded": props.role ? props.in : null,
89
89
  onEnter: handleEnter,
@@ -92,7 +92,7 @@ var Collapse = React.forwardRef(function (_ref, ref) {
92
92
  onExit: handleExit,
93
93
  onExiting: handleExiting
94
94
  }), function (state, innerProps) {
95
- return React.cloneElement(children, _extends({}, innerProps, {
95
+ return /*#__PURE__*/React.cloneElement(children, _extends({}, innerProps, {
96
96
  className: classNames(className, children.props.className, collapseStyles[state], computedDimension === 'width' && 'width')
97
97
  }));
98
98
  });
package/esm/Container.js CHANGED
@@ -6,7 +6,7 @@ import { useBootstrapPrefix } from './ThemeProvider';
6
6
  var defaultProps = {
7
7
  fluid: false
8
8
  };
9
- var Container = React.forwardRef(function (_ref, ref) {
9
+ var Container = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
10
10
  var bsPrefix = _ref.bsPrefix,
11
11
  fluid = _ref.fluid,
12
12
  _ref$as = _ref.as,
package/esm/Dropdown.js CHANGED
@@ -27,7 +27,7 @@ var DropdownItemText = createWithBsPrefix('dropdown-item-text', {
27
27
  var defaultProps = {
28
28
  navbar: false
29
29
  };
30
- var Dropdown = React.forwardRef(function (pProps, ref) {
30
+ var Dropdown = /*#__PURE__*/React.forwardRef(function (pProps, ref) {
31
31
  var _useUncontrolled = useUncontrolled(pProps, {
32
32
  show: 'onToggle'
33
33
  }),
@@ -2,21 +2,23 @@ import React from 'react';
2
2
  import { DropdownProps } from './Dropdown';
3
3
  import { PropsFromToggle } from './DropdownToggle';
4
4
  import { AlignType } from './DropdownMenu';
5
- export interface DropdownButtonProps extends DropdownProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'title'>, React.PropsWithChildren<PropsFromToggle> {
5
+ import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
6
+ export interface DropdownButtonProps extends DropdownProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'title'>, PropsFromToggle, BsPrefixPropsWithChildren {
6
7
  title: React.ReactNode;
7
8
  menuAlign?: AlignType;
8
9
  menuRole?: string;
9
10
  renderMenuOnMount?: boolean;
10
11
  rootCloseEvent?: 'click' | 'mousedown';
11
- bsPrefix?: string;
12
12
  }
13
+ declare type DropdownButton = BsPrefixRefForwardingComponent<'div', DropdownButtonProps>;
13
14
  /**
14
15
  * A convenience component for simple or general use dropdowns. Renders a `Button` toggle and all `children`
15
- * are passed directly to the default `Dropdown.Menu`.
16
+ * are passed directly to the default `Dropdown.Menu`. This component accepts all of
17
+ * [`Dropdown`'s props](#dropdown-props).
16
18
  *
17
19
  * _All unknown props are passed through to the `Dropdown` component._ Only
18
20
  * the Button `variant`, `size` and `bsPrefix` props are passed to the toggle,
19
- * along with menu related props are passed to the `Dropdown.Menu`
21
+ * along with menu-related props are passed to the `Dropdown.Menu`
20
22
  */
21
- declare const DropdownButton: React.ForwardRefExoticComponent<DropdownButtonProps & React.RefAttributes<HTMLDivElement>>;
23
+ declare const DropdownButton: DropdownButton;
22
24
  export default DropdownButton;
@@ -58,14 +58,15 @@ var propTypes = {
58
58
  };
59
59
  /**
60
60
  * A convenience component for simple or general use dropdowns. Renders a `Button` toggle and all `children`
61
- * are passed directly to the default `Dropdown.Menu`.
61
+ * are passed directly to the default `Dropdown.Menu`. This component accepts all of
62
+ * [`Dropdown`'s props](#dropdown-props).
62
63
  *
63
64
  * _All unknown props are passed through to the `Dropdown` component._ Only
64
65
  * the Button `variant`, `size` and `bsPrefix` props are passed to the toggle,
65
- * along with menu related props are passed to the `Dropdown.Menu`
66
+ * along with menu-related props are passed to the `Dropdown.Menu`
66
67
  */
67
68
 
68
- var DropdownButton = React.forwardRef(function (_ref, ref) {
69
+ var DropdownButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
69
70
  var title = _ref.title,
70
71
  children = _ref.children,
71
72
  bsPrefix = _ref.bsPrefix,
@@ -11,7 +11,7 @@ var defaultProps = {
11
11
  as: SafeAnchor,
12
12
  disabled: false
13
13
  };
14
- var DropdownItem = React.forwardRef(function (_ref, ref) {
14
+ var DropdownItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
15
15
  var bsPrefix = _ref.bsPrefix,
16
16
  className = _ref.className,
17
17
  children = _ref.children,
@@ -26,7 +26,7 @@ var defaultProps = {
26
26
  flip: true
27
27
  }; // TODO: remove this hack
28
28
 
29
- var DropdownMenu = React.forwardRef(function (_ref, ref) {
29
+ var DropdownMenu = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
30
30
  var bsPrefix = _ref.bsPrefix,
31
31
  className = _ref.className,
32
32
  align = _ref.align,
@@ -94,14 +94,17 @@ var DropdownMenu = React.forwardRef(function (_ref, ref) {
94
94
  menuProps.alignRight = alignEnd;
95
95
  }
96
96
 
97
+ var style = props.style;
98
+
97
99
  if (placement) {
98
100
  // we don't need the default popper style,
99
101
  // menus are display: none when not shown.
100
- props.style = _extends({}, props.style, {}, menuProps.style);
102
+ style = _extends({}, props.style, menuProps.style);
101
103
  props['x-placement'] = placement;
102
104
  }
103
105
 
104
106
  return /*#__PURE__*/React.createElement(Component, _extends({}, props, menuProps, {
107
+ style: style,
105
108
  className: classNames.apply(void 0, [className, prefix, show && 'show', alignEnd && prefix + "-right"].concat(alignClasses))
106
109
  }));
107
110
  });
@@ -8,7 +8,7 @@ import useMergedRefs from '@restart/hooks/useMergedRefs';
8
8
  import Button from './Button';
9
9
  import { useBootstrapPrefix } from './ThemeProvider';
10
10
  import useWrappedRefWithWarning from './useWrappedRefWithWarning';
11
- var DropdownToggle = React.forwardRef(function (_ref, ref) {
11
+ var DropdownToggle = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12
12
  var bsPrefix = _ref.bsPrefix,
13
13
  split = _ref.split,
14
14
  className = _ref.className,
@@ -11,7 +11,7 @@ import React from 'react';
11
11
  function map(children, func) {
12
12
  var index = 0;
13
13
  return React.Children.map(children, function (child) {
14
- return React.isValidElement(child) ? func(child, index++) : child;
14
+ return /*#__PURE__*/React.isValidElement(child) ? func(child, index++) : child;
15
15
  });
16
16
  }
17
17
  /**
@@ -25,7 +25,7 @@ function map(children, func) {
25
25
  function forEach(children, func) {
26
26
  var index = 0;
27
27
  React.Children.forEach(children, function (child) {
28
- if (React.isValidElement(child)) func(child, index++);
28
+ if ( /*#__PURE__*/React.isValidElement(child)) func(child, index++);
29
29
  });
30
30
  }
31
31
 
package/esm/Fade.js CHANGED
@@ -4,9 +4,9 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
4
4
  var _fadeStyles;
5
5
 
6
6
  import classNames from 'classnames';
7
- import transitionEnd from 'dom-helpers/transitionEnd';
8
7
  import React, { useCallback } from 'react';
9
8
  import Transition, { ENTERED, ENTERING } from 'react-transition-group/Transition';
9
+ import transitionEndListener from './transitionEndListener';
10
10
  import triggerBrowserReflow from './triggerBrowserReflow';
11
11
  var defaultProps = {
12
12
  in: false,
@@ -16,7 +16,7 @@ var defaultProps = {
16
16
  appear: false
17
17
  };
18
18
  var fadeStyles = (_fadeStyles = {}, _fadeStyles[ENTERING] = 'show', _fadeStyles[ENTERED] = 'show', _fadeStyles);
19
- var Fade = React.forwardRef(function (_ref, ref) {
19
+ var Fade = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
20
20
  var className = _ref.className,
21
21
  children = _ref.children,
22
22
  props = _objectWithoutPropertiesLoose(_ref, ["className", "children"]);
@@ -27,11 +27,11 @@ var Fade = React.forwardRef(function (_ref, ref) {
27
27
  }, [props]);
28
28
  return /*#__PURE__*/React.createElement(Transition, _extends({
29
29
  ref: ref,
30
- addEndListener: transitionEnd
30
+ addEndListener: transitionEndListener
31
31
  }, props, {
32
32
  onEnter: handleEnter
33
33
  }), function (status, innerProps) {
34
- return React.cloneElement(children, _extends({}, innerProps, {
34
+ return /*#__PURE__*/React.cloneElement(children, _extends({}, innerProps, {
35
35
  className: classNames('fade', className, children.props.className, fadeStyles[status])
36
36
  }));
37
37
  });
package/esm/Feedback.js CHANGED
@@ -15,7 +15,7 @@ var propTypes = {
15
15
  tooltip: PropTypes.bool,
16
16
  as: PropTypes.elementType
17
17
  };
18
- var Feedback = React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
18
+ var Feedback = /*#__PURE__*/React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
19
19
  function (_ref, ref) {
20
20
  var _ref$as = _ref.as,
21
21
  Component = _ref$as === void 0 ? 'div' : _ref$as,
@@ -6,7 +6,7 @@ import Image, { propTypes as imagePropTypes } from './Image';
6
6
  var defaultProps = {
7
7
  fluid: true
8
8
  };
9
- var FigureImage = React.forwardRef(function (_ref, ref) {
9
+ var FigureImage = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
10
10
  var className = _ref.className,
11
11
  props = _objectWithoutPropertiesLoose(_ref, ["className"]);
12
12
 
package/esm/Form.js CHANGED
@@ -15,7 +15,7 @@ var FormRow = createWithBsPrefix('form-row');
15
15
  var defaultProps = {
16
16
  inline: false
17
17
  };
18
- var FormImpl = React.forwardRef(function (_ref, ref) {
18
+ var FormImpl = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
19
19
  var bsPrefix = _ref.bsPrefix,
20
20
  inline = _ref.inline,
21
21
  className = _ref.className,
@@ -3,7 +3,7 @@ import FormCheckInput from './FormCheckInput';
3
3
  import FormCheckLabel from './FormCheckLabel';
4
4
  import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
5
5
  export declare type FormCheckType = 'checkbox' | 'radio' | 'switch';
6
- export interface FormCheckProps extends BsPrefixPropsWithChildren, React.HTMLAttributes<HTMLInputElement> {
6
+ export interface FormCheckProps extends BsPrefixPropsWithChildren, React.InputHTMLAttributes<HTMLInputElement> {
7
7
  bsCustomPrefix?: string;
8
8
  inline?: boolean;
9
9
  disabled?: boolean;
package/esm/FormCheck.js CHANGED
@@ -8,7 +8,7 @@ import FormCheckInput from './FormCheckInput';
8
8
  import FormCheckLabel from './FormCheckLabel';
9
9
  import FormContext from './FormContext';
10
10
  import { useBootstrapPrefix } from './ThemeProvider';
11
- var FormCheck = React.forwardRef(function (_ref, ref) {
11
+ var FormCheck = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12
12
  var id = _ref.id,
13
13
  bsPrefix = _ref.bsPrefix,
14
14
  bsCustomPrefix = _ref.bsCustomPrefix,
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
  import React, { useContext } from 'react';
5
5
  import FormContext from './FormContext';
6
6
  import { useBootstrapPrefix } from './ThemeProvider';
7
- var FormCheckInput = React.forwardRef(function (_ref, ref) {
7
+ var FormCheckInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
8
8
  var id = _ref.id,
9
9
  bsPrefix = _ref.bsPrefix,
10
10
  bsCustomPrefix = _ref.bsCustomPrefix,
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
  import React, { useContext } from 'react';
5
5
  import FormContext from './FormContext';
6
6
  import { useBootstrapPrefix } from './ThemeProvider';
7
- var FormCheckLabel = React.forwardRef(function (_ref, ref) {
7
+ var FormCheckLabel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
8
8
  var bsPrefix = _ref.bsPrefix,
9
9
  bsCustomPrefix = _ref.bsCustomPrefix,
10
10
  className = _ref.className,