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.
Files changed (225) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +5 -6
  3. package/cjs/AbstractModalHeader.js +2 -1
  4. package/cjs/Accordion.d.ts +1 -1
  5. package/cjs/Accordion.js +2 -1
  6. package/cjs/AccordionBody.js +2 -1
  7. package/cjs/AccordionButton.d.ts +1 -1
  8. package/cjs/AccordionButton.js +2 -1
  9. package/cjs/AccordionCollapse.js +2 -1
  10. package/cjs/AccordionContext.d.ts +3 -3
  11. package/cjs/AccordionContext.js +2 -1
  12. package/cjs/AccordionHeader.js +2 -1
  13. package/cjs/AccordionItem.js +2 -1
  14. package/cjs/AccordionItemContext.js +2 -1
  15. package/cjs/Alert.js +2 -1
  16. package/cjs/AlertHeading.js +2 -1
  17. package/cjs/AlertLink.js +2 -1
  18. package/cjs/Badge.d.ts +1 -7
  19. package/cjs/Badge.js +3 -3
  20. package/cjs/Breadcrumb.js +2 -1
  21. package/cjs/BreadcrumbItem.js +2 -1
  22. package/cjs/Button.js +2 -1
  23. package/cjs/ButtonGroup.js +2 -1
  24. package/cjs/ButtonToolbar.js +2 -1
  25. package/cjs/Card.d.ts +1 -7
  26. package/cjs/Card.js +3 -3
  27. package/cjs/CardBody.js +2 -1
  28. package/cjs/CardFooter.js +2 -1
  29. package/cjs/CardGroup.js +2 -1
  30. package/cjs/CardHeader.js +2 -1
  31. package/cjs/CardHeaderContext.js +2 -1
  32. package/cjs/CardImg.d.ts +2 -1
  33. package/cjs/CardImg.js +2 -1
  34. package/cjs/CardImgOverlay.js +2 -1
  35. package/cjs/CardLink.js +2 -1
  36. package/cjs/CardSubtitle.js +2 -1
  37. package/cjs/CardText.js +2 -1
  38. package/cjs/CardTitle.js +2 -1
  39. package/cjs/Carousel.d.ts +2 -1
  40. package/cjs/Carousel.js +3 -2
  41. package/cjs/CarouselCaption.js +2 -1
  42. package/cjs/CarouselItem.js +2 -1
  43. package/cjs/CloseButton.d.ts +2 -1
  44. package/cjs/CloseButton.js +2 -1
  45. package/cjs/Col.js +2 -1
  46. package/cjs/Collapse.js +2 -1
  47. package/cjs/Container.d.ts +2 -1
  48. package/cjs/Container.js +2 -1
  49. package/cjs/Dropdown.js +2 -1
  50. package/cjs/DropdownButton.js +2 -1
  51. package/cjs/DropdownContext.js +2 -1
  52. package/cjs/DropdownDivider.js +2 -1
  53. package/cjs/DropdownHeader.js +2 -1
  54. package/cjs/DropdownItem.js +2 -1
  55. package/cjs/DropdownItemText.js +2 -1
  56. package/cjs/DropdownMenu.d.ts +2 -1
  57. package/cjs/DropdownMenu.js +4 -3
  58. package/cjs/DropdownToggle.d.ts +1 -6
  59. package/cjs/DropdownToggle.js +2 -1
  60. package/cjs/ElementChildren.js +2 -1
  61. package/cjs/Fade.js +2 -1
  62. package/cjs/Feedback.js +2 -1
  63. package/cjs/Figure.js +2 -1
  64. package/cjs/FigureCaption.js +2 -1
  65. package/cjs/FigureImage.js +2 -1
  66. package/cjs/FloatingLabel.js +2 -1
  67. package/cjs/Form.d.ts +27 -27
  68. package/cjs/Form.js +2 -1
  69. package/cjs/FormCheck.js +2 -1
  70. package/cjs/FormCheckInput.js +2 -1
  71. package/cjs/FormCheckLabel.js +2 -1
  72. package/cjs/FormContext.js +2 -1
  73. package/cjs/FormControl.js +4 -3
  74. package/cjs/FormFloating.js +2 -1
  75. package/cjs/FormGroup.js +2 -1
  76. package/cjs/FormLabel.js +4 -3
  77. package/cjs/FormRange.js +2 -1
  78. package/cjs/FormSelect.js +2 -1
  79. package/cjs/FormText.js +2 -1
  80. package/cjs/Image.js +2 -1
  81. package/cjs/InputGroup.d.ts +2 -2
  82. package/cjs/InputGroup.js +2 -1
  83. package/cjs/InputGroupContext.js +2 -1
  84. package/cjs/InputGroupText.js +2 -1
  85. package/cjs/ListGroup.d.ts +3 -3
  86. package/cjs/ListGroup.js +4 -3
  87. package/cjs/ListGroupItem.js +4 -3
  88. package/cjs/Modal.d.ts +2 -2
  89. package/cjs/Modal.js +24 -9
  90. package/cjs/ModalBody.js +2 -1
  91. package/cjs/ModalContext.js +2 -1
  92. package/cjs/ModalDialog.d.ts +2 -1
  93. package/cjs/ModalDialog.js +2 -1
  94. package/cjs/ModalFooter.js +2 -1
  95. package/cjs/ModalHeader.js +2 -1
  96. package/cjs/ModalTitle.js +2 -1
  97. package/cjs/Nav.d.ts +2 -2
  98. package/cjs/Nav.js +2 -1
  99. package/cjs/NavContext.js +2 -1
  100. package/cjs/NavDropdown.d.ts +4 -0
  101. package/cjs/NavDropdown.js +4 -1
  102. package/cjs/NavItem.js +2 -1
  103. package/cjs/NavLink.js +2 -1
  104. package/cjs/Navbar.d.ts +4 -3
  105. package/cjs/Navbar.js +3 -2
  106. package/cjs/NavbarBrand.js +2 -1
  107. package/cjs/NavbarCollapse.js +2 -1
  108. package/cjs/NavbarContext.d.ts +2 -1
  109. package/cjs/NavbarContext.js +2 -1
  110. package/cjs/NavbarOffcanvas.js +2 -1
  111. package/cjs/NavbarText.js +2 -1
  112. package/cjs/NavbarToggle.js +2 -1
  113. package/cjs/Offcanvas.d.ts +2 -2
  114. package/cjs/Offcanvas.js +2 -1
  115. package/cjs/OffcanvasBody.js +2 -1
  116. package/cjs/OffcanvasHeader.js +2 -1
  117. package/cjs/OffcanvasTitle.js +2 -1
  118. package/cjs/OffcanvasToggling.js +2 -1
  119. package/cjs/Overlay.js +10 -1
  120. package/cjs/OverlayTrigger.js +4 -3
  121. package/cjs/PageItem.js +2 -1
  122. package/cjs/Pagination.js +2 -1
  123. package/cjs/Placeholder.js +2 -1
  124. package/cjs/PlaceholderButton.js +2 -1
  125. package/cjs/Popover.d.ts +1 -15
  126. package/cjs/Popover.js +2 -1
  127. package/cjs/PopoverBody.js +2 -1
  128. package/cjs/PopoverHeader.js +2 -1
  129. package/cjs/ProgressBar.d.ts +2 -5
  130. package/cjs/ProgressBar.js +45 -70
  131. package/cjs/Ratio.d.ts +2 -1
  132. package/cjs/Ratio.js +2 -1
  133. package/cjs/Row.js +2 -1
  134. package/cjs/Spinner.js +2 -1
  135. package/cjs/SplitButton.js +2 -1
  136. package/cjs/Stack.js +2 -1
  137. package/cjs/Switch.js +2 -1
  138. package/cjs/Tab.d.ts +1 -1
  139. package/cjs/TabContainer.d.ts +1 -1
  140. package/cjs/TabContent.js +2 -1
  141. package/cjs/TabPane.js +2 -1
  142. package/cjs/Table.js +2 -1
  143. package/cjs/Tabs.js +2 -1
  144. package/cjs/ThemeProvider.d.ts +1 -1
  145. package/cjs/ThemeProvider.js +2 -1
  146. package/cjs/Toast.js +2 -1
  147. package/cjs/ToastBody.js +2 -1
  148. package/cjs/ToastContainer.js +2 -1
  149. package/cjs/ToastContext.d.ts +1 -1
  150. package/cjs/ToastContext.js +2 -1
  151. package/cjs/ToastFade.js +2 -1
  152. package/cjs/ToastHeader.js +2 -1
  153. package/cjs/ToggleButton.js +3 -1
  154. package/cjs/ToggleButtonGroup.js +2 -1
  155. package/cjs/Tooltip.d.ts +1 -15
  156. package/cjs/Tooltip.js +2 -1
  157. package/cjs/TransitionWrapper.js +2 -1
  158. package/cjs/createWithBsPrefix.js +2 -1
  159. package/cjs/divWithClassName.js +2 -1
  160. package/cjs/index.d.ts +2 -0
  161. package/cjs/index.js +4 -2
  162. package/cjs/internal/transitionEnd.d.ts +2 -0
  163. package/cjs/internal/transitionEnd.js +38 -0
  164. package/cjs/internal/warning.d.ts +2 -0
  165. package/cjs/internal/warning.js +37 -0
  166. package/cjs/transitionEndListener.js +1 -1
  167. package/cjs/types.d.ts +6 -9
  168. package/cjs/useCol.d.ts +1 -1
  169. package/dist/react-bootstrap.js +11028 -0
  170. package/dist/react-bootstrap.min.js +2 -0
  171. package/dist/react-bootstrap.min.js.LICENSE.txt +9 -0
  172. package/lib/Accordion.d.ts +1 -1
  173. package/lib/AccordionButton.d.ts +1 -1
  174. package/lib/AccordionContext.d.ts +3 -3
  175. package/lib/Badge.d.ts +1 -7
  176. package/lib/Badge.js +1 -2
  177. package/lib/Card.d.ts +1 -7
  178. package/lib/Card.js +1 -2
  179. package/lib/CardImg.d.ts +2 -1
  180. package/lib/Carousel.d.ts +2 -1
  181. package/lib/Carousel.js +1 -1
  182. package/lib/CloseButton.d.ts +2 -1
  183. package/lib/Container.d.ts +2 -1
  184. package/lib/DropdownMenu.d.ts +2 -1
  185. package/lib/DropdownMenu.js +2 -2
  186. package/lib/DropdownToggle.d.ts +1 -6
  187. package/lib/Form.d.ts +27 -27
  188. package/lib/FormControl.js +2 -2
  189. package/lib/FormLabel.js +2 -2
  190. package/lib/InputGroup.d.ts +2 -2
  191. package/lib/ListGroup.d.ts +3 -3
  192. package/lib/ListGroup.js +2 -2
  193. package/lib/ListGroupItem.js +2 -2
  194. package/lib/Modal.d.ts +2 -2
  195. package/lib/Modal.js +22 -8
  196. package/lib/ModalDialog.d.ts +2 -1
  197. package/lib/Nav.d.ts +2 -2
  198. package/lib/NavDropdown.d.ts +4 -0
  199. package/lib/NavDropdown.js +2 -0
  200. package/lib/Navbar.d.ts +4 -3
  201. package/lib/Navbar.js +1 -1
  202. package/lib/NavbarContext.d.ts +2 -1
  203. package/lib/Offcanvas.d.ts +2 -2
  204. package/lib/Overlay.js +8 -0
  205. package/lib/OverlayTrigger.js +2 -2
  206. package/lib/Popover.d.ts +1 -15
  207. package/lib/ProgressBar.d.ts +2 -5
  208. package/lib/ProgressBar.js +43 -69
  209. package/lib/Ratio.d.ts +2 -1
  210. package/lib/Tab.d.ts +1 -1
  211. package/lib/TabContainer.d.ts +1 -1
  212. package/lib/ThemeProvider.d.ts +1 -1
  213. package/lib/ToastContext.d.ts +1 -1
  214. package/lib/ToggleButton.js +1 -0
  215. package/lib/Tooltip.d.ts +1 -15
  216. package/lib/index.d.ts +2 -0
  217. package/lib/index.js +1 -0
  218. package/lib/internal/transitionEnd.d.ts +2 -0
  219. package/lib/internal/transitionEnd.js +32 -0
  220. package/lib/internal/warning.d.ts +2 -0
  221. package/lib/internal/warning.js +32 -0
  222. package/lib/transitionEndListener.js +1 -1
  223. package/lib/types.d.ts +6 -9
  224. package/lib/useCol.d.ts +1 -1
  225. 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
