react-bootstrap 1.5.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/AbstractModalHeader.d.ts +10 -0
- package/cjs/AbstractNav.js +7 -3
- package/cjs/AbstractNavItem.d.ts +2 -1
- package/cjs/AbstractNavItem.js +7 -3
- package/cjs/Accordion.js +3 -1
- package/cjs/AccordionBody.d.ts +6 -0
- package/cjs/AccordionButton.d.ts +8 -0
- package/cjs/AccordionCollapse.js +7 -3
- package/cjs/AccordionHeader.d.ts +6 -0
- package/cjs/AccordionItem.d.ts +7 -0
- package/cjs/AccordionItemContext.d.ts +6 -0
- package/cjs/AccordionToggle.js +7 -3
- package/cjs/Alert.js +2 -1
- package/cjs/Anchor.d.ts +3 -0
- package/cjs/Badge.js +2 -1
- package/cjs/Breadcrumb.js +2 -1
- package/cjs/BreadcrumbItem.js +2 -1
- package/cjs/Button.js +2 -1
- package/cjs/ButtonGroup.js +2 -1
- package/cjs/ButtonToolbar.js +2 -1
- package/cjs/Card.js +7 -3
- package/cjs/CardHeader.d.ts +6 -0
- package/cjs/CardHeaderContext.d.ts +6 -0
- package/cjs/CardImg.js +2 -1
- package/cjs/Carousel.js +7 -3
- package/cjs/CarouselItem.js +3 -1
- package/cjs/CloseButton.js +2 -1
- package/cjs/Col.js +2 -1
- package/cjs/Collapse.d.ts +1 -2
- package/cjs/Collapse.js +7 -3
- package/cjs/Container.js +2 -1
- package/cjs/Dropdown.js +7 -3
- package/cjs/DropdownButton.js +7 -3
- package/cjs/DropdownContext.d.ts +10 -0
- package/cjs/DropdownItem.d.ts +2 -1
- package/cjs/DropdownItem.js +8 -5
- package/cjs/DropdownMenu.js +7 -3
- package/cjs/DropdownToggle.d.ts +0 -1
- package/cjs/DropdownToggle.js +3 -1
- package/cjs/Fade.js +7 -3
- package/cjs/Feedback.js +2 -1
- package/cjs/FigureImage.js +7 -3
- package/cjs/FloatingLabel.d.ts +9 -0
- package/cjs/Form.js +2 -1
- package/cjs/FormCheck.js +7 -3
- package/cjs/FormCheckInput.js +7 -3
- package/cjs/FormCheckLabel.js +7 -3
- package/cjs/FormControl.js +7 -3
- package/cjs/FormFile.js +7 -3
- package/cjs/FormFileInput.js +7 -3
- package/cjs/FormFileLabel.js +7 -3
- package/cjs/FormFloating.d.ts +2 -0
- package/cjs/FormGroup.js +7 -3
- package/cjs/FormLabel.js +8 -3
- package/cjs/FormRange.d.ts +6 -0
- package/cjs/FormSelect.d.ts +10 -0
- package/cjs/FormText.js +3 -1
- package/cjs/Image.js +2 -1
- package/cjs/InputGroup.js +2 -1
- package/cjs/InputGroupContext.d.ts +3 -0
- package/cjs/Jumbotron.js +2 -1
- package/cjs/ListGroup.d.ts +3 -2
- package/cjs/ListGroup.js +2 -1
- package/cjs/ListGroupItem.d.ts +2 -2
- package/cjs/ListGroupItem.js +8 -9
- package/cjs/Media.js +2 -1
- package/cjs/Modal.d.ts +3 -2
- package/cjs/Modal.js +23 -34
- package/cjs/ModalDialog.js +3 -1
- package/cjs/ModalHeader.js +7 -3
- package/cjs/Nav.d.ts +4 -2
- package/cjs/Nav.js +9 -4
- package/cjs/NavDropdown.js +3 -1
- package/cjs/NavItem.js +3 -1
- package/cjs/NavLink.d.ts +2 -1
- package/cjs/NavLink.js +2 -1
- package/cjs/Navbar.js +7 -3
- package/cjs/NavbarBrand.js +3 -1
- package/cjs/NavbarCollapse.js +3 -1
- package/cjs/NavbarToggle.js +7 -3
- package/cjs/Offcanvas.d.ts +16 -0
- package/cjs/OffcanvasBody.d.ts +2 -0
- package/cjs/OffcanvasHeader.d.ts +7 -0
- package/cjs/OffcanvasTitle.d.ts +3 -0
- package/cjs/OffcanvasToggling.d.ts +15 -0
- package/cjs/Overlay.js +9 -4
- package/cjs/OverlayTrigger.js +7 -3
- package/cjs/PageItem.js +4 -3
- package/cjs/Pagination.js +7 -3
- package/cjs/Placeholder.d.ts +8 -0
- package/cjs/PlaceholderButton.d.ts +8 -0
- package/cjs/Popover.js +2 -1
- package/cjs/PopoverBody.d.ts +2 -0
- package/cjs/PopoverContent.js +3 -1
- package/cjs/PopoverHeader.d.ts +2 -0
- package/cjs/PopoverTitle.js +3 -1
- package/cjs/ProgressBar.js +11 -5
- package/cjs/Ratio.d.ts +9 -0
- package/cjs/ResponsiveEmbed.js +2 -1
- package/cjs/Row.js +2 -1
- package/cjs/SafeAnchor.d.ts +0 -1
- package/cjs/SafeAnchor.js +3 -1
- package/cjs/SelectableContext.d.ts +1 -1
- package/cjs/Spinner.d.ts +0 -1
- package/cjs/Spinner.js +3 -1
- package/cjs/SplitButton.js +2 -1
- package/cjs/Tab.d.ts +4 -2
- package/cjs/TabContainer.d.ts +5 -4
- package/cjs/TabContainer.js +4 -2
- package/cjs/TabContent.js +3 -1
- package/cjs/TabPane.d.ts +2 -1
- package/cjs/TabPane.js +9 -4
- package/cjs/Table.js +3 -1
- package/cjs/Tabs.d.ts +3 -2
- package/cjs/Tabs.js +2 -1
- package/cjs/ThemeProvider.js +4 -2
- package/cjs/Toast.js +7 -3
- package/cjs/ToastContainer.d.ts +8 -0
- package/cjs/ToastHeader.js +7 -3
- package/cjs/ToggleButton.js +7 -3
- package/cjs/ToggleButtonGroup.js +2 -1
- package/cjs/Tooltip.js +2 -1
- package/cjs/TransitionWrapper.d.ts +8 -0
- package/cjs/createWithBsPrefix.js +3 -1
- package/cjs/getTabTransitionComponent.d.ts +3 -0
- package/cjs/index.js +5 -3
- package/cjs/safeFindDOMNode.d.ts +2 -0
- package/cjs/types.d.ts +1 -0
- package/cjs/types.js +3 -1
- package/cjs/useOverlayOffset.d.ts +6 -0
- package/cjs/usePlaceholder.d.ts +10 -0
- package/cjs/usePopperMarginModifiers.js +51 -13
- package/dist/react-bootstrap.js +899 -630
- package/dist/react-bootstrap.min.js +1 -1
- package/dist/react-bootstrap.min.js.LICENSE.txt +1 -1
- package/esm/AbstractModalHeader.d.ts +10 -0
- package/esm/AbstractNav.js +2 -1
- package/esm/AbstractNavItem.d.ts +2 -1
- package/esm/AbstractNavItem.js +2 -1
- package/esm/Accordion.js +2 -1
- package/esm/AccordionBody.d.ts +6 -0
- package/esm/AccordionButton.d.ts +8 -0
- package/esm/AccordionCollapse.js +2 -1
- package/esm/AccordionHeader.d.ts +6 -0
- package/esm/AccordionItem.d.ts +7 -0
- package/esm/AccordionItemContext.d.ts +6 -0
- package/esm/AccordionToggle.js +2 -1
- package/esm/Alert.js +2 -1
- package/esm/Anchor.d.ts +3 -0
- package/esm/Badge.js +2 -1
- package/esm/Breadcrumb.js +2 -1
- package/esm/BreadcrumbItem.js +2 -1
- package/esm/Button.js +2 -1
- package/esm/ButtonGroup.js +2 -1
- package/esm/ButtonToolbar.js +2 -1
- package/esm/Card.js +2 -1
- package/esm/CardHeader.d.ts +6 -0
- package/esm/CardHeaderContext.d.ts +6 -0
- package/esm/CardImg.js +2 -1
- package/esm/Carousel.js +2 -1
- package/esm/CarouselItem.js +2 -1
- package/esm/CloseButton.js +2 -1
- package/esm/Col.js +2 -1
- package/esm/Collapse.d.ts +1 -2
- package/esm/Collapse.js +2 -1
- package/esm/Container.js +2 -1
- package/esm/Dropdown.js +2 -1
- package/esm/DropdownButton.js +2 -1
- package/esm/DropdownContext.d.ts +10 -0
- package/esm/DropdownItem.d.ts +2 -1
- package/esm/DropdownItem.js +3 -3
- package/esm/DropdownMenu.js +2 -1
- package/esm/DropdownToggle.d.ts +0 -1
- package/esm/DropdownToggle.js +2 -1
- package/esm/Fade.js +2 -1
- package/esm/Feedback.js +2 -1
- package/esm/FigureImage.js +2 -1
- package/esm/FloatingLabel.d.ts +9 -0
- package/esm/Form.js +2 -1
- package/esm/FormCheck.js +2 -1
- package/esm/FormCheckInput.js +2 -1
- package/esm/FormCheckLabel.js +2 -1
- package/esm/FormControl.js +2 -1
- package/esm/FormFile.js +2 -1
- package/esm/FormFileInput.js +2 -1
- package/esm/FormFileLabel.js +2 -1
- package/esm/FormFloating.d.ts +2 -0
- package/esm/FormGroup.js +2 -1
- package/esm/FormLabel.js +3 -1
- package/esm/FormRange.d.ts +6 -0
- package/esm/FormSelect.d.ts +10 -0
- package/esm/FormText.js +2 -1
- package/esm/Image.js +2 -1
- package/esm/InputGroup.js +2 -1
- package/esm/InputGroupContext.d.ts +3 -0
- package/esm/Jumbotron.js +2 -1
- package/esm/ListGroup.d.ts +3 -2
- package/esm/ListGroup.js +2 -1
- package/esm/ListGroupItem.d.ts +2 -2
- package/esm/ListGroupItem.js +3 -6
- package/esm/Media.js +2 -1
- package/esm/Modal.d.ts +3 -2
- package/esm/Modal.js +17 -31
- package/esm/ModalDialog.js +2 -1
- package/esm/ModalHeader.js +2 -1
- package/esm/Nav.d.ts +4 -2
- package/esm/Nav.js +4 -2
- package/esm/NavDropdown.js +2 -1
- package/esm/NavItem.js +2 -1
- package/esm/NavLink.d.ts +2 -1
- package/esm/NavLink.js +2 -1
- package/esm/Navbar.js +2 -1
- package/esm/NavbarBrand.js +2 -1
- package/esm/NavbarCollapse.js +2 -1
- package/esm/NavbarToggle.js +2 -1
- package/esm/Offcanvas.d.ts +16 -0
- package/esm/OffcanvasBody.d.ts +2 -0
- package/esm/OffcanvasHeader.d.ts +7 -0
- package/esm/OffcanvasTitle.d.ts +3 -0
- package/esm/OffcanvasToggling.d.ts +15 -0
- package/esm/Overlay.js +4 -2
- package/esm/OverlayTrigger.js +2 -1
- package/esm/PageItem.js +4 -2
- package/esm/Pagination.js +2 -1
- package/esm/Placeholder.d.ts +8 -0
- package/esm/PlaceholderButton.d.ts +8 -0
- package/esm/Popover.js +2 -1
- package/esm/PopoverBody.d.ts +2 -0
- package/esm/PopoverContent.js +2 -1
- package/esm/PopoverHeader.d.ts +2 -0
- package/esm/PopoverTitle.js +2 -1
- package/esm/ProgressBar.js +6 -3
- package/esm/Ratio.d.ts +9 -0
- package/esm/ResponsiveEmbed.js +2 -1
- package/esm/Row.js +2 -1
- package/esm/SafeAnchor.d.ts +0 -1
- package/esm/SafeAnchor.js +2 -1
- package/esm/SelectableContext.d.ts +1 -1
- package/esm/Spinner.d.ts +0 -1
- package/esm/Spinner.js +2 -1
- package/esm/SplitButton.js +2 -1
- package/esm/Tab.d.ts +4 -2
- package/esm/TabContainer.d.ts +5 -4
- package/esm/TabContent.js +2 -1
- package/esm/TabPane.d.ts +2 -1
- package/esm/TabPane.js +4 -2
- package/esm/Table.js +2 -1
- package/esm/Tabs.d.ts +3 -2
- package/esm/Tabs.js +2 -1
- package/esm/Toast.js +2 -1
- package/esm/ToastContainer.d.ts +8 -0
- package/esm/ToastHeader.js +2 -1
- package/esm/ToggleButton.js +2 -1
- package/esm/ToggleButtonGroup.js +2 -1
- package/esm/Tooltip.js +2 -1
- package/esm/TransitionWrapper.d.ts +8 -0
- package/esm/createWithBsPrefix.js +2 -1
- package/esm/getTabTransitionComponent.d.ts +3 -0
- package/esm/safeFindDOMNode.d.ts +2 -0
- package/esm/types.d.ts +1 -0
- package/esm/types.js +1 -0
- package/esm/useOverlayOffset.d.ts +6 -0
- package/esm/usePlaceholder.d.ts +10 -0
- package/esm/usePopperMarginModifiers.js +51 -13
- package/package.json +6 -12
package/esm/Tabs.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectCallback, TransitionType } from './helpers';
|
|
3
|
+
import { EventKey } from './types';
|
|
3
4
|
export interface TabsProps extends React.PropsWithChildren<unknown> {
|
|
4
|
-
activeKey?:
|
|
5
|
-
defaultActiveKey?:
|
|
5
|
+
activeKey?: EventKey;
|
|
6
|
+
defaultActiveKey?: EventKey;
|
|
6
7
|
onSelect?: SelectCallback;
|
|
7
8
|
variant?: 'tabs' | 'pills';
|
|
8
9
|
transition?: TransitionType;
|
package/esm/Tabs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["id", "onSelect", "transition", "mountOnEnter", "unmountOnExit", "children", "activeKey"];
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import requiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
5
6
|
import { useUncontrolled } from 'uncontrollable';
|
|
@@ -59,7 +60,7 @@ var Tabs = function Tabs(props) {
|
|
|
59
60
|
children = _useUncontrolled.children,
|
|
60
61
|
_useUncontrolled$acti = _useUncontrolled.activeKey,
|
|
61
62
|
activeKey = _useUncontrolled$acti === void 0 ? getDefaultActiveKey(children) : _useUncontrolled$acti,
|
|
62
|
-
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled,
|
|
63
|
+
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded);
|
|
63
64
|
|
|
64
65
|
return /*#__PURE__*/React.createElement(TabContainer, {
|
|
65
66
|
id: id,
|
package/esm/Toast.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "className", "children", "transition", "show", "animation", "delay", "autohide", "onClose"];
|
|
3
4
|
import React, { useEffect, useMemo, useRef, useCallback } from 'react';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import useTimeout from '@restart/hooks/useTimeout';
|
|
@@ -23,7 +24,7 @@ var Toast = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
23
24
|
_ref$autohide = _ref.autohide,
|
|
24
25
|
autohide = _ref$autohide === void 0 ? false : _ref$autohide,
|
|
25
26
|
onClose = _ref.onClose,
|
|
26
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
27
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
27
28
|
|
|
28
29
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'toast'); // We use refs for these, because we don't want to restart the autohide
|
|
29
30
|
// timer in case these values change.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
|
+
export declare type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'middle-start' | 'middle-center' | 'middle-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
|
|
4
|
+
export interface ToastContainerProps extends BsPrefixProps, React.HTMLAttributes<HTMLElement> {
|
|
5
|
+
position?: ToastPosition;
|
|
6
|
+
}
|
|
7
|
+
declare const ToastContainer: BsPrefixRefForwardingComponent<'div', ToastContainerProps>;
|
|
8
|
+
export default ToastContainer;
|
package/esm/ToastHeader.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "closeLabel", "closeButton", "className", "children"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React, { useContext } from 'react';
|
|
5
6
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
@@ -16,7 +17,7 @@ var ToastHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16
17
|
closeButton = _ref.closeButton,
|
|
17
18
|
className = _ref.className,
|
|
18
19
|
children = _ref.children,
|
|
19
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
20
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
21
|
|
|
21
22
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'toast-header');
|
|
22
23
|
var context = useContext(ToastContext);
|
package/esm/ToggleButton.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["children", "name", "className", "checked", "type", "onChange", "value", "disabled", "inputRef"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React, { useCallback, useState } from 'react';
|
|
5
6
|
import Button from './Button';
|
|
@@ -18,7 +19,7 @@ var ToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
18
19
|
value = _ref.value,
|
|
19
20
|
disabled = _ref.disabled,
|
|
20
21
|
inputRef = _ref.inputRef,
|
|
21
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
22
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
23
|
|
|
23
24
|
var _useState = useState(false),
|
|
24
25
|
focused = _useState[0],
|
package/esm/ToggleButtonGroup.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["children", "type", "name", "value", "onChange"];
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import invariant from 'invariant';
|
|
5
6
|
import { useUncontrolled } from 'uncontrollable';
|
|
@@ -20,7 +21,7 @@ var ToggleButtonGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
20
21
|
name = _useUncontrolled.name,
|
|
21
22
|
value = _useUncontrolled.value,
|
|
22
23
|
onChange = _useUncontrolled.onChange,
|
|
23
|
-
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled,
|
|
24
|
+
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded);
|
|
24
25
|
|
|
25
26
|
var getValues = function getValues() {
|
|
26
27
|
return value == null ? [] : [].concat(value);
|
package/esm/Tooltip.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "placement", "className", "style", "children", "arrowProps", "popper", "show"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
@@ -16,7 +17,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16
17
|
arrowProps = _ref.arrowProps,
|
|
17
18
|
_ = _ref.popper,
|
|
18
19
|
_2 = _ref.show,
|
|
19
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
20
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
21
|
|
|
21
22
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'tooltip');
|
|
22
23
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Transition, { TransitionProps, TransitionStatus } from 'react-transition-group/Transition';
|
|
3
|
+
export declare type TransitionWrapperProps = TransitionProps & {
|
|
4
|
+
childRef?: React.Ref<unknown>;
|
|
5
|
+
children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
6
|
+
};
|
|
7
|
+
declare const TransitionWrapper: React.ForwardRefExoticComponent<Pick<TransitionWrapperProps, string | number> & React.RefAttributes<Transition<any>>>;
|
|
8
|
+
export default TransitionWrapper;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["className", "bsPrefix", "as"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import camelize from 'dom-helpers/camelize';
|
|
5
6
|
import React from 'react';
|
|
@@ -22,7 +23,7 @@ export default function createWithBsPrefix(prefix, _temp) {
|
|
|
22
23
|
bsPrefix = _ref2.bsPrefix,
|
|
23
24
|
_ref2$as = _ref2.as,
|
|
24
25
|
Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,
|
|
25
|
-
props = _objectWithoutPropertiesLoose(_ref2,
|
|
26
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
26
27
|
|
|
27
28
|
var resolvedPrefix = useBootstrapPrefix(bsPrefix, prefix);
|
|
28
29
|
return /*#__PURE__*/React.createElement(Tag, _extends({
|
package/esm/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare type Variant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
|
|
2
2
|
export declare type ButtonVariant = Variant | 'link' | 'outline-primary' | 'outline-secondary' | 'outline-success' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-dark' | 'outline-light';
|
|
3
3
|
export declare type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted';
|
|
4
|
+
export declare type EventKey = string | number;
|
package/esm/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColProps } from './Col';
|
|
2
|
+
import { Variant } from './types';
|
|
3
|
+
export declare type PlaceholderAnimation = 'glow' | 'wave';
|
|
4
|
+
export declare type PlaceholderSize = 'xs' | 'sm' | 'lg';
|
|
5
|
+
export interface UsePlaceholderProps extends Omit<ColProps, 'as'> {
|
|
6
|
+
animation?: PlaceholderAnimation;
|
|
7
|
+
bg?: Variant;
|
|
8
|
+
size?: PlaceholderSize;
|
|
9
|
+
}
|
|
10
|
+
export default function usePlaceholder({ animation, bg, bsPrefix, size, ...props }: UsePlaceholderProps): any;
|
|
@@ -19,6 +19,7 @@ function getMargins(element) {
|
|
|
19
19
|
export default function usePopperMarginModifiers() {
|
|
20
20
|
var overlayRef = useRef(null);
|
|
21
21
|
var margins = useRef(null);
|
|
22
|
+
var arrowMargins = useRef(null);
|
|
22
23
|
var popoverClass = useBootstrapPrefix(undefined, 'popover');
|
|
23
24
|
var dropdownMenuClass = useBootstrapPrefix(undefined, 'dropdown-menu');
|
|
24
25
|
var callback = useCallback(function (overlay) {
|
|
@@ -59,32 +60,69 @@ export default function usePopperMarginModifiers() {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
|
-
}, [margins]);
|
|
63
|
+
}, [margins]);
|
|
64
|
+
var arrow = useMemo(function () {
|
|
65
|
+
return {
|
|
66
|
+
name: 'arrow',
|
|
67
|
+
options: {
|
|
68
|
+
padding: function padding() {
|
|
69
|
+
// The options here are used for Popper 2.8.4 and up.
|
|
70
|
+
// For earlier version, padding is handled in popoverArrowMargins below.
|
|
71
|
+
if (!arrowMargins.current) {
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var _arrowMargins$current = arrowMargins.current,
|
|
76
|
+
top = _arrowMargins$current.top,
|
|
77
|
+
right = _arrowMargins$current.right;
|
|
78
|
+
var padding = top || right;
|
|
79
|
+
return {
|
|
80
|
+
top: padding,
|
|
81
|
+
left: padding,
|
|
82
|
+
right: padding,
|
|
83
|
+
bottom: padding
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}, [arrowMargins]); // Converts popover arrow margin to arrow modifier padding
|
|
63
89
|
|
|
64
90
|
var popoverArrowMargins = useMemo(function () {
|
|
65
91
|
return {
|
|
66
92
|
name: 'popoverArrowMargins',
|
|
67
93
|
enabled: true,
|
|
68
94
|
phase: 'main',
|
|
95
|
+
fn: function fn() {
|
|
96
|
+
return undefined;
|
|
97
|
+
},
|
|
69
98
|
requiresIfExists: ['arrow'],
|
|
70
99
|
effect: function effect(_ref2) {
|
|
71
100
|
var state = _ref2.state;
|
|
72
101
|
|
|
73
|
-
if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass)
|
|
102
|
+
if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass)) {
|
|
74
103
|
return undefined;
|
|
75
104
|
}
|
|
76
105
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
106
|
+
if (state.modifiersData['arrow#persistent']) {
|
|
107
|
+
// @popperjs/core <= 2.8.3 uses arrow#persistent to pass padding to arrow modifier.
|
|
108
|
+
var _getMargins = getMargins(state.elements.arrow),
|
|
109
|
+
top = _getMargins.top,
|
|
110
|
+
right = _getMargins.right;
|
|
111
|
+
|
|
112
|
+
var padding = top || right;
|
|
113
|
+
state.modifiersData['arrow#persistent'].padding = {
|
|
114
|
+
top: padding,
|
|
115
|
+
left: padding,
|
|
116
|
+
right: padding,
|
|
117
|
+
bottom: padding
|
|
118
|
+
};
|
|
119
|
+
} else {
|
|
120
|
+
// @popperjs/core >= 2.8.4 gets the padding from the arrow modifier options,
|
|
121
|
+
// so we'll get the margins here, and let the arrow modifier above pass
|
|
122
|
+
// it to popper.
|
|
123
|
+
arrowMargins.current = getMargins(state.elements.arrow);
|
|
124
|
+
}
|
|
80
125
|
|
|
81
|
-
var padding = top || right;
|
|
82
|
-
state.modifiersData['arrow#persistent'].padding = {
|
|
83
|
-
top: padding,
|
|
84
|
-
left: padding,
|
|
85
|
-
right: padding,
|
|
86
|
-
bottom: padding
|
|
87
|
-
};
|
|
88
126
|
state.elements.arrow.style.margin = '0';
|
|
89
127
|
return function () {
|
|
90
128
|
if (state.elements.arrow) state.elements.arrow.style.margin = '';
|
|
@@ -92,5 +130,5 @@ export default function usePopperMarginModifiers() {
|
|
|
92
130
|
}
|
|
93
131
|
};
|
|
94
132
|
}, [popoverClass]);
|
|
95
|
-
return [callback, [offset, popoverArrowMargins]];
|
|
133
|
+
return [callback, [offset, arrow, popoverArrowMargins]];
|
|
96
134
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-bootstrap",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "Bootstrap 4 components built with React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -25,11 +25,6 @@
|
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "git+https://github.com/react-bootstrap/react-bootstrap.git"
|
|
27
27
|
},
|
|
28
|
-
"husky": {
|
|
29
|
-
"hooks": {
|
|
30
|
-
"pre-commit": "lint-staged"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
28
|
"lint-staged": {
|
|
34
29
|
"*.{js,ts,tsx}": "eslint --fix"
|
|
35
30
|
},
|
|
@@ -38,21 +33,20 @@
|
|
|
38
33
|
"trailingComma": "all"
|
|
39
34
|
},
|
|
40
35
|
"dependencies": {
|
|
41
|
-
"@babel/runtime": "^7.
|
|
36
|
+
"@babel/runtime": "^7.14.0",
|
|
42
37
|
"@restart/context": "^2.1.4",
|
|
43
38
|
"@restart/hooks": "^0.3.26",
|
|
44
|
-
"@types/classnames": "^2.2.10",
|
|
45
39
|
"@types/invariant": "^2.2.33",
|
|
46
40
|
"@types/prop-types": "^15.7.3",
|
|
47
|
-
"@types/react": ">=16.
|
|
41
|
+
"@types/react": ">=16.14.8",
|
|
48
42
|
"@types/react-transition-group": "^4.4.1",
|
|
49
43
|
"@types/warning": "^3.0.0",
|
|
50
|
-
"classnames": "^2.
|
|
51
|
-
"dom-helpers": "^5.1
|
|
44
|
+
"classnames": "^2.3.1",
|
|
45
|
+
"dom-helpers": "^5.2.1",
|
|
52
46
|
"invariant": "^2.2.4",
|
|
53
47
|
"prop-types": "^15.7.2",
|
|
54
48
|
"prop-types-extra": "^1.1.0",
|
|
55
|
-
"react-overlays": "^5.
|
|
49
|
+
"react-overlays": "^5.1.1",
|
|
56
50
|
"react-transition-group": "^4.4.1",
|
|
57
51
|
"uncontrollable": "^7.2.1",
|
|
58
52
|
"warning": "^4.0.3"
|