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
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Transition, { TransitionProps, TransitionStatus } from 'react-transition-group/Transition';
3
- export declare type TransitionWrapperProps = TransitionProps & {
3
+ export type TransitionWrapperProps = TransitionProps & {
4
4
  childRef?: React.Ref<unknown>;
5
5
  children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
6
6
  };
@@ -18,19 +18,16 @@ const TransitionWrapper = /*#__PURE__*/React.forwardRef(({
18
18
  }, ref) => {
19
19
  const nodeRef = useRef(null);
20
20
  const mergedRef = useMergedRefs(nodeRef, childRef);
21
-
22
21
  const attachRef = r => {
23
22
  mergedRef(safeFindDOMNode(r));
24
23
  };
25
-
26
24
  const normalize = callback => param => {
27
25
  if (callback && nodeRef.current) {
28
26
  callback(nodeRef.current, param);
29
27
  }
30
28
  };
31
- /* eslint-disable react-hooks/exhaustive-deps */
32
-
33
29
 
30
+ /* eslint-disable react-hooks/exhaustive-deps */
34
31
  const handleEnter = useCallback(normalize(onEnter), [onEnter]);
35
32
  const handleEntering = useCallback(normalize(onEntering), [onEntering]);
36
33
  const handleEntered = useCallback(normalize(onEntered), [onEntered]);
@@ -51,7 +48,8 @@ const TransitionWrapper = /*#__PURE__*/React.forwardRef(({
51
48
  onExiting: handleExiting,
52
49
  addEndListener: handleAddEndListener,
53
50
  nodeRef: nodeRef,
54
- children: typeof children === 'function' ? (status, innerProps) => children(status, { ...innerProps,
51
+ children: typeof children === 'function' ? (status, innerProps) => children(status, {
52
+ ...innerProps,
55
53
  ref: attachRef
56
54
  }) : /*#__PURE__*/React.cloneElement(children, {
57
55
  ref: attachRef
@@ -12,15 +12,13 @@ function createChainedFunction(...funcs) {
12
12
  if (typeof f !== 'function') {
13
13
  throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
14
14
  }
15
-
16
15
  if (acc === null) return f;
17
16
  return function chainedFunction(...args) {
18
17
  // @ts-ignore
19
- acc.apply(this, args); // @ts-ignore
20
-
18
+ acc.apply(this, args);
19
+ // @ts-ignore
21
20
  f.apply(this, args);
22
21
  };
23
22
  }, null);
24
23
  }
25
-
26
24
  export default createChainedFunction;
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- export declare type ResponsiveUtilityValue<T> = T | {
2
+ export type ResponsiveUtilityValue<T> = T | {
3
3
  xs?: T;
4
4
  sm?: T;
5
5
  md?: T;
@@ -17,7 +17,6 @@ export default function createUtilityClassName(utilityValues, breakpoints = DEFA
17
17
  if (typeof utilValue === 'object') {
18
18
  breakpoints.forEach(brkPoint => {
19
19
  const bpValue = utilValue[brkPoint];
20
-
21
20
  if (bpValue != null) {
22
21
  const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
23
22
  classes.push(`${utilName}${infix}-${bpValue}`);
@@ -3,9 +3,7 @@ import camelize from 'dom-helpers/camelize';
3
3
  import * as React from 'react';
4
4
  import { useBootstrapPrefix } from './ThemeProvider';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
-
7
6
  const pascalCase = str => str[0].toUpperCase() + camelize(str).slice(1);
8
-
9
7
  // TODO: emstricten & fix the typing here! `createWithBsPrefix<TElementType>...`
10
8
  export default function createWithBsPrefix(prefix, {
11
9
  displayName = pascalCase(prefix),
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
- export default (className => /*#__PURE__*/React.forwardRef((p, ref) => /*#__PURE__*/_jsx("div", { ...p,
4
+ export default (className => /*#__PURE__*/React.forwardRef((p, ref) => /*#__PURE__*/_jsx("div", {
5
+ ...p,
5
6
  ref: ref,
6
7
  className: classNames(p.className, className)
7
8
  })));
@@ -4,6 +4,5 @@ export default function getTabTransitionComponent(transition) {
4
4
  if (typeof transition === 'boolean') {
5
5
  return transition ? Fade : NoopTransition;
6
6
  }
7
-
8
7
  return transition;
9
8
  }
package/esm/helpers.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { TransitionComponent } from '@restart/ui/types';
3
- export declare type Omit<T, U> = Pick<T, Exclude<keyof T, keyof U>>;
4
- export declare type ReplaceProps<Inner extends React.ElementType, P> = Omit<React.ComponentPropsWithRef<Inner>, P> & P;
3
+ export type Omit<T, U> = Pick<T, Exclude<keyof T, keyof U>>;
4
+ export type ReplaceProps<Inner extends React.ElementType, P> = Omit<React.ComponentPropsWithRef<Inner>, P> & P;
5
5
  export interface BsPrefixOnlyProps {
6
6
  bsPrefix?: string;
7
7
  }
@@ -19,6 +19,6 @@ export interface BsPrefixRefForwardingComponent<TInitial extends React.ElementTy
19
19
  }
20
20
  export declare class BsPrefixComponent<As extends React.ElementType, P = unknown> extends React.Component<ReplaceProps<As, BsPrefixProps<As> & P>> {
21
21
  }
22
- export declare type BsPrefixComponentClass<As extends React.ElementType, P = unknown> = React.ComponentClass<ReplaceProps<As, BsPrefixProps<As> & P>>;
23
- export declare type TransitionType = boolean | TransitionComponent;
22
+ export type BsPrefixComponentClass<As extends React.ElementType, P = unknown> = React.ComponentClass<ReplaceProps<As, BsPrefixProps<As> & P>>;
23
+ export type TransitionType = boolean | TransitionComponent;
24
24
  export declare function getOverlayDirection(placement: string, isRTL?: boolean): string;
package/esm/helpers.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import * as React from 'react';
2
- export class BsPrefixComponent extends React.Component {} // Need to use this instead of typeof Component to get proper type checking.
2
+ export class BsPrefixComponent extends React.Component {}
3
+
4
+ // Need to use this instead of typeof Component to get proper type checking.
3
5
 
4
6
  export function getOverlayDirection(placement, isRTL) {
5
7
  let bsDirection = placement;
6
-
7
8
  if (placement === 'left') {
8
9
  bsDirection = isRTL ? 'end' : 'start';
9
10
  } else if (placement === 'right') {
10
11
  bsDirection = isRTL ? 'start' : 'end';
11
12
  }
12
-
13
13
  return bsDirection;
14
14
  }
@@ -3,6 +3,5 @@ export default function safeFindDOMNode(componentOrElement) {
3
3
  if (componentOrElement && 'setState' in componentOrElement) {
4
4
  return ReactDOM.findDOMNode(componentOrElement);
5
5
  }
6
-
7
6
  return componentOrElement != null ? componentOrElement : null;
8
7
  }
@@ -1,12 +1,10 @@
1
1
  import css from 'dom-helpers/css';
2
2
  import transitionEnd from 'dom-helpers/transitionEnd';
3
-
4
3
  function parseDuration(node, property) {
5
4
  const str = css(node, property) || '';
6
5
  const mult = str.indexOf('ms') === -1 ? 1000 : 1;
7
6
  return parseFloat(str) * mult;
8
7
  }
9
-
10
8
  export default function transitionEndListener(element, handler) {
11
9
  const duration = parseDuration(element, 'transitionDuration');
12
10
  const delay = parseDuration(element, 'transitionDelay');
package/esm/types.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import { State } from '@restart/ui/usePopper';
3
- export declare type Variant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
4
- export declare type ButtonVariant = Variant | 'link' | 'outline-primary' | 'outline-secondary' | 'outline-success' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-dark' | 'outline-light';
5
- export declare type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted';
6
- export declare type Placement = import('@restart/ui/usePopper').Placement;
7
- export declare type AlignDirection = 'start' | 'end';
8
- export declare type ResponsiveAlignProp = {
3
+ export type Variant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
4
+ export type ButtonVariant = Variant | 'link' | 'outline-primary' | 'outline-secondary' | 'outline-success' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-dark' | 'outline-light';
5
+ export type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted';
6
+ export type Placement = import('@restart/ui/usePopper').Placement;
7
+ export type AlignDirection = 'start' | 'end';
8
+ export type ResponsiveAlignProp = {
9
9
  sm: AlignDirection;
10
10
  } | {
11
11
  md: AlignDirection;
@@ -16,10 +16,10 @@ export declare type ResponsiveAlignProp = {
16
16
  } | {
17
17
  xxl: AlignDirection;
18
18
  } | Record<string, AlignDirection>;
19
- export declare type AlignType = AlignDirection | ResponsiveAlignProp;
19
+ export type AlignType = AlignDirection | ResponsiveAlignProp;
20
20
  export declare const alignPropType: PropTypes.Requireable<NonNullable<object | AlignDirection | null | undefined>>;
21
- export declare type RootCloseEvent = 'click' | 'mousedown';
22
- export declare type GapValue = 0 | 1 | 2 | 3 | 4 | 5;
21
+ export type RootCloseEvent = 'click' | 'mousedown';
22
+ export type GapValue = 0 | 1 | 2 | 3 | 4 | 5;
23
23
  export interface PopperRef {
24
24
  state: State | undefined;
25
25
  outOfBoundaries: boolean;
@@ -1,9 +1,10 @@
1
1
  import { useMemo, useRef } from 'react';
2
2
  import hasClass from 'dom-helpers/hasClass';
3
3
  import { useBootstrapPrefix } from './ThemeProvider';
4
- import Popover from './Popover'; // This is meant for internal use.
5
- // This applies a custom offset to the overlay if it's a popover.
4
+ import Popover from './Popover';
6
5
 
6
+ // This is meant for internal use.
7
+ // This applies a custom offset to the overlay if it's a popover.
7
8
  export default function useOverlayOffset(customOffset) {
8
9
  const overlayRef = useRef(null);
9
10
  const popoverClass = useBootstrapPrefix(undefined, 'popover');
@@ -14,7 +15,6 @@ export default function useOverlayOffset(customOffset) {
14
15
  if (overlayRef.current && hasClass(overlayRef.current, popoverClass)) {
15
16
  return customOffset || Popover.POPPER_OFFSET;
16
17
  }
17
-
18
18
  return customOffset || [0, 0];
19
19
  }
20
20
  }
@@ -1,7 +1,7 @@
1
1
  import { ColProps } from './Col';
2
2
  import { Variant } from './types';
3
- export declare type PlaceholderAnimation = 'glow' | 'wave';
4
- export declare type PlaceholderSize = 'xs' | 'sm' | 'lg';
3
+ export type PlaceholderAnimation = 'glow' | 'wave';
4
+ export type PlaceholderSize = 'xs' | 'sm' | 'lg';
5
5
  export interface UsePlaceholderProps extends Omit<ColProps, 'as'> {
6
6
  animation?: PlaceholderAnimation;
7
7
  bg?: Variant;
@@ -13,7 +13,8 @@ export default function usePlaceholder({
13
13
  className,
14
14
  ...colProps
15
15
  }] = useCol(props);
16
- return { ...colProps,
16
+ return {
17
+ ...colProps,
17
18
  className: classNames(className, animation ? `${bsPrefix}-${animation}` : bsPrefix, size && `${bsPrefix}-${size}`, bg && `bg-${bg}`)
18
19
  };
19
20
  }
@@ -3,11 +3,12 @@ import { useCallback } from 'react';
3
3
  import useMergedRefs from '@restart/hooks/useMergedRefs';
4
4
  export default function useWrappedRefWithWarning(ref, componentName) {
5
5
  // @ts-ignore
6
- if (!(process.env.NODE_ENV !== "production")) return ref; // eslint-disable-next-line react-hooks/rules-of-hooks
6
+ if (!(process.env.NODE_ENV !== "production")) return ref;
7
7
 
8
+ // eslint-disable-next-line react-hooks/rules-of-hooks
8
9
  const warningRef = useCallback(refValue => {
9
10
  !(refValue == null || !refValue.isReactComponent) ? process.env.NODE_ENV !== "production" ? invariant(false, `${componentName} injected a ref to a provided \`as\` component that resolved to a component instance instead of a DOM element. ` + 'Use `React.forwardRef` to provide the injected ref to the class component as a prop in order to pass it directly to a DOM element') : invariant(false) : void 0;
10
- }, [componentName]); // eslint-disable-next-line react-hooks/rules-of-hooks
11
-
11
+ }, [componentName]);
12
+ // eslint-disable-next-line react-hooks/rules-of-hooks
12
13
  return useMergedRefs(warningRef, ref);
13
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Bootstrap 5 components built with React",
5
5
  "keywords": [
6
6
  "bootstrap",