- "aria-label"?: string | undefined | undefined;
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.FormEventHandler<HTMLInputElement> | undefined;
157
+ onChange?: React.ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined;
158
+ onChangeCapture?: React.ChangeEventHandler<HTMLInputElement, Element> | undefined;
167
159
  onBeforeInput?: React.InputEventHandler<HTMLInputElement> | undefined;
168
- onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
169
- onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
170
- onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
171
- onReset?: React.FormEventHandler<HTMLInputElement> | undefined;
172
- onResetCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
173
- onSubmit?: React.FormEventHandler<HTMLInputElement> | undefined;
174
- onSubmitCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
175
- onInvalid?: React.FormEventHandler<HTMLInputElement> | undefined;
176
- onInvalidCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
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;
@@ -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 warning from 'warning';
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
- process.env.NODE_ENV !== "production" ? warning(controlId == null || !id, '`controlId` is ignored on `<FormControl>` when `id` is specified.') : void 0;
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 warning from 'warning';
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
- process.env.NODE_ENV !== "production" ? warning(controlId == null || !htmlFor, '`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified.') : void 0;
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,
@@ -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) => import("react/jsx-runtime").JSX.Element;
27
- Checkbox: (props: FormCheckInputProps) => import("react/jsx-runtime").JSX.Element;
26
+ Radio: (props: FormCheckInputProps) => React.JSX.Element;
27
+ Checkbox: (props: FormCheckInputProps) => React.JSX.Element;
28
28
  };
29
29
  export default _default;
@@ -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' | string | undefined;
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 | string | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | undefined;
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 warning from 'warning';
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
- process.env.NODE_ENV !== "production" ? warning(!(horizontal && variant === 'flush'), '`variant="flush"` and `horizontal` should not be used together.') : void 0;
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,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import clsx from 'clsx';
4
4
  import * as React from 'react';
5
- import warning from 'warning';
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
- process.env.NODE_ENV !== "production" ? warning(as || !(!action && props.href), '`action=false` and `href` should not be used together.') : void 0;
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 | string | 'sm-down' | 'md-down' | 'lg-down' | 'xl-down' | 'xxl-down' | undefined;
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
- removeStaticModalAnimationRef.current == null || removeStaticModalAnimationRef.current();
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
- removeStaticModalAnimationRef.current = transitionEnd(modal.dialog, () => {
126
- setAnimateStaticModal(false);
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
- removeStaticModalAnimationRef.current == null || removeStaticModalAnimationRef.current();
178
+ cleanupStaticModalAnimation();
179
+ setAnimateStaticModal(false);
166
180
  onExit == null || onExit(node);
167
181
  };
168
182
  const handleEntering = (node, isAppearing) => {
@@ -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 | string | 'sm-down' | 'md-down' | 'lg-down' | 'xl-down' | 'xxl-down' | undefined;
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' | string | undefined;
16
+ variant?: LiteralUnion<'tabs' | 'pills' | 'underline', string> | undefined;
17
17
  /**
18
18
  * The default active key that is selected on start.
19
19
  */
@@ -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>;
@@ -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' | string | undefined;
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 | string | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | undefined;
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 | string | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | undefined;
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
@@ -17,7 +17,7 @@ const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
17
17
  const {
18
18
  bsPrefix: initialBsPrefix,
19
19
  expand = true,
20
- variant = 'light',
20
+ variant,
21
21
  bg,
22
22
  fixed,
23
23
  sticky,
@@ -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 | string | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
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;
@@ -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' | string | undefined;
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,
@@ -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 warning from 'warning';
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
- process.env.NODE_ENV !== "production" ? warning(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.') : void 0;
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, PopperRef } from './types.js';
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>;
@@ -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' | string | undefined;
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;