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/esm/Col.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useBootstrapPrefix, useBootstrapBreakpoints } from './ThemeProvider';
|
|
3
|
+
import { useBootstrapPrefix, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
export function useCol({
|
|
6
6
|
as,
|
|
@@ -10,6 +10,7 @@ export function useCol({
|
|
|
10
10
|
}) {
|
|
11
11
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'col');
|
|
12
12
|
const breakpoints = useBootstrapBreakpoints();
|
|
13
|
+
const minBreakpoint = useBootstrapMinBreakpoint();
|
|
13
14
|
const spans = [];
|
|
14
15
|
const classes = [];
|
|
15
16
|
breakpoints.forEach(brkPoint => {
|
|
@@ -29,7 +30,7 @@ export function useCol({
|
|
|
29
30
|
span = propValue;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
const infix = brkPoint !==
|
|
33
|
+
const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
|
33
34
|
if (span) spans.push(span === true ? `${bsPrefix}${infix}` : `${bsPrefix}${infix}-${span}`);
|
|
34
35
|
if (order != null) classes.push(`order${infix}-${order}`);
|
|
35
36
|
if (offset != null) classes.push(`offset${infix}-${offset}`);
|
package/esm/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/esm/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/esm/FormCheck.js
CHANGED
|
@@ -15,6 +15,7 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
|
|
|
15
15
|
bsPrefix,
|
|
16
16
|
bsSwitchPrefix,
|
|
17
17
|
inline = false,
|
|
18
|
+
reverse = false,
|
|
18
19
|
disabled = false,
|
|
19
20
|
isValid = false,
|
|
20
21
|
isInvalid = false,
|
|
@@ -54,7 +55,7 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
|
|
|
54
55
|
value: innerFormContext,
|
|
55
56
|
children: /*#__PURE__*/_jsx("div", {
|
|
56
57
|
style: style,
|
|
57
|
-
className: classNames(className, hasLabel && bsPrefix, inline && `${bsPrefix}-inline`, type === 'switch' && bsSwitchPrefix),
|
|
58
|
+
className: classNames(className, hasLabel && bsPrefix, inline && `${bsPrefix}-inline`, reverse && `${bsPrefix}-reverse`, type === 'switch' && bsSwitchPrefix),
|
|
58
59
|
children: children || /*#__PURE__*/_jsxs(_Fragment, {
|
|
59
60
|
children: [input, hasLabel && /*#__PURE__*/_jsx(FormCheckLabel, {
|
|
60
61
|
title: title,
|
package/esm/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/esm/Navbar.js
CHANGED
|
@@ -58,8 +58,9 @@ const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
58
58
|
const navbarContext = useMemo(() => ({
|
|
59
59
|
onToggle: () => onToggle == null ? void 0 : onToggle(!expanded),
|
|
60
60
|
bsPrefix,
|
|
61
|
-
expanded: !!expanded
|
|
62
|
-
|
|
61
|
+
expanded: !!expanded,
|
|
62
|
+
expand
|
|
63
|
+
}), [bsPrefix, expanded, expand, onToggle]);
|
|
63
64
|
return /*#__PURE__*/_jsx(NavbarContext.Provider, {
|
|
64
65
|
value: navbarContext,
|
|
65
66
|
children: /*#__PURE__*/_jsx(SelectableContext.Provider, {
|
package/esm/NavbarContext.d.ts
CHANGED
package/esm/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/esm/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/esm/Offcanvas.js
CHANGED
|
@@ -13,6 +13,8 @@ import OffcanvasTitle from './OffcanvasTitle';
|
|
|
13
13
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
14
14
|
import BootstrapModalManager, { getSharedManager } from './BootstrapModalManager';
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
18
|
const defaultProps = {
|
|
17
19
|
show: false,
|
|
18
20
|
backdrop: true,
|
|
@@ -40,6 +42,7 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
40
42
|
children,
|
|
41
43
|
'aria-labelledby': ariaLabelledby,
|
|
42
44
|
placement,
|
|
45
|
+
responsive,
|
|
43
46
|
|
|
44
47
|
/* BaseModal props */
|
|
45
48
|
show,
|
|
@@ -106,42 +109,42 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
106
109
|
className: classNames(`${bsPrefix}-backdrop`, backdropClassName)
|
|
107
110
|
}), [backdropClassName, bsPrefix]);
|
|
108
111
|
|
|
109
|
-
const renderDialog = dialogProps => /*#__PURE__*/_jsx("div", {
|
|
110
|
-
role: "dialog",
|
|
111
|
-
...dialogProps,
|
|
112
|
+
const renderDialog = dialogProps => /*#__PURE__*/_jsx("div", { ...dialogProps,
|
|
112
113
|
...props,
|
|
113
|
-
className: classNames(className, bsPrefix, `${bsPrefix}-${placement}`),
|
|
114
|
+
className: classNames(className, responsive ? `${bsPrefix}-${responsive}` : bsPrefix, `${bsPrefix}-${placement}`),
|
|
114
115
|
"aria-labelledby": ariaLabelledby,
|
|
115
116
|
children: children
|
|
116
117
|
});
|
|
117
118
|
|
|
118
|
-
return /*#__PURE__*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
119
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
120
|
+
children: [!show && renderDialog({}), /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
121
|
+
value: modalContext,
|
|
122
|
+
children: /*#__PURE__*/_jsx(BaseModal, {
|
|
123
|
+
show: show,
|
|
124
|
+
ref: ref,
|
|
125
|
+
backdrop: backdrop,
|
|
126
|
+
container: container,
|
|
127
|
+
keyboard: keyboard,
|
|
128
|
+
autoFocus: autoFocus,
|
|
129
|
+
enforceFocus: enforceFocus && !scroll,
|
|
130
|
+
restoreFocus: restoreFocus,
|
|
131
|
+
restoreFocusOptions: restoreFocusOptions,
|
|
132
|
+
onEscapeKeyDown: onEscapeKeyDown,
|
|
133
|
+
onShow: onShow,
|
|
134
|
+
onHide: handleHide,
|
|
135
|
+
onEnter: handleEnter,
|
|
136
|
+
onEntering: onEntering,
|
|
137
|
+
onEntered: onEntered,
|
|
138
|
+
onExit: onExit,
|
|
139
|
+
onExiting: onExiting,
|
|
140
|
+
onExited: handleExited,
|
|
141
|
+
manager: getModalManager(),
|
|
142
|
+
transition: DialogTransition,
|
|
143
|
+
backdropTransition: BackdropTransition,
|
|
144
|
+
renderBackdrop: renderBackdrop,
|
|
145
|
+
renderDialog: renderDialog
|
|
146
|
+
})
|
|
147
|
+
})]
|
|
145
148
|
});
|
|
146
149
|
});
|
|
147
150
|
Offcanvas.displayName = 'Offcanvas';
|
package/esm/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/esm/Overlay.js
CHANGED
|
@@ -2,6 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { useRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import BaseOverlay from '@restart/ui/Overlay';
|
|
5
|
+
import useCallbackRef from '@restart/hooks/useCallbackRef';
|
|
6
|
+
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
7
|
+
import useIsomorphicEffect from '@restart/hooks/useIsomorphicEffect';
|
|
5
8
|
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
6
9
|
import useOverlayOffset from './useOverlayOffset';
|
|
7
10
|
import Fade from './Fade';
|
|
@@ -34,13 +37,24 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
34
37
|
...outerProps
|
|
35
38
|
}, outerRef) => {
|
|
36
39
|
const popperRef = useRef({});
|
|
40
|
+
const [firstRenderedState, setFirstRenderedState] = useCallbackRef();
|
|
37
41
|
const [ref, modifiers] = useOverlayOffset(outerProps.offset);
|
|
38
42
|
const mergedRef = useMergedRefs(outerRef, ref);
|
|
39
43
|
const actualTransition = transition === true ? Fade : transition || undefined;
|
|
44
|
+
const handleFirstUpdate = useEventCallback(state => {
|
|
45
|
+
setFirstRenderedState(state);
|
|
46
|
+
popperConfig == null ? void 0 : popperConfig.onFirstUpdate == null ? void 0 : popperConfig.onFirstUpdate(state);
|
|
47
|
+
});
|
|
48
|
+
useIsomorphicEffect(() => {
|
|
49
|
+
if (firstRenderedState) {
|
|
50
|
+
popperRef.current.scheduleUpdate == null ? void 0 : popperRef.current.scheduleUpdate();
|
|
51
|
+
}
|
|
52
|
+
}, [firstRenderedState]);
|
|
40
53
|
return /*#__PURE__*/_jsx(BaseOverlay, { ...outerProps,
|
|
41
54
|
ref: mergedRef,
|
|
42
55
|
popperConfig: { ...popperConfig,
|
|
43
|
-
modifiers: modifiers.concat(popperConfig.modifiers || [])
|
|
56
|
+
modifiers: modifiers.concat(popperConfig.modifiers || []),
|
|
57
|
+
onFirstUpdate: handleFirstUpdate
|
|
44
58
|
},
|
|
45
59
|
transition: actualTransition,
|
|
46
60
|
children: (overlayProps, {
|
package/esm/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/esm/Row.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useBootstrapPrefix, useBootstrapBreakpoints } from './ThemeProvider';
|
|
3
|
+
import { useBootstrapPrefix, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
const Row = /*#__PURE__*/React.forwardRef(({
|
|
6
6
|
bsPrefix,
|
|
@@ -11,6 +11,7 @@ const Row = /*#__PURE__*/React.forwardRef(({
|
|
|
11
11
|
}, ref) => {
|
|
12
12
|
const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'row');
|
|
13
13
|
const breakpoints = useBootstrapBreakpoints();
|
|
14
|
+
const minBreakpoint = useBootstrapMinBreakpoint();
|
|
14
15
|
const sizePrefix = `${decoratedBsPrefix}-cols`;
|
|
15
16
|
const classes = [];
|
|
16
17
|
breakpoints.forEach(brkPoint => {
|
|
@@ -26,7 +27,7 @@ const Row = /*#__PURE__*/React.forwardRef(({
|
|
|
26
27
|
cols = propValue;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
const infix = brkPoint !==
|
|
30
|
+
const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
|
30
31
|
if (cols != null) classes.push(`${sizePrefix}${infix}-${cols}`);
|
|
31
32
|
});
|
|
32
33
|
return /*#__PURE__*/_jsx(Component, {
|
package/esm/Stack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useBootstrapPrefix, useBootstrapBreakpoints } from './ThemeProvider';
|
|
3
|
+
import { useBootstrapPrefix, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';
|
|
4
4
|
import createUtilityClassName, { responsivePropType } from './createUtilityClasses';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
const Stack = /*#__PURE__*/React.forwardRef(({
|
|
@@ -13,11 +13,13 @@ const Stack = /*#__PURE__*/React.forwardRef(({
|
|
|
13
13
|
}, ref) => {
|
|
14
14
|
bsPrefix = useBootstrapPrefix(bsPrefix, direction === 'horizontal' ? 'hstack' : 'vstack');
|
|
15
15
|
const breakpoints = useBootstrapBreakpoints();
|
|
16
|
+
const minBreakpoint = useBootstrapMinBreakpoint();
|
|
16
17
|
return /*#__PURE__*/_jsx(Component, { ...props,
|
|
17
18
|
ref: ref,
|
|
18
19
|
className: classNames(className, bsPrefix, ...createUtilityClassName({
|
|
19
20
|
gap,
|
|
20
|
-
breakpoints
|
|
21
|
+
breakpoints,
|
|
22
|
+
minBreakpoint
|
|
21
23
|
}))
|
|
22
24
|
});
|
|
23
25
|
});
|
package/esm/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/esm/Table.js
CHANGED
|
@@ -15,7 +15,7 @@ const Table = /*#__PURE__*/React.forwardRef(({
|
|
|
15
15
|
...props
|
|
16
16
|
}, ref) => {
|
|
17
17
|
const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'table');
|
|
18
|
-
const classes = classNames(className, decoratedBsPrefix, variant && `${decoratedBsPrefix}-${variant}`, size && `${decoratedBsPrefix}-${size}`, striped && `${decoratedBsPrefix}
|
|
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
19
|
|
|
20
20
|
const table = /*#__PURE__*/_jsx("table", { ...props,
|
|
21
21
|
className: classes,
|
package/esm/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/esm/ThemeProvider.js
CHANGED
|
@@ -2,9 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import { useContext, useMemo } from 'react';
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
export const DEFAULT_BREAKPOINTS = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
|
5
|
+
export const DEFAULT_MIN_BREAKPOINT = 'xs';
|
|
5
6
|
const ThemeContext = /*#__PURE__*/React.createContext({
|
|
6
7
|
prefixes: {},
|
|
7
|
-
breakpoints: DEFAULT_BREAKPOINTS
|
|
8
|
+
breakpoints: DEFAULT_BREAKPOINTS,
|
|
9
|
+
minBreakpoint: DEFAULT_MIN_BREAKPOINT
|
|
8
10
|
});
|
|
9
11
|
const {
|
|
10
12
|
Consumer,
|
|
@@ -14,6 +16,7 @@ const {
|
|
|
14
16
|
function ThemeProvider({
|
|
15
17
|
prefixes = {},
|
|
16
18
|
breakpoints = DEFAULT_BREAKPOINTS,
|
|
19
|
+
minBreakpoint = DEFAULT_MIN_BREAKPOINT,
|
|
17
20
|
dir,
|
|
18
21
|
children
|
|
19
22
|
}) {
|
|
@@ -21,8 +24,9 @@ function ThemeProvider({
|
|
|
21
24
|
prefixes: { ...prefixes
|
|
22
25
|
},
|
|
23
26
|
breakpoints,
|
|
27
|
+
minBreakpoint,
|
|
24
28
|
dir
|
|
25
|
-
}), [prefixes, breakpoints, dir]);
|
|
29
|
+
}), [prefixes, breakpoints, minBreakpoint, dir]);
|
|
26
30
|
return /*#__PURE__*/_jsx(Provider, {
|
|
27
31
|
value: contextValue,
|
|
28
32
|
children: children
|
|
@@ -41,6 +45,12 @@ export function useBootstrapBreakpoints() {
|
|
|
41
45
|
} = useContext(ThemeContext);
|
|
42
46
|
return breakpoints;
|
|
43
47
|
}
|
|
48
|
+
export function useBootstrapMinBreakpoint() {
|
|
49
|
+
const {
|
|
50
|
+
minBreakpoint
|
|
51
|
+
} = useContext(ThemeContext);
|
|
52
|
+
return minBreakpoint;
|
|
53
|
+
}
|
|
44
54
|
export function useIsRTL() {
|
|
45
55
|
const {
|
|
46
56
|
dir
|
package/esm/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/esm/ToastContainer.js
CHANGED
|
@@ -16,6 +16,7 @@ const positionClasses = {
|
|
|
16
16
|
const ToastContainer = /*#__PURE__*/React.forwardRef(({
|
|
17
17
|
bsPrefix,
|
|
18
18
|
position,
|
|
19
|
+
containerPosition = 'absolute',
|
|
19
20
|
className,
|
|
20
21
|
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
21
22
|
as: Component = 'div',
|
|
@@ -25,7 +26,7 @@ const ToastContainer = /*#__PURE__*/React.forwardRef(({
|
|
|
25
26
|
return /*#__PURE__*/_jsx(Component, {
|
|
26
27
|
ref: ref,
|
|
27
28
|
...props,
|
|
28
|
-
className: classNames(bsPrefix, position && `position
|
|
29
|
+
className: classNames(bsPrefix, position && [containerPosition ? `position-${containerPosition}` : null, positionClasses[position]], className)
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
32
|
ToastContainer.displayName = 'ToastContainer';
|
package/esm/ToggleButtonGroup.js
CHANGED
|
@@ -33,7 +33,7 @@ const ToggleButtonGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
33
33
|
const isActive = values.indexOf(inputVal) !== -1;
|
|
34
34
|
|
|
35
35
|
if (type === 'radio') {
|
|
36
|
-
if (!isActive
|
|
36
|
+
if (!isActive) onChange(inputVal, event);
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
|
package/esm/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[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { DEFAULT_BREAKPOINTS } from './ThemeProvider';
|
|
2
|
+
import { DEFAULT_BREAKPOINTS, DEFAULT_MIN_BREAKPOINT } from './ThemeProvider';
|
|
3
3
|
export function responsivePropType(propType) {
|
|
4
4
|
return PropTypes.oneOfType([propType, PropTypes.shape({
|
|
5
5
|
xs: propType,
|
|
@@ -10,7 +10,7 @@ export function responsivePropType(propType) {
|
|
|
10
10
|
xxl: propType
|
|
11
11
|
})]);
|
|
12
12
|
}
|
|
13
|
-
export default function createUtilityClassName(utilityValues, breakpoints = DEFAULT_BREAKPOINTS) {
|
|
13
|
+
export default function createUtilityClassName(utilityValues, breakpoints = DEFAULT_BREAKPOINTS, minBreakpoint = DEFAULT_MIN_BREAKPOINT) {
|
|
14
14
|
const classes = [];
|
|
15
15
|
Object.entries(utilityValues).forEach(([utilName, utilValue]) => {
|
|
16
16
|
if (utilValue != null) {
|
|
@@ -19,7 +19,7 @@ export default function createUtilityClassName(utilityValues, breakpoints = DEFA
|
|
|
19
19
|
const bpValue = utilValue[brkPoint];
|
|
20
20
|
|
|
21
21
|
if (bpValue != null) {
|
|
22
|
-
const infix = brkPoint !==
|
|
22
|
+
const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
|
23
23
|
classes.push(`${utilName}${infix}-${bpValue}`);
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import NoopTransition from '@restart/ui/NoopTransition';
|
|
1
2
|
import Fade from './Fade';
|
|
2
3
|
export default function getTabTransitionComponent(transition) {
|
|
3
4
|
if (typeof transition === 'boolean') {
|
|
4
|
-
return transition ? Fade :
|
|
5
|
+
return transition ? Fade : NoopTransition;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
return transition;
|
package/esm/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
|
+
}
|