react-bootstrap 2.8.0 → 2.9.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/cjs/AbstractModalHeader.js +1 -0
  2. package/cjs/Accordion.js +1 -0
  3. package/cjs/AccordionBody.js +1 -0
  4. package/cjs/AccordionButton.js +1 -0
  5. package/cjs/AccordionCollapse.js +1 -0
  6. package/cjs/AccordionContext.js +1 -0
  7. package/cjs/AccordionHeader.js +1 -0
  8. package/cjs/AccordionItem.js +1 -0
  9. package/cjs/AccordionItemContext.js +1 -0
  10. package/cjs/Alert.js +1 -0
  11. package/cjs/Badge.js +1 -0
  12. package/cjs/Breadcrumb.js +1 -0
  13. package/cjs/BreadcrumbItem.js +1 -0
  14. package/cjs/Button.js +1 -0
  15. package/cjs/ButtonGroup.js +1 -0
  16. package/cjs/ButtonToolbar.js +1 -0
  17. package/cjs/Card.js +1 -0
  18. package/cjs/CardHeader.js +1 -0
  19. package/cjs/CardHeaderContext.js +1 -0
  20. package/cjs/CardImg.js +1 -0
  21. package/cjs/Carousel.js +1 -0
  22. package/cjs/CarouselItem.js +1 -0
  23. package/cjs/Col.js +1 -0
  24. package/cjs/Container.js +1 -0
  25. package/cjs/Dropdown.js +1 -0
  26. package/cjs/DropdownContext.js +1 -0
  27. package/cjs/DropdownItem.js +1 -0
  28. package/cjs/DropdownMenu.js +1 -0
  29. package/cjs/DropdownToggle.js +1 -0
  30. package/cjs/FloatingLabel.js +1 -0
  31. package/cjs/FormCheck.js +1 -0
  32. package/cjs/FormCheckInput.js +1 -0
  33. package/cjs/FormCheckLabel.js +1 -0
  34. package/cjs/FormContext.js +1 -0
  35. package/cjs/FormControl.js +1 -0
  36. package/cjs/FormLabel.js +1 -0
  37. package/cjs/FormRange.js +1 -0
  38. package/cjs/FormSelect.js +1 -0
  39. package/cjs/FormText.js +1 -0
  40. package/cjs/Image.js +1 -0
  41. package/cjs/InputGroup.js +1 -0
  42. package/cjs/InputGroupContext.js +1 -0
  43. package/cjs/ListGroup.js +1 -0
  44. package/cjs/ListGroupItem.js +1 -0
  45. package/cjs/Modal.js +1 -0
  46. package/cjs/ModalContext.js +1 -0
  47. package/cjs/ModalDialog.js +1 -0
  48. package/cjs/ModalHeader.js +1 -0
  49. package/cjs/Nav.js +1 -0
  50. package/cjs/NavContext.js +1 -0
  51. package/cjs/NavDropdown.js +1 -0
  52. package/cjs/NavLink.js +1 -0
  53. package/cjs/Navbar.js +1 -0
  54. package/cjs/NavbarBrand.js +1 -0
  55. package/cjs/NavbarCollapse.js +1 -0
  56. package/cjs/NavbarContext.js +1 -0
  57. package/cjs/NavbarOffcanvas.js +1 -0
  58. package/cjs/NavbarToggle.js +1 -0
  59. package/cjs/Offcanvas.js +1 -0
  60. package/cjs/OffcanvasHeader.js +1 -0
  61. package/cjs/OffcanvasToggling.js +1 -0
  62. package/cjs/Overlay.js +1 -0
  63. package/cjs/OverlayTrigger.js +1 -0
  64. package/cjs/Pagination.js +1 -0
  65. package/cjs/Popover.js +1 -0
  66. package/cjs/ProgressBar.js +1 -0
  67. package/cjs/Ratio.js +1 -0
  68. package/cjs/Row.js +1 -0
  69. package/cjs/Spinner.js +1 -0
  70. package/cjs/Stack.js +1 -0
  71. package/cjs/Tab.js +0 -6
  72. package/cjs/TabPane.js +1 -0
  73. package/cjs/Table.js +1 -0
  74. package/cjs/ThemeProvider.js +1 -0
  75. package/cjs/Toast.js +1 -0
  76. package/cjs/ToastContainer.js +1 -0
  77. package/cjs/ToastContext.js +1 -0
  78. package/cjs/ToastHeader.js +1 -0
  79. package/cjs/ToggleButton.js +1 -0
  80. package/cjs/Tooltip.js +1 -0
  81. package/cjs/TransitionWrapper.js +1 -0
  82. package/cjs/createWithBsPrefix.js +1 -0
  83. package/cjs/useOverlayOffset.js +1 -0
  84. package/cjs/usePlaceholder.js +1 -0
  85. package/dist/react-bootstrap.js +98 -16
  86. package/dist/react-bootstrap.min.js +1 -1
  87. package/esm/AbstractModalHeader.js +2 -0
  88. package/esm/Accordion.js +2 -0
  89. package/esm/AccordionBody.js +2 -0
  90. package/esm/AccordionButton.js +2 -0
  91. package/esm/AccordionCollapse.js +2 -0
  92. package/esm/AccordionContext.js +2 -0
  93. package/esm/AccordionHeader.js +2 -0
  94. package/esm/AccordionItem.js +2 -0
  95. package/esm/AccordionItemContext.js +2 -0
  96. package/esm/Alert.js +2 -0
  97. package/esm/Badge.js +2 -0
  98. package/esm/Breadcrumb.js +2 -0
  99. package/esm/BreadcrumbItem.js +2 -0
  100. package/esm/Button.js +2 -0
  101. package/esm/ButtonGroup.js +2 -0
  102. package/esm/ButtonToolbar.js +2 -0
  103. package/esm/Card.js +2 -0
  104. package/esm/CardHeader.js +2 -0
  105. package/esm/CardHeaderContext.js +2 -0
  106. package/esm/CardImg.js +2 -0
  107. package/esm/Carousel.js +2 -0
  108. package/esm/CarouselItem.js +2 -0
  109. package/esm/Col.js +2 -0
  110. package/esm/Container.js +2 -0
  111. package/esm/Dropdown.js +2 -0
  112. package/esm/DropdownContext.js +2 -0
  113. package/esm/DropdownItem.js +2 -0
  114. package/esm/DropdownMenu.js +2 -0
  115. package/esm/DropdownToggle.js +2 -0
  116. package/esm/FloatingLabel.js +2 -0
  117. package/esm/FormCheck.js +2 -0
  118. package/esm/FormCheckInput.js +2 -0
  119. package/esm/FormCheckLabel.js +2 -0
  120. package/esm/FormContext.js +2 -0
  121. package/esm/FormControl.js +2 -0
  122. package/esm/FormLabel.js +2 -0
  123. package/esm/FormRange.js +2 -0
  124. package/esm/FormSelect.js +2 -0
  125. package/esm/FormText.js +2 -0
  126. package/esm/Image.js +2 -0
  127. package/esm/InputGroup.js +2 -0
  128. package/esm/InputGroupContext.js +2 -0
  129. package/esm/ListGroup.js +2 -0
  130. package/esm/ListGroupItem.js +2 -0
  131. package/esm/Modal.js +2 -0
  132. package/esm/ModalContext.js +2 -0
  133. package/esm/ModalDialog.js +2 -0
  134. package/esm/ModalHeader.js +2 -0
  135. package/esm/Nav.js +2 -0
  136. package/esm/NavContext.js +2 -0
  137. package/esm/NavDropdown.js +2 -0
  138. package/esm/NavLink.js +2 -0
  139. package/esm/Navbar.js +2 -0
  140. package/esm/NavbarBrand.js +2 -0
  141. package/esm/NavbarCollapse.js +2 -0
  142. package/esm/NavbarContext.js +2 -0
  143. package/esm/NavbarOffcanvas.js +2 -0
  144. package/esm/NavbarToggle.js +2 -0
  145. package/esm/Offcanvas.js +2 -0
  146. package/esm/OffcanvasHeader.js +2 -0
  147. package/esm/OffcanvasToggling.js +2 -0
  148. package/esm/Overlay.js +2 -0
  149. package/esm/OverlayTrigger.js +2 -0
  150. package/esm/Pagination.js +2 -0
  151. package/esm/Popover.js +2 -0
  152. package/esm/ProgressBar.js +2 -0
  153. package/esm/Ratio.js +2 -0
  154. package/esm/Row.js +2 -0
  155. package/esm/Spinner.js +2 -0
  156. package/esm/Stack.js +2 -0
  157. package/esm/Tab.js +0 -5
  158. package/esm/TabPane.js +2 -0
  159. package/esm/Table.js +2 -0
  160. package/esm/ThemeProvider.js +2 -0
  161. package/esm/Toast.js +2 -0
  162. package/esm/ToastContainer.js +2 -0
  163. package/esm/ToastContext.js +2 -0
  164. package/esm/ToastHeader.js +2 -0
  165. package/esm/ToggleButton.js +2 -0
  166. package/esm/Tooltip.js +2 -0
  167. package/esm/TransitionWrapper.js +2 -0
  168. package/esm/createWithBsPrefix.js +2 -0
  169. package/esm/useOverlayOffset.js +2 -0
  170. package/esm/usePlaceholder.js +2 -0
  171. package/package.json +4 -4
