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/Form.d.ts
CHANGED
|
@@ -25,16 +25,7 @@ declare const _default: DynamicRefForwardingComponent<"form", FormProps> & {
|
|
|
25
25
|
Input: DynamicRefForwardingComponent<"input", import("./FormCheckInput.js").FormCheckInputProps>;
|
|
26
26
|
Label: React.ForwardRefExoticComponent<import("./FormCheckLabel.js").FormCheckLabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
27
27
|
}, {
|
|
28
|
-
|
|
29
|
-
disabled?: boolean | undefined | undefined;
|
|
30
|
-
form?: string | undefined | undefined;
|
|
31
|
-
formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
|
|
32
|
-
formEncType?: string | undefined | undefined;
|
|
33
|
-
formMethod?: string | undefined | undefined;
|
|
34
|
-
formNoValidate?: boolean | undefined | undefined;
|
|
35
|
-
formTarget?: string | undefined | undefined;
|
|
36
|
-
name?: string | undefined | undefined;
|
|
37
|
-
value?: string | number | readonly string[] | undefined;
|
|
28
|
+
onSelect?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
38
29
|
defaultChecked?: boolean | undefined | undefined;
|
|
39
30
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
40
31
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
@@ -82,7 +73,7 @@ declare const _default: DynamicRefForwardingComponent<"form", FormProps> & {
|
|
|
82
73
|
results?: number | undefined | undefined;
|
|
83
74
|
security?: string | undefined | undefined;
|
|
84
75
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
85
|
-
popover?: "" | "auto" | "manual" | undefined | undefined;
|
|
76
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
86
77
|
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
87
78
|
popoverTarget?: string | undefined | undefined;
|
|
88
79
|
inert?: boolean | undefined | undefined;
|
|
@@ -116,6 +107,7 @@ declare const _default: DynamicRefForwardingComponent<"form", FormProps> & {
|
|
|
116
107
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
117
108
|
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
118
109
|
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
110
|
+
"aria-label"?: string | undefined | undefined;
|
|
119
111
|
"aria-labelledby"?: string | undefined | undefined;
|
|
120
112
|
"aria-level"?: number | undefined | undefined;
|
|
121
113
|
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
@@ -162,18 +154,18 @@ declare const _default: DynamicRefForwardingComponent<"form", FormProps> & {
|
|
|
162
154
|
onFocusCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
163
155
|
onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
164
156
|
onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
165
|
-
onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
166
|
-
onChangeCapture?: React.
|
|
157
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined;
|
|
158
|
+
onChangeCapture?: React.ChangeEventHandler<HTMLInputElement, Element> | undefined;
|
|
167
159
|
onBeforeInput?: React.InputEventHandler<HTMLInputElement> | undefined;
|
|
168
|
-
onBeforeInputCapture?: React.
|
|
169
|
-
onInput?: React.
|
|
170
|
-
onInputCapture?: React.
|
|
171
|
-
onReset?: React.
|
|
172
|
-
onResetCapture?: React.
|
|
173
|
-
onSubmit?: React.
|
|
174
|
-
onSubmitCapture?: React.
|
|
175
|
-
onInvalid?: React.
|
|
176
|
-
onInvalidCapture?: React.
|
|
160
|
+
onBeforeInputCapture?: React.InputEventHandler<HTMLInputElement> | undefined;
|
|
161
|
+
onInput?: React.InputEventHandler<HTMLInputElement> | undefined;
|
|
162
|
+
onInputCapture?: React.InputEventHandler<HTMLInputElement> | undefined;
|
|
163
|
+
onReset?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
164
|
+
onResetCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
165
|
+
onSubmit?: React.SubmitEventHandler<HTMLInputElement> | undefined;
|
|
166
|
+
onSubmitCapture?: React.SubmitEventHandler<HTMLInputElement> | undefined;
|
|
167
|
+
onInvalid?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
168
|
+
onInvalidCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
177
169
|
onLoad?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
178
170
|
onLoadCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
179
171
|
onError?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
@@ -264,7 +256,6 @@ declare const _default: DynamicRefForwardingComponent<"form", FormProps> & {
|
|
|
264
256
|
onMouseOverCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
265
257
|
onMouseUp?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
266
258
|
onMouseUpCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
267
|
-
onSelect?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
268
259
|
onSelectCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
269
260
|
onTouchCancel?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
270
261
|
onTouchCancelCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
@@ -314,19 +305,28 @@ declare const _default: DynamicRefForwardingComponent<"form", FormProps> & {
|
|
|
314
305
|
onTransitionRunCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
|
|
315
306
|
onTransitionStart?: React.TransitionEventHandler<HTMLInputElement> | undefined;
|
|
316
307
|
onTransitionStartCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
|
|
308
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
309
|
+
form?: string | undefined | undefined;
|
|
310
|
+
label?: React.ReactNode;
|
|
311
|
+
pattern?: string | undefined | undefined;
|
|
312
|
+
disabled?: boolean | undefined | undefined;
|
|
313
|
+
formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
|
|
314
|
+
formEncType?: string | undefined | undefined;
|
|
315
|
+
formMethod?: string | undefined | undefined;
|
|
316
|
+
formNoValidate?: boolean | undefined | undefined;
|
|
317
|
+
formTarget?: string | undefined | undefined;
|
|
318
|
+
name?: string | undefined | undefined;
|
|
319
|
+
value?: string | number | readonly string[] | undefined;
|
|
317
320
|
reverse?: boolean | undefined | undefined;
|
|
318
321
|
list?: string | undefined | undefined;
|
|
319
322
|
bsPrefix?: string | undefined | undefined;
|
|
320
|
-
label?: React.ReactNode;
|
|
321
|
-
pattern?: string | undefined | undefined;
|
|
322
|
-
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
323
323
|
height?: number | string | undefined | undefined;
|
|
324
324
|
width?: number | string | undefined | undefined;
|
|
325
325
|
size?: number | undefined | undefined;
|
|
326
326
|
inline?: boolean | undefined | undefined;
|
|
327
327
|
multiple?: boolean | undefined | undefined;
|
|
328
|
-
autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
|
|
329
328
|
alt?: string | undefined | undefined;
|
|
329
|
+
autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
|
|
330
330
|
accept?: string | undefined | undefined;
|
|
331
331
|
capture?: boolean | "user" | "environment" | undefined | undefined;
|
|
332
332
|
checked?: boolean | undefined | undefined;
|
package/lib/FormControl.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useContext } from 'react';
|
|
6
|
-
import
|
|
6
|
+
import { warn } from './internal/warning.js';
|
|
7
7
|
import Feedback from './Feedback.js';
|
|
8
8
|
import FormContext from './FormContext.js';
|
|
9
9
|
import { useBootstrapPrefix } from './ThemeProvider.js';
|
|
@@ -27,7 +27,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(({
|
|
|
27
27
|
controlId
|
|
28
28
|
} = useContext(FormContext);
|
|
29
29
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-control');
|
|
30
|
-
|
|
30
|
+
warn(controlId == null || !id, '`controlId` is ignored on `<FormControl>` when `id` is specified.');
|
|
31
31
|
return /*#__PURE__*/_jsx(Component, {
|
|
32
32
|
...props,
|
|
33
33
|
type: type,
|
package/lib/FormLabel.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useContext } from 'react';
|
|
6
|
-
import
|
|
6
|
+
import { warn } from './internal/warning.js';
|
|
7
7
|
import Col from './Col.js';
|
|
8
8
|
import FormContext from './FormContext.js';
|
|
9
9
|
import { useBootstrapPrefix } from './ThemeProvider.js';
|
|
@@ -25,7 +25,7 @@ const FormLabel = /*#__PURE__*/React.forwardRef(({
|
|
|
25
25
|
let columnClass = 'col-form-label';
|
|
26
26
|
if (typeof column === 'string') columnClass = `${columnClass} ${columnClass}-${column}`;
|
|
27
27
|
const classes = clsx(className, bsPrefix, visuallyHidden && 'visually-hidden', column && columnClass);
|
|
28
|
-
|
|
28
|
+
warn(controlId == null || !htmlFor, '`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified.');
|
|
29
29
|
htmlFor = htmlFor || controlId;
|
|
30
30
|
if (column) return /*#__PURE__*/_jsx(Col, {
|
|
31
31
|
ref: ref,
|
package/lib/InputGroup.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface InputGroupProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
23
23
|
}
|
|
24
24
|
declare const _default: DynamicRefForwardingComponent<"div", InputGroupProps> & {
|
|
25
25
|
Text: DynamicRefForwardingComponent<"span", import("./InputGroupText.js").InputGroupTextProps>;
|
|
26
|
-
Radio: (props: FormCheckInputProps) =>
|
|
27
|
-
Checkbox: (props: FormCheckInputProps) =>
|
|
26
|
+
Radio: (props: FormCheckInputProps) => React.JSX.Element;
|
|
27
|
+
Checkbox: (props: FormCheckInputProps) => React.JSX.Element;
|
|
28
28
|
};
|
|
29
29
|
export default _default;
|
package/lib/ListGroup.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { DynamicRefForwardingComponent, EventKey } from '@restart/ui/types';
|
|
3
|
-
import type { BaseNavProps } from './types.js';
|
|
3
|
+
import type { BaseNavProps, LiteralUnion } from './types.js';
|
|
4
4
|
export interface ListGroupProps extends BaseNavProps {
|
|
5
5
|
/**
|
|
6
6
|
* Element used to render the component.
|
|
@@ -15,14 +15,14 @@ export interface ListGroupProps extends BaseNavProps {
|
|
|
15
15
|
/**
|
|
16
16
|
* Adds a variant to the list-group
|
|
17
17
|
*/
|
|
18
|
-
variant?: 'flush'
|
|
18
|
+
variant?: LiteralUnion<'flush', string> | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Changes the flow of the list group items from vertical to horizontal.
|
|
21
21
|
* A value of `null` (the default) sets it to vertical for all breakpoints;
|
|
22
22
|
* Just including the prop sets it for all breakpoints, while `{sm|md|lg|xl|xxl}`
|
|
23
23
|
* makes the list group horizontal starting at that breakpoint’s `min-width`.
|
|
24
24
|
*/
|
|
25
|
-
horizontal?: boolean |
|
|
25
|
+
horizontal?: boolean | LiteralUnion<'sm' | 'md' | 'lg' | 'xl' | 'xxl', string> | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* The default active key of the list group.
|
|
28
28
|
*/
|
package/lib/ListGroup.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import { warn } from './internal/warning.js';
|
|
6
6
|
import { useUncontrolled } from 'uncontrollable';
|
|
7
7
|
import BaseNav from '@restart/ui/Nav';
|
|
8
8
|
import { useBootstrapPrefix } from './ThemeProvider.js';
|
|
@@ -26,7 +26,7 @@ const ListGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
26
26
|
if (horizontal) {
|
|
27
27
|
horizontalVariant = horizontal === true ? 'horizontal' : `horizontal-${horizontal}`;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
warn(!(horizontal && variant === 'flush'), '`variant="flush"` and `horizontal` should not be used together.');
|
|
30
30
|
return /*#__PURE__*/_jsx(BaseNav, {
|
|
31
31
|
ref: ref,
|
|
32
32
|
...controlledProps,
|
package/lib/ListGroupItem.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import { warn } from './internal/warning.js';
|
|
6
6
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
7
7
|
import { useNavItem } from '@restart/ui/NavItem';
|
|
8
8
|
import { makeEventKey } from '@restart/ui/SelectableContext';
|
|
@@ -38,7 +38,7 @@ const ListGroupItem = /*#__PURE__*/React.forwardRef(({
|
|
|
38
38
|
props['aria-disabled'] = true;
|
|
39
39
|
}
|
|
40
40
|
const Component = as || (action ? props.href ? 'a' : 'button' : 'div');
|
|
41
|
-
|
|
41
|
+
warn(!!as || !(!action && props.href), '`action=false` and `href` should not be used together.');
|
|
42
42
|
return /*#__PURE__*/_jsx(Component, {
|
|
43
43
|
ref: ref,
|
|
44
44
|
...props,
|
package/lib/Modal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ModalHandle } from '@restart/ui/Modal';
|
|
3
|
-
import type { BaseModalProps } from './types.js';
|
|
3
|
+
import type { BaseModalProps, LiteralUnion } from './types.js';
|
|
4
4
|
export interface ModalProps extends BaseModalProps {
|
|
5
5
|
/**
|
|
6
6
|
* @default 'modal'
|
|
@@ -15,7 +15,7 @@ export interface ModalProps extends BaseModalProps {
|
|
|
15
15
|
* Renders a fullscreen modal. Specifying a breakpoint will render the modal
|
|
16
16
|
* as fullscreen __below__ the breakpoint size.
|
|
17
17
|
*/
|
|
18
|
-
fullscreen?: true |
|
|
18
|
+
fullscreen?: true | LiteralUnion<'sm-down' | 'md-down' | 'lg-down' | 'xl-down' | 'xxl-down', string> | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* vertically center the Dialog in the window
|
|
21
21
|
*/
|
package/lib/Modal.js
CHANGED
|
@@ -8,7 +8,6 @@ import useCallbackRef from '@restart/hooks/useCallbackRef';
|
|
|
8
8
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
9
9
|
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
10
10
|
import useWillUnmount from '@restart/hooks/useWillUnmount';
|
|
11
|
-
import transitionEnd from 'dom-helpers/transitionEnd';
|
|
12
11
|
import * as React from 'react';
|
|
13
12
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
14
13
|
import BaseModal from '@restart/ui/Modal';
|
|
@@ -21,6 +20,7 @@ import ModalFooter from './ModalFooter.js';
|
|
|
21
20
|
import ModalHeader from './ModalHeader.js';
|
|
22
21
|
import ModalTitle from './ModalTitle.js';
|
|
23
22
|
import { useBootstrapPrefix, useIsRTL } from './ThemeProvider.js';
|
|
23
|
+
import transitionEnd from './internal/transitionEnd.js';
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
function DialogTransition(props) {
|
|
26
26
|
return /*#__PURE__*/_jsx(Fade, {
|
|
@@ -89,8 +89,13 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
89
89
|
isRTL
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Updates the modal padding style to account for scrollbar width differences
|
|
95
|
+
* between the container and modal dialog when viewport or content resizes.
|
|
96
|
+
*/
|
|
92
97
|
function updateDialogStyle(node) {
|
|
93
|
-
if (!canUseDOM) return;
|
|
98
|
+
if (!canUseDOM || !node) return;
|
|
94
99
|
const containerIsOverflowing = getModalManager().getScrollbarWidth() > 0;
|
|
95
100
|
const modalIsOverflowing = node.scrollHeight > ownerDocument(node).documentElement.clientHeight;
|
|
96
101
|
setStyle({
|
|
@@ -99,13 +104,17 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
99
104
|
});
|
|
100
105
|
}
|
|
101
106
|
const handleWindowResize = useEventCallback(() => {
|
|
102
|
-
if (modal) {
|
|
107
|
+
if (modal != null && modal.dialog) {
|
|
103
108
|
updateDialogStyle(modal.dialog);
|
|
104
109
|
}
|
|
105
110
|
});
|
|
111
|
+
const cleanupStaticModalAnimation = () => {
|
|
112
|
+
removeStaticModalAnimationRef.current == null || removeStaticModalAnimationRef.current();
|
|
113
|
+
removeStaticModalAnimationRef.current = null;
|
|
114
|
+
};
|
|
106
115
|
useWillUnmount(() => {
|
|
107
116
|
window.removeEventListener('resize', handleWindowResize);
|
|
108
|
-
|
|
117
|
+
cleanupStaticModalAnimation();
|
|
109
118
|
});
|
|
110
119
|
|
|
111
120
|
// We prevent the modal from closing during a drag by detecting where the
|
|
@@ -122,9 +131,13 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
122
131
|
};
|
|
123
132
|
const handleStaticModalAnimation = () => {
|
|
124
133
|
setAnimateStaticModal(true);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
if (modal != null && modal.dialog) {
|
|
135
|
+
cleanupStaticModalAnimation();
|
|
136
|
+
removeStaticModalAnimationRef.current = transitionEnd(modal.dialog, () => {
|
|
137
|
+
setAnimateStaticModal(false);
|
|
138
|
+
cleanupStaticModalAnimation();
|
|
139
|
+
});
|
|
140
|
+
}
|
|
128
141
|
};
|
|
129
142
|
const handleStaticBackdropClick = e => {
|
|
130
143
|
if (e.target !== e.currentTarget) {
|
|
@@ -162,7 +175,8 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
162
175
|
onEnter == null || onEnter(node, isAppearing);
|
|
163
176
|
};
|
|
164
177
|
const handleExit = node => {
|
|
165
|
-
|
|
178
|
+
cleanupStaticModalAnimation();
|
|
179
|
+
setAnimateStaticModal(false);
|
|
166
180
|
onExit == null || onExit(node);
|
|
167
181
|
};
|
|
168
182
|
const handleEntering = (node, isAppearing) => {
|
package/lib/ModalDialog.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { LiteralUnion } from './types.js';
|
|
2
3
|
export interface ModalDialogProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
/**
|
|
4
5
|
* Element used to render the component.
|
|
@@ -16,7 +17,7 @@ export interface ModalDialogProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
16
17
|
* Renders a fullscreen modal. Specifying a breakpoint will render the modal
|
|
17
18
|
* as fullscreen __below__ the breakpoint size.
|
|
18
19
|
*/
|
|
19
|
-
fullscreen?: true |
|
|
20
|
+
fullscreen?: true | LiteralUnion<'sm-down' | 'md-down' | 'lg-down' | 'xl-down' | 'xxl-down', string> | undefined;
|
|
20
21
|
/**
|
|
21
22
|
* Specify whether the Component should be vertically centered
|
|
22
23
|
*/
|
package/lib/Nav.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DynamicRefForwardingComponent, EventKey } from '@restart/ui/types';
|
|
3
|
-
import type { BaseNavProps } from './types.js';
|
|
3
|
+
import type { BaseNavProps, LiteralUnion } from './types.js';
|
|
4
4
|
export interface NavProps extends BaseNavProps {
|
|
5
5
|
/**
|
|
6
6
|
* Element used to render the component.
|
|
@@ -13,7 +13,7 @@ export interface NavProps extends BaseNavProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* The visual variant of the nav items.
|
|
15
15
|
*/
|
|
16
|
-
variant?: 'tabs' | 'pills' | 'underline'
|
|
16
|
+
variant?: LiteralUnion<'tabs' | 'pills' | 'underline', string> | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* The default active key that is selected on start.
|
|
19
19
|
*/
|
package/lib/NavDropdown.d.ts
CHANGED
|
@@ -39,6 +39,10 @@ export interface NavDropdownProps extends BsDropdownProps, Omit<React.HTMLAttrib
|
|
|
39
39
|
* Omitting this will use the default light color.
|
|
40
40
|
*/
|
|
41
41
|
menuVariant?: DropdownMenuVariant | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* An optional tabIndex for the toggle element.
|
|
44
|
+
*/
|
|
45
|
+
tabIndex?: number | undefined;
|
|
42
46
|
}
|
|
43
47
|
declare const _default: DynamicRefForwardingComponent<"div", NavDropdownProps> & {
|
|
44
48
|
Item: DynamicRefForwardingComponent<"a", import("./DropdownItem.js").DropdownItemProps>;
|
package/lib/NavDropdown.js
CHANGED
|
@@ -18,6 +18,7 @@ const NavDropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
18
18
|
active,
|
|
19
19
|
renderMenuOnMount,
|
|
20
20
|
menuVariant,
|
|
21
|
+
tabIndex,
|
|
21
22
|
...props
|
|
22
23
|
}, ref) => {
|
|
23
24
|
/* NavItem has no additional logic, it's purely presentational. Can set nav item class here to support "as" */
|
|
@@ -33,6 +34,7 @@ const NavDropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
33
34
|
disabled: disabled,
|
|
34
35
|
childBsPrefix: bsPrefix,
|
|
35
36
|
as: NavLink,
|
|
37
|
+
tabIndex: tabIndex,
|
|
36
38
|
children: title
|
|
37
39
|
}), /*#__PURE__*/_jsx(Dropdown.Menu, {
|
|
38
40
|
role: menuRole,
|
package/lib/Navbar.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DynamicRefForwardingComponent, SelectCallback } from '@restart/ui/types';
|
|
3
|
+
import type { LiteralUnion } from './types.js';
|
|
3
4
|
export interface NavbarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'onToggle'> {
|
|
4
5
|
/**
|
|
5
6
|
* Element used to render the component.
|
|
@@ -14,16 +15,16 @@ export interface NavbarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'on
|
|
|
14
15
|
* Use in combination with the `bg` prop, `background-color` utilities,
|
|
15
16
|
* or your own background styles.
|
|
16
17
|
*/
|
|
17
|
-
variant?: 'light' | 'dark'
|
|
18
|
+
variant?: LiteralUnion<'light' | 'dark', string> | undefined;
|
|
18
19
|
/**
|
|
19
20
|
* The breakpoint, below which, the Navbar will collapse.
|
|
20
21
|
* When `true` the Navbar will always be expanded regardless of screen size.
|
|
21
22
|
*/
|
|
22
|
-
expand?: boolean |
|
|
23
|
+
expand?: boolean | LiteralUnion<'sm' | 'md' | 'lg' | 'xl' | 'xxl', string> | undefined;
|
|
23
24
|
/**
|
|
24
25
|
* Default expanded state of the Navbar.
|
|
25
26
|
*/
|
|
26
|
-
defaultExpand?: boolean |
|
|
27
|
+
defaultExpand?: boolean | LiteralUnion<'sm' | 'md' | 'lg' | 'xl' | 'xxl', string> | undefined;
|
|
27
28
|
/**
|
|
28
29
|
* A convenience prop for adding `bg-*` utility classes since they are so commonly used here.
|
|
29
30
|
* `light` and `dark` are common choices but any `bg-*` class is supported, including any custom ones you might define.
|
package/lib/Navbar.js
CHANGED
package/lib/NavbarContext.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { LiteralUnion } from './types.js';
|
|
2
3
|
export interface NavbarContextType {
|
|
3
4
|
onToggle: () => void;
|
|
4
5
|
bsPrefix?: string;
|
|
5
6
|
expanded: boolean;
|
|
6
|
-
expand?: boolean |
|
|
7
|
+
expand?: boolean | LiteralUnion<'sm' | 'md' | 'lg' | 'xl' | 'xxl', string>;
|
|
7
8
|
}
|
|
8
9
|
declare const context: React.Context<NavbarContextType | null>;
|
|
9
10
|
export default context;
|
package/lib/Offcanvas.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ModalHandle } from '@restart/ui/Modal';
|
|
3
|
-
import type { BaseModalProps } from './types.js';
|
|
3
|
+
import type { BaseModalProps, LiteralUnion } from './types.js';
|
|
4
4
|
export type OffcanvasPlacement = 'start' | 'end' | 'top' | 'bottom';
|
|
5
5
|
export interface OffcanvasProps extends BaseModalProps {
|
|
6
6
|
/**
|
|
@@ -22,7 +22,7 @@ export interface OffcanvasProps extends BaseModalProps {
|
|
|
22
22
|
/**
|
|
23
23
|
* Hide content outside the viewport from a specified breakpoint and down.
|
|
24
24
|
*/
|
|
25
|
-
responsive?: 'sm' | 'md' | 'lg' | 'xl' | 'xxl'
|
|
25
|
+
responsive?: LiteralUnion<'sm' | 'md' | 'lg' | 'xl' | 'xxl', string> | undefined;
|
|
26
26
|
[other: string]: any;
|
|
27
27
|
}
|
|
28
28
|
declare const _default: React.ForwardRefExoticComponent<Omit<OffcanvasProps, "ref"> & React.RefAttributes<ModalHandle>> & {
|
package/lib/Overlay.js
CHANGED
|
@@ -20,6 +20,10 @@ function wrapRefs(props, arrowProps) {
|
|
|
20
20
|
props.ref = ref.__wrapped || (ref.__wrapped = r => ref(r));
|
|
21
21
|
arrowProps.ref = aRef.__wrapped || (aRef.__wrapped = r => aRef(r));
|
|
22
22
|
}
|
|
23
|
+
function clearPopperCache(popperRef) {
|
|
24
|
+
popperRef.state = undefined;
|
|
25
|
+
popperRef.scheduleUpdate = undefined;
|
|
26
|
+
}
|
|
23
27
|
const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
24
28
|
children: overlay,
|
|
25
29
|
transition = Fade,
|
|
@@ -47,8 +51,12 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
47
51
|
useEffect(() => {
|
|
48
52
|
if (!outerShow) {
|
|
49
53
|
setFirstRenderedState(null);
|
|
54
|
+
clearPopperCache(popperRef.current);
|
|
50
55
|
}
|
|
51
56
|
}, [outerShow]);
|
|
57
|
+
useEffect(() => () => {
|
|
58
|
+
clearPopperCache(popperRef.current);
|
|
59
|
+
}, []);
|
|
52
60
|
return /*#__PURE__*/_jsx(BaseOverlay, {
|
|
53
61
|
...outerProps,
|
|
54
62
|
ref: mergedRef,
|
package/lib/OverlayTrigger.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { cloneElement, useCallback, useRef } from 'react';
|
|
5
5
|
import useTimeout from '@restart/hooks/useTimeout';
|
|
6
|
-
import
|
|
6
|
+
import { warnOnce } from './internal/warning.js';
|
|
7
7
|
import { useUncontrolledProp } from 'uncontrollable';
|
|
8
8
|
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
9
9
|
import { getChildRef } from '@restart/ui/utils';
|
|
@@ -104,7 +104,7 @@ const OverlayTrigger = ({
|
|
|
104
104
|
triggerProps.onBlur = handleBlur;
|
|
105
105
|
}
|
|
106
106
|
if (triggers.indexOf('hover') !== -1) {
|
|
107
|
-
|
|
107
|
+
warnOnce(triggers.length > 1, '[react-bootstrap] Specifying only the `"hover"` trigger limits the visibility of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.');
|
|
108
108
|
triggerProps.onMouseOver = handleMouseOver;
|
|
109
109
|
triggerProps.onMouseOut = handleMouseOut;
|
|
110
110
|
}
|
package/lib/Popover.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 PopoverProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
6
6
|
* @default 'popover'
|
|
@@ -25,20 +25,6 @@ export interface PopoverProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
* passing the children directly to it
|
|
26
26
|
*/
|
|
27
27
|
body?: boolean | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* @private
|
|
30
|
-
*/
|
|
31
|
-
popper?: PopperRef | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
show?: boolean | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Whether or not Popper has done its initial measurement and positioning.
|
|
38
|
-
*
|
|
39
|
-
* @private
|
|
40
|
-
*/
|
|
41
|
-
hasDoneInitialMeasure?: boolean | undefined;
|
|
42
28
|
}
|
|
43
29
|
declare const _default: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>> & {
|
|
44
30
|
Header: import("@restart/ui/types").DynamicRefForwardingComponent<"div", import("./PopoverHeader.js").PopoverHeaderProps>;
|
package/lib/ProgressBar.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { LiteralUnion } from './types.js';
|
|
2
3
|
export interface ProgressBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
/**
|
|
4
5
|
* @default 'progress'
|
|
@@ -38,11 +39,7 @@ export interface ProgressBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
38
39
|
*
|
|
39
40
|
* @type {'success' | 'danger' | 'warning' | 'info' | string | undefined}
|
|
40
41
|
*/
|
|
41
|
-
variant?: 'success' | 'danger' | 'warning' | 'info'
|
|
42
|
-
/**
|
|
43
|
-
* @private
|
|
44
|
-
*/
|
|
45
|
-
isChild?: boolean | undefined;
|
|
42
|
+
variant?: LiteralUnion<'success' | 'danger' | 'warning' | 'info', string> | undefined;
|
|
46
43
|
}
|
|
47
44
|
declare const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
45
|
export default ProgressBar;
|