react-bootstrap 2.5.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/AbstractNav.d.ts +15 -0
- package/cjs/AbstractNavItem.d.ts +19 -0
- 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/AccordionToggle.d.ts +11 -0
- 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/CardColumns.d.ts +2 -0
- package/cjs/CardContext.d.ts +6 -0
- package/cjs/CardDeck.d.ts +2 -0
- 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 +2 -9
- 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 +5 -5
- 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/FormFile.d.ts +23 -0
- package/cjs/FormFileInput.d.ts +10 -0
- package/cjs/FormFileLabel.d.ts +7 -0
- 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/Jumbotron.d.ts +7 -0
- package/cjs/ListGroup.js +0 -16
- package/cjs/ListGroupItem.js +4 -15
- package/cjs/Media.d.ts +8 -0
- package/cjs/Modal.js +32 -73
- 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 +9 -9
- package/cjs/OverlayTrigger.js +7 -32
- package/cjs/PageItem.js +3 -12
- 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/PopoverContent.d.ts +5 -0
- package/cjs/PopoverHeader.js +0 -4
- package/cjs/PopoverTitle.d.ts +5 -0
- package/cjs/ProgressBar.js +2 -20
- package/cjs/Ratio.d.ts +1 -1
- package/cjs/Ratio.js +3 -12
- package/cjs/ResponsiveEmbed.d.ts +9 -0
- package/cjs/Row.d.ts +2 -2
- package/cjs/Row.js +0 -10
- package/cjs/SSRProvider.js +0 -2
- package/cjs/SafeAnchor.d.ts +17 -0
- package/cjs/SelectableContext.d.ts +5 -0
- package/cjs/Spinner.d.ts +1 -1
- package/cjs/Spinner.js +1 -9
- 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.d.ts +2 -2
- package/cjs/Tab.js +2 -20
- package/cjs/TabContainer.d.ts +2 -2
- package/cjs/TabContainer.js +2 -10
- package/cjs/TabContent.js +0 -4
- package/cjs/TabContext.d.ts +12 -0
- package/cjs/TabPane.js +7 -17
- package/cjs/Table.js +2 -13
- package/cjs/Tabs.d.ts +3 -3
- 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.d.ts +1 -1
- package/cjs/safeFindDOMNode.js +0 -5
- package/cjs/transitionEndListener.js +0 -6
- package/cjs/triggerBrowserReflow.js +0 -2
- package/cjs/types.d.ts +10 -10
- 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/usePopperMarginModifiers.d.ts +4 -0
- package/cjs/useWrappedRefWithWarning.js +4 -9
- package/dist/react-bootstrap.js +750 -2195
- package/dist/react-bootstrap.min.js +1 -1
- package/esm/AbstractNav.d.ts +15 -0
- package/esm/AbstractNavItem.d.ts +19 -0
- 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/AccordionToggle.d.ts +11 -0
- 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/CardColumns.d.ts +2 -0
- package/esm/CardContext.d.ts +6 -0
- package/esm/CardDeck.d.ts +2 -0
- 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 +2 -1
- 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 +5 -5
- 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/FormFile.d.ts +23 -0
- package/esm/FormFileInput.d.ts +10 -0
- package/esm/FormFileLabel.d.ts +7 -0
- 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/Jumbotron.d.ts +7 -0
- package/esm/ListGroup.js +0 -2
- package/esm/ListGroupItem.js +4 -4
- package/esm/Media.d.ts +8 -0
- package/esm/Modal.js +32 -44
- 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 +9 -9
- package/esm/OverlayTrigger.js +7 -20
- package/esm/PageItem.js +2 -4
- package/esm/Pagination.js +0 -1
- package/esm/Placeholder.js +2 -1
- package/esm/PlaceholderButton.js +2 -1
- package/esm/PopoverContent.d.ts +5 -0
- package/esm/PopoverTitle.d.ts +5 -0
- package/esm/ProgressBar.js +2 -12
- package/esm/Ratio.d.ts +1 -1
- package/esm/Ratio.js +3 -4
- package/esm/ResponsiveEmbed.d.ts +9 -0
- package/esm/Row.d.ts +2 -2
- package/esm/Row.js +0 -2
- package/esm/SafeAnchor.d.ts +17 -0
- package/esm/SelectableContext.d.ts +5 -0
- package/esm/Spinner.d.ts +1 -1
- package/esm/Spinner.js +1 -1
- 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.d.ts +2 -2
- package/esm/Tab.js +2 -9
- package/esm/TabContainer.d.ts +2 -2
- package/esm/TabContainer.js +2 -3
- package/esm/TabContext.d.ts +12 -0
- package/esm/TabPane.js +7 -4
- package/esm/Table.js +2 -6
- package/esm/Tabs.d.ts +3 -3
- 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.d.ts +1 -1
- package/esm/safeFindDOMNode.js +0 -1
- package/esm/transitionEndListener.js +0 -2
- package/esm/types.d.ts +10 -10
- package/esm/useOverlayOffset.js +3 -3
- package/esm/usePlaceholder.d.ts +2 -2
- package/esm/usePlaceholder.js +2 -1
- package/esm/usePopperMarginModifiers.d.ts +4 -0
- package/esm/useWrappedRefWithWarning.js +4 -3
- package/package.json +2 -2
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({
|
|
31
|
+
}] = useTabPanel({
|
|
32
|
+
...props,
|
|
32
33
|
transition: getTabTransitionComponent(transition)
|
|
33
34
|
});
|
|
34
|
-
const prefix = useBootstrapPrefix(bsPrefix, 'tab-pane');
|
|
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, {
|
|
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
|
-
|
|
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.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ declare const Tabs: {
|
|
|
14
14
|
*
|
|
15
15
|
* @controllable onSelect
|
|
16
16
|
*/
|
|
17
|
-
activeKey: PropTypes.Requireable<string | number
|
|
17
|
+
activeKey: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
18
18
|
/** The default active key that is selected on start */
|
|
19
|
-
defaultActiveKey: PropTypes.Requireable<string | number
|
|
19
|
+
defaultActiveKey: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
20
20
|
/**
|
|
21
21
|
* Navigation style
|
|
22
22
|
*
|
|
@@ -32,7 +32,7 @@ declare const Tabs: {
|
|
|
32
32
|
* @type {Transition | false}
|
|
33
33
|
* @default {Fade}
|
|
34
34
|
*/
|
|
35
|
-
transition: PropTypes.Requireable<boolean | PropTypes.ReactComponentLike
|
|
35
|
+
transition: PropTypes.Requireable<NonNullable<boolean | PropTypes.ReactComponentLike | null | undefined>>;
|
|
36
36
|
/**
|
|
37
37
|
* HTML id attribute, required if no `generateChildId` prop
|
|
38
38
|
* is specified.
|
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, {
|
|
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 = {
|
|
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, {
|
|
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;
|
package/esm/ThemeProvider.js
CHANGED
|
@@ -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: {
|
|
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;
|
|
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(({
|
|
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, {
|
|
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');
|
|
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
|
-
|
|
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, {
|
package/esm/ToastContainer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
|
-
export
|
|
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;
|
package/esm/ToastContext.js
CHANGED
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, {
|
|
9
|
+
const ToastFade = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Fade, {
|
|
10
|
+
...props,
|
|
10
11
|
ref: ref,
|
|
11
12
|
transitionClasses: fadeStyles
|
|
12
13
|
}));
|
package/esm/ToggleButton.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from './Button';
|
|
3
|
-
export
|
|
3
|
+
export type ToggleButtonType = 'checkbox' | 'radio';
|
|
4
4
|
export interface ToggleButtonProps extends Omit<ButtonProps, 'onChange' | 'type'> {
|
|
5
5
|
type?: ToggleButtonType;
|
|
6
6
|
name?: string;
|
package/esm/ToggleButton.js
CHANGED
|
@@ -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, {
|
|
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
|
-
|
|
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
|
|
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
|
};
|
package/esm/ToggleButtonGroup.js
CHANGED
|
@@ -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, {
|
|
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,
|
|
@@ -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.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function safeFindDOMNode(componentOrElement: React.
|
|
2
|
+
export default function safeFindDOMNode(componentOrElement: React.Component | Element | null | undefined): Element | Text | null;
|
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
|
|
20
|
-
export declare const alignPropType: PropTypes.Requireable<object | AlignDirection
|
|
21
|
-
export
|
|
22
|
-
export
|
|
19
|
+
export type AlignType = AlignDirection | ResponsiveAlignProp;
|
|
20
|
+
export declare const alignPropType: PropTypes.Requireable<NonNullable<object | AlignDirection | null | undefined>>;
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-bootstrap",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Bootstrap 5 components built with React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bootstrap",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.17.2",
|
|
39
39
|
"@restart/hooks": "^0.4.6",
|
|
40
|
-
"@restart/ui": "^1.
|
|
40
|
+
"@restart/ui": "^1.4.1",
|
|
41
41
|
"@types/react-transition-group": "^4.4.4",
|
|
42
42
|
"classnames": "^2.3.1",
|
|
43
43
|
"dom-helpers": "^5.2.1",
|