@@ -979,7 +979,7 @@ var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__
979
979
  // EXTERNAL MODULE: ./node_modules/prop-types/index.js
980
980
  var prop_types = __webpack_require__(526);
981
981
  var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
982
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
982
+ ;// CONCATENATED MODULE: ./node_modules/uncontrollable/node_modules/@babel/runtime/helpers/esm/extends.js
983
983
  function extends_extends() {
984
984
  extends_extends = Object.assign ? Object.assign.bind() : function (target) {
985
985
  for (var i = 1; i < arguments.length; i++) {
@@ -994,7 +994,7 @@ function extends_extends() {
994
994
  };
995
995
  return extends_extends.apply(this, arguments);
996
996
  }
997
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
997
+ ;// CONCATENATED MODULE: ./node_modules/uncontrollable/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
998
998
  function objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) {
999
999
  if (source == null) return {};
1000
1000
  var target = {};
@@ -1575,7 +1575,20 @@ function style(node, property) {
1575
1575
  node.style.cssText += ";" + css;
1576
1576
  }
1577
1577
  /* harmony default export */ const css = (style);
1578
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
1578
+ ;// CONCATENATED MODULE: ./node_modules/react-transition-group/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
1579
+ function esm_objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) {
1580
+ if (source == null) return {};
1581
+ var target = {};
1582
+ var sourceKeys = Object.keys(source);
1583
+ var key, i;
1584
+ for (i = 0; i < sourceKeys.length; i++) {
1585
+ key = sourceKeys[i];
1586
+ if (excluded.indexOf(key) >= 0) continue;
1587
+ target[key] = source[key];
1588
+ }
1589
+ return target;
1590
+ }
1591
+ ;// CONCATENATED MODULE: ./node_modules/react-transition-group/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
1579
1592
  function _setPrototypeOf(o, p) {
1580
1593
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
1581
1594
  o.__proto__ = p;
@@ -1583,7 +1596,7 @@ function _setPrototypeOf(o, p) {
1583
1596
  };
1584
1597
  return _setPrototypeOf(o, p);
1585
1598
  }
1586
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
1599
+ ;// CONCATENATED MODULE: ./node_modules/react-transition-group/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
1587
1600
 
1588
1601
  function inheritsLoose_inheritsLoose(subClass, superClass) {
1589
1602
  subClass.prototype = Object.create(superClass.prototype);
@@ -1960,7 +1973,7 @@ var Transition = /*#__PURE__*/function (_React$Component) {
1960
1973
  _onExiting = _this$props.onExiting,
1961
1974
  _onExited = _this$props.onExited,
1962
1975
  _nodeRef = _this$props.nodeRef,
1963
- childProps = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
1976
+ childProps = esm_objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
1964
1977
  return /*#__PURE__*/(
1965
1978
  // allows for nested Transitions
1966
1979
  external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(TransitionGroupContext.Provider, {
@@ -5251,6 +5264,74 @@ var toArray = Function.prototype.bind.call(Function.prototype.call, [].slice);
5251
5264
  function qsa(element, selector) {
5252
5265
  return toArray(element.querySelectorAll(selector));
5253
5266
  }
5267
+ ;// CONCATENATED MODULE: ./node_modules/@restart/ui/node_modules/uncontrollable/lib/esm/index.js
5268
+ function esm_objectWithoutPropertiesLoose(source, excluded) {
5269
+ if (source == null) return {};
5270
+ var target = {};
5271
+ var sourceKeys = Object.keys(source);
5272
+ var key, i;
5273
+ for (i = 0; i < sourceKeys.length; i++) {
5274
+ key = sourceKeys[i];
5275
+ if (excluded.indexOf(key) >= 0) continue;
5276
+ target[key] = source[key];
5277
+ }
5278
+ return target;
5279
+ }
5280
+ function esm_toPropertyKey(arg) {
5281
+ var key = esm_toPrimitive(arg, "string");
5282
+ return typeof key === "symbol" ? key : String(key);
5283
+ }
5284
+ function esm_toPrimitive(input, hint) {
5285
+ if (typeof input !== "object" || input === null) return input;
5286
+ var prim = input[Symbol.toPrimitive];
5287
+ if (prim !== undefined) {
5288
+ var res = prim.call(input, hint || "default");
5289
+ if (typeof res !== "object") return res;
5290
+ throw new TypeError("@@toPrimitive must return a primitive value.");
5291
+ }
5292
+ return (hint === "string" ? String : Number)(input);
5293
+ }
5294
+
5295
+ function esm_defaultKey(key) {
5296
+ return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
5297
+ }
5298
+ function esm_useUncontrolledProp(propValue, defaultValue, handler) {
5299
+ const wasPropRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(propValue !== undefined);
5300
+ const [stateValue, setState] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(defaultValue);
5301
+ const isProp = propValue !== undefined;
5302
+ const wasProp = wasPropRef.current;
5303
+ wasPropRef.current = isProp;
5304
+
5305
+ /**
5306
+ * If a prop switches from controlled to Uncontrolled
5307
+ * reset its value to the defaultValue
5308
+ */
5309
+ if (!isProp && wasProp && stateValue !== defaultValue) {
5310
+ setState(defaultValue);
5311
+ }
5312
+ return [isProp ? propValue : stateValue, (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((value, ...args) => {
5313
+ if (handler) handler(value, ...args);
5314
+ setState(value);
5315
+ }, [handler])];
5316
+ }
5317
+
5318
+ function esm_useUncontrolled(props, config) {
5319
+ return Object.keys(config).reduce((result, fieldName) => {
5320
+ const _ref = result,
5321
+ _defaultKey = esm_defaultKey(fieldName),
5322
+ {
5323
+ [_defaultKey]: defaultValue,
5324
+ [fieldName]: propsValue
5325
+ } = _ref,
5326
+ rest = esm_objectWithoutPropertiesLoose(_ref, [_defaultKey, fieldName].map(esm_toPropertyKey));
5327
+ const handlerName = config[fieldName];
5328
+ const [value, handler] = esm_useUncontrolledProp(propsValue, defaultValue, props[handlerName]);
5329
+ return Object.assign({}, rest, {
5330
+ [fieldName]: value,
5331
+ [handlerName]: handler
5332
+ });
5333
+ }, props);
5334
+ }
5254
5335
  ;// CONCATENATED MODULE: ./node_modules/@restart/hooks/esm/useForceUpdate.js
5255
5336
 
5256
5337
  /**
@@ -7348,12 +7429,16 @@ function useClickOutside(ref, onClickOutside = useClickOutside_noop, {
7348
7429
  }
7349
7430
  });
7350
7431
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
7432
+ var _ownerWindow$event, _ownerWindow$parent;
7351
7433
  if (disabled || ref == null) return undefined;
7352
7434
  const doc = ownerDocument(getRefTarget(ref));
7435
+ const ownerWindow = doc.defaultView || window;
7353
7436
 
7354
7437
  // Store the current event to avoid triggering handlers immediately
7438
+ // For things rendered in an iframe, the event might originate on the parent window
7439
+ // so we should fall back to that global event if the local one doesn't exist
7355
7440
  // https://github.com/facebook/react/issues/20074
7356
- let currentEvent = (doc.defaultView || window).event;
7441
+ let currentEvent = (_ownerWindow$event = ownerWindow.event) != null ? _ownerWindow$event : (_ownerWindow$parent = ownerWindow.parent) == null ? void 0 : _ownerWindow$parent.event;
7357
7442
  let removeInitialTriggerListener = null;
7358
7443
  if (InitialTriggerEvents[clickTrigger]) {
7359
7444
  removeInitialTriggerListener = esm_listen(doc, InitialTriggerEvents[clickTrigger], handleInitialMouse, true);
@@ -7914,7 +7999,7 @@ function Dropdown({
7914
7999
  children
7915
8000
  }) {
7916
8001
  const window = useWindow();
7917
- const [show, onToggle] = useUncontrolledProp(rawShow, defaultShow, rawOnToggle);
8002
+ const [show, onToggle] = esm_useUncontrolledProp(rawShow, defaultShow, rawOnToggle);
7918
8003
 
7919
8004
  // We use normal refs instead of useCallbackRef in order to populate the
7920
8005
  // the value as quickly as possible, otherwise the effect to focus the element
@@ -10659,6 +10744,7 @@ const Modal = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react
10659
10744
  onEntered
10660
10745
  } = _ref,
10661
10746
  rest = Modal_objectWithoutPropertiesLoose(_ref, Modal_excluded);
10747
+ const ownerWindow = useWindow();
10662
10748
  const container = useWaitForDOMRef(containerRef);
10663
10749
  const modal = useModalManager(providedManager);
10664
10750
  const isMounted = useMounted();
@@ -10667,7 +10753,7 @@ const Modal = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react
10667
10753
  const lastFocusRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
10668
10754
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => modal, [modal]);
10669
10755
  if (canUseDOM && !prevShow && show) {
10670
- lastFocusRef.current = activeElement();
10756
+ lastFocusRef.current = activeElement(ownerWindow == null ? void 0 : ownerWindow.document);
10671
10757
  }
10672
10758
 
10673
10759
  // TODO: I think this needs to be in an effect
@@ -10688,7 +10774,8 @@ const Modal = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react
10688
10774
  // autofocus after onShow to not trigger a focus event for previous
10689
10775
  // modals before this one is shown.
10690
10776
  if (autoFocus) {
10691
- const currentActiveElement = activeElement(document);
10777
+ var _modal$dialog$ownerDo, _modal$dialog;
10778
+ const currentActiveElement = activeElement((_modal$dialog$ownerDo = (_modal$dialog = modal.dialog) == null ? void 0 : _modal$dialog.ownerDocument) != null ? _modal$dialog$ownerDo : ownerWindow == null ? void 0 : ownerWindow.document);
10692
10779
  if (modal.dialog && currentActiveElement && !contains_contains(modal.dialog, currentActiveElement)) {
10693
10780
  lastFocusRef.current = currentActiveElement;
10694
10781
  modal.dialog.focus();
@@ -10733,7 +10820,7 @@ const Modal = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react
10733
10820
  if (!enforceFocus || !isMounted() || !modal.isTopModal()) {
10734
10821
  return;
10735
10822
  }
10736
- const currentActiveElement = activeElement();
10823
+ const currentActiveElement = activeElement(ownerWindow == null ? void 0 : ownerWindow.document);
10737
10824
  if (modal.dialog && currentActiveElement && !contains_contains(modal.dialog, currentActiveElement)) {
10738
10825
  modal.dialog.focus();
10739
10826
  }
@@ -14713,7 +14800,7 @@ const Tabs = props => {
14713
14800
  unmountOnExit,
14714
14801
  children
14715
14802
  } = props;
14716
- const [activeKey, onSelect] = useUncontrolledProp(propsActiveKey, defaultActiveKey, propsOnSelect);
14803
+ const [activeKey, onSelect] = esm_useUncontrolledProp(propsActiveKey, defaultActiveKey, propsOnSelect);
14717
14804
  const id = $704cf1d3b684cc5c$export$619500959fc48b26(userId);
14718
14805
  const generateChildId = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => generateCustomChildId || ((key, type) => id ? `${id}-${type}-${key}` : null), [id, generateCustomChildId]);
14719
14806
  const tabContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
@@ -14964,9 +15051,6 @@ TabPane.propTypes = TabPane_propTypes;
14964
15051
 
14965
15052
 
14966
15053
 
14967
-
14968
-
14969
-
14970
15054
  /* eslint-disable react/no-unused-prop-types */
14971
15055
  const Tab_propTypes = {
14972
15056
  eventKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
@@ -14989,8 +15073,6 @@ const Tab_propTypes = {
14989
15073
  };
14990
15074
  const Tab = () => {
14991
15075
  throw new Error('ReactBootstrap: The `Tab` component is not meant to be rendered! ' + "It's an abstract component that is only valid as a direct Child of the `Tabs` Component. " + 'For custom tabs components use TabPane and TabsContainer directly');
14992
- // Needed otherwise docs error out.
14993
- return /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(jsx_dev_runtime.Fragment, {}, void 0, false);
14994
15076
  };
14995
15077
  Tab.propTypes = Tab_propTypes;
14996
15078
  /* harmony default export */ const src_Tab = (Object.assign(Tab, {