react-bootstrap 2.3.0 → 2.5.0-beta.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/Col.js +2 -1
- package/cjs/Form.d.ts +14 -13
- package/cjs/FormCheck.d.ts +1 -0
- package/cjs/FormCheck.js +2 -1
- package/cjs/Navbar.d.ts +1 -1
- package/cjs/Navbar.js +3 -2
- package/cjs/NavbarContext.d.ts +1 -0
- package/cjs/NavbarOffcanvas.d.ts +2 -1
- package/cjs/Offcanvas.d.ts +1 -0
- package/cjs/Offcanvas.js +32 -31
- package/cjs/Overlay.d.ts +2 -7
- package/cjs/Overlay.js +18 -1
- package/cjs/Popover.d.ts +2 -2
- package/cjs/Row.js +2 -1
- package/cjs/Stack.js +3 -1
- package/cjs/Table.d.ts +1 -1
- package/cjs/Table.js +1 -1
- package/cjs/ThemeProvider.d.ts +4 -1
- package/cjs/ThemeProvider.js +16 -3
- package/cjs/ToastContainer.d.ts +1 -0
- package/cjs/ToastContainer.js +2 -1
- package/cjs/ToggleButtonGroup.js +1 -1
- package/cjs/Tooltip.d.ts +2 -2
- package/cjs/TransitionWrapper.d.ts +7 -1
- package/cjs/createUtilityClasses.d.ts +1 -1
- package/cjs/createUtilityClasses.js +2 -2
- package/cjs/getTabTransitionComponent.js +3 -1
- package/cjs/types.d.ts +7 -0
- package/dist/react-bootstrap.js +182 -309
- package/dist/react-bootstrap.min.js +1 -1
- package/esm/Col.js +3 -2
- package/esm/Form.d.ts +14 -13
- package/esm/FormCheck.d.ts +1 -0
- package/esm/FormCheck.js +2 -1
- package/esm/Navbar.d.ts +1 -1
- package/esm/Navbar.js +3 -2
- package/esm/NavbarContext.d.ts +1 -0
- package/esm/NavbarOffcanvas.d.ts +2 -1
- package/esm/Offcanvas.d.ts +1 -0
- package/esm/Offcanvas.js +34 -31
- package/esm/Overlay.d.ts +2 -7
- package/esm/Overlay.js +15 -1
- package/esm/Popover.d.ts +2 -2
- package/esm/Row.js +3 -2
- package/esm/Stack.js +4 -2
- package/esm/Table.d.ts +1 -1
- package/esm/Table.js +1 -1
- package/esm/ThemeProvider.d.ts +4 -1
- package/esm/ThemeProvider.js +12 -2
- package/esm/ToastContainer.d.ts +1 -0
- package/esm/ToastContainer.js +2 -1
- package/esm/ToggleButtonGroup.js +1 -1
- package/esm/Tooltip.d.ts +2 -2
- package/esm/TransitionWrapper.d.ts +7 -1
- package/esm/createUtilityClasses.d.ts +1 -1
- package/esm/createUtilityClasses.js +3 -3
- package/esm/getTabTransitionComponent.js +2 -1
- package/esm/types.d.ts +7 -0
- package/package.json +1 -1
package/cjs/Col.js
CHANGED
|
@@ -26,6 +26,7 @@ function useCol({
|
|
|
26
26
|
}) {
|
|
27
27
|
bsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'col');
|
|
28
28
|
const breakpoints = (0, _ThemeProvider.useBootstrapBreakpoints)();
|
|
29
|
+
const minBreakpoint = (0, _ThemeProvider.useBootstrapMinBreakpoint)();
|
|
29
30
|
const spans = [];
|
|
30
31
|
const classes = [];
|
|
31
32
|
breakpoints.forEach(brkPoint => {
|
|
@@ -45,7 +46,7 @@ function useCol({
|
|
|
45
46
|
span = propValue;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
const infix = brkPoint !==
|
|
49
|
+
const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
|
49
50
|
if (span) spans.push(span === true ? `${bsPrefix}${infix}` : `${bsPrefix}${infix}-${span}`);
|
|
50
51
|
if (order != null) classes.push(`order${infix}-${order}`);
|
|
51
52
|
if (offset != null) classes.push(`offset${infix}-${offset}`);
|
package/cjs/Form.d.ts
CHANGED
|
@@ -72,9 +72,9 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
72
72
|
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
73
73
|
is?: string | undefined;
|
|
74
74
|
'aria-activedescendant'?: string | undefined;
|
|
75
|
-
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
|
75
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
76
76
|
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
77
|
-
'aria-busy'?: boolean | "true" | "false" | undefined;
|
|
77
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
78
78
|
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
79
79
|
'aria-colcount'?: number | undefined;
|
|
80
80
|
'aria-colindex'?: number | undefined;
|
|
@@ -83,36 +83,36 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
83
83
|
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
84
84
|
'aria-describedby'?: string | undefined;
|
|
85
85
|
'aria-details'?: string | undefined;
|
|
86
|
-
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
|
86
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
87
87
|
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
88
88
|
'aria-errormessage'?: string | undefined;
|
|
89
|
-
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
|
89
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
90
90
|
'aria-flowto'?: string | undefined;
|
|
91
|
-
'aria-grabbed'?: boolean | "true" | "false" | undefined;
|
|
91
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
92
92
|
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
93
|
-
'aria-hidden'?: boolean | "true" | "false" | undefined;
|
|
93
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
94
94
|
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
95
95
|
'aria-keyshortcuts'?: string | undefined;
|
|
96
96
|
'aria-label'?: string | undefined;
|
|
97
97
|
'aria-labelledby'?: string | undefined;
|
|
98
98
|
'aria-level'?: number | undefined;
|
|
99
99
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
100
|
-
'aria-modal'?: boolean | "true" | "false" | undefined;
|
|
101
|
-
'aria-multiline'?: boolean | "true" | "false" | undefined;
|
|
102
|
-
'aria-multiselectable'?: boolean | "true" | "false" | undefined;
|
|
100
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
101
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
102
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
103
103
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
104
104
|
'aria-owns'?: string | undefined;
|
|
105
105
|
'aria-placeholder'?: string | undefined;
|
|
106
106
|
'aria-posinset'?: number | undefined;
|
|
107
107
|
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
108
|
-
'aria-readonly'?: boolean | "true" | "false" | undefined;
|
|
108
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
109
109
|
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
110
|
-
'aria-required'?: boolean | "true" | "false" | undefined;
|
|
110
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
111
111
|
'aria-roledescription'?: string | undefined;
|
|
112
112
|
'aria-rowcount'?: number | undefined;
|
|
113
113
|
'aria-rowindex'?: number | undefined;
|
|
114
114
|
'aria-rowspan'?: number | undefined;
|
|
115
|
-
'aria-selected'?: boolean | "true" | "false" | undefined;
|
|
115
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
116
116
|
'aria-setsize'?: number | undefined;
|
|
117
117
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
118
118
|
'aria-valuemax'?: number | undefined;
|
|
@@ -291,13 +291,14 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
291
291
|
bsPrefix?: string | undefined;
|
|
292
292
|
height?: string | number | undefined;
|
|
293
293
|
width?: string | number | undefined;
|
|
294
|
+
reverse?: boolean | undefined;
|
|
294
295
|
size?: number | undefined;
|
|
295
296
|
multiple?: boolean | undefined;
|
|
296
297
|
as?: React.ElementType<any> | undefined;
|
|
297
298
|
autoComplete?: string | undefined;
|
|
298
299
|
alt?: string | undefined;
|
|
299
300
|
accept?: string | undefined;
|
|
300
|
-
capture?:
|
|
301
|
+
capture?: boolean | "user" | "environment" | undefined;
|
|
301
302
|
checked?: boolean | undefined;
|
|
302
303
|
maxLength?: number | undefined;
|
|
303
304
|
minLength?: number | undefined;
|
package/cjs/FormCheck.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
|
4
4
|
export declare type FormCheckType = 'checkbox' | 'radio' | 'switch';
|
|
5
5
|
export interface FormCheckProps extends BsPrefixProps, React.InputHTMLAttributes<HTMLInputElement> {
|
|
6
6
|
inline?: boolean;
|
|
7
|
+
reverse?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
label?: React.ReactNode;
|
|
9
10
|
type?: FormCheckType;
|
package/cjs/FormCheck.js
CHANGED
|
@@ -32,6 +32,7 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
|
|
|
32
32
|
bsPrefix,
|
|
33
33
|
bsSwitchPrefix,
|
|
34
34
|
inline = false,
|
|
35
|
+
reverse = false,
|
|
35
36
|
disabled = false,
|
|
36
37
|
isValid = false,
|
|
37
38
|
isInvalid = false,
|
|
@@ -69,7 +70,7 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
|
|
|
69
70
|
value: innerFormContext,
|
|
70
71
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
72
|
style: style,
|
|
72
|
-
className: (0, _classnames.default)(className, hasLabel && bsPrefix, inline && `${bsPrefix}-inline`, type === 'switch' && bsSwitchPrefix),
|
|
73
|
+
className: (0, _classnames.default)(className, hasLabel && bsPrefix, inline && `${bsPrefix}-inline`, reverse && `${bsPrefix}-reverse`, type === 'switch' && bsSwitchPrefix),
|
|
73
74
|
children: children || /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
74
75
|
children: [input, hasLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormCheckLabel.default, {
|
|
75
76
|
title: title,
|
package/cjs/Navbar.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface NavbarProps extends BsPrefixProps, Omit<React.HTMLAttributes<HT
|
|
|
15
15
|
declare const _default: BsPrefixRefForwardingComponent<"nav", NavbarProps> & {
|
|
16
16
|
Brand: BsPrefixRefForwardingComponent<"a", import("./NavbarBrand").NavbarBrandProps>;
|
|
17
17
|
Collapse: React.ForwardRefExoticComponent<import("./NavbarCollapse").NavbarCollapseProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
-
Offcanvas: React.ForwardRefExoticComponent<Pick<import("./
|
|
18
|
+
Offcanvas: React.ForwardRefExoticComponent<Pick<import("./NavbarOffcanvas").NavbarOffcanvasProps, keyof import("./Offcanvas").OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
|
|
19
19
|
Text: BsPrefixRefForwardingComponent<"span", unknown>;
|
|
20
20
|
Toggle: BsPrefixRefForwardingComponent<"button", import("./NavbarToggle").NavbarToggleProps>;
|
|
21
21
|
};
|
package/cjs/Navbar.js
CHANGED
|
@@ -80,8 +80,9 @@ const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
80
80
|
const navbarContext = (0, React.useMemo)(() => ({
|
|
81
81
|
onToggle: () => onToggle == null ? void 0 : onToggle(!expanded),
|
|
82
82
|
bsPrefix,
|
|
83
|
-
expanded: !!expanded
|
|
84
|
-
|
|
83
|
+
expanded: !!expanded,
|
|
84
|
+
expand
|
|
85
|
+
}), [bsPrefix, expanded, expand, onToggle]);
|
|
85
86
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NavbarContext.default.Provider, {
|
|
86
87
|
value: navbarContext,
|
|
87
88
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectableContext.default.Provider, {
|
package/cjs/NavbarContext.d.ts
CHANGED
package/cjs/NavbarOffcanvas.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OffcanvasProps } from './Offcanvas';
|
|
3
|
-
declare
|
|
3
|
+
export declare type NavbarOffcanvasProps = Omit<OffcanvasProps, 'show'>;
|
|
4
|
+
declare const NavbarOffcanvas: React.ForwardRefExoticComponent<Pick<NavbarOffcanvasProps, keyof OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
|
|
4
5
|
export default NavbarOffcanvas;
|
package/cjs/Offcanvas.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface OffcanvasProps extends Omit<BaseModalProps, 'role' | 'renderBac
|
|
|
7
7
|
backdropClassName?: string;
|
|
8
8
|
scroll?: boolean;
|
|
9
9
|
placement?: OffcanvasPlacement;
|
|
10
|
+
responsive?: 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | string;
|
|
10
11
|
}
|
|
11
12
|
declare const _default: BsPrefixRefForwardingComponent<"div", OffcanvasProps> & {
|
|
12
13
|
Body: BsPrefixRefForwardingComponent<"div", unknown>;
|
package/cjs/Offcanvas.js
CHANGED
|
@@ -64,6 +64,7 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
64
64
|
children,
|
|
65
65
|
'aria-labelledby': ariaLabelledby,
|
|
66
66
|
placement,
|
|
67
|
+
responsive,
|
|
67
68
|
|
|
68
69
|
/* BaseModal props */
|
|
69
70
|
show,
|
|
@@ -130,42 +131,42 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
130
131
|
className: (0, _classnames.default)(`${bsPrefix}-backdrop`, backdropClassName)
|
|
131
132
|
}), [backdropClassName, bsPrefix]);
|
|
132
133
|
|
|
133
|
-
const renderDialog = dialogProps => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
134
|
-
role: "dialog",
|
|
135
|
-
...dialogProps,
|
|
134
|
+
const renderDialog = dialogProps => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { ...dialogProps,
|
|
136
135
|
...props,
|
|
137
|
-
className: (0, _classnames.default)(className, bsPrefix, `${bsPrefix}-${placement}`),
|
|
136
|
+
className: (0, _classnames.default)(className, responsive ? `${bsPrefix}-${responsive}` : bsPrefix, `${bsPrefix}-${placement}`),
|
|
138
137
|
"aria-labelledby": ariaLabelledby,
|
|
139
138
|
children: children
|
|
140
139
|
});
|
|
141
140
|
|
|
142
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
141
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
142
|
+
children: [!show && renderDialog({}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalContext.default.Provider, {
|
|
143
|
+
value: modalContext,
|
|
144
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.default, {
|
|
145
|
+
show: show,
|
|
146
|
+
ref: ref,
|
|
147
|
+
backdrop: backdrop,
|
|
148
|
+
container: container,
|
|
149
|
+
keyboard: keyboard,
|
|
150
|
+
autoFocus: autoFocus,
|
|
151
|
+
enforceFocus: enforceFocus && !scroll,
|
|
152
|
+
restoreFocus: restoreFocus,
|
|
153
|
+
restoreFocusOptions: restoreFocusOptions,
|
|
154
|
+
onEscapeKeyDown: onEscapeKeyDown,
|
|
155
|
+
onShow: onShow,
|
|
156
|
+
onHide: handleHide,
|
|
157
|
+
onEnter: handleEnter,
|
|
158
|
+
onEntering: onEntering,
|
|
159
|
+
onEntered: onEntered,
|
|
160
|
+
onExit: onExit,
|
|
161
|
+
onExiting: onExiting,
|
|
162
|
+
onExited: handleExited,
|
|
163
|
+
manager: getModalManager(),
|
|
164
|
+
transition: DialogTransition,
|
|
165
|
+
backdropTransition: BackdropTransition,
|
|
166
|
+
renderBackdrop: renderBackdrop,
|
|
167
|
+
renderDialog: renderDialog
|
|
168
|
+
})
|
|
169
|
+
})]
|
|
169
170
|
});
|
|
170
171
|
});
|
|
171
172
|
Offcanvas.displayName = 'Offcanvas';
|
package/cjs/Overlay.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OverlayProps as BaseOverlayProps, OverlayArrowProps } from '@restart/ui/Overlay';
|
|
3
3
|
import { TransitionType } from './helpers';
|
|
4
|
-
import { Placement, RootCloseEvent } from './types';
|
|
4
|
+
import { Placement, PopperRef, RootCloseEvent } from './types';
|
|
5
5
|
export interface OverlayInjectedProps {
|
|
6
6
|
ref: React.RefCallback<HTMLElement>;
|
|
7
7
|
style: React.CSSProperties;
|
|
@@ -9,12 +9,7 @@ export interface OverlayInjectedProps {
|
|
|
9
9
|
arrowProps: Partial<OverlayArrowProps>;
|
|
10
10
|
show: boolean;
|
|
11
11
|
placement: Placement | undefined;
|
|
12
|
-
popper:
|
|
13
|
-
state: any;
|
|
14
|
-
outOfBoundaries: boolean;
|
|
15
|
-
placement: Placement | undefined;
|
|
16
|
-
scheduleUpdate?: () => void;
|
|
17
|
-
};
|
|
12
|
+
popper: PopperRef;
|
|
18
13
|
[prop: string]: any;
|
|
19
14
|
}
|
|
20
15
|
export declare type OverlayChildren = React.ReactElement<OverlayInjectedProps> | ((injected: OverlayInjectedProps) => React.ReactNode);
|
package/cjs/Overlay.js
CHANGED
|
@@ -11,6 +11,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
|
|
12
12
|
var _Overlay = _interopRequireDefault(require("@restart/ui/Overlay"));
|
|
13
13
|
|
|
14
|
+
var _useCallbackRef = _interopRequireDefault(require("@restart/hooks/useCallbackRef"));
|
|
15
|
+
|
|
16
|
+
var _useEventCallback = _interopRequireDefault(require("@restart/hooks/useEventCallback"));
|
|
17
|
+
|
|
18
|
+
var _useIsomorphicEffect = _interopRequireDefault(require("@restart/hooks/useIsomorphicEffect"));
|
|
19
|
+
|
|
14
20
|
var _useMergedRefs = _interopRequireDefault(require("@restart/hooks/useMergedRefs"));
|
|
15
21
|
|
|
16
22
|
var _useOverlayOffset = _interopRequireDefault(require("./useOverlayOffset"));
|
|
@@ -52,13 +58,24 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
52
58
|
...outerProps
|
|
53
59
|
}, outerRef) => {
|
|
54
60
|
const popperRef = (0, React.useRef)({});
|
|
61
|
+
const [firstRenderedState, setFirstRenderedState] = (0, _useCallbackRef.default)();
|
|
55
62
|
const [ref, modifiers] = (0, _useOverlayOffset.default)(outerProps.offset);
|
|
56
63
|
const mergedRef = (0, _useMergedRefs.default)(outerRef, ref);
|
|
57
64
|
const actualTransition = transition === true ? _Fade.default : transition || undefined;
|
|
65
|
+
const handleFirstUpdate = (0, _useEventCallback.default)(state => {
|
|
66
|
+
setFirstRenderedState(state);
|
|
67
|
+
popperConfig == null ? void 0 : popperConfig.onFirstUpdate == null ? void 0 : popperConfig.onFirstUpdate(state);
|
|
68
|
+
});
|
|
69
|
+
(0, _useIsomorphicEffect.default)(() => {
|
|
70
|
+
if (firstRenderedState) {
|
|
71
|
+
popperRef.current.scheduleUpdate == null ? void 0 : popperRef.current.scheduleUpdate();
|
|
72
|
+
}
|
|
73
|
+
}, [firstRenderedState]);
|
|
58
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Overlay.default, { ...outerProps,
|
|
59
75
|
ref: mergedRef,
|
|
60
76
|
popperConfig: { ...popperConfig,
|
|
61
|
-
modifiers: modifiers.concat(popperConfig.modifiers || [])
|
|
77
|
+
modifiers: modifiers.concat(popperConfig.modifiers || []),
|
|
78
|
+
onFirstUpdate: handleFirstUpdate
|
|
62
79
|
},
|
|
63
80
|
transition: actualTransition,
|
|
64
81
|
children: (overlayProps, {
|
package/cjs/Popover.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OverlayArrowProps } from '@restart/ui/Overlay';
|
|
3
|
-
import { Placement } from './types';
|
|
3
|
+
import { Placement, PopperRef } from './types';
|
|
4
4
|
import { BsPrefixProps } from './helpers';
|
|
5
5
|
export interface PopoverProps extends React.HTMLAttributes<HTMLDivElement>, BsPrefixProps {
|
|
6
6
|
placement?: Placement;
|
|
7
7
|
title?: string;
|
|
8
8
|
arrowProps?: Partial<OverlayArrowProps>;
|
|
9
9
|
body?: boolean;
|
|
10
|
-
popper?:
|
|
10
|
+
popper?: PopperRef;
|
|
11
11
|
show?: boolean;
|
|
12
12
|
}
|
|
13
13
|
declare const _default: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>> & {
|
package/cjs/Row.js
CHANGED
|
@@ -26,6 +26,7 @@ const Row = /*#__PURE__*/React.forwardRef(({
|
|
|
26
26
|
}, ref) => {
|
|
27
27
|
const decoratedBsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'row');
|
|
28
28
|
const breakpoints = (0, _ThemeProvider.useBootstrapBreakpoints)();
|
|
29
|
+
const minBreakpoint = (0, _ThemeProvider.useBootstrapMinBreakpoint)();
|
|
29
30
|
const sizePrefix = `${decoratedBsPrefix}-cols`;
|
|
30
31
|
const classes = [];
|
|
31
32
|
breakpoints.forEach(brkPoint => {
|
|
@@ -41,7 +42,7 @@ const Row = /*#__PURE__*/React.forwardRef(({
|
|
|
41
42
|
cols = propValue;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
const infix = brkPoint !==
|
|
45
|
+
const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
|
45
46
|
if (cols != null) classes.push(`${sizePrefix}${infix}-${cols}`);
|
|
46
47
|
});
|
|
47
48
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
package/cjs/Stack.js
CHANGED
|
@@ -29,11 +29,13 @@ const Stack = /*#__PURE__*/React.forwardRef(({
|
|
|
29
29
|
}, ref) => {
|
|
30
30
|
bsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, direction === 'horizontal' ? 'hstack' : 'vstack');
|
|
31
31
|
const breakpoints = (0, _ThemeProvider.useBootstrapBreakpoints)();
|
|
32
|
+
const minBreakpoint = (0, _ThemeProvider.useBootstrapMinBreakpoint)();
|
|
32
33
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, { ...props,
|
|
33
34
|
ref: ref,
|
|
34
35
|
className: (0, _classnames.default)(className, bsPrefix, ...(0, _createUtilityClasses.default)({
|
|
35
36
|
gap,
|
|
36
|
-
breakpoints
|
|
37
|
+
breakpoints,
|
|
38
|
+
minBreakpoint
|
|
37
39
|
}))
|
|
38
40
|
});
|
|
39
41
|
});
|
package/cjs/Table.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BsPrefixOnlyProps } from './helpers';
|
|
3
3
|
export interface TableProps extends BsPrefixOnlyProps, React.TableHTMLAttributes<HTMLTableElement> {
|
|
4
|
-
striped?: boolean;
|
|
4
|
+
striped?: boolean | string;
|
|
5
5
|
bordered?: boolean;
|
|
6
6
|
borderless?: boolean;
|
|
7
7
|
hover?: boolean;
|
package/cjs/Table.js
CHANGED
|
@@ -30,7 +30,7 @@ const Table = /*#__PURE__*/React.forwardRef(({
|
|
|
30
30
|
...props
|
|
31
31
|
}, ref) => {
|
|
32
32
|
const decoratedBsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'table');
|
|
33
|
-
const classes = (0, _classnames.default)(className, decoratedBsPrefix, variant && `${decoratedBsPrefix}-${variant}`, size && `${decoratedBsPrefix}-${size}`, striped && `${decoratedBsPrefix}
|
|
33
|
+
const classes = (0, _classnames.default)(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`);
|
|
34
34
|
const table = /*#__PURE__*/(0, _jsxRuntime.jsx)("table", { ...props,
|
|
35
35
|
className: classes,
|
|
36
36
|
ref: ref
|
package/cjs/ThemeProvider.d.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const DEFAULT_BREAKPOINTS: string[];
|
|
3
|
+
export declare const DEFAULT_MIN_BREAKPOINT = "xs";
|
|
3
4
|
export interface ThemeContextValue {
|
|
4
5
|
prefixes: Record<string, string>;
|
|
5
6
|
breakpoints: string[];
|
|
7
|
+
minBreakpoint?: string;
|
|
6
8
|
dir?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface ThemeProviderProps extends Partial<ThemeContextValue> {
|
|
9
11
|
children: React.ReactNode;
|
|
10
12
|
}
|
|
11
13
|
declare const Consumer: React.Consumer<ThemeContextValue>;
|
|
12
|
-
declare function ThemeProvider({ prefixes, breakpoints, dir, children, }: ThemeProviderProps): JSX.Element;
|
|
14
|
+
declare function ThemeProvider({ prefixes, breakpoints, minBreakpoint, dir, children, }: ThemeProviderProps): JSX.Element;
|
|
13
15
|
declare namespace ThemeProvider {
|
|
14
16
|
var propTypes: any;
|
|
15
17
|
}
|
|
16
18
|
export declare function useBootstrapPrefix(prefix: string | undefined, defaultPrefix: string): string;
|
|
17
19
|
export declare function useBootstrapBreakpoints(): string[];
|
|
20
|
+
export declare function useBootstrapMinBreakpoint(): string | undefined;
|
|
18
21
|
export declare function useIsRTL(): boolean;
|
|
19
22
|
declare function createBootstrapComponent(Component: any, opts: any): React.ForwardRefExoticComponent<{
|
|
20
23
|
bsPrefix?: string | undefined;
|
package/cjs/ThemeProvider.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.ThemeConsumer = exports.DEFAULT_BREAKPOINTS = void 0;
|
|
4
|
+
exports.ThemeConsumer = exports.DEFAULT_MIN_BREAKPOINT = exports.DEFAULT_BREAKPOINTS = void 0;
|
|
5
5
|
exports.createBootstrapComponent = createBootstrapComponent;
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.useBootstrapBreakpoints = useBootstrapBreakpoints;
|
|
8
|
+
exports.useBootstrapMinBreakpoint = useBootstrapMinBreakpoint;
|
|
8
9
|
exports.useBootstrapPrefix = useBootstrapPrefix;
|
|
9
10
|
exports.useIsRTL = useIsRTL;
|
|
10
11
|
|
|
@@ -18,9 +19,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
18
19
|
|
|
19
20
|
const DEFAULT_BREAKPOINTS = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
|
20
21
|
exports.DEFAULT_BREAKPOINTS = DEFAULT_BREAKPOINTS;
|
|
22
|
+
const DEFAULT_MIN_BREAKPOINT = 'xs';
|
|
23
|
+
exports.DEFAULT_MIN_BREAKPOINT = DEFAULT_MIN_BREAKPOINT;
|
|
21
24
|
const ThemeContext = /*#__PURE__*/React.createContext({
|
|
22
25
|
prefixes: {},
|
|
23
|
-
breakpoints: DEFAULT_BREAKPOINTS
|
|
26
|
+
breakpoints: DEFAULT_BREAKPOINTS,
|
|
27
|
+
minBreakpoint: DEFAULT_MIN_BREAKPOINT
|
|
24
28
|
});
|
|
25
29
|
const {
|
|
26
30
|
Consumer,
|
|
@@ -31,6 +35,7 @@ exports.ThemeConsumer = Consumer;
|
|
|
31
35
|
function ThemeProvider({
|
|
32
36
|
prefixes = {},
|
|
33
37
|
breakpoints = DEFAULT_BREAKPOINTS,
|
|
38
|
+
minBreakpoint = DEFAULT_MIN_BREAKPOINT,
|
|
34
39
|
dir,
|
|
35
40
|
children
|
|
36
41
|
}) {
|
|
@@ -38,8 +43,9 @@ function ThemeProvider({
|
|
|
38
43
|
prefixes: { ...prefixes
|
|
39
44
|
},
|
|
40
45
|
breakpoints,
|
|
46
|
+
minBreakpoint,
|
|
41
47
|
dir
|
|
42
|
-
}), [prefixes, breakpoints, dir]);
|
|
48
|
+
}), [prefixes, breakpoints, minBreakpoint, dir]);
|
|
43
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Provider, {
|
|
44
50
|
value: contextValue,
|
|
45
51
|
children: children
|
|
@@ -60,6 +66,13 @@ function useBootstrapBreakpoints() {
|
|
|
60
66
|
return breakpoints;
|
|
61
67
|
}
|
|
62
68
|
|
|
69
|
+
function useBootstrapMinBreakpoint() {
|
|
70
|
+
const {
|
|
71
|
+
minBreakpoint
|
|
72
|
+
} = (0, React.useContext)(ThemeContext);
|
|
73
|
+
return minBreakpoint;
|
|
74
|
+
}
|
|
75
|
+
|
|
63
76
|
function useIsRTL() {
|
|
64
77
|
const {
|
|
65
78
|
dir
|
package/cjs/ToastContainer.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
|
3
3
|
export declare 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
|
+
containerPosition?: string;
|
|
6
7
|
}
|
|
7
8
|
declare const ToastContainer: BsPrefixRefForwardingComponent<'div', ToastContainerProps>;
|
|
8
9
|
export default ToastContainer;
|
package/cjs/ToastContainer.js
CHANGED
|
@@ -31,6 +31,7 @@ const positionClasses = {
|
|
|
31
31
|
const ToastContainer = /*#__PURE__*/React.forwardRef(({
|
|
32
32
|
bsPrefix,
|
|
33
33
|
position,
|
|
34
|
+
containerPosition = 'absolute',
|
|
34
35
|
className,
|
|
35
36
|
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
36
37
|
as: Component = 'div',
|
|
@@ -40,7 +41,7 @@ const ToastContainer = /*#__PURE__*/React.forwardRef(({
|
|
|
40
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
41
42
|
ref: ref,
|
|
42
43
|
...props,
|
|
43
|
-
className: (0, _classnames.default)(bsPrefix, position && `position
|
|
44
|
+
className: (0, _classnames.default)(bsPrefix, position && [containerPosition ? `position-${containerPosition}` : null, positionClasses[position]], className)
|
|
44
45
|
});
|
|
45
46
|
});
|
|
46
47
|
ToastContainer.displayName = 'ToastContainer';
|
package/cjs/ToggleButtonGroup.js
CHANGED
|
@@ -52,7 +52,7 @@ const ToggleButtonGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
52
52
|
const isActive = values.indexOf(inputVal) !== -1;
|
|
53
53
|
|
|
54
54
|
if (type === 'radio') {
|
|
55
|
-
if (!isActive
|
|
55
|
+
if (!isActive) onChange(inputVal, event);
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
|
package/cjs/Tooltip.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OverlayArrowProps } from '@restart/ui/Overlay';
|
|
3
|
-
import { Placement } from './types';
|
|
3
|
+
import { Placement, PopperRef } from './types';
|
|
4
4
|
import { BsPrefixProps } from './helpers';
|
|
5
5
|
export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement>, BsPrefixProps {
|
|
6
6
|
placement?: Placement;
|
|
7
7
|
arrowProps?: Partial<OverlayArrowProps>;
|
|
8
8
|
show?: boolean;
|
|
9
|
-
popper?:
|
|
9
|
+
popper?: PopperRef;
|
|
10
10
|
}
|
|
11
11
|
declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export default Tooltip;
|
|
@@ -4,5 +4,11 @@ export declare type TransitionWrapperProps = TransitionProps & {
|
|
|
4
4
|
childRef?: React.Ref<unknown>;
|
|
5
5
|
children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
6
6
|
};
|
|
7
|
-
declare const TransitionWrapper: React.ForwardRefExoticComponent<Pick<
|
|
7
|
+
declare const TransitionWrapper: React.ForwardRefExoticComponent<(Pick<import("react-transition-group/Transition").TimeoutProps<undefined> & {
|
|
8
|
+
childRef?: React.Ref<unknown> | undefined;
|
|
9
|
+
children: React.ReactElement<any, string | React.JSXElementConstructor<any>> | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
10
|
+
}, keyof import("react-transition-group/Transition").TimeoutProps<undefined>> | Pick<import("react-transition-group/Transition").EndListenerProps<undefined> & {
|
|
11
|
+
childRef?: React.Ref<unknown> | undefined;
|
|
12
|
+
children: React.ReactElement<any, string | React.JSXElementConstructor<any>> | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
13
|
+
}, keyof import("react-transition-group/Transition").EndListenerProps<undefined>>) & React.RefAttributes<Transition<any>>>;
|
|
8
14
|
export default TransitionWrapper;
|
|
@@ -8,4 +8,4 @@ export declare type ResponsiveUtilityValue<T> = T | {
|
|
|
8
8
|
xxl?: T;
|
|
9
9
|
};
|
|
10
10
|
export declare function responsivePropType(propType: any): PropTypes.Requireable<any>;
|
|
11
|
-
export default function createUtilityClassName(utilityValues: Record<string, ResponsiveUtilityValue<unknown>>, breakpoints?: string[]): string[];
|
|
11
|
+
export default function createUtilityClassName(utilityValues: Record<string, ResponsiveUtilityValue<unknown>>, breakpoints?: string[], minBreakpoint?: string): string[];
|
|
@@ -21,7 +21,7 @@ function responsivePropType(propType) {
|
|
|
21
21
|
})]);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function createUtilityClassName(utilityValues, breakpoints = _ThemeProvider.DEFAULT_BREAKPOINTS) {
|
|
24
|
+
function createUtilityClassName(utilityValues, breakpoints = _ThemeProvider.DEFAULT_BREAKPOINTS, minBreakpoint = _ThemeProvider.DEFAULT_MIN_BREAKPOINT) {
|
|
25
25
|
const classes = [];
|
|
26
26
|
Object.entries(utilityValues).forEach(([utilName, utilValue]) => {
|
|
27
27
|
if (utilValue != null) {
|
|
@@ -30,7 +30,7 @@ function createUtilityClassName(utilityValues, breakpoints = _ThemeProvider.DEFA
|
|
|
30
30
|
const bpValue = utilValue[brkPoint];
|
|
31
31
|
|
|
32
32
|
if (bpValue != null) {
|
|
33
|
-
const infix = brkPoint !==
|
|
33
|
+
const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
|
34
34
|
classes.push(`${utilName}${infix}-${bpValue}`);
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -5,11 +5,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = getTabTransitionComponent;
|
|
7
7
|
|
|
8
|
+
var _NoopTransition = _interopRequireDefault(require("@restart/ui/NoopTransition"));
|
|
9
|
+
|
|
8
10
|
var _Fade = _interopRequireDefault(require("./Fade"));
|
|
9
11
|
|
|
10
12
|
function getTabTransitionComponent(transition) {
|
|
11
13
|
if (typeof transition === 'boolean') {
|
|
12
|
-
return transition ? _Fade.default :
|
|
14
|
+
return transition ? _Fade.default : _NoopTransition.default;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
return transition;
|
package/cjs/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { State } from '@restart/ui/usePopper';
|
|
2
3
|
export declare type Variant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
|
|
3
4
|
export declare type ButtonVariant = Variant | 'link' | 'outline-primary' | 'outline-secondary' | 'outline-success' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-dark' | 'outline-light';
|
|
4
5
|
export declare type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted';
|
|
@@ -19,3 +20,9 @@ export declare type AlignType = AlignDirection | ResponsiveAlignProp;
|
|
|
19
20
|
export declare const alignPropType: PropTypes.Requireable<object | AlignDirection>;
|
|
20
21
|
export declare type RootCloseEvent = 'click' | 'mousedown';
|
|
21
22
|
export declare type GapValue = 0 | 1 | 2 | 3 | 4 | 5;
|
|
23
|
+
export interface PopperRef {
|
|
24
|
+
state: State | undefined;
|
|
25
|
+
outOfBoundaries: boolean;
|
|
26
|
+
placement: Placement | undefined;
|
|
27
|
+
scheduleUpdate?: () => void;
|
|
28
|
+
}
|