react-bootstrap 2.5.0-beta.0 → 2.5.0-beta.1
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/Dropdown.d.ts +0 -1
- package/cjs/DropdownButton.d.ts +1 -0
- package/cjs/DropdownButton.js +9 -0
- package/cjs/Offcanvas.js +11 -2
- package/cjs/OverlayTrigger.d.ts +2 -0
- package/cjs/SplitButton.d.ts +1 -0
- package/cjs/SplitButton.js +9 -0
- package/cjs/Tabs.d.ts +10 -2
- package/dist/react-bootstrap.js +646 -179
- package/dist/react-bootstrap.min.js +1 -1
- package/esm/Dropdown.d.ts +0 -1
- package/esm/DropdownButton.d.ts +1 -0
- package/esm/DropdownButton.js +9 -0
- package/esm/Offcanvas.js +11 -3
- package/esm/OverlayTrigger.d.ts +2 -0
- package/esm/SplitButton.d.ts +1 -0
- package/esm/SplitButton.js +9 -0
- package/esm/Tabs.d.ts +10 -2
- package/package.json +2 -2
package/esm/Dropdown.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { AlignType } from './types';
|
|
|
6
6
|
export interface DropdownProps extends BaseDropdownProps, BsPrefixProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'children'> {
|
|
7
7
|
drop?: DropDirection;
|
|
8
8
|
align?: AlignType;
|
|
9
|
-
flip?: boolean;
|
|
10
9
|
focusFirstItemOnShow?: boolean | 'keyboard';
|
|
11
10
|
navbar?: boolean;
|
|
12
11
|
autoClose?: boolean | 'outside' | 'inside';
|
package/esm/DropdownButton.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface DropdownButtonProps extends Omit<DropdownProps, 'title'>, Props
|
|
|
9
9
|
renderMenuOnMount?: boolean;
|
|
10
10
|
rootCloseEvent?: 'click' | 'mousedown';
|
|
11
11
|
menuVariant?: DropdownMenuVariant;
|
|
12
|
+
flip?: boolean;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* A convenience component for simple or general use dropdowns. Renders a `Button` toggle and all `children`
|
package/esm/DropdownButton.js
CHANGED
|
@@ -54,6 +54,13 @@ const propTypes = {
|
|
|
54
54
|
*/
|
|
55
55
|
menuVariant: PropTypes.oneOf(['dark']),
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to
|
|
59
|
+
* Popper.js's flip [docs](https://popper.js.org/docs/v2/modifiers/flip/).
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
flip: PropTypes.bool,
|
|
63
|
+
|
|
57
64
|
/** @ignore */
|
|
58
65
|
bsPrefix: PropTypes.string,
|
|
59
66
|
|
|
@@ -86,6 +93,7 @@ const DropdownButton = /*#__PURE__*/React.forwardRef(({
|
|
|
86
93
|
href,
|
|
87
94
|
id,
|
|
88
95
|
menuVariant,
|
|
96
|
+
flip,
|
|
89
97
|
...props
|
|
90
98
|
}, ref) => /*#__PURE__*/_jsxs(Dropdown, {
|
|
91
99
|
ref: ref,
|
|
@@ -103,6 +111,7 @@ const DropdownButton = /*#__PURE__*/React.forwardRef(({
|
|
|
103
111
|
renderOnMount: renderMenuOnMount,
|
|
104
112
|
rootCloseEvent: rootCloseEvent,
|
|
105
113
|
variant: menuVariant,
|
|
114
|
+
flip: flip,
|
|
106
115
|
children: children
|
|
107
116
|
})]
|
|
108
117
|
}));
|
package/esm/Offcanvas.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
+
import useBreakpoint from '@restart/hooks/useBreakpoint';
|
|
2
3
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
3
4
|
import * as React from 'react';
|
|
4
|
-
import { useCallback, useContext, useMemo, useRef } from 'react';
|
|
5
|
+
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
6
|
import BaseModal from '@restart/ui/Modal';
|
|
6
7
|
import Fade from './Fade';
|
|
7
8
|
import OffcanvasBody from './OffcanvasBody';
|
|
@@ -72,6 +73,13 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
72
73
|
const {
|
|
73
74
|
onToggle
|
|
74
75
|
} = useContext(NavbarContext) || {};
|
|
76
|
+
const [showOffcanvas, setShowOffcanvas] = useState(false);
|
|
77
|
+
const hideResponsiveOffcanvas = useBreakpoint(responsive || 'xs', 'up');
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
// Handles the case where screen is resized while the responsive
|
|
80
|
+
// offcanvas is shown. If `responsive` not provided, just use `show`.
|
|
81
|
+
setShowOffcanvas(responsive ? show && !hideResponsiveOffcanvas : show);
|
|
82
|
+
}, [show, responsive, hideResponsiveOffcanvas]);
|
|
75
83
|
const handleHide = useEventCallback(() => {
|
|
76
84
|
onToggle == null ? void 0 : onToggle();
|
|
77
85
|
onHide == null ? void 0 : onHide();
|
|
@@ -117,10 +125,10 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
117
125
|
});
|
|
118
126
|
|
|
119
127
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
120
|
-
children: [!
|
|
128
|
+
children: [!showOffcanvas && renderDialog({}), /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
121
129
|
value: modalContext,
|
|
122
130
|
children: /*#__PURE__*/_jsx(BaseModal, {
|
|
123
|
-
show:
|
|
131
|
+
show: showOffcanvas,
|
|
124
132
|
ref: ref,
|
|
125
133
|
backdrop: backdrop,
|
|
126
134
|
container: container,
|
package/esm/OverlayTrigger.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ declare namespace OverlayTrigger {
|
|
|
31
31
|
/**
|
|
32
32
|
* Specify which action or actions trigger Overlay visibility
|
|
33
33
|
*
|
|
34
|
+
* The `click` trigger ignores the configured `delay`.
|
|
35
|
+
*
|
|
34
36
|
* @type {'hover' | 'click' |'focus' | Array<'hover' | 'click' |'focus'>}
|
|
35
37
|
*/
|
|
36
38
|
trigger: PropTypes.Requireable<string | (string | null | undefined)[]>;
|
package/esm/SplitButton.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface SplitButtonProps extends Omit<DropdownProps, 'title'>, PropsFro
|
|
|
11
11
|
title: React.ReactNode;
|
|
12
12
|
toggleLabel?: string;
|
|
13
13
|
type?: ButtonType;
|
|
14
|
+
flip?: boolean;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* A convenience component for simple or general use split button dropdowns. Renders a
|
package/esm/SplitButton.js
CHANGED
|
@@ -59,6 +59,13 @@ const propTypes = {
|
|
|
59
59
|
*/
|
|
60
60
|
rootCloseEvent: PropTypes.string,
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to
|
|
64
|
+
* Popper.js's flip [docs](https://popper.js.org/docs/v2/modifiers/flip/).
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
flip: PropTypes.bool,
|
|
68
|
+
|
|
62
69
|
/** @ignore */
|
|
63
70
|
bsPrefix: PropTypes.string,
|
|
64
71
|
|
|
@@ -98,6 +105,7 @@ const SplitButton = /*#__PURE__*/React.forwardRef(({
|
|
|
98
105
|
menuRole,
|
|
99
106
|
renderMenuOnMount,
|
|
100
107
|
rootCloseEvent,
|
|
108
|
+
flip,
|
|
101
109
|
...props
|
|
102
110
|
}, ref) => /*#__PURE__*/_jsxs(Dropdown, {
|
|
103
111
|
ref: ref,
|
|
@@ -128,6 +136,7 @@ const SplitButton = /*#__PURE__*/React.forwardRef(({
|
|
|
128
136
|
role: menuRole,
|
|
129
137
|
renderOnMount: renderMenuOnMount,
|
|
130
138
|
rootCloseEvent: rootCloseEvent,
|
|
139
|
+
flip: flip,
|
|
131
140
|
children: children
|
|
132
141
|
})]
|
|
133
142
|
}));
|
package/esm/Tabs.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { TabsProps as BaseTabsProps } from '@restart/ui/Tabs';
|
|
4
|
+
import { NavProps } from './Nav';
|
|
4
5
|
import { TransitionType } from './helpers';
|
|
5
|
-
export interface TabsProps extends Omit<BaseTabsProps, 'transition'>, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'
|
|
6
|
-
variant?: 'tabs' | 'pills';
|
|
6
|
+
export interface TabsProps extends Omit<BaseTabsProps, 'transition'>, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'>, NavProps {
|
|
7
7
|
transition?: TransitionType;
|
|
8
8
|
}
|
|
9
9
|
declare const Tabs: {
|
|
@@ -61,6 +61,14 @@ declare const Tabs: {
|
|
|
61
61
|
* Unmount tabs (remove it from the DOM) when it is no longer visible
|
|
62
62
|
*/
|
|
63
63
|
unmountOnExit: PropTypes.Requireable<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* Have all `Tabs`s proportionately fill all available width.
|
|
66
|
+
*/
|
|
67
|
+
fill: PropTypes.Requireable<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* Have all `Tab`s evenly fill all available width.
|
|
70
|
+
*/
|
|
71
|
+
justify: PropTypes.Requireable<boolean>;
|
|
64
72
|
};
|
|
65
73
|
defaultProps: {
|
|
66
74
|
variant: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-bootstrap",
|
|
3
|
-
"version": "2.5.0-beta.
|
|
3
|
+
"version": "2.5.0-beta.1",
|
|
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.3.0",
|
|
41
41
|
"@types/react-transition-group": "^4.4.4",
|
|
42
42
|
"classnames": "^2.3.1",
|
|
43
43
|
"dom-helpers": "^5.2.1",
|