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.
- package/cjs/AbstractModalHeader.js +0 -9
- package/cjs/Accordion.js +0 -17
- package/cjs/AccordionBody.d.ts +2 -1
- package/cjs/AccordionBody.js +12 -10
- package/cjs/AccordionButton.d.ts +1 -1
- package/cjs/AccordionButton.js +0 -15
- package/cjs/AccordionCollapse.js +0 -10
- package/cjs/AccordionContext.d.ts +1 -1
- package/cjs/AccordionContext.js +0 -5
- package/cjs/AccordionHeader.js +0 -9
- package/cjs/AccordionItem.js +0 -9
- package/cjs/AccordionItemContext.js +0 -4
- package/cjs/Alert.js +0 -17
- package/cjs/Anchor.js +0 -3
- package/cjs/Badge.js +0 -8
- package/cjs/BootstrapModalManager.js +2 -18
- package/cjs/Breadcrumb.js +2 -12
- package/cjs/BreadcrumbItem.js +2 -10
- package/cjs/Button.d.ts +1 -1
- package/cjs/Button.js +2 -10
- package/cjs/ButtonGroup.js +2 -9
- package/cjs/ButtonToolbar.js +2 -9
- package/cjs/Card.js +0 -14
- package/cjs/CardGroup.js +0 -4
- package/cjs/CardHeader.js +0 -9
- package/cjs/CardHeaderContext.js +0 -4
- package/cjs/CardImg.js +2 -9
- package/cjs/Carousel.d.ts +1 -1
- package/cjs/Carousel.js +9 -58
- package/cjs/CarouselCaption.js +0 -4
- package/cjs/CarouselItem.js +0 -8
- package/cjs/CloseButton.d.ts +1 -1
- package/cjs/CloseButton.js +0 -10
- package/cjs/Col.d.ts +5 -5
- package/cjs/Col.js +6 -14
- package/cjs/Collapse.d.ts +1 -1
- package/cjs/Collapse.js +10 -22
- package/cjs/Container.js +0 -8
- package/cjs/Dropdown.js +17 -27
- package/cjs/DropdownButton.js +1 -25
- package/cjs/DropdownContext.d.ts +2 -2
- package/cjs/DropdownContext.js +0 -4
- package/cjs/DropdownItem.js +2 -11
- package/cjs/DropdownMenu.d.ts +2 -2
- package/cjs/DropdownMenu.js +12 -34
- package/cjs/DropdownToggle.d.ts +2 -2
- package/cjs/DropdownToggle.js +7 -24
- package/cjs/ElementChildren.js +2 -8
- package/cjs/Fade.js +2 -12
- package/cjs/Feedback.d.ts +1 -1
- package/cjs/Feedback.js +4 -11
- package/cjs/Figure.js +0 -7
- package/cjs/FigureCaption.js +0 -3
- package/cjs/FigureImage.js +0 -8
- package/cjs/FloatingLabel.js +0 -9
- package/cjs/Form.d.ts +1 -1
- package/cjs/Form.js +2 -22
- package/cjs/FormCheck.d.ts +1 -1
- package/cjs/FormCheck.js +2 -16
- package/cjs/FormCheckInput.d.ts +1 -1
- package/cjs/FormCheckInput.js +2 -10
- package/cjs/FormCheckLabel.js +2 -10
- package/cjs/FormContext.js +0 -4
- package/cjs/FormControl.d.ts +1 -1
- package/cjs/FormControl.js +2 -16
- package/cjs/FormFloating.js +0 -4
- package/cjs/FormGroup.js +2 -8
- package/cjs/FormLabel.d.ts +1 -1
- package/cjs/FormLabel.js +0 -11
- package/cjs/FormRange.js +2 -10
- package/cjs/FormSelect.js +2 -10
- package/cjs/FormText.js +4 -10
- package/cjs/Image.js +0 -13
- package/cjs/InputGroup.js +3 -18
- package/cjs/InputGroupContext.js +0 -4
- package/cjs/ListGroup.js +0 -16
- package/cjs/ListGroupItem.js +2 -16
- package/cjs/Modal.js +31 -72
- package/cjs/ModalBody.js +0 -4
- package/cjs/ModalContext.js +0 -5
- package/cjs/ModalDialog.js +2 -9
- package/cjs/ModalFooter.js +0 -4
- package/cjs/ModalHeader.js +0 -9
- package/cjs/ModalTitle.js +0 -6
- package/cjs/Nav.js +0 -19
- package/cjs/NavContext.js +0 -4
- package/cjs/NavDropdown.js +0 -12
- package/cjs/NavItem.js +0 -4
- package/cjs/NavLink.js +2 -12
- package/cjs/Navbar.js +3 -22
- package/cjs/NavbarBrand.js +2 -9
- package/cjs/NavbarCollapse.js +0 -9
- package/cjs/NavbarContext.js +0 -4
- package/cjs/NavbarOffcanvas.d.ts +1 -1
- package/cjs/NavbarOffcanvas.js +0 -8
- package/cjs/NavbarToggle.js +2 -13
- package/cjs/Offcanvas.d.ts +1 -1
- package/cjs/Offcanvas.js +9 -37
- package/cjs/OffcanvasBody.js +0 -4
- package/cjs/OffcanvasHeader.js +0 -9
- package/cjs/OffcanvasTitle.js +0 -6
- package/cjs/OffcanvasToggling.js +2 -12
- package/cjs/Overlay.d.ts +1 -1
- package/cjs/Overlay.js +12 -27
- package/cjs/OverlayTrigger.d.ts +4 -4
- package/cjs/OverlayTrigger.js +7 -32
- package/cjs/PageItem.js +3 -11
- package/cjs/Pagination.js +0 -11
- package/cjs/Placeholder.js +2 -11
- package/cjs/PlaceholderButton.js +2 -9
- package/cjs/Popover.js +0 -13
- package/cjs/PopoverBody.js +0 -4
- package/cjs/PopoverHeader.js +0 -4
- package/cjs/ProgressBar.js +2 -20
- package/cjs/Ratio.d.ts +1 -1
- package/cjs/Ratio.js +3 -12
- package/cjs/Row.d.ts +2 -2
- package/cjs/Row.js +0 -10
- package/cjs/SSRProvider.js +0 -2
- package/cjs/Spinner.js +0 -8
- package/cjs/SplitButton.js +1 -27
- package/cjs/Stack.d.ts +1 -1
- package/cjs/Stack.js +2 -10
- package/cjs/Switch.d.ts +1 -1
- package/cjs/Switch.js +2 -10
- package/cjs/Tab.js +2 -20
- package/cjs/TabContainer.js +2 -10
- package/cjs/TabContent.js +0 -4
- package/cjs/TabPane.js +7 -17
- package/cjs/Table.js +2 -13
- package/cjs/Tabs.js +6 -24
- package/cjs/ThemeProvider.js +8 -17
- package/cjs/Toast.js +5 -18
- package/cjs/ToastBody.js +0 -4
- package/cjs/ToastContainer.d.ts +1 -1
- package/cjs/ToastContainer.js +0 -8
- package/cjs/ToastContext.js +0 -5
- package/cjs/ToastFade.js +2 -9
- package/cjs/ToastHeader.js +0 -11
- package/cjs/ToggleButton.d.ts +1 -1
- package/cjs/ToggleButton.js +2 -11
- package/cjs/ToggleButtonGroup.d.ts +2 -2
- package/cjs/ToggleButtonGroup.js +2 -23
- package/cjs/Tooltip.js +0 -9
- package/cjs/TransitionWrapper.d.ts +1 -1
- package/cjs/TransitionWrapper.js +3 -15
- package/cjs/createChainedFunction.js +2 -5
- package/cjs/createUtilityClasses.d.ts +1 -1
- package/cjs/createUtilityClasses.js +0 -6
- package/cjs/createWithBsPrefix.js +0 -11
- package/cjs/divWithClassName.js +2 -9
- package/cjs/getTabTransitionComponent.js +0 -6
- package/cjs/helpers.d.ts +4 -4
- package/cjs/helpers.js +2 -9
- package/cjs/index.js +0 -171
- package/cjs/safeFindDOMNode.js +0 -5
- package/cjs/transitionEndListener.js +0 -6
- package/cjs/triggerBrowserReflow.js +0 -2
- package/cjs/types.d.ts +9 -9
- package/cjs/types.js +0 -5
- package/cjs/useOverlayOffset.js +0 -8
- package/cjs/usePlaceholder.d.ts +2 -2
- package/cjs/usePlaceholder.js +2 -7
- package/cjs/useWrappedRefWithWarning.js +4 -9
- package/dist/react-bootstrap.js +676 -1945
- package/dist/react-bootstrap.min.js +1 -1
- package/esm/AccordionBody.d.ts +2 -1
- package/esm/AccordionBody.js +12 -0
- package/esm/AccordionButton.d.ts +1 -1
- package/esm/AccordionButton.js +0 -4
- package/esm/AccordionCollapse.js +0 -1
- package/esm/AccordionContext.d.ts +1 -1
- package/esm/Alert.js +0 -2
- package/esm/BootstrapModalManager.js +2 -9
- package/esm/Breadcrumb.js +2 -1
- package/esm/BreadcrumbItem.js +2 -1
- package/esm/Button.d.ts +1 -1
- package/esm/Button.js +2 -1
- package/esm/ButtonGroup.js +2 -1
- package/esm/ButtonToolbar.js +2 -1
- package/esm/CardImg.js +2 -1
- package/esm/Carousel.d.ts +1 -1
- package/esm/Carousel.js +9 -36
- package/esm/CloseButton.d.ts +1 -1
- package/esm/CloseButton.js +0 -2
- package/esm/Col.d.ts +5 -5
- package/esm/Col.js +6 -5
- package/esm/Collapse.d.ts +1 -1
- package/esm/Collapse.js +11 -8
- package/esm/Dropdown.js +17 -7
- package/esm/DropdownButton.js +1 -14
- package/esm/DropdownContext.d.ts +2 -2
- package/esm/DropdownItem.js +2 -1
- package/esm/DropdownMenu.d.ts +2 -2
- package/esm/DropdownMenu.js +12 -15
- package/esm/DropdownToggle.d.ts +2 -2
- package/esm/DropdownToggle.js +7 -10
- package/esm/ElementChildren.js +3 -6
- package/esm/Fade.js +2 -1
- package/esm/Feedback.d.ts +1 -1
- package/esm/Feedback.js +4 -3
- package/esm/Form.d.ts +1 -1
- package/esm/Form.js +2 -2
- package/esm/FormCheck.d.ts +1 -1
- package/esm/FormCheck.js +2 -3
- package/esm/FormCheckInput.d.ts +1 -1
- package/esm/FormCheckInput.js +2 -1
- package/esm/FormCheckLabel.js +2 -1
- package/esm/FormContext.js +3 -1
- package/esm/FormControl.d.ts +1 -1
- package/esm/FormControl.js +2 -3
- package/esm/FormGroup.js +2 -1
- package/esm/FormLabel.d.ts +1 -1
- package/esm/FormRange.js +2 -1
- package/esm/FormSelect.js +2 -1
- package/esm/FormText.js +4 -2
- package/esm/Image.js +0 -4
- package/esm/InputGroup.js +3 -5
- package/esm/ListGroup.js +0 -2
- package/esm/ListGroupItem.js +2 -4
- package/esm/Modal.js +31 -43
- package/esm/ModalContext.js +0 -1
- package/esm/ModalDialog.js +2 -1
- package/esm/Nav.js +0 -2
- package/esm/NavLink.js +2 -1
- package/esm/Navbar.js +3 -4
- package/esm/NavbarBrand.js +2 -1
- package/esm/NavbarContext.js +3 -1
- package/esm/NavbarOffcanvas.d.ts +1 -1
- package/esm/NavbarToggle.js +2 -3
- package/esm/Offcanvas.d.ts +1 -1
- package/esm/Offcanvas.js +9 -16
- package/esm/OffcanvasToggling.js +2 -1
- package/esm/Overlay.d.ts +1 -1
- package/esm/Overlay.js +12 -12
- package/esm/OverlayTrigger.d.ts +4 -4
- package/esm/OverlayTrigger.js +7 -20
- package/esm/PageItem.js +2 -3
- package/esm/Pagination.js +0 -1
- package/esm/Placeholder.js +2 -1
- package/esm/PlaceholderButton.js +2 -1
- package/esm/ProgressBar.js +2 -12
- package/esm/Ratio.d.ts +1 -1
- package/esm/Ratio.js +3 -4
- package/esm/Row.d.ts +2 -2
- package/esm/Row.js +0 -2
- package/esm/SplitButton.js +1 -16
- package/esm/Stack.d.ts +1 -1
- package/esm/Stack.js +2 -1
- package/esm/Switch.d.ts +1 -1
- package/esm/Switch.js +2 -1
- package/esm/Tab.js +2 -9
- package/esm/TabContainer.js +2 -3
- package/esm/TabPane.js +7 -4
- package/esm/Table.js +2 -6
- package/esm/Tabs.js +6 -9
- package/esm/ThemeProvider.js +8 -9
- package/esm/Toast.js +5 -5
- package/esm/ToastContainer.d.ts +1 -1
- package/esm/ToastContext.js +0 -1
- package/esm/ToastFade.js +2 -1
- package/esm/ToggleButton.d.ts +1 -1
- package/esm/ToggleButton.js +2 -3
- package/esm/ToggleButtonGroup.d.ts +2 -2
- package/esm/ToggleButtonGroup.js +2 -9
- package/esm/TransitionWrapper.d.ts +1 -1
- package/esm/TransitionWrapper.js +3 -5
- package/esm/createChainedFunction.js +2 -4
- package/esm/createUtilityClasses.d.ts +1 -1
- package/esm/createUtilityClasses.js +0 -1
- package/esm/createWithBsPrefix.js +0 -2
- package/esm/divWithClassName.js +2 -1
- package/esm/getTabTransitionComponent.js +0 -1
- package/esm/helpers.d.ts +4 -4
- package/esm/helpers.js +3 -3
- package/esm/safeFindDOMNode.js +0 -1
- package/esm/transitionEndListener.js +0 -2
- package/esm/types.d.ts +9 -9
- package/esm/useOverlayOffset.js +3 -3
- package/esm/usePlaceholder.d.ts +2 -2
- package/esm/usePlaceholder.js +2 -1
- package/esm/useWrappedRefWithWarning.js +4 -3
- 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
|
|
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
|
};
|
package/esm/TransitionWrapper.js
CHANGED
|
@@ -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, {
|
|
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);
|
|
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;
|
|
@@ -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),
|
package/esm/divWithClassName.js
CHANGED
|
@@ -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", {
|
|
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
|
})));
|
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
|
|
4
|
-
export
|
|
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
|
|
23
|
-
export
|
|
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 {}
|
|
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
|
}
|
package/esm/safeFindDOMNode.js
CHANGED
|
@@ -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
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
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
|
|
19
|
+
export type AlignType = AlignDirection | ResponsiveAlignProp;
|
|
20
20
|
export declare const alignPropType: PropTypes.Requireable<NonNullable<object | AlignDirection | null | undefined>>;
|
|
21
|
-
export
|
|
22
|
-
export
|
|
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;
|
package/esm/useOverlayOffset.js
CHANGED
|
@@ -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';
|
|
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
|
}
|
package/esm/usePlaceholder.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColProps } from './Col';
|
|
2
2
|
import { Variant } from './types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
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;
|
package/esm/usePlaceholder.js
CHANGED
|
@@ -13,7 +13,8 @@ export default function usePlaceholder({
|
|
|
13
13
|
className,
|
|
14
14
|
...colProps
|
|
15
15
|
}] = useCol(props);
|
|
16
|
-
return {
|
|
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;
|
|
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]);
|
|
11
|
-
|
|
11
|
+
}, [componentName]);
|
|
12
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
12
13
|
return useMergedRefs(warningRef, ref);
|
|
13
14
|
}
|