react-bootstrap 2.4.0 → 2.5.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/AccordionCollapse.d.ts +3 -0
- package/cjs/AccordionCollapse.js +3 -0
- package/cjs/CardImg.d.ts +1 -1
- package/cjs/Carousel.d.ts +1 -1
- package/cjs/CloseButton.d.ts +1 -1
- package/cjs/Col.js +2 -1
- package/cjs/Dropdown.d.ts +0 -1
- package/cjs/DropdownButton.d.ts +1 -0
- package/cjs/DropdownButton.js +9 -0
- package/cjs/Form.d.ts +1 -0
- package/cjs/FormCheck.d.ts +1 -0
- package/cjs/FormCheck.js +2 -1
- package/cjs/ListGroup.d.ts +1 -1
- package/cjs/Nav.d.ts +1 -1
- package/cjs/Navbar.d.ts +1 -1
- package/cjs/NavbarOffcanvas.js +4 -57
- package/cjs/Offcanvas.d.ts +2 -0
- package/cjs/Offcanvas.js +44 -32
- package/cjs/Overlay.d.ts +2 -7
- package/cjs/Overlay.js +18 -1
- package/cjs/OverlayTrigger.d.ts +2 -0
- package/cjs/Popover.d.ts +2 -2
- package/cjs/Row.js +2 -1
- package/cjs/SplitButton.d.ts +1 -0
- package/cjs/SplitButton.js +9 -0
- package/cjs/Stack.js +3 -1
- package/cjs/Table.d.ts +1 -1
- package/cjs/Table.js +1 -1
- package/cjs/Tabs.d.ts +10 -2
- package/cjs/ThemeProvider.d.ts +4 -1
- package/cjs/ThemeProvider.js +16 -3
- package/cjs/ToggleButtonGroup.js +1 -1
- package/cjs/Tooltip.d.ts +2 -2
- package/cjs/createUtilityClasses.d.ts +1 -1
- package/cjs/createUtilityClasses.js +2 -2
- package/cjs/types.d.ts +7 -0
- package/dist/react-bootstrap.js +594 -305
- package/dist/react-bootstrap.min.js +1 -1
- package/esm/AccordionCollapse.d.ts +3 -0
- package/esm/AccordionCollapse.js +4 -0
- package/esm/CardImg.d.ts +1 -1
- package/esm/Carousel.d.ts +1 -1
- package/esm/CloseButton.d.ts +1 -1
- package/esm/Col.js +3 -2
- package/esm/Dropdown.d.ts +0 -1
- package/esm/DropdownButton.d.ts +1 -0
- package/esm/DropdownButton.js +9 -0
- package/esm/Form.d.ts +1 -0
- package/esm/FormCheck.d.ts +1 -0
- package/esm/FormCheck.js +2 -1
- package/esm/ListGroup.d.ts +1 -1
- package/esm/Nav.d.ts +1 -1
- package/esm/Navbar.d.ts +1 -1
- package/esm/NavbarOffcanvas.js +4 -54
- package/esm/Offcanvas.d.ts +2 -0
- package/esm/Offcanvas.js +46 -33
- package/esm/Overlay.d.ts +2 -7
- package/esm/Overlay.js +15 -1
- package/esm/OverlayTrigger.d.ts +2 -0
- package/esm/Popover.d.ts +2 -2
- package/esm/Row.js +3 -2
- package/esm/SplitButton.d.ts +1 -0
- package/esm/SplitButton.js +9 -0
- package/esm/Stack.js +4 -2
- package/esm/Table.d.ts +1 -1
- package/esm/Table.js +1 -1
- package/esm/Tabs.d.ts +10 -2
- package/esm/ThemeProvider.d.ts +4 -1
- package/esm/ThemeProvider.js +12 -2
- package/esm/ToggleButtonGroup.js +1 -1
- package/esm/Tooltip.d.ts +2 -2
- package/esm/createUtilityClasses.d.ts +1 -1
- package/esm/createUtilityClasses.js +3 -3
- package/esm/types.d.ts +7 -0
- package/package.json +2 -2
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/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;
|
|
@@ -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
|
});
|
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
|
+
}
|