react-bootstrap 3.0.0-beta.5 → 3.0.0-beta.7
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/CHANGELOG.md +49 -0
- package/README.md +5 -6
- package/cjs/AbstractModalHeader.js +2 -1
- package/cjs/Accordion.d.ts +1 -1
- package/cjs/Accordion.js +2 -1
- package/cjs/AccordionBody.js +2 -1
- package/cjs/AccordionButton.d.ts +1 -1
- package/cjs/AccordionButton.js +2 -1
- package/cjs/AccordionCollapse.js +2 -1
- package/cjs/AccordionContext.d.ts +3 -3
- package/cjs/AccordionContext.js +2 -1
- package/cjs/AccordionHeader.js +2 -1
- package/cjs/AccordionItem.js +2 -1
- package/cjs/AccordionItemContext.js +2 -1
- package/cjs/Alert.js +2 -1
- package/cjs/AlertHeading.js +2 -1
- package/cjs/AlertLink.js +2 -1
- package/cjs/Badge.d.ts +1 -7
- package/cjs/Badge.js +3 -3
- package/cjs/Breadcrumb.js +2 -1
- package/cjs/BreadcrumbItem.js +2 -1
- package/cjs/Button.js +2 -1
- package/cjs/ButtonGroup.js +2 -1
- package/cjs/ButtonToolbar.js +2 -1
- package/cjs/Card.d.ts +1 -7
- package/cjs/Card.js +3 -3
- package/cjs/CardBody.js +2 -1
- package/cjs/CardFooter.js +2 -1
- package/cjs/CardGroup.js +2 -1
- package/cjs/CardHeader.js +2 -1
- package/cjs/CardHeaderContext.js +2 -1
- package/cjs/CardImg.d.ts +2 -1
- package/cjs/CardImg.js +2 -1
- package/cjs/CardImgOverlay.js +2 -1
- package/cjs/CardLink.js +2 -1
- package/cjs/CardSubtitle.js +2 -1
- package/cjs/CardText.js +2 -1
- package/cjs/CardTitle.js +2 -1
- package/cjs/Carousel.d.ts +2 -1
- package/cjs/Carousel.js +3 -2
- package/cjs/CarouselCaption.js +2 -1
- package/cjs/CarouselItem.js +2 -1
- package/cjs/CloseButton.d.ts +2 -1
- package/cjs/CloseButton.js +2 -1
- package/cjs/Col.js +2 -1
- package/cjs/Collapse.js +2 -1
- package/cjs/Container.d.ts +2 -1
- package/cjs/Container.js +2 -1
- package/cjs/Dropdown.js +2 -1
- package/cjs/DropdownButton.js +2 -1
- package/cjs/DropdownContext.js +2 -1
- package/cjs/DropdownDivider.js +2 -1
- package/cjs/DropdownHeader.js +2 -1
- package/cjs/DropdownItem.js +2 -1
- package/cjs/DropdownItemText.js +2 -1
- package/cjs/DropdownMenu.d.ts +2 -1
- package/cjs/DropdownMenu.js +4 -3
- package/cjs/DropdownToggle.d.ts +1 -6
- package/cjs/DropdownToggle.js +2 -1
- package/cjs/ElementChildren.js +2 -1
- package/cjs/Fade.js +2 -1
- package/cjs/Feedback.js +2 -1
- package/cjs/Figure.js +2 -1
- package/cjs/FigureCaption.js +2 -1
- package/cjs/FigureImage.js +2 -1
- package/cjs/FloatingLabel.js +2 -1
- package/cjs/Form.d.ts +27 -27
- package/cjs/Form.js +2 -1
- package/cjs/FormCheck.js +2 -1
- package/cjs/FormCheckInput.js +2 -1
- package/cjs/FormCheckLabel.js +2 -1
- package/cjs/FormContext.js +2 -1
- package/cjs/FormControl.js +4 -3
- package/cjs/FormFloating.js +2 -1
- package/cjs/FormGroup.js +2 -1
- package/cjs/FormLabel.js +4 -3
- package/cjs/FormRange.js +2 -1
- package/cjs/FormSelect.js +2 -1
- package/cjs/FormText.js +2 -1
- package/cjs/Image.js +2 -1
- package/cjs/InputGroup.d.ts +2 -2
- package/cjs/InputGroup.js +2 -1
- package/cjs/InputGroupContext.js +2 -1
- package/cjs/InputGroupText.js +2 -1
- package/cjs/ListGroup.d.ts +3 -3
- package/cjs/ListGroup.js +4 -3
- package/cjs/ListGroupItem.js +4 -3
- package/cjs/Modal.d.ts +2 -2
- package/cjs/Modal.js +24 -9
- package/cjs/ModalBody.js +2 -1
- package/cjs/ModalContext.js +2 -1
- package/cjs/ModalDialog.d.ts +2 -1
- package/cjs/ModalDialog.js +2 -1
- package/cjs/ModalFooter.js +2 -1
- package/cjs/ModalHeader.js +2 -1
- package/cjs/ModalTitle.js +2 -1
- package/cjs/Nav.d.ts +2 -2
- package/cjs/Nav.js +2 -1
- package/cjs/NavContext.js +2 -1
- package/cjs/NavDropdown.d.ts +4 -0
- package/cjs/NavDropdown.js +4 -1
- package/cjs/NavItem.js +2 -1
- package/cjs/NavLink.js +2 -1
- package/cjs/Navbar.d.ts +4 -3
- package/cjs/Navbar.js +3 -2
- package/cjs/NavbarBrand.js +2 -1
- package/cjs/NavbarCollapse.js +2 -1
- package/cjs/NavbarContext.d.ts +2 -1
- package/cjs/NavbarContext.js +2 -1
- package/cjs/NavbarOffcanvas.js +2 -1
- package/cjs/NavbarText.js +2 -1
- package/cjs/NavbarToggle.js +2 -1
- package/cjs/Offcanvas.d.ts +2 -2
- package/cjs/Offcanvas.js +2 -1
- package/cjs/OffcanvasBody.js +2 -1
- package/cjs/OffcanvasHeader.js +2 -1
- package/cjs/OffcanvasTitle.js +2 -1
- package/cjs/OffcanvasToggling.js +2 -1
- package/cjs/Overlay.js +10 -1
- package/cjs/OverlayTrigger.js +4 -3
- package/cjs/PageItem.js +2 -1
- package/cjs/Pagination.js +2 -1
- package/cjs/Placeholder.js +2 -1
- package/cjs/PlaceholderButton.js +2 -1
- package/cjs/Popover.d.ts +1 -15
- package/cjs/Popover.js +2 -1
- package/cjs/PopoverBody.js +2 -1
- package/cjs/PopoverHeader.js +2 -1
- package/cjs/ProgressBar.d.ts +2 -5
- package/cjs/ProgressBar.js +45 -70
- package/cjs/Ratio.d.ts +2 -1
- package/cjs/Ratio.js +2 -1
- package/cjs/Row.js +2 -1
- package/cjs/Spinner.js +2 -1
- package/cjs/SplitButton.js +2 -1
- package/cjs/Stack.js +2 -1
- package/cjs/Switch.js +2 -1
- package/cjs/Tab.d.ts +1 -1
- package/cjs/TabContainer.d.ts +1 -1
- package/cjs/TabContent.js +2 -1
- package/cjs/TabPane.js +2 -1
- package/cjs/Table.js +2 -1
- package/cjs/Tabs.js +2 -1
- package/cjs/ThemeProvider.d.ts +1 -1
- package/cjs/ThemeProvider.js +2 -1
- package/cjs/Toast.js +2 -1
- package/cjs/ToastBody.js +2 -1
- package/cjs/ToastContainer.js +2 -1
- package/cjs/ToastContext.d.ts +1 -1
- package/cjs/ToastContext.js +2 -1
- package/cjs/ToastFade.js +2 -1
- package/cjs/ToastHeader.js +2 -1
- package/cjs/ToggleButton.js +3 -1
- package/cjs/ToggleButtonGroup.js +2 -1
- package/cjs/Tooltip.d.ts +1 -15
- package/cjs/Tooltip.js +2 -1
- package/cjs/TransitionWrapper.js +2 -1
- package/cjs/createWithBsPrefix.js +2 -1
- package/cjs/divWithClassName.js +2 -1
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +4 -2
- package/cjs/internal/transitionEnd.d.ts +2 -0
- package/cjs/internal/transitionEnd.js +38 -0
- package/cjs/internal/warning.d.ts +2 -0
- package/cjs/internal/warning.js +37 -0
- package/cjs/transitionEndListener.js +1 -1
- package/cjs/types.d.ts +6 -9
- package/cjs/useCol.d.ts +1 -1
- package/dist/react-bootstrap.js +11028 -0
- package/dist/react-bootstrap.min.js +2 -0
- package/dist/react-bootstrap.min.js.LICENSE.txt +9 -0
- package/lib/Accordion.d.ts +1 -1
- package/lib/AccordionButton.d.ts +1 -1
- package/lib/AccordionContext.d.ts +3 -3
- package/lib/Badge.d.ts +1 -7
- package/lib/Badge.js +1 -2
- package/lib/Card.d.ts +1 -7
- package/lib/Card.js +1 -2
- package/lib/CardImg.d.ts +2 -1
- package/lib/Carousel.d.ts +2 -1
- package/lib/Carousel.js +1 -1
- package/lib/CloseButton.d.ts +2 -1
- package/lib/Container.d.ts +2 -1
- package/lib/DropdownMenu.d.ts +2 -1
- package/lib/DropdownMenu.js +2 -2
- package/lib/DropdownToggle.d.ts +1 -6
- package/lib/Form.d.ts +27 -27
- package/lib/FormControl.js +2 -2
- package/lib/FormLabel.js +2 -2
- package/lib/InputGroup.d.ts +2 -2
- package/lib/ListGroup.d.ts +3 -3
- package/lib/ListGroup.js +2 -2
- package/lib/ListGroupItem.js +2 -2
- package/lib/Modal.d.ts +2 -2
- package/lib/Modal.js +22 -8
- package/lib/ModalDialog.d.ts +2 -1
- package/lib/Nav.d.ts +2 -2
- package/lib/NavDropdown.d.ts +4 -0
- package/lib/NavDropdown.js +2 -0
- package/lib/Navbar.d.ts +4 -3
- package/lib/Navbar.js +1 -1
- package/lib/NavbarContext.d.ts +2 -1
- package/lib/Offcanvas.d.ts +2 -2
- package/lib/Overlay.js +8 -0
- package/lib/OverlayTrigger.js +2 -2
- package/lib/Popover.d.ts +1 -15
- package/lib/ProgressBar.d.ts +2 -5
- package/lib/ProgressBar.js +43 -69
- package/lib/Ratio.d.ts +2 -1
- package/lib/Tab.d.ts +1 -1
- package/lib/TabContainer.d.ts +1 -1
- package/lib/ThemeProvider.d.ts +1 -1
- package/lib/ToastContext.d.ts +1 -1
- package/lib/ToggleButton.js +1 -0
- package/lib/Tooltip.d.ts +1 -15
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/internal/transitionEnd.d.ts +2 -0
- package/lib/internal/transitionEnd.js +32 -0
- package/lib/internal/warning.d.ts +2 -0
- package/lib/internal/warning.js +32 -0
- package/lib/transitionEndListener.js +1 -1
- package/lib/types.d.ts +6 -9
- package/lib/useCol.d.ts +1 -1
- package/package.json +43 -37
package/lib/ProgressBar.js
CHANGED
|
@@ -11,89 +11,63 @@ function getPercentage(now, min, max) {
|
|
|
11
11
|
const percentage = (now - min) / (max - min) * 100;
|
|
12
12
|
return Math.round(percentage * ROUND_PRECISION) / ROUND_PRECISION;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const ProgressBar = /*#__PURE__*/React.forwardRef(({
|
|
15
|
+
bsPrefix,
|
|
16
|
+
isChild = false,
|
|
17
|
+
children,
|
|
18
|
+
min = 0,
|
|
19
|
+
now = 0,
|
|
20
|
+
max = 100,
|
|
18
21
|
label,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
animated = false,
|
|
23
|
+
visuallyHidden = false,
|
|
24
|
+
striped = false,
|
|
25
|
+
variant,
|
|
22
26
|
className,
|
|
23
27
|
style,
|
|
24
|
-
variant,
|
|
25
|
-
bsPrefix,
|
|
26
28
|
...props
|
|
27
|
-
}, ref) {
|
|
29
|
+
}, ref) => {
|
|
30
|
+
bsPrefix = useBootstrapPrefix(bsPrefix, 'progress');
|
|
31
|
+
if (children) {
|
|
32
|
+
return /*#__PURE__*/_jsx("div", {
|
|
33
|
+
ref: ref,
|
|
34
|
+
...props,
|
|
35
|
+
style: style,
|
|
36
|
+
className: clsx(className, `${bsPrefix}-stacked`),
|
|
37
|
+
children: map(children, child => /*#__PURE__*/cloneElement(child, {
|
|
38
|
+
isChild: true
|
|
39
|
+
}))
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const width = `${getPercentage(now, min, max)}%`;
|
|
28
43
|
return /*#__PURE__*/_jsx("div", {
|
|
29
44
|
ref: ref,
|
|
30
45
|
...props,
|
|
31
46
|
role: "progressbar",
|
|
32
|
-
className: clsx(className,
|
|
33
|
-
[`bg-${variant}`]: variant,
|
|
34
|
-
[`${bsPrefix}-bar-animated`]: animated,
|
|
35
|
-
[`${bsPrefix}-bar-striped`]: animated || striped
|
|
36
|
-
}),
|
|
47
|
+
className: clsx(className, bsPrefix),
|
|
37
48
|
style: {
|
|
38
|
-
width:
|
|
49
|
+
width: isChild ? width : undefined,
|
|
39
50
|
...style
|
|
40
51
|
},
|
|
41
52
|
"aria-valuenow": now,
|
|
42
53
|
"aria-valuemin": min,
|
|
43
54
|
"aria-valuemax": max,
|
|
44
|
-
children:
|
|
45
|
-
className:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
...rest
|
|
61
|
-
};
|
|
62
|
-
props.bsPrefix = useBootstrapPrefix(props.bsPrefix, 'progress');
|
|
63
|
-
if (isChild) {
|
|
64
|
-
return renderProgressBar(props, ref);
|
|
65
|
-
}
|
|
66
|
-
const {
|
|
67
|
-
min,
|
|
68
|
-
now,
|
|
69
|
-
max,
|
|
70
|
-
label,
|
|
71
|
-
visuallyHidden,
|
|
72
|
-
striped,
|
|
73
|
-
animated,
|
|
74
|
-
bsPrefix,
|
|
75
|
-
variant,
|
|
76
|
-
className,
|
|
77
|
-
children,
|
|
78
|
-
...wrapperProps
|
|
79
|
-
} = props;
|
|
80
|
-
return /*#__PURE__*/_jsx("div", {
|
|
81
|
-
ref: ref,
|
|
82
|
-
...wrapperProps,
|
|
83
|
-
className: clsx(className, bsPrefix),
|
|
84
|
-
children: children ? map(children, child => /*#__PURE__*/cloneElement(child, {
|
|
85
|
-
isChild: true
|
|
86
|
-
})) : renderProgressBar({
|
|
87
|
-
min,
|
|
88
|
-
now,
|
|
89
|
-
max,
|
|
90
|
-
label,
|
|
91
|
-
visuallyHidden,
|
|
92
|
-
striped,
|
|
93
|
-
animated,
|
|
94
|
-
bsPrefix,
|
|
95
|
-
variant
|
|
96
|
-
}, ref)
|
|
55
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
56
|
+
className: clsx(className, `${bsPrefix}-bar`, {
|
|
57
|
+
[`bg-${variant}`]: variant,
|
|
58
|
+
[`${bsPrefix}-bar-animated`]: animated,
|
|
59
|
+
[`${bsPrefix}-bar-striped`]: animated || striped
|
|
60
|
+
}),
|
|
61
|
+
style:
|
|
62
|
+
// Stacked progress bar width style is on the parent.
|
|
63
|
+
isChild ? undefined : {
|
|
64
|
+
width
|
|
65
|
+
},
|
|
66
|
+
children: visuallyHidden ? /*#__PURE__*/_jsx("span", {
|
|
67
|
+
className: "visually-hidden",
|
|
68
|
+
children: label
|
|
69
|
+
}) : label
|
|
70
|
+
})
|
|
97
71
|
});
|
|
98
72
|
});
|
|
99
73
|
ProgressBar.displayName = 'ProgressBar';
|
package/lib/Ratio.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import type { LiteralUnion } from './types.js';
|
|
3
|
+
export type AspectRatio = LiteralUnion<'1x1' | '4x3' | '16x9' | '21x9', string>;
|
|
3
4
|
export interface RatioProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
5
|
/**
|
|
5
6
|
* @default 'ratio'
|
package/lib/Tab.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface TabProps extends Omit<TabPaneProps, 'title'> {
|
|
|
20
20
|
}
|
|
21
21
|
declare const _default: React.FC<TabProps> & {
|
|
22
22
|
Container: {
|
|
23
|
-
({ transition, ...props }: import("./TabContainer.js").TabContainerProps):
|
|
23
|
+
({ transition, ...props }: import("./TabContainer.js").TabContainerProps): React.JSX.Element;
|
|
24
24
|
displayName: string;
|
|
25
25
|
};
|
|
26
26
|
Content: import("@restart/ui/types").DynamicRefForwardingComponent<"div", import("./TabContent.js").TabContentProps>;
|
package/lib/TabContainer.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface TabContainerProps extends React.PropsWithChildren {
|
|
|
50
50
|
defaultActiveKey?: EventKey | undefined;
|
|
51
51
|
}
|
|
52
52
|
declare const TabContainer: {
|
|
53
|
-
({ transition, ...props }: TabContainerProps): import("react
|
|
53
|
+
({ transition, ...props }: TabContainerProps): import("react").JSX.Element;
|
|
54
54
|
displayName: string;
|
|
55
55
|
};
|
|
56
56
|
export default TabContainer;
|
package/lib/ThemeProvider.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface ThemeProviderProps extends Partial<ThemeContextValue> {
|
|
|
33
33
|
children: React.ReactNode;
|
|
34
34
|
}
|
|
35
35
|
declare const Consumer: React.Consumer<ThemeContextValue>;
|
|
36
|
-
declare function ThemeProvider({ prefixes, breakpoints, minBreakpoint, dir, children, }: ThemeProviderProps):
|
|
36
|
+
declare function ThemeProvider({ prefixes, breakpoints, minBreakpoint, dir, children, }: ThemeProviderProps): React.JSX.Element;
|
|
37
37
|
export declare function useBootstrapPrefix(prefix: string | undefined, defaultPrefix: string): string;
|
|
38
38
|
export declare function useBootstrapBreakpoints(): string[];
|
|
39
39
|
export declare function useBootstrapMinBreakpoint(): string | undefined;
|
package/lib/ToastContext.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface ToastContextType {
|
|
3
|
-
onClose?: (e?: React.MouseEvent | React.KeyboardEvent) => void;
|
|
3
|
+
onClose?: ((e?: React.MouseEvent | React.KeyboardEvent) => void) | undefined;
|
|
4
4
|
}
|
|
5
5
|
declare const ToastContext: React.Context<ToastContextType>;
|
|
6
6
|
export default ToastContext;
|
package/lib/ToggleButton.js
CHANGED
package/lib/Tooltip.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OverlayArrowProps } from '@restart/ui/Overlay';
|
|
3
|
-
import type { Placement
|
|
3
|
+
import type { Placement } from './types.js';
|
|
4
4
|
export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
6
6
|
* @default 'tooltip'
|
|
@@ -22,20 +22,6 @@ export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
22
22
|
* @type {{ ref: ReactRef, style: Object }}
|
|
23
23
|
*/
|
|
24
24
|
arrowProps?: Partial<OverlayArrowProps> | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* @private
|
|
27
|
-
*/
|
|
28
|
-
show?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* @private
|
|
31
|
-
*/
|
|
32
|
-
popper?: PopperRef | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Whether or not Popper has done its initial measurement and positioning.
|
|
35
|
-
*
|
|
36
|
-
* @private
|
|
37
|
-
*/
|
|
38
|
-
hasDoneInitialMeasure?: boolean | undefined;
|
|
39
25
|
}
|
|
40
26
|
declare const _default: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>> & {
|
|
41
27
|
TOOLTIP_OFFSET: number[];
|
package/lib/index.d.ts
CHANGED
|
@@ -111,6 +111,8 @@ export { default as Image } from './Image.js';
|
|
|
111
111
|
export type { ImageProps } from './Image.js';
|
|
112
112
|
export { default as InputGroup } from './InputGroup.js';
|
|
113
113
|
export type { InputGroupProps } from './InputGroup.js';
|
|
114
|
+
export { default as InputGroupText } from './InputGroupText.js';
|
|
115
|
+
export type { InputGroupTextProps } from './InputGroupText.js';
|
|
114
116
|
export { default as ListGroup } from './ListGroup.js';
|
|
115
117
|
export type { ListGroupProps } from './ListGroup.js';
|
|
116
118
|
export { default as ListGroupItem } from './ListGroupItem.js';
|
package/lib/index.js
CHANGED
|
@@ -56,6 +56,7 @@ export { default as FormText } from './FormText.js';
|
|
|
56
56
|
export { default as FormSelect } from './FormSelect.js';
|
|
57
57
|
export { default as Image } from './Image.js';
|
|
58
58
|
export { default as InputGroup } from './InputGroup.js';
|
|
59
|
+
export { default as InputGroupText } from './InputGroupText.js';
|
|
59
60
|
export { default as ListGroup } from './ListGroup.js';
|
|
60
61
|
export { default as ListGroupItem } from './ListGroupItem.js';
|
|
61
62
|
export { default as Modal } from './Modal.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import css from 'dom-helpers/css';
|
|
2
|
+
import listen from 'dom-helpers/listen';
|
|
3
|
+
import triggerEvent from 'dom-helpers/triggerEvent';
|
|
4
|
+
function parseDuration(node) {
|
|
5
|
+
const str = css(node, 'transitionDuration') || '';
|
|
6
|
+
const mult = str.indexOf('ms') === -1 ? 1000 : 1;
|
|
7
|
+
return parseFloat(str) * mult;
|
|
8
|
+
}
|
|
9
|
+
function emulateTransitionEnd(element, duration, padding = 5) {
|
|
10
|
+
let called = false;
|
|
11
|
+
const handle = setTimeout(() => {
|
|
12
|
+
if (!called) triggerEvent(element, 'transitionend', true);
|
|
13
|
+
}, duration + padding);
|
|
14
|
+
const remove = listen(element, 'transitionend', e => {
|
|
15
|
+
if (e.target === element) {
|
|
16
|
+
called = true;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return () => {
|
|
20
|
+
clearTimeout(handle);
|
|
21
|
+
remove();
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export default function transitionEnd(element, handler, duration, padding) {
|
|
25
|
+
if (duration == null) duration = parseDuration(element) || 0;
|
|
26
|
+
const removeEmulate = emulateTransitionEnd(element, duration, padding);
|
|
27
|
+
const remove = listen(element, 'transitionend', handler);
|
|
28
|
+
return () => {
|
|
29
|
+
removeEmulate();
|
|
30
|
+
remove();
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const __DEV__ = process.env.NODE_ENV !== 'production';
|
|
2
|
+
function printWarning(message) {
|
|
3
|
+
if (typeof console !== 'undefined') {
|
|
4
|
+
console.error(message);
|
|
5
|
+
}
|
|
6
|
+
try {
|
|
7
|
+
throw new Error(message);
|
|
8
|
+
} catch (_unused) {
|
|
9
|
+
// Ignore the error.
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function warn(condition, message) {
|
|
13
|
+
if (!__DEV__) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!condition) {
|
|
17
|
+
printWarning(message);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const messages = new Set();
|
|
21
|
+
export function warnOnce(condition, message) {
|
|
22
|
+
if (!__DEV__) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (!condition) {
|
|
26
|
+
if (messages.has(message)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
messages.add(message);
|
|
30
|
+
printWarning(message);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import transitionEnd from '
|
|
1
|
+
import transitionEnd from './internal/transitionEnd.js';
|
|
2
2
|
export function parseDuration(node, property) {
|
|
3
3
|
const str = getComputedStyle(node).getPropertyValue(property);
|
|
4
4
|
const mult = str.indexOf('ms') === -1 ? 1000 : 1;
|
package/lib/types.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type { ToggleMetadata } from '@restart/ui/Dropdown';
|
|
|
3
3
|
import type ModalManager from '@restart/ui/ModalManager';
|
|
4
4
|
import type { EventKey, SelectCallback } from '@restart/ui/types';
|
|
5
5
|
import type { DropDirection } from './DropdownContext.js';
|
|
6
|
+
export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
7
|
+
export type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
6
8
|
export type DOMContainer<T extends HTMLElement | VirtualElement = HTMLElement> = T | React.RefObject<T | null> | null | (() => T | React.RefObject<T | null> | null);
|
|
7
|
-
export type Variant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light'
|
|
9
|
+
export type Variant = LiteralUnion<'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light', string>;
|
|
8
10
|
export type ButtonVariant = Variant | 'link' | 'outline-primary' | 'outline-secondary' | 'outline-success' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-dark' | 'outline-light';
|
|
9
|
-
export type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | (string & {});
|
|
10
11
|
export type Placement = import('@restart/ui/usePopper').Placement;
|
|
11
12
|
export type AlignDirection = 'start' | 'end';
|
|
12
13
|
export type ResponsiveAlignProp = {
|
|
@@ -22,12 +23,12 @@ export type ResponsiveAlignProp = {
|
|
|
22
23
|
} | Record<string, AlignDirection>;
|
|
23
24
|
export type AlignType = AlignDirection | ResponsiveAlignProp;
|
|
24
25
|
export type RootCloseEvent = 'click' | 'mousedown';
|
|
25
|
-
export type GapValue = 0 | 1 | 2 | 3 | 4 | 5
|
|
26
|
+
export type GapValue = LiteralUnion<0 | 1 | 2 | 3 | 4 | 5, number>;
|
|
26
27
|
export interface PopperRef {
|
|
27
28
|
state: State | undefined;
|
|
28
29
|
outOfBoundaries: boolean;
|
|
29
30
|
placement: Placement | undefined;
|
|
30
|
-
scheduleUpdate?: () => void;
|
|
31
|
+
scheduleUpdate?: (() => void) | undefined;
|
|
31
32
|
strategy: UsePopperOptions['strategy'];
|
|
32
33
|
}
|
|
33
34
|
export interface TransitionCallbacks {
|
|
@@ -141,7 +142,7 @@ export interface BaseNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'o
|
|
|
141
142
|
*
|
|
142
143
|
* @type {((eventKey: string | null, e: React.SyntheticEvent<any>) => void) | undefined}
|
|
143
144
|
*/
|
|
144
|
-
onSelect?: SelectCallback;
|
|
145
|
+
onSelect?: SelectCallback | undefined;
|
|
145
146
|
}
|
|
146
147
|
export interface BaseNavItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
147
148
|
/**
|
|
@@ -357,8 +358,4 @@ export interface BsDropdownProps extends BaseDropdownProps {
|
|
|
357
358
|
* the button or the list.
|
|
358
359
|
*/
|
|
359
360
|
autoClose?: boolean | 'outside' | 'inside' | undefined;
|
|
360
|
-
/**
|
|
361
|
-
* @private
|
|
362
|
-
*/
|
|
363
|
-
navbar?: boolean | undefined;
|
|
364
361
|
}
|
package/lib/useCol.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-bootstrap",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.7",
|
|
4
4
|
"description": "Bootstrap 5 components built with React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bootstrap",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"files": [
|
|
23
23
|
"CHANGELOG.md",
|
|
24
24
|
"lib",
|
|
25
|
-
"cjs"
|
|
25
|
+
"cjs",
|
|
26
|
+
"dist"
|
|
26
27
|
],
|
|
27
28
|
"type": "module",
|
|
28
29
|
"main": "cjs/index.js",
|
|
@@ -57,20 +58,21 @@
|
|
|
57
58
|
"url": "git+https://github.com/react-bootstrap/react-bootstrap.git"
|
|
58
59
|
},
|
|
59
60
|
"scripts": {
|
|
60
|
-
"bootstrap": "
|
|
61
|
-
"build": "rimraf lib &&
|
|
61
|
+
"bootstrap": "npm install && npm install --prefix www",
|
|
62
|
+
"build": "rimraf lib && npm run build:esm && npm run build:esm:types && npm run build:cjs && npm run build:cjs:types && npm run build:dist",
|
|
62
63
|
"build:esm": "babel src --out-dir lib --delete-dir-on-start --env-name esm --extensions .ts,.tsx --ignore '**/*.d.ts'",
|
|
63
64
|
"build:cjs": "babel src --out-dir cjs --env-name cjs --delete-dir-on-start --extensions .ts,.tsx --ignore '**/*.d.ts' && echo '{\"type\": \"commonjs\"}' > cjs/package.json",
|
|
65
|
+
"build:dist": "node ./scripts/buildDist.ts",
|
|
64
66
|
"build:esm:types": "tsc --emitDeclarationOnly",
|
|
65
67
|
"build:cjs:types": "tsc --emitDeclarationOnly --outDir cjs",
|
|
66
|
-
"build-docs": "
|
|
68
|
+
"build-docs": "npm run build --prefix www",
|
|
67
69
|
"check-types": "tsc -p ./test/tsconfig.json --noEmit",
|
|
68
|
-
"deploy-docs": "
|
|
70
|
+
"deploy-docs": "npm run deploy --prefix www",
|
|
69
71
|
"lint": "eslint src test",
|
|
70
72
|
"prepublishOnly": "npm run build",
|
|
71
73
|
"release": "rollout",
|
|
72
|
-
"start": "
|
|
73
|
-
"tdd": "vitest",
|
|
74
|
+
"start": "npm run start --prefix www",
|
|
75
|
+
"tdd": "vitest --browser=chromium",
|
|
74
76
|
"test": "npm run lint && npm run test-browser -- --browser=chromium",
|
|
75
77
|
"test-browser": "vitest --run",
|
|
76
78
|
"prepare": "husky"
|
|
@@ -90,41 +92,46 @@
|
|
|
90
92
|
"dom-helpers": "^6.0.1",
|
|
91
93
|
"invariant": "^2.2.4",
|
|
92
94
|
"react-transition-group": "^4.4.5",
|
|
93
|
-
"uncontrollable": "^9.0.0"
|
|
94
|
-
"warning": "^4.0.3"
|
|
95
|
+
"uncontrollable": "^9.0.0"
|
|
95
96
|
},
|
|
96
97
|
"devDependencies": {
|
|
97
98
|
"@4c/rollout": "^4.0.2",
|
|
98
|
-
"@babel/cli": "^7.
|
|
99
|
-
"@babel/core": "^7.
|
|
100
|
-
"@babel/preset-typescript": "^7.
|
|
101
|
-
"@babel/register": "^7.
|
|
99
|
+
"@babel/cli": "^7.29.7",
|
|
100
|
+
"@babel/core": "^7.29.0",
|
|
101
|
+
"@babel/preset-typescript": "^7.29.7",
|
|
102
|
+
"@babel/register": "^7.29.7",
|
|
103
|
+
"@eslint/js": "^9.39.5",
|
|
102
104
|
"@react-bootstrap/babel-preset": "^2.3.0",
|
|
103
|
-
"@testing-library/dom": "^10.4.
|
|
104
|
-
"@testing-library/react": "^16.3.
|
|
105
|
+
"@testing-library/dom": "^10.4.2",
|
|
106
|
+
"@testing-library/react": "^16.3.3",
|
|
107
|
+
"@testing-library/user-event": "^14.6.8",
|
|
105
108
|
"@types/invariant": "^2.2.37",
|
|
106
|
-
"@types/
|
|
107
|
-
"@types/react
|
|
108
|
-
"@types/
|
|
109
|
-
"@vitejs/plugin-react": "^
|
|
110
|
-
"@vitest/browser": "^
|
|
111
|
-
"@vitest/
|
|
112
|
-
"
|
|
109
|
+
"@types/node": "^26.6.5",
|
|
110
|
+
"@types/react": "^19.3.0",
|
|
111
|
+
"@types/react-dom": "^19.3.0",
|
|
112
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
113
|
+
"@vitest/browser": "^5.0.5",
|
|
114
|
+
"@vitest/browser-playwright": "^5.0.5",
|
|
115
|
+
"@vitest/coverage-istanbul": "^5.0.5",
|
|
116
|
+
"babel-loader": "^10.1.1",
|
|
117
|
+
"eslint": "^9.39.5",
|
|
113
118
|
"eslint-config-prettier": "^10.1.8",
|
|
114
|
-
"eslint-plugin-prettier": "^5.5.
|
|
119
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
115
120
|
"eslint-plugin-react": "^7.37.5",
|
|
116
|
-
"eslint-plugin-react-hooks": "^
|
|
117
|
-
"globals": "^
|
|
121
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
122
|
+
"globals": "^17.13.0",
|
|
118
123
|
"husky": "^9.1.7",
|
|
119
|
-
"lint-staged": "^
|
|
120
|
-
"playwright": "^1.
|
|
121
|
-
"prettier": "^3.
|
|
122
|
-
"react": "^19.
|
|
123
|
-
"react-dom": "^19.
|
|
124
|
-
"rimraf": "^6.
|
|
125
|
-
"typescript": "^5.9.
|
|
126
|
-
"typescript-eslint": "^8.
|
|
127
|
-
"
|
|
124
|
+
"lint-staged": "^17.6.0",
|
|
125
|
+
"playwright": "^1.64.1",
|
|
126
|
+
"prettier": "^3.9.10",
|
|
127
|
+
"react": "^19.3.1",
|
|
128
|
+
"react-dom": "^19.3.1",
|
|
129
|
+
"rimraf": "^6.1.3",
|
|
130
|
+
"typescript": "^5.9.3",
|
|
131
|
+
"typescript-eslint": "^8.72.0",
|
|
132
|
+
"vite": "^8.3.4",
|
|
133
|
+
"vitest": "^5.0.5",
|
|
134
|
+
"webpack": "^5.112.2"
|
|
128
135
|
},
|
|
129
136
|
"peerDependencies": {
|
|
130
137
|
"@types/react": ">=18.3.12",
|
|
@@ -141,6 +148,5 @@
|
|
|
141
148
|
},
|
|
142
149
|
"release": {
|
|
143
150
|
"conventionalCommits": true
|
|
144
|
-
}
|
|
145
|
-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
151
|
+
}
|
|
146
152
|
}
|