react-bootstrap 2.6.0 → 2.7.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 (283) hide show
  1. package/cjs/AbstractModalHeader.js +0 -9
  2. package/cjs/Accordion.js +0 -17
  3. package/cjs/AccordionBody.d.ts +2 -1
  4. package/cjs/AccordionBody.js +12 -10
  5. package/cjs/AccordionButton.d.ts +1 -1
  6. package/cjs/AccordionButton.js +0 -15
  7. package/cjs/AccordionCollapse.js +0 -10
  8. package/cjs/AccordionContext.d.ts +1 -1
  9. package/cjs/AccordionContext.js +0 -5
  10. package/cjs/AccordionHeader.js +0 -9
  11. package/cjs/AccordionItem.js +0 -9
  12. package/cjs/AccordionItemContext.js +0 -4
  13. package/cjs/Alert.js +0 -17
  14. package/cjs/Anchor.js +0 -3
  15. package/cjs/Badge.js +0 -8
  16. package/cjs/BootstrapModalManager.js +2 -18
  17. package/cjs/Breadcrumb.js +2 -12
  18. package/cjs/BreadcrumbItem.js +2 -10
  19. package/cjs/Button.d.ts +1 -1
  20. package/cjs/Button.js +2 -10
  21. package/cjs/ButtonGroup.js +2 -9
  22. package/cjs/ButtonToolbar.js +2 -9
  23. package/cjs/Card.js +0 -14
  24. package/cjs/CardGroup.js +0 -4
  25. package/cjs/CardHeader.js +0 -9
  26. package/cjs/CardHeaderContext.js +0 -4
  27. package/cjs/CardImg.js +2 -9
  28. package/cjs/Carousel.d.ts +1 -1
  29. package/cjs/Carousel.js +9 -58
  30. package/cjs/CarouselCaption.js +0 -4
  31. package/cjs/CarouselItem.js +0 -8
  32. package/cjs/CloseButton.d.ts +1 -1
  33. package/cjs/CloseButton.js +0 -10
  34. package/cjs/Col.d.ts +5 -5
  35. package/cjs/Col.js +6 -14
  36. package/cjs/Collapse.d.ts +1 -1
  37. package/cjs/Collapse.js +10 -22
  38. package/cjs/Container.js +0 -8
  39. package/cjs/Dropdown.js +17 -27
  40. package/cjs/DropdownButton.js +1 -25
  41. package/cjs/DropdownContext.d.ts +2 -2
  42. package/cjs/DropdownContext.js +0 -4
  43. package/cjs/DropdownItem.js +2 -11
  44. package/cjs/DropdownMenu.d.ts +2 -2
  45. package/cjs/DropdownMenu.js +12 -34
  46. package/cjs/DropdownToggle.d.ts +2 -2
  47. package/cjs/DropdownToggle.js +7 -24
  48. package/cjs/ElementChildren.js +2 -8
  49. package/cjs/Fade.js +2 -12
  50. package/cjs/Feedback.d.ts +1 -1
  51. package/cjs/Feedback.js +4 -11
  52. package/cjs/Figure.js +0 -7
  53. package/cjs/FigureCaption.js +0 -3
  54. package/cjs/FigureImage.js +0 -8
  55. package/cjs/FloatingLabel.js +0 -9
  56. package/cjs/Form.d.ts +1 -1
  57. package/cjs/Form.js +2 -22
  58. package/cjs/FormCheck.d.ts +1 -1
  59. package/cjs/FormCheck.js +2 -16
  60. package/cjs/FormCheckInput.d.ts +1 -1
  61. package/cjs/FormCheckInput.js +2 -10
  62. package/cjs/FormCheckLabel.js +2 -10
  63. package/cjs/FormContext.js +0 -4
  64. package/cjs/FormControl.d.ts +1 -1
  65. package/cjs/FormControl.js +2 -16
  66. package/cjs/FormFloating.js +0 -4
  67. package/cjs/FormGroup.js +2 -8
  68. package/cjs/FormLabel.d.ts +1 -1
  69. package/cjs/FormLabel.js +0 -11
  70. package/cjs/FormRange.js +2 -10
  71. package/cjs/FormSelect.js +2 -10
  72. package/cjs/FormText.js +4 -10
  73. package/cjs/Image.js +0 -13
  74. package/cjs/InputGroup.js +3 -18
  75. package/cjs/InputGroupContext.js +0 -4
  76. package/cjs/ListGroup.js +0 -16
  77. package/cjs/ListGroupItem.js +2 -16
  78. package/cjs/Modal.js +31 -72
  79. package/cjs/ModalBody.js +0 -4
  80. package/cjs/ModalContext.js +0 -5
  81. package/cjs/ModalDialog.js +2 -9
  82. package/cjs/ModalFooter.js +0 -4
  83. package/cjs/ModalHeader.js +0 -9
  84. package/cjs/ModalTitle.js +0 -6
  85. package/cjs/Nav.js +0 -19
  86. package/cjs/NavContext.js +0 -4
  87. package/cjs/NavDropdown.js +0 -12
  88. package/cjs/NavItem.js +0 -4
  89. package/cjs/NavLink.js +2 -12
  90. package/cjs/Navbar.js +3 -22
  91. package/cjs/NavbarBrand.js +2 -9
  92. package/cjs/NavbarCollapse.js +0 -9
  93. package/cjs/NavbarContext.js +0 -4
  94. package/cjs/NavbarOffcanvas.d.ts +1 -1
  95. package/cjs/NavbarOffcanvas.js +0 -8
  96. package/cjs/NavbarToggle.js +2 -13
  97. package/cjs/Offcanvas.d.ts +1 -1
  98. package/cjs/Offcanvas.js +9 -37
  99. package/cjs/OffcanvasBody.js +0 -4
  100. package/cjs/OffcanvasHeader.js +0 -9
  101. package/cjs/OffcanvasTitle.js +0 -6
  102. package/cjs/OffcanvasToggling.js +2 -12
  103. package/cjs/Overlay.d.ts +1 -1
  104. package/cjs/Overlay.js +12 -27
  105. package/cjs/OverlayTrigger.d.ts +4 -4
  106. package/cjs/OverlayTrigger.js +7 -32
  107. package/cjs/PageItem.js +3 -11
  108. package/cjs/Pagination.js +0 -11
  109. package/cjs/Placeholder.js +2 -11
  110. package/cjs/PlaceholderButton.js +2 -9
  111. package/cjs/Popover.js +0 -13
  112. package/cjs/PopoverBody.js +0 -4
  113. package/cjs/PopoverHeader.js +0 -4
  114. package/cjs/ProgressBar.js +2 -20
  115. package/cjs/Ratio.d.ts +1 -1
  116. package/cjs/Ratio.js +3 -12
  117. package/cjs/Row.d.ts +2 -2
  118. package/cjs/Row.js +0 -10
  119. package/cjs/SSRProvider.js +0 -2
  120. package/cjs/Spinner.js +0 -8
  121. package/cjs/SplitButton.js +1 -27
  122. package/cjs/Stack.d.ts +1 -1
  123. package/cjs/Stack.js +2 -10
  124. package/cjs/Switch.d.ts +1 -1
  125. package/cjs/Switch.js +2 -10
  126. package/cjs/Tab.js +2 -20
  127. package/cjs/TabContainer.js +2 -10
  128. package/cjs/TabContent.js +0 -4
  129. package/cjs/TabPane.js +7 -17
  130. package/cjs/Table.js +2 -13
  131. package/cjs/Tabs.js +6 -24
  132. package/cjs/ThemeProvider.js +8 -17
  133. package/cjs/Toast.js +5 -18
  134. package/cjs/ToastBody.js +0 -4
  135. package/cjs/ToastContainer.d.ts +1 -1
  136. package/cjs/ToastContainer.js +0 -8
  137. package/cjs/ToastContext.js +0 -5
  138. package/cjs/ToastFade.js +2 -9
  139. package/cjs/ToastHeader.js +0 -11
  140. package/cjs/ToggleButton.d.ts +1 -1
  141. package/cjs/ToggleButton.js +2 -11
  142. package/cjs/ToggleButtonGroup.d.ts +2 -2
  143. package/cjs/ToggleButtonGroup.js +2 -23
  144. package/cjs/Tooltip.js +0 -9
  145. package/cjs/TransitionWrapper.d.ts +1 -1
  146. package/cjs/TransitionWrapper.js +3 -15
  147. package/cjs/createChainedFunction.js +2 -5
  148. package/cjs/createUtilityClasses.d.ts +1 -1
  149. package/cjs/createUtilityClasses.js +0 -6
  150. package/cjs/createWithBsPrefix.js +0 -11
  151. package/cjs/divWithClassName.js +2 -9
  152. package/cjs/getTabTransitionComponent.js +0 -6
  153. package/cjs/helpers.d.ts +4 -4
  154. package/cjs/helpers.js +2 -9
  155. package/cjs/index.js +0 -171
  156. package/cjs/safeFindDOMNode.js +0 -5
  157. package/cjs/transitionEndListener.js +0 -6
  158. package/cjs/triggerBrowserReflow.js +0 -2
  159. package/cjs/types.d.ts +9 -9
  160. package/cjs/types.js +0 -5
  161. package/cjs/useOverlayOffset.js +0 -8
  162. package/cjs/usePlaceholder.d.ts +2 -2
  163. package/cjs/usePlaceholder.js +2 -7
  164. package/cjs/useWrappedRefWithWarning.js +4 -9
  165. package/dist/react-bootstrap.js +676 -1945
  166. package/dist/react-bootstrap.min.js +1 -1
  167. package/esm/AccordionBody.d.ts +2 -1
  168. package/esm/AccordionBody.js +12 -0
  169. package/esm/AccordionButton.d.ts +1 -1
  170. package/esm/AccordionButton.js +0 -4
  171. package/esm/AccordionCollapse.js +0 -1
  172. package/esm/AccordionContext.d.ts +1 -1
  173. package/esm/Alert.js +0 -2
  174. package/esm/BootstrapModalManager.js +2 -9
  175. package/esm/Breadcrumb.js +2 -1
  176. package/esm/BreadcrumbItem.js +2 -1
  177. package/esm/Button.d.ts +1 -1
  178. package/esm/Button.js +2 -1
  179. package/esm/ButtonGroup.js +2 -1
  180. package/esm/ButtonToolbar.js +2 -1
  181. package/esm/CardImg.js +2 -1
  182. package/esm/Carousel.d.ts +1 -1
  183. package/esm/Carousel.js +9 -36
  184. package/esm/CloseButton.d.ts +1 -1
  185. package/esm/CloseButton.js +0 -2
  186. package/esm/Col.d.ts +5 -5
  187. package/esm/Col.js +6 -5
  188. package/esm/Collapse.d.ts +1 -1
  189. package/esm/Collapse.js +11 -8
  190. package/esm/Dropdown.js +17 -7
  191. package/esm/DropdownButton.js +1 -14
  192. package/esm/DropdownContext.d.ts +2 -2
  193. package/esm/DropdownItem.js +2 -1
  194. package/esm/DropdownMenu.d.ts +2 -2
  195. package/esm/DropdownMenu.js +12 -15
  196. package/esm/DropdownToggle.d.ts +2 -2
  197. package/esm/DropdownToggle.js +7 -10
  198. package/esm/ElementChildren.js +3 -6
  199. package/esm/Fade.js +2 -1
  200. package/esm/Feedback.d.ts +1 -1
  201. package/esm/Feedback.js +4 -3
  202. package/esm/Form.d.ts +1 -1
  203. package/esm/Form.js +2 -2
  204. package/esm/FormCheck.d.ts +1 -1
  205. package/esm/FormCheck.js +2 -3
  206. package/esm/FormCheckInput.d.ts +1 -1
  207. package/esm/FormCheckInput.js +2 -1
  208. package/esm/FormCheckLabel.js +2 -1
  209. package/esm/FormContext.js +3 -1
  210. package/esm/FormControl.d.ts +1 -1
  211. package/esm/FormControl.js +2 -3
  212. package/esm/FormGroup.js +2 -1
  213. package/esm/FormLabel.d.ts +1 -1
  214. package/esm/FormRange.js +2 -1
  215. package/esm/FormSelect.js +2 -1
  216. package/esm/FormText.js +4 -2
  217. package/esm/Image.js +0 -4
  218. package/esm/InputGroup.js +3 -5
  219. package/esm/ListGroup.js +0 -2
  220. package/esm/ListGroupItem.js +2 -4
  221. package/esm/Modal.js +31 -43
  222. package/esm/ModalContext.js +0 -1
  223. package/esm/ModalDialog.js +2 -1
  224. package/esm/Nav.js +0 -2
  225. package/esm/NavLink.js +2 -1
  226. package/esm/Navbar.js +3 -4
  227. package/esm/NavbarBrand.js +2 -1
  228. package/esm/NavbarContext.js +3 -1
  229. package/esm/NavbarOffcanvas.d.ts +1 -1
  230. package/esm/NavbarToggle.js +2 -3
  231. package/esm/Offcanvas.d.ts +1 -1
  232. package/esm/Offcanvas.js +9 -16
  233. package/esm/OffcanvasToggling.js +2 -1
  234. package/esm/Overlay.d.ts +1 -1
  235. package/esm/Overlay.js +12 -12
  236. package/esm/OverlayTrigger.d.ts +4 -4
  237. package/esm/OverlayTrigger.js +7 -20
  238. package/esm/PageItem.js +2 -3
  239. package/esm/Pagination.js +0 -1
  240. package/esm/Placeholder.js +2 -1
  241. package/esm/PlaceholderButton.js +2 -1
  242. package/esm/ProgressBar.js +2 -12
  243. package/esm/Ratio.d.ts +1 -1
  244. package/esm/Ratio.js +3 -4
  245. package/esm/Row.d.ts +2 -2
  246. package/esm/Row.js +0 -2
  247. package/esm/SplitButton.js +1 -16
  248. package/esm/Stack.d.ts +1 -1
  249. package/esm/Stack.js +2 -1
  250. package/esm/Switch.d.ts +1 -1
  251. package/esm/Switch.js +2 -1
  252. package/esm/Tab.js +2 -9
  253. package/esm/TabContainer.js +2 -3
  254. package/esm/TabPane.js +7 -4
  255. package/esm/Table.js +2 -6
  256. package/esm/Tabs.js +6 -9
  257. package/esm/ThemeProvider.js +8 -9
  258. package/esm/Toast.js +5 -5
  259. package/esm/ToastContainer.d.ts +1 -1
  260. package/esm/ToastContext.js +0 -1
  261. package/esm/ToastFade.js +2 -1
  262. package/esm/ToggleButton.d.ts +1 -1
  263. package/esm/ToggleButton.js +2 -3
  264. package/esm/ToggleButtonGroup.d.ts +2 -2
  265. package/esm/ToggleButtonGroup.js +2 -9
  266. package/esm/TransitionWrapper.d.ts +1 -1
  267. package/esm/TransitionWrapper.js +3 -5
  268. package/esm/createChainedFunction.js +2 -4
  269. package/esm/createUtilityClasses.d.ts +1 -1
  270. package/esm/createUtilityClasses.js +0 -1
  271. package/esm/createWithBsPrefix.js +0 -2
  272. package/esm/divWithClassName.js +2 -1
  273. package/esm/getTabTransitionComponent.js +0 -1
  274. package/esm/helpers.d.ts +4 -4
  275. package/esm/helpers.js +3 -3
  276. package/esm/safeFindDOMNode.js +0 -1
  277. package/esm/transitionEndListener.js +0 -2
  278. package/esm/types.d.ts +9 -9
  279. package/esm/useOverlayOffset.js +3 -3
  280. package/esm/usePlaceholder.d.ts +2 -2
  281. package/esm/usePlaceholder.js +2 -1
  282. package/esm/useWrappedRefWithWarning.js +4 -3
  283. package/package.json +1 -1
@@ -4,7 +4,8 @@ import usePlaceholder from './usePlaceholder';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const PlaceholderButton = /*#__PURE__*/React.forwardRef((props, ref) => {
6
6
  const placeholderProps = usePlaceholder(props);
7
- return /*#__PURE__*/_jsx(Button, { ...placeholderProps,
7
+ return /*#__PURE__*/_jsx(Button, {
8
+ ...placeholderProps,
8
9
  ref: ref,
9
10
  disabled: true,
10
11
  tabIndex: -1
@@ -5,22 +5,21 @@ import { useBootstrapPrefix } from './ThemeProvider';
5
5
  import { map } from './ElementChildren';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  const ROUND_PRECISION = 1000;
8
+
8
9
  /**
9
10
  * Validate that children, if any, are instances of `<ProgressBar>`.
10
11
  */
11
-
12
12
  function onlyProgressBar(props, propName, componentName) {
13
13
  const children = props[propName];
14
-
15
14
  if (!children) {
16
15
  return null;
17
16
  }
18
-
19
17
  let error = null;
20
18
  React.Children.forEach(children, child => {
21
19
  if (error) {
22
20
  return;
23
21
  }
22
+
24
23
  /**
25
24
  * Compare types in a way that works with libraries that patch and proxy
26
25
  * components like react-hot-loader.
@@ -28,10 +27,7 @@ function onlyProgressBar(props, propName, componentName) {
28
27
  * see https://github.com/gaearon/react-hot-loader#checking-element-types
29
28
  */
30
29
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
31
-
32
-
33
30
  const element = /*#__PURE__*/_jsx(ProgressBar, {});
34
-
35
31
  if (child.type === element.type) return;
36
32
  const childType = child.type;
37
33
  const childIdentifier = /*#__PURE__*/React.isValidElement(child) ? childType.displayName || childType.name || childType : child;
@@ -39,7 +35,6 @@ function onlyProgressBar(props, propName, componentName) {
39
35
  });
40
36
  return error;
41
37
  }
42
-
43
38
  const defaultProps = {
44
39
  min: 0,
45
40
  max: 100,
@@ -48,12 +43,10 @@ const defaultProps = {
48
43
  visuallyHidden: false,
49
44
  striped: false
50
45
  };
51
-
52
46
  function getPercentage(now, min, max) {
53
47
  const percentage = (now - min) / (max - min) * 100;
54
48
  return Math.round(percentage * ROUND_PRECISION) / ROUND_PRECISION;
55
49
  }
56
-
57
50
  function renderProgressBar({
58
51
  min,
59
52
  now,
@@ -90,17 +83,14 @@ function renderProgressBar({
90
83
  }) : label
91
84
  });
92
85
  }
93
-
94
86
  const ProgressBar = /*#__PURE__*/React.forwardRef(({
95
87
  isChild,
96
88
  ...props
97
89
  }, ref) => {
98
90
  props.bsPrefix = useBootstrapPrefix(props.bsPrefix, 'progress');
99
-
100
91
  if (isChild) {
101
92
  return renderProgressBar(props, ref);
102
93
  }
103
-
104
94
  const {
105
95
  min,
106
96
  now,
package/esm/Ratio.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { BsPrefixProps } from './helpers';
3
- export declare type AspectRatio = '1x1' | '4x3' | '16x9' | '21x9' | string;
3
+ export type AspectRatio = '1x1' | '4x3' | '16x9' | '21x9' | string;
4
4
  export interface RatioProps extends BsPrefixProps, React.HTMLAttributes<HTMLDivElement> {
5
5
  children: React.ReactChild;
6
6
  aspectRatio?: AspectRatio | number;
package/esm/Ratio.js CHANGED
@@ -5,13 +5,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const defaultProps = {
6
6
  aspectRatio: '1x1'
7
7
  };
8
-
9
8
  function toPercent(num) {
10
- if (num <= 0 || num > 100) return '100%';
9
+ if (num <= 0) return '100%';
11
10
  if (num < 1) return `${num * 100}%`;
12
11
  return `${num}%`;
13
12
  }
14
-
15
13
  const Ratio = /*#__PURE__*/React.forwardRef(({
16
14
  bsPrefix,
17
15
  className,
@@ -25,7 +23,8 @@ const Ratio = /*#__PURE__*/React.forwardRef(({
25
23
  return /*#__PURE__*/_jsx("div", {
26
24
  ref: ref,
27
25
  ...props,
28
- style: { ...style,
26
+ style: {
27
+ ...style,
29
28
  ...(isCustomRatio && {
30
29
  '--bs-aspect-ratio': toPercent(aspectRatio)
31
30
  })
package/esm/Row.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
3
- declare type RowColWidth = number | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'auto';
4
- declare type RowColumns = RowColWidth | {
3
+ type RowColWidth = number | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'auto';
4
+ type RowColumns = RowColWidth | {
5
5
  cols?: RowColWidth;
6
6
  };
7
7
  export interface RowProps extends BsPrefixProps, React.HTMLAttributes<HTMLElement> {
package/esm/Row.js CHANGED
@@ -18,7 +18,6 @@ const Row = /*#__PURE__*/React.forwardRef(({
18
18
  const propValue = props[brkPoint];
19
19
  delete props[brkPoint];
20
20
  let cols;
21
-
22
21
  if (propValue != null && typeof propValue === 'object') {
23
22
  ({
24
23
  cols
@@ -26,7 +25,6 @@ const Row = /*#__PURE__*/React.forwardRef(({
26
25
  } else {
27
26
  cols = propValue;
28
27
  }
29
-
30
28
  const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
31
29
  if (cols != null) classes.push(`${sizePrefix}${infix}-${cols}`);
32
30
  });
@@ -13,30 +13,22 @@ const propTypes = {
13
13
  * @required
14
14
  */
15
15
  id: PropTypes.string,
16
-
17
16
  /**
18
17
  * Accessible label for the toggle; the value of `title` if not specified.
19
18
  */
20
19
  toggleLabel: PropTypes.string,
21
-
22
20
  /** An `href` passed to the non-toggle Button */
23
21
  href: PropTypes.string,
24
-
25
22
  /** An anchor `target` passed to the non-toggle Button */
26
23
  target: PropTypes.string,
27
-
28
24
  /** An `onClick` handler passed to the non-toggle Button */
29
25
  onClick: PropTypes.func,
30
-
31
26
  /** The content of the non-toggle Button. */
32
27
  title: PropTypes.node.isRequired,
33
-
34
28
  /** A `type` passed to the non-toggle Button */
35
29
  type: PropTypes.string,
36
-
37
30
  /** Disables both Buttons */
38
31
  disabled: PropTypes.bool,
39
-
40
32
  /**
41
33
  * Aligns the dropdown menu.
42
34
  *
@@ -45,33 +37,26 @@ const propTypes = {
45
37
  * @type {"start"|"end"|{ sm: "start"|"end" }|{ md: "start"|"end" }|{ lg: "start"|"end" }|{ xl: "start"|"end"}|{ xxl: "start"|"end"} }
46
38
  */
47
39
  align: alignPropType,
48
-
49
40
  /** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */
50
41
  menuRole: PropTypes.string,
51
-
52
42
  /** Whether to render the dropdown menu in the DOM before the first time it is shown */
53
43
  renderMenuOnMount: PropTypes.bool,
54
-
55
44
  /**
56
45
  * Which event when fired outside the component will cause it to be closed.
57
46
  *
58
47
  * _see [DropdownMenu](#dropdown-menu-props) for more details_
59
48
  */
60
49
  rootCloseEvent: PropTypes.string,
61
-
62
50
  /**
63
51
  * Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to
64
52
  * Popper.js's flip [docs](https://popper.js.org/docs/v2/modifiers/flip/).
65
53
  *
66
54
  */
67
55
  flip: PropTypes.bool,
68
-
69
56
  /** @ignore */
70
57
  bsPrefix: PropTypes.string,
71
-
72
58
  /** @ignore */
73
59
  variant: PropTypes.string,
74
-
75
60
  /** @ignore */
76
61
  size: PropTypes.string
77
62
  };
@@ -79,6 +64,7 @@ const defaultProps = {
79
64
  toggleLabel: 'Toggle dropdown',
80
65
  type: 'button'
81
66
  };
67
+
82
68
  /**
83
69
  * A convenience component for simple or general use split button dropdowns. Renders a
84
70
  * `ButtonGroup` containing a `Button` and a `Button` toggle for the `Dropdown`. All `children`
@@ -89,7 +75,6 @@ const defaultProps = {
89
75
  * The Button `variant`, `size` and `bsPrefix` props are passed to the button and toggle,
90
76
  * and menu-related props are passed to the `Dropdown.Menu`
91
77
  */
92
-
93
78
  const SplitButton = /*#__PURE__*/React.forwardRef(({
94
79
  id,
95
80
  bsPrefix,
package/esm/Stack.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
3
3
  import { GapValue } from './types';
4
4
  import { ResponsiveUtilityValue } from './createUtilityClasses';
5
- export declare type StackDirection = 'horizontal' | 'vertical';
5
+ export type StackDirection = 'horizontal' | 'vertical';
6
6
  export interface StackProps extends BsPrefixProps, React.HTMLAttributes<HTMLElement> {
7
7
  direction?: StackDirection;
8
8
  gap?: ResponsiveUtilityValue<GapValue>;
package/esm/Stack.js CHANGED
@@ -14,7 +14,8 @@ const Stack = /*#__PURE__*/React.forwardRef(({
14
14
  bsPrefix = useBootstrapPrefix(bsPrefix, direction === 'horizontal' ? 'hstack' : 'vstack');
15
15
  const breakpoints = useBootstrapBreakpoints();
16
16
  const minBreakpoint = useBootstrapMinBreakpoint();
17
- return /*#__PURE__*/_jsx(Component, { ...props,
17
+ return /*#__PURE__*/_jsx(Component, {
18
+ ...props,
18
19
  ref: ref,
19
20
  className: classNames(className, bsPrefix, ...createUtilityClassName({
20
21
  gap,
package/esm/Switch.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { FormCheckProps } from './FormCheck';
3
3
  import { BsPrefixRefForwardingComponent } from './helpers';
4
- declare type SwitchProps = Omit<FormCheckProps, 'type'>;
4
+ type SwitchProps = Omit<FormCheckProps, 'type'>;
5
5
  declare const _default: BsPrefixRefForwardingComponent<BsPrefixRefForwardingComponent<"input", FormCheckProps> & {
6
6
  Input: BsPrefixRefForwardingComponent<"input", import("./FormCheckInput").FormCheckInputProps>;
7
7
  Label: React.ForwardRefExoticComponent<import("./FormCheckLabel").FormCheckLabelProps & React.RefAttributes<HTMLLabelElement>>;
package/esm/Switch.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import FormCheck from './FormCheck';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
- const Switch = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(FormCheck, { ...props,
4
+ const Switch = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(FormCheck, {
5
+ ...props,
5
6
  ref: ref,
6
7
  type: "switch"
7
8
  }));
package/esm/Tab.js CHANGED
@@ -5,38 +5,31 @@ import TabContent from './TabContent';
5
5
  import TabPane from './TabPane';
6
6
  import { Fragment as _Fragment } from "react/jsx-runtime";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
-
9
8
  /* eslint-disable react/no-unused-prop-types */
10
9
  const propTypes = {
11
10
  eventKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
12
-
13
11
  /**
14
12
  * Content for the tab title.
15
13
  */
16
14
  title: PropTypes.node.isRequired,
17
-
18
15
  /**
19
16
  * The disabled state of the tab.
20
17
  */
21
18
  disabled: PropTypes.bool,
22
-
23
19
  /**
24
20
  * Class to pass to the underlying nav link.
25
21
  */
26
22
  tabClassName: PropTypes.string,
27
-
28
23
  /**
29
24
  * Object containing attributes to pass to underlying nav link.
30
25
  */
31
26
  tabAttrs: PropTypes.object
32
27
  };
33
-
34
28
  const Tab = () => {
35
- 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'); // Needed otherwise docs error out.
36
-
29
+ 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.
37
31
  return /*#__PURE__*/_jsx(_Fragment, {});
38
32
  };
39
-
40
33
  Tab.propTypes = propTypes;
41
34
  export default Object.assign(Tab, {
42
35
  Container: TabContainer,
@@ -2,13 +2,12 @@ import * as React from 'react';
2
2
  import Tabs from '@restart/ui/Tabs';
3
3
  import getTabTransitionComponent from './getTabTransitionComponent';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
-
6
5
  const TabContainer = ({
7
6
  transition,
8
7
  ...props
9
- }) => /*#__PURE__*/_jsx(Tabs, { ...props,
8
+ }) => /*#__PURE__*/_jsx(Tabs, {
9
+ ...props,
10
10
  transition: getTabTransitionComponent(transition)
11
11
  });
12
-
13
12
  TabContainer.displayName = 'TabContainer';
14
13
  export default TabContainer;
package/esm/TabPane.js CHANGED
@@ -28,12 +28,14 @@ const TabPane = /*#__PURE__*/React.forwardRef(({
28
28
  mountOnEnter,
29
29
  unmountOnExit,
30
30
  transition: Transition = Fade
31
- }] = useTabPanel({ ...props,
31
+ }] = useTabPanel({
32
+ ...props,
32
33
  transition: getTabTransitionComponent(transition)
33
34
  });
34
- const prefix = useBootstrapPrefix(bsPrefix, 'tab-pane'); // We provide an empty the TabContext so `<Nav>`s in `<TabPanel>`s don't
35
- // conflict with the top level one.
35
+ const prefix = useBootstrapPrefix(bsPrefix, 'tab-pane');
36
36
 
37
+ // We provide an empty the TabContext so `<Nav>`s in `<TabPanel>`s don't
38
+ // conflict with the top level one.
37
39
  return /*#__PURE__*/_jsx(TabContext.Provider, {
38
40
  value: null,
39
41
  children: /*#__PURE__*/_jsx(SelectableContext.Provider, {
@@ -48,7 +50,8 @@ const TabPane = /*#__PURE__*/React.forwardRef(({
48
50
  onExited: onExited,
49
51
  mountOnEnter: mountOnEnter,
50
52
  unmountOnExit: unmountOnExit,
51
- children: /*#__PURE__*/_jsx(Component, { ...rest,
53
+ children: /*#__PURE__*/_jsx(Component, {
54
+ ...rest,
52
55
  ref: ref,
53
56
  className: classNames(className, prefix, isActive && 'active')
54
57
  })
package/esm/Table.js CHANGED
@@ -16,25 +16,21 @@ const Table = /*#__PURE__*/React.forwardRef(({
16
16
  }, ref) => {
17
17
  const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'table');
18
18
  const classes = classNames(className, decoratedBsPrefix, variant && `${decoratedBsPrefix}-${variant}`, size && `${decoratedBsPrefix}-${size}`, striped && `${decoratedBsPrefix}-${typeof striped === 'string' ? `striped-${striped}` : 'striped'}`, bordered && `${decoratedBsPrefix}-bordered`, borderless && `${decoratedBsPrefix}-borderless`, hover && `${decoratedBsPrefix}-hover`);
19
-
20
- const table = /*#__PURE__*/_jsx("table", { ...props,
19
+ const table = /*#__PURE__*/_jsx("table", {
20
+ ...props,
21
21
  className: classes,
22
22
  ref: ref
23
23
  });
24
-
25
24
  if (responsive) {
26
25
  let responsiveClass = `${decoratedBsPrefix}-responsive`;
27
-
28
26
  if (typeof responsive === 'string') {
29
27
  responsiveClass = `${responsiveClass}-${responsive}`;
30
28
  }
31
-
32
29
  return /*#__PURE__*/_jsx("div", {
33
30
  className: responsiveClass,
34
31
  children: table
35
32
  });
36
33
  }
37
-
38
34
  return table;
39
35
  });
40
36
  export default Table;
package/esm/Tabs.js CHANGED
@@ -15,7 +15,6 @@ const defaultProps = {
15
15
  mountOnEnter: false,
16
16
  unmountOnExit: false
17
17
  };
18
-
19
18
  function getDefaultActiveKey(children) {
20
19
  let defaultActiveKey;
21
20
  forEach(children, child => {
@@ -25,7 +24,6 @@ function getDefaultActiveKey(children) {
25
24
  });
26
25
  return defaultActiveKey;
27
26
  }
28
-
29
27
  function renderTab(child) {
30
28
  const {
31
29
  title,
@@ -35,11 +33,9 @@ function renderTab(child) {
35
33
  tabAttrs,
36
34
  id
37
35
  } = child.props;
38
-
39
36
  if (title == null) {
40
37
  return null;
41
38
  }
42
-
43
39
  return /*#__PURE__*/_jsx(NavItem, {
44
40
  as: "li",
45
41
  role: "presentation",
@@ -55,7 +51,6 @@ function renderTab(child) {
55
51
  })
56
52
  });
57
53
  }
58
-
59
54
  const Tabs = props => {
60
55
  const {
61
56
  id,
@@ -76,25 +71,27 @@ const Tabs = props => {
76
71
  transition: getTabTransitionComponent(transition),
77
72
  mountOnEnter: mountOnEnter,
78
73
  unmountOnExit: unmountOnExit,
79
- children: [/*#__PURE__*/_jsx(Nav, { ...controlledProps,
74
+ children: [/*#__PURE__*/_jsx(Nav, {
75
+ ...controlledProps,
80
76
  role: "tablist",
81
77
  as: "ul",
82
78
  children: map(children, renderTab)
83
79
  }), /*#__PURE__*/_jsx(TabContent, {
84
80
  children: map(children, child => {
85
- const childProps = { ...child.props
81
+ const childProps = {
82
+ ...child.props
86
83
  };
87
84
  delete childProps.title;
88
85
  delete childProps.disabled;
89
86
  delete childProps.tabClassName;
90
87
  delete childProps.tabAttrs;
91
- return /*#__PURE__*/_jsx(TabPane, { ...childProps
88
+ return /*#__PURE__*/_jsx(TabPane, {
89
+ ...childProps
92
90
  });
93
91
  })
94
92
  })]
95
93
  });
96
94
  };
97
-
98
95
  Tabs.defaultProps = defaultProps;
99
96
  Tabs.displayName = 'Tabs';
100
97
  export default Tabs;
@@ -12,7 +12,6 @@ const {
12
12
  Consumer,
13
13
  Provider
14
14
  } = ThemeContext;
15
-
16
15
  function ThemeProvider({
17
16
  prefixes = {},
18
17
  breakpoints = DEFAULT_BREAKPOINTS,
@@ -21,7 +20,8 @@ function ThemeProvider({
21
20
  children
22
21
  }) {
23
22
  const contextValue = useMemo(() => ({
24
- prefixes: { ...prefixes
23
+ prefixes: {
24
+ ...prefixes
25
25
  },
26
26
  breakpoints,
27
27
  minBreakpoint,
@@ -32,7 +32,6 @@ function ThemeProvider({
32
32
  children: children
33
33
  });
34
34
  }
35
-
36
35
  export function useBootstrapPrefix(prefix, defaultPrefix) {
37
36
  const {
38
37
  prefixes
@@ -57,28 +56,28 @@ export function useIsRTL() {
57
56
  } = useContext(ThemeContext);
58
57
  return dir === 'rtl';
59
58
  }
60
-
61
59
  function createBootstrapComponent(Component, opts) {
62
60
  if (typeof opts === 'string') opts = {
63
61
  prefix: opts
64
62
  };
65
- const isClassy = Component.prototype && Component.prototype.isReactComponent; // If it's a functional component make sure we don't break it with a ref
66
-
63
+ const isClassy = Component.prototype && Component.prototype.isReactComponent;
64
+ // If it's a functional component make sure we don't break it with a ref
67
65
  const {
68
66
  prefix,
69
67
  forwardRefAs = isClassy ? 'ref' : 'innerRef'
70
68
  } = opts;
71
- const Wrapped = /*#__PURE__*/React.forwardRef(({ ...props
69
+ const Wrapped = /*#__PURE__*/React.forwardRef(({
70
+ ...props
72
71
  }, ref) => {
73
72
  props[forwardRefAs] = ref;
74
73
  const bsPrefix = useBootstrapPrefix(props.bsPrefix, prefix);
75
- return /*#__PURE__*/_jsx(Component, { ...props,
74
+ return /*#__PURE__*/_jsx(Component, {
75
+ ...props,
76
76
  bsPrefix: bsPrefix
77
77
  });
78
78
  });
79
79
  Wrapped.displayName = `Bootstrap(${Component.displayName || Component.name})`;
80
80
  return Wrapped;
81
81
  }
82
-
83
82
  export { createBootstrapComponent, Consumer as ThemeConsumer };
84
83
  export default ThemeProvider;
package/esm/Toast.js CHANGED
@@ -20,9 +20,10 @@ const Toast = /*#__PURE__*/React.forwardRef(({
20
20
  bg,
21
21
  ...props
22
22
  }, ref) => {
23
- bsPrefix = useBootstrapPrefix(bsPrefix, 'toast'); // We use refs for these, because we don't want to restart the autohide
24
- // timer in case these values change.
23
+ bsPrefix = useBootstrapPrefix(bsPrefix, 'toast');
25
24
 
25
+ // We use refs for these, because we don't want to restart the autohide
26
+ // timer in case these values change.
26
27
  const delayRef = useRef(delay);
27
28
  const onCloseRef = useRef(onClose);
28
29
  useEffect(() => {
@@ -44,15 +45,14 @@ const Toast = /*#__PURE__*/React.forwardRef(({
44
45
  onClose
45
46
  }), [onClose]);
46
47
  const hasAnimation = !!(Transition && animation);
47
-
48
- const toast = /*#__PURE__*/_jsx("div", { ...props,
48
+ const toast = /*#__PURE__*/_jsx("div", {
49
+ ...props,
49
50
  ref: ref,
50
51
  className: classNames(bsPrefix, className, bg && `bg-${bg}`, !hasAnimation && (show ? 'show' : 'hide')),
51
52
  role: "alert",
52
53
  "aria-live": "assertive",
53
54
  "aria-atomic": "true"
54
55
  });
55
-
56
56
  return /*#__PURE__*/_jsx(ToastContext.Provider, {
57
57
  value: toastContext,
58
58
  children: hasAnimation && Transition ? /*#__PURE__*/_jsx(Transition, {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
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';
3
+ export type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'middle-start' | 'middle-center' | 'middle-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
4
4
  export interface ToastContainerProps extends BsPrefixProps, React.HTMLAttributes<HTMLElement> {
5
5
  position?: ToastPosition;
6
6
  containerPosition?: string;
@@ -2,6 +2,5 @@ import * as React from 'react';
2
2
  const ToastContext = /*#__PURE__*/React.createContext({
3
3
  // eslint-disable-next-line @typescript-eslint/no-empty-function
4
4
  onClose() {}
5
-
6
5
  });
7
6
  export default ToastContext;
package/esm/ToastFade.js CHANGED
@@ -6,7 +6,8 @@ const fadeStyles = {
6
6
  [ENTERING]: 'showing',
7
7
  [EXITING]: 'showing show'
8
8
  };
9
- const ToastFade = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Fade, { ...props,
9
+ const ToastFade = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Fade, {
10
+ ...props,
10
11
  ref: ref,
11
12
  transitionClasses: fadeStyles
12
13
  }));
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ButtonProps } from './Button';
3
- export declare type ToggleButtonType = 'checkbox' | 'radio';
3
+ export type ToggleButtonType = 'checkbox' | 'radio';
4
4
  export interface ToggleButtonProps extends Omit<ButtonProps, 'onChange' | 'type'> {
5
5
  type?: ToggleButtonType;
6
6
  name?: string;
@@ -5,9 +5,7 @@ import Button from './Button';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { Fragment as _Fragment } from "react/jsx-runtime";
7
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
-
9
8
  const noop = () => undefined;
10
-
11
9
  const ToggleButton = /*#__PURE__*/React.forwardRef(({
12
10
  bsPrefix,
13
11
  name,
@@ -34,7 +32,8 @@ const ToggleButton = /*#__PURE__*/React.forwardRef(({
34
32
  disabled: !!disabled,
35
33
  onChange: onChange || noop,
36
34
  id: id
37
- }), /*#__PURE__*/_jsx(Button, { ...props,
35
+ }), /*#__PURE__*/_jsx(Button, {
36
+ ...props,
38
37
  ref: ref,
39
38
  className: classNames(className, disabled && 'disabled'),
40
39
  type: undefined,
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { ButtonGroupProps } from './ButtonGroup';
3
3
  import { BsPrefixRefForwardingComponent } from './helpers';
4
- declare type BaseToggleButtonProps = Omit<ButtonGroupProps, 'toggle' | 'defaultValue' | 'onChange'>;
4
+ type BaseToggleButtonProps = Omit<ButtonGroupProps, 'toggle' | 'defaultValue' | 'onChange'>;
5
5
  export interface ToggleButtonRadioProps<T> extends BaseToggleButtonProps {
6
6
  type?: 'radio';
7
7
  name: string;
@@ -16,7 +16,7 @@ export interface ToggleButtonCheckboxProps<T> extends BaseToggleButtonProps {
16
16
  defaultValue?: T[];
17
17
  onChange?: (value: T[]) => void;
18
18
  }
19
- export declare type ToggleButtonGroupProps<T> = ToggleButtonRadioProps<T> | ToggleButtonCheckboxProps<T>;
19
+ export type ToggleButtonGroupProps<T> = ToggleButtonRadioProps<T> | ToggleButtonCheckboxProps<T>;
20
20
  declare const _default: BsPrefixRefForwardingComponent<"a", ToggleButtonGroupProps<any>> & {
21
21
  Button: React.ForwardRefExoticComponent<import("./ToggleButton").ToggleButtonProps & React.RefAttributes<HTMLLabelElement>>;
22
22
  };
@@ -21,31 +21,26 @@ const ToggleButtonGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
21
21
  } = useUncontrolled(props, {
22
22
  value: 'onChange'
23
23
  });
24
-
25
24
  const getValues = () => value == null ? [] : [].concat(value);
26
-
27
25
  const handleToggle = (inputVal, event) => {
28
26
  if (!onChange) {
29
27
  return;
30
28
  }
31
-
32
29
  const values = getValues();
33
30
  const isActive = values.indexOf(inputVal) !== -1;
34
-
35
31
  if (type === 'radio') {
36
32
  if (!isActive) onChange(inputVal, event);
37
33
  return;
38
34
  }
39
-
40
35
  if (isActive) {
41
36
  onChange(values.filter(n => n !== inputVal), event);
42
37
  } else {
43
38
  onChange([...values, inputVal], event);
44
39
  }
45
40
  };
46
-
47
41
  !(type !== 'radio' || !!name) ? process.env.NODE_ENV !== "production" ? invariant(false, 'A `name` is required to group the toggle buttons when the `type` ' + 'is set to "radio"') : invariant(false) : void 0;
48
- return /*#__PURE__*/_jsx(ButtonGroup, { ...controlledProps,
42
+ return /*#__PURE__*/_jsx(ButtonGroup, {
43
+ ...controlledProps,
49
44
  ref: ref,
50
45
  children: map(children, child => {
51
46
  const values = getValues();
@@ -53,9 +48,7 @@ const ToggleButtonGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
53
48
  value: childVal,
54
49
  onChange: childOnChange
55
50
  } = child.props;
56
-
57
51
  const handler = e => handleToggle(childVal, e);
58
-
59
52
  return /*#__PURE__*/React.cloneElement(child, {
60
53
  type,
61
54
  name: child.name || name,