@coreui/react 4.1.0 → 4.2.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 (121) hide show
  1. package/README.md +1 -1
  2. package/dist/components/accordion/index.d.ts +7 -0
  3. package/dist/components/alert/index.d.ts +4 -0
  4. package/dist/components/avatar/index.d.ts +2 -0
  5. package/dist/components/backdrop/index.d.ts +2 -0
  6. package/dist/components/badge/index.d.ts +2 -0
  7. package/dist/components/breadcrumb/index.d.ts +3 -0
  8. package/dist/components/button/index.d.ts +2 -0
  9. package/dist/components/button-group/index.d.ts +3 -0
  10. package/dist/components/callout/index.d.ts +2 -0
  11. package/dist/components/card/index.d.ts +12 -0
  12. package/dist/components/carousel/index.d.ts +4 -0
  13. package/dist/components/close-button/index.d.ts +2 -0
  14. package/dist/components/collapse/index.d.ts +2 -0
  15. package/dist/components/dropdown/CDropdown.d.ts +10 -1
  16. package/dist/components/dropdown/CDropdownToggle.d.ts +4 -0
  17. package/dist/components/dropdown/index.d.ts +8 -0
  18. package/dist/components/footer/index.d.ts +2 -0
  19. package/dist/components/form/CForm.d.ts +2 -2
  20. package/dist/components/form/CFormCheck.d.ts +2 -1
  21. package/dist/components/form/CFormControlValidation.d.ts +46 -0
  22. package/dist/components/form/CFormControlWrapper.d.ts +31 -0
  23. package/dist/components/form/CFormInput.d.ts +6 -9
  24. package/dist/components/form/CFormRange.d.ts +7 -1
  25. package/dist/components/form/CFormSelect.d.ts +3 -10
  26. package/dist/components/form/CFormTextarea.d.ts +2 -9
  27. package/dist/components/form/index.d.ts +14 -0
  28. package/dist/components/grid/index.d.ts +4 -0
  29. package/dist/components/header/index.d.ts +7 -0
  30. package/dist/components/image/index.d.ts +2 -0
  31. package/dist/components/index.d.ts +35 -0
  32. package/dist/components/link/index.d.ts +2 -0
  33. package/dist/components/list-group/index.d.ts +3 -0
  34. package/dist/components/modal/CModal.d.ts +4 -0
  35. package/dist/components/modal/index.d.ts +8 -0
  36. package/dist/components/nav/index.d.ts +7 -0
  37. package/dist/components/navbar/index.d.ts +6 -0
  38. package/dist/components/offcanvas/index.d.ts +5 -0
  39. package/dist/components/pagination/index.d.ts +3 -0
  40. package/dist/components/placeholder/index.d.ts +2 -0
  41. package/dist/components/popover/CPopover.d.ts +4 -4
  42. package/dist/components/popover/index.d.ts +2 -0
  43. package/dist/components/progress/index.d.ts +3 -0
  44. package/dist/components/sidebar/index.d.ts +7 -0
  45. package/dist/components/spinner/index.d.ts +2 -0
  46. package/dist/components/table/index.d.ts +9 -0
  47. package/dist/components/tabs/index.d.ts +3 -0
  48. package/dist/components/toast/index.d.ts +6 -0
  49. package/dist/components/tooltip/CTooltip.d.ts +7 -3
  50. package/dist/components/tooltip/index.d.ts +2 -0
  51. package/dist/index.d.ts +0 -120
  52. package/dist/index.es.js +676 -559
  53. package/dist/index.es.js.map +1 -1
  54. package/dist/index.js +676 -559
  55. package/dist/index.js.map +1 -1
  56. package/package.json +13 -12
  57. package/src/components/accordion/CAccordionButton.tsx +2 -1
  58. package/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap +2 -0
  59. package/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap +2 -0
  60. package/src/components/accordion/index.ts +15 -0
  61. package/src/components/alert/CAlert.tsx +14 -3
  62. package/src/components/alert/index.ts +5 -0
  63. package/src/components/avatar/index.ts +3 -0
  64. package/src/components/backdrop/CBackdrop.tsx +10 -3
  65. package/src/components/backdrop/index.ts +3 -0
  66. package/src/components/badge/index.ts +3 -0
  67. package/src/components/breadcrumb/index.ts +4 -0
  68. package/src/components/button/index.ts +3 -0
  69. package/src/components/button-group/index.ts +4 -0
  70. package/src/components/callout/index.ts +3 -0
  71. package/src/components/card/index.ts +25 -0
  72. package/src/components/carousel/index.ts +5 -0
  73. package/src/components/close-button/index.ts +3 -0
  74. package/src/components/collapse/CCollapse.tsx +1 -0
  75. package/src/components/collapse/index.ts +3 -0
  76. package/src/components/dropdown/CDropdown.tsx +19 -24
  77. package/src/components/dropdown/CDropdownItem.tsx +1 -1
  78. package/src/components/dropdown/CDropdownMenu.tsx +55 -3
  79. package/src/components/dropdown/CDropdownToggle.tsx +28 -5
  80. package/src/components/dropdown/index.ts +17 -0
  81. package/src/components/footer/index.ts +3 -0
  82. package/src/components/form/CForm.tsx +2 -2
  83. package/src/components/form/CFormCheck.tsx +32 -7
  84. package/src/components/form/CFormControlValidation.tsx +97 -0
  85. package/src/components/form/CFormControlWrapper.tsx +85 -0
  86. package/src/components/form/CFormInput.tsx +75 -19
  87. package/src/components/form/CFormRange.tsx +18 -4
  88. package/src/components/form/CFormSelect.tsx +60 -32
  89. package/src/components/form/CFormTextarea.tsx +45 -17
  90. package/src/components/form/index.ts +29 -0
  91. package/src/components/grid/index.ts +5 -0
  92. package/src/components/header/index.ts +8 -0
  93. package/src/components/image/index.ts +3 -0
  94. package/src/components/index.ts +35 -0
  95. package/src/components/link/index.ts +3 -0
  96. package/src/components/list-group/index.ts +4 -0
  97. package/src/components/modal/CModal.tsx +43 -19
  98. package/src/components/modal/__tests__/CModal.spec.tsx +1 -1
  99. package/src/components/modal/__tests__/__snapshots__/CModal.spec.tsx.snap +2 -10
  100. package/src/components/modal/index.ts +9 -0
  101. package/src/components/nav/CNavGroup.tsx +1 -0
  102. package/src/components/nav/index.ts +8 -0
  103. package/src/components/navbar/index.ts +7 -0
  104. package/src/components/offcanvas/COffcanvas.tsx +1 -0
  105. package/src/components/offcanvas/index.ts +6 -0
  106. package/src/components/pagination/index.ts +4 -0
  107. package/src/components/placeholder/index.ts +3 -0
  108. package/src/components/popover/CPopover.tsx +63 -61
  109. package/src/components/popover/index.ts +3 -0
  110. package/src/components/progress/index.ts +4 -0
  111. package/src/components/sidebar/index.ts +8 -0
  112. package/src/components/spinner/index.ts +3 -0
  113. package/src/components/table/index.ts +19 -0
  114. package/src/components/tabs/CTabPane.tsx +7 -3
  115. package/src/components/tabs/index.ts +4 -0
  116. package/src/components/toast/CToast.tsx +6 -1
  117. package/src/components/toast/index.ts +7 -0
  118. package/src/components/tooltip/CTooltip.tsx +65 -47
  119. package/src/components/tooltip/index.ts +3 -0
  120. package/src/index.ts +0 -242
  121. package/src/utils/hooks/useForkedRef.ts +5 -0
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
29
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
30
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
31
31
 
32
- /*! *****************************************************************************
32
+ /******************************************************************************
33
33
  Copyright (c) Microsoft Corporation.
34
34
 
35
35
  Permission to use, copy, modify, and/or distribute this software for any
@@ -385,6 +385,8 @@ var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
385
385
 
386
386
  var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
387
387
 
388
+ var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
389
+
388
390
  /**
389
391
  * Copyright (c) 2013-present, Facebook, Inc.
390
392
  *
@@ -397,7 +399,7 @@ var printWarning$2 = function() {};
397
399
  if (process.env.NODE_ENV !== 'production') {
398
400
  var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
399
401
  var loggedTypeFailures = {};
400
- var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
402
+ var has$1 = has$2;
401
403
 
402
404
  printWarning$2 = function(text) {
403
405
  var message = 'Warning: ' + text;
@@ -409,7 +411,7 @@ if (process.env.NODE_ENV !== 'production') {
409
411
  // This error was thrown as a convenience so that you can use this stack
410
412
  // to find the callsite that caused this warning to fire.
411
413
  throw new Error(message);
412
- } catch (x) {}
414
+ } catch (x) { /**/ }
413
415
  };
414
416
  }
415
417
 
@@ -438,7 +440,8 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
438
440
  if (typeof typeSpecs[typeSpecName] !== 'function') {
439
441
  var err = Error(
440
442
  (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
441
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
443
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
444
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
442
445
  );
443
446
  err.name = 'Invariant Violation';
444
447
  throw err;
@@ -497,9 +500,9 @@ var ReactIs$1 = reactIs.exports;
497
500
  var assign = objectAssign;
498
501
 
499
502
  var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
503
+ var has = has$2;
500
504
  var checkPropTypes = checkPropTypes_1;
501
505
 
502
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
503
506
  var printWarning$1 = function() {};
504
507
 
505
508
  if (process.env.NODE_ENV !== 'production') {
@@ -600,6 +603,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
600
603
  // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
601
604
  var ReactPropTypes = {
602
605
  array: createPrimitiveTypeChecker('array'),
606
+ bigint: createPrimitiveTypeChecker('bigint'),
603
607
  bool: createPrimitiveTypeChecker('boolean'),
604
608
  func: createPrimitiveTypeChecker('function'),
605
609
  number: createPrimitiveTypeChecker('number'),
@@ -645,8 +649,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
645
649
  * is prohibitively expensive if they are created too often, such as what
646
650
  * happens in oneOfType() for any type before the one that matched.
647
651
  */
648
- function PropTypeError(message) {
652
+ function PropTypeError(message, data) {
649
653
  this.message = message;
654
+ this.data = data && typeof data === 'object' ? data: {};
650
655
  this.stack = '';
651
656
  }
652
657
  // Make `instanceof Error` still work for returned errors.
@@ -681,7 +686,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
681
686
  ) {
682
687
  printWarning$1(
683
688
  'You are manually calling a React.PropTypes validation ' +
684
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
689
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
685
690
  'and will throw in the standalone `prop-types` package. ' +
686
691
  'You may be seeing this warning due to a third-party PropTypes ' +
687
692
  'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
@@ -720,7 +725,10 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
720
725
  // 'of type `object`'.
721
726
  var preciseType = getPreciseType(propValue);
722
727
 
723
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
728
+ return new PropTypeError(
729
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
730
+ {expectedType: expectedType}
731
+ );
724
732
  }
725
733
  return null;
726
734
  }
@@ -864,14 +872,19 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
864
872
  }
865
873
 
866
874
  function validate(props, propName, componentName, location, propFullName) {
875
+ var expectedTypes = [];
867
876
  for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
868
877
  var checker = arrayOfTypeCheckers[i];
869
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) {
878
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
879
+ if (checkerResult == null) {
870
880
  return null;
871
881
  }
882
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
883
+ expectedTypes.push(checkerResult.data.expectedType);
884
+ }
872
885
  }
873
-
874
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
886
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
887
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
875
888
  }
876
889
  return createChainableTypeChecker(validate);
877
890
  }
@@ -886,6 +899,13 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
886
899
  return createChainableTypeChecker(validate);
887
900
  }
888
901
 
902
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
903
+ return new PropTypeError(
904
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
905
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
906
+ );
907
+ }
908
+
889
909
  function createShapeTypeChecker(shapeTypes) {
890
910
  function validate(props, propName, componentName, location, propFullName) {
891
911
  var propValue = props[propName];
@@ -895,8 +915,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
895
915
  }
896
916
  for (var key in shapeTypes) {
897
917
  var checker = shapeTypes[key];
898
- if (!checker) {
899
- continue;
918
+ if (typeof checker !== 'function') {
919
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
900
920
  }
901
921
  var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
902
922
  if (error) {
@@ -915,16 +935,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
915
935
  if (propType !== 'object') {
916
936
  return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
917
937
  }
918
- // We need to check all keys in case some are required but missing from
919
- // props.
938
+ // We need to check all keys in case some are required but missing from props.
920
939
  var allKeys = assign({}, props[propName], shapeTypes);
921
940
  for (var key in allKeys) {
922
941
  var checker = shapeTypes[key];
942
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
943
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
944
+ }
923
945
  if (!checker) {
924
946
  return new PropTypeError(
925
947
  'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
926
948
  '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
927
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
949
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
928
950
  );
929
951
  }
930
952
  var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
@@ -1109,6 +1131,7 @@ var factoryWithThrowingShims = function() {
1109
1131
  // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1110
1132
  var ReactPropTypes = {
1111
1133
  array: shim,
1134
+ bigint: shim,
1112
1135
  bool: shim,
1113
1136
  func: shim,
1114
1137
  number: shim,
@@ -2387,6 +2410,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
2387
2410
  var CSSTransition$1 = CSSTransition;
2388
2411
 
2389
2412
  // code borrowed from https://github.com/reach/reach-ui
2413
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2390
2414
  function useForkedRef() {
2391
2415
  var refs = [];
2392
2416
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -2396,6 +2420,7 @@ function useForkedRef() {
2396
2420
  if (refs.every(function (ref) { return ref == null; })) {
2397
2421
  return null;
2398
2422
  }
2423
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2399
2424
  return function (node) {
2400
2425
  refs.forEach(function (ref) {
2401
2426
  assignRef(ref, node);
@@ -2403,7 +2428,10 @@ function useForkedRef() {
2403
2428
  };
2404
2429
  }, refs);
2405
2430
  }
2406
- function assignRef(ref, value) {
2431
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2432
+ function assignRef(ref,
2433
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2434
+ value) {
2407
2435
  if (ref == null)
2408
2436
  return;
2409
2437
  if (isFunction(ref)) {
@@ -2418,6 +2446,7 @@ function assignRef(ref, value) {
2418
2446
  }
2419
2447
  }
2420
2448
  }
2449
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
2421
2450
  function isFunction(value) {
2422
2451
  return !!(value && {}.toString.call(value) == '[object Function]');
2423
2452
  }
@@ -2477,7 +2506,7 @@ var CCollapse = React.forwardRef(function (_a, ref) {
2477
2506
  var _className = classNames({
2478
2507
  'collapse-horizontal': horizontal,
2479
2508
  }, className);
2480
- return (React__default["default"].createElement(CSSTransition$1, { in: visible, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 350 }, function (state) {
2509
+ return (React__default["default"].createElement(CSSTransition$1, { in: visible, nodeRef: collapseRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 350 }, function (state) {
2481
2510
  var transitionClass = getTransitionClass(state);
2482
2511
  var currentHeight = height === 0 ? null : { height: height };
2483
2512
  var currentWidth = width === 0 ? null : { width: width };
@@ -2511,7 +2540,7 @@ var CAccordionButton = React.forwardRef(function (_a, ref) {
2511
2540
  var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
2512
2541
  var _b = React.useContext(CAccordionItemContext), visible = _b.visible, setVisible = _b.setVisible;
2513
2542
  var _className = classNames('accordion-button', { collapsed: !visible }, className);
2514
- return (React__default["default"].createElement("button", __assign({ className: _className }, rest, { "aria-expanded": !visible, onClick: function () { return setVisible(!visible); }, ref: ref }), children));
2543
+ return (React__default["default"].createElement("button", __assign({ type: "button", className: _className, "aria-expanded": !visible, onClick: function () { return setVisible(!visible); } }, rest, { ref: ref }), children));
2515
2544
  });
2516
2545
  CAccordionButton.propTypes = {
2517
2546
  children: PropTypes.node,
@@ -2609,6 +2638,8 @@ CCloseButton.displayName = 'CCloseButton';
2609
2638
 
2610
2639
  var CAlert = React.forwardRef(function (_a, ref) {
2611
2640
  var children = _a.children, className = _a.className, _b = _a.color, color = _b === void 0 ? 'primary' : _b, dismissible = _a.dismissible, variant = _a.variant, _c = _a.visible, visible = _c === void 0 ? true : _c, onClose = _a.onClose, rest = __rest(_a, ["children", "className", "color", "dismissible", "variant", "visible", "onClose"]);
2641
+ var alertRef = React.useRef(null);
2642
+ var forkedRef = useForkedRef(ref, alertRef);
2612
2643
  var _d = React.useState(visible), _visible = _d[0], setVisible = _d[1];
2613
2644
  React.useEffect(function () {
2614
2645
  setVisible(visible);
@@ -2619,9 +2650,9 @@ var CAlert = React.forwardRef(function (_a, ref) {
2619
2650
  var getTransitionClass = function (state) {
2620
2651
  return state === 'entered' && 'show';
2621
2652
  };
2622
- return (React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, onExit: onClose, timeout: 150, unmountOnExit: true }, function (state) {
2653
+ return (React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: alertRef, onExit: onClose, timeout: 150, unmountOnExit: true }, function (state) {
2623
2654
  var transitionClass = getTransitionClass(state);
2624
- return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass), role: "alert" }, rest, { ref: ref }),
2655
+ return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass), role: "alert" }, rest, { ref: forkedRef }),
2625
2656
  children,
2626
2657
  dismissible && React__default["default"].createElement(CCloseButton, { onClick: function () { return setVisible(false); } })));
2627
2658
  }));
@@ -2705,6 +2736,25 @@ CAvatar.propTypes = {
2705
2736
  };
2706
2737
  CAvatar.displayName = 'CAvatar';
2707
2738
 
2739
+ var CBackdrop = React.forwardRef(function (_a, ref) {
2740
+ var _b = _a.className, className = _b === void 0 ? 'modal-backdrop' : _b, visible = _a.visible, rest = __rest(_a, ["className", "visible"]);
2741
+ var backdropRef = React.useRef(null);
2742
+ var forkedRef = useForkedRef(ref, backdropRef);
2743
+ var _className = classNames(className, 'fade');
2744
+ var getTransitionClass = function (state) {
2745
+ return state === 'entered' && 'show';
2746
+ };
2747
+ return (React__default["default"].createElement(Transition$1, { in: visible, mountOnEnter: true, nodeRef: backdropRef, timeout: 150, unmountOnExit: true }, function (state) {
2748
+ var transitionClass = getTransitionClass(state);
2749
+ return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: forkedRef })));
2750
+ }));
2751
+ });
2752
+ CBackdrop.propTypes = {
2753
+ className: PropTypes.string,
2754
+ visible: PropTypes.bool,
2755
+ };
2756
+ CBackdrop.displayName = 'CBackdrop';
2757
+
2708
2758
  var CBadge = React.forwardRef(function (_a, ref) {
2709
2759
  var _b;
2710
2760
  var children = _a.children, className = _a.className, color = _a.color, _c = _a.component, Component = _c === void 0 ? 'span' : _c, position = _a.position, shape = _a.shape, size = _a.size, textColor = _a.textColor, rest = __rest(_a, ["children", "className", "color", "component", "position", "shape", "size", "textColor"]);
@@ -2732,23 +2782,6 @@ CBadge.propTypes = {
2732
2782
  };
2733
2783
  CBadge.displayName = 'CBadge';
2734
2784
 
2735
- var CBackdrop = React.forwardRef(function (_a, ref) {
2736
- var _b = _a.className, className = _b === void 0 ? 'modal-backdrop' : _b, visible = _a.visible, rest = __rest(_a, ["className", "visible"]);
2737
- var _className = classNames(className, 'fade');
2738
- var getTransitionClass = function (state) {
2739
- return state === 'entered' && 'show';
2740
- };
2741
- return (React__default["default"].createElement(Transition$1, { in: visible, mountOnEnter: true, timeout: 150, unmountOnExit: true }, function (state) {
2742
- var transitionClass = getTransitionClass(state);
2743
- return React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: ref }));
2744
- }));
2745
- });
2746
- CBackdrop.propTypes = {
2747
- className: PropTypes.string,
2748
- visible: PropTypes.bool,
2749
- };
2750
- CBackdrop.displayName = 'CBackdrop';
2751
-
2752
2785
  var CBreadcrumb = React.forwardRef(function (_a, ref) {
2753
2786
  var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
2754
2787
  var _className = classNames('breadcrumb', className);
@@ -2794,6 +2827,17 @@ CButton.propTypes = {
2794
2827
  };
2795
2828
  CButton.displayName = 'CButton';
2796
2829
 
2830
+ var CButtonToolbar = React.forwardRef(function (_a, ref) {
2831
+ var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
2832
+ var _className = classNames('btn-toolbar', className);
2833
+ return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
2834
+ });
2835
+ CButtonToolbar.propTypes = {
2836
+ children: PropTypes.node,
2837
+ className: PropTypes.string,
2838
+ };
2839
+ CButtonToolbar.displayName = 'CButtonToolbar';
2840
+
2797
2841
  var CButtonGroup = React.forwardRef(function (_a, ref) {
2798
2842
  var _b;
2799
2843
  var children = _a.children, className = _a.className, size = _a.size, vertical = _a.vertical, rest = __rest(_a, ["children", "className", "size", "vertical"]);
@@ -2808,17 +2852,6 @@ CButtonGroup.propTypes = {
2808
2852
  };
2809
2853
  CButtonGroup.displayName = 'CButtonGroup';
2810
2854
 
2811
- var CButtonToolbar = React.forwardRef(function (_a, ref) {
2812
- var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
2813
- var _className = classNames('btn-toolbar', className);
2814
- return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
2815
- });
2816
- CButtonToolbar.propTypes = {
2817
- children: PropTypes.node,
2818
- className: PropTypes.string,
2819
- };
2820
- CButtonToolbar.displayName = 'CButtonToolbar';
2821
-
2822
2855
  var CCallout = React.forwardRef(function (_a, ref) {
2823
2856
  var _b;
2824
2857
  var children = _a.children, className = _a.className, color = _a.color, rest = __rest(_a, ["children", "className", "color"]);
@@ -3569,6 +3602,10 @@ function getContainingBlock(element) {
3569
3602
 
3570
3603
  var currentNode = getParentNode(element);
3571
3604
 
3605
+ if (isShadowRoot(currentNode)) {
3606
+ currentNode = currentNode.host;
3607
+ }
3608
+
3572
3609
  while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
3573
3610
  var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
3574
3611
  // create a containing block.
@@ -3761,13 +3798,21 @@ function mapToStyles(_ref2) {
3761
3798
  adaptive = _ref2.adaptive,
3762
3799
  roundOffsets = _ref2.roundOffsets,
3763
3800
  isFixed = _ref2.isFixed;
3801
+ var _offsets$x = offsets.x,
3802
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
3803
+ _offsets$y = offsets.y,
3804
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
3764
3805
 
3765
- var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
3766
- _ref3$x = _ref3.x,
3767
- x = _ref3$x === void 0 ? 0 : _ref3$x,
3768
- _ref3$y = _ref3.y,
3769
- y = _ref3$y === void 0 ? 0 : _ref3$y;
3806
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
3807
+ x: x,
3808
+ y: y
3809
+ }) : {
3810
+ x: x,
3811
+ y: y
3812
+ };
3770
3813
 
3814
+ x = _ref3.x;
3815
+ y = _ref3.y;
3771
3816
  var hasX = offsets.hasOwnProperty('x');
3772
3817
  var hasY = offsets.hasOwnProperty('y');
3773
3818
  var sideX = left;
@@ -3793,7 +3838,7 @@ function mapToStyles(_ref2) {
3793
3838
 
3794
3839
  if (placement === top || (placement === left || placement === right) && variation === end) {
3795
3840
  sideY = bottom;
3796
- var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
3841
+ var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
3797
3842
  offsetParent[heightProp];
3798
3843
  y -= offsetY - popperRect.height;
3799
3844
  y *= gpuAcceleration ? 1 : -1;
@@ -3801,7 +3846,7 @@ function mapToStyles(_ref2) {
3801
3846
 
3802
3847
  if (placement === left || (placement === top || placement === bottom) && variation === end) {
3803
3848
  sideX = right;
3804
- var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
3849
+ var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
3805
3850
  offsetParent[widthProp];
3806
3851
  x -= offsetX - popperRect.width;
3807
3852
  x *= gpuAcceleration ? 1 : -1;
@@ -3812,6 +3857,17 @@ function mapToStyles(_ref2) {
3812
3857
  position: position
3813
3858
  }, adaptive && unsetSides);
3814
3859
 
3860
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
3861
+ x: x,
3862
+ y: y
3863
+ }) : {
3864
+ x: x,
3865
+ y: y
3866
+ };
3867
+
3868
+ x = _ref4.x;
3869
+ y = _ref4.y;
3870
+
3815
3871
  if (gpuAcceleration) {
3816
3872
  var _Object$assign;
3817
3873
 
@@ -3821,9 +3877,9 @@ function mapToStyles(_ref2) {
3821
3877
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
3822
3878
  }
3823
3879
 
3824
- function computeStyles(_ref4) {
3825
- var state = _ref4.state,
3826
- options = _ref4.options;
3880
+ function computeStyles(_ref5) {
3881
+ var state = _ref5.state,
3882
+ options = _ref5.options;
3827
3883
  var _options$gpuAccelerat = options.gpuAcceleration,
3828
3884
  gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
3829
3885
  _options$adaptive = options.adaptive,
@@ -4122,7 +4178,7 @@ function getClippingParents(element) {
4122
4178
 
4123
4179
 
4124
4180
  return clippingParents.filter(function (clippingParent) {
4125
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle$1(clippingParent).position !== 'static' : true);
4181
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
4126
4182
  });
4127
4183
  } // Gets the maximum area that the element is visible in due to any number of
4128
4184
  // clipping parents
@@ -5597,9 +5653,10 @@ function Reference(_ref) {
5597
5653
 
5598
5654
  var CDropdownContext = React.createContext({});
5599
5655
  var CDropdown = React.forwardRef(function (_a, ref) {
5600
- var children = _a.children, alignment = _a.alignment, className = _a.className, dark = _a.dark, direction = _a.direction, onHide = _a.onHide, onShow = _a.onShow, _b = _a.placement, placement = _b === void 0 ? 'bottom-start' : _b, _c = _a.popper, popper = _c === void 0 ? true : _c, _d = _a.variant, variant = _d === void 0 ? 'btn-group' : _d, _e = _a.component, component = _e === void 0 ? 'div' : _e, _f = _a.visible, visible = _f === void 0 ? false : _f, rest = __rest(_a, ["children", "alignment", "className", "dark", "direction", "onHide", "onShow", "placement", "popper", "variant", "component", "visible"]);
5601
- var _g = React.useState(visible), _visible = _g[0], setVisible = _g[1];
5656
+ var children = _a.children, alignment = _a.alignment, _b = _a.autoClose, autoClose = _b === void 0 ? true : _b, className = _a.className, dark = _a.dark, direction = _a.direction, onHide = _a.onHide, onShow = _a.onShow, _c = _a.placement, placement = _c === void 0 ? 'bottom-start' : _c, _d = _a.popper, popper = _d === void 0 ? true : _d, _e = _a.variant, variant = _e === void 0 ? 'btn-group' : _e, _f = _a.component, component = _f === void 0 ? 'div' : _f, _g = _a.visible, visible = _g === void 0 ? false : _g, rest = __rest(_a, ["children", "alignment", "autoClose", "className", "dark", "direction", "onHide", "onShow", "placement", "popper", "variant", "component", "visible"]);
5657
+ var _h = React.useState(visible), _visible = _h[0], setVisible = _h[1];
5602
5658
  var dropdownRef = React.useRef(null);
5659
+ var dropdownToggleRef = React.useRef(null);
5603
5660
  var forkedRef = useForkedRef(ref, dropdownRef);
5604
5661
  var Component = variant === 'nav-item' ? 'li' : component;
5605
5662
  // Disable popper if responsive aligment is set.
@@ -5608,8 +5665,10 @@ var CDropdown = React.forwardRef(function (_a, ref) {
5608
5665
  }
5609
5666
  var contextValues = {
5610
5667
  alignment: alignment,
5668
+ autoClose: autoClose,
5611
5669
  dark: dark,
5612
5670
  direction: direction,
5671
+ dropdownToggleRef: dropdownToggleRef,
5613
5672
  placement: placement,
5614
5673
  popper: popper,
5615
5674
  variant: variant,
@@ -5619,17 +5678,6 @@ var CDropdown = React.forwardRef(function (_a, ref) {
5619
5678
  var _className = classNames(variant === 'nav-item' ? 'nav-item dropdown' : variant, {
5620
5679
  show: _visible,
5621
5680
  }, direction, className);
5622
- React.useEffect(function () {
5623
- _visible &&
5624
- setTimeout(function () {
5625
- window.addEventListener('click', handleClickOutside);
5626
- window.addEventListener('keyup', handleKeyup);
5627
- });
5628
- return function () {
5629
- window.removeEventListener('click', handleClickOutside);
5630
- window.removeEventListener('keyup', handleKeyup);
5631
- };
5632
- }, [_visible]);
5633
5681
  React.useEffect(function () {
5634
5682
  setVisible(visible);
5635
5683
  }, [visible]);
@@ -5637,18 +5685,6 @@ var CDropdown = React.forwardRef(function (_a, ref) {
5637
5685
  _visible && onShow && onShow();
5638
5686
  !_visible && onHide && onHide();
5639
5687
  }, [_visible]);
5640
- var handleKeyup = function (event) {
5641
- var _a;
5642
- if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
5643
- setVisible(false);
5644
- }
5645
- };
5646
- var handleClickOutside = function (event) {
5647
- var _a;
5648
- if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
5649
- setVisible(false);
5650
- }
5651
- };
5652
5688
  var dropdownContent = function () {
5653
5689
  return variant === 'input-group' ? (React__default["default"].createElement(React__default["default"].Fragment, null, children)) : (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: forkedRef }), children));
5654
5690
  };
@@ -5667,6 +5703,10 @@ CDropdown.propTypes = {
5667
5703
  PropTypes.shape({ xl: alignmentDirection }),
5668
5704
  PropTypes.shape({ xxl: alignmentDirection }),
5669
5705
  ]),
5706
+ autoClose: PropTypes.oneOfType([
5707
+ PropTypes.bool,
5708
+ PropTypes.oneOf(['inside', 'outside']),
5709
+ ]),
5670
5710
  children: PropTypes.node,
5671
5711
  className: PropTypes.string,
5672
5712
  component: PropTypes.elementType,
@@ -5706,7 +5746,7 @@ CDropdownHeader.displayName = 'CDropdownHeader';
5706
5746
  var CDropdownItem = React.forwardRef(function (_a, ref) {
5707
5747
  var children = _a.children, className = _a.className, _b = _a.component, component = _b === void 0 ? 'a' : _b, rest = __rest(_a, ["children", "className", "component"]);
5708
5748
  var _className = classNames('dropdown-item', className);
5709
- return (React__default["default"].createElement(CLink, __assign({ component: component }, rest, { className: _className, ref: ref }), children));
5749
+ return (React__default["default"].createElement(CLink, __assign({ className: _className, component: component }, rest, { ref: ref }), children));
5710
5750
  });
5711
5751
  CDropdownItem.propTypes = {
5712
5752
  children: PropTypes.node,
@@ -5729,7 +5769,36 @@ CDropdownItemPlain.displayName = 'CDropdownItemPlain';
5729
5769
 
5730
5770
  var CDropdownMenu = function (_a) {
5731
5771
  var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'ul' : _b, rest = __rest(_a, ["children", "className", "component"]);
5732
- var _c = React.useContext(CDropdownContext), alignment = _c.alignment, dark = _c.dark, direction = _c.direction, placement = _c.placement, popper = _c.popper, visible = _c.visible;
5772
+ var _c = React.useContext(CDropdownContext), alignment = _c.alignment, autoClose = _c.autoClose, dark = _c.dark, direction = _c.direction, dropdownToggleRef = _c.dropdownToggleRef, placement = _c.placement, popper = _c.popper, visible = _c.visible, setVisible = _c.setVisible;
5773
+ var dropdownMenuRef = React.useRef(null);
5774
+ React.useEffect(function () {
5775
+ visible && window.addEventListener('mouseup', handleMouseUp);
5776
+ visible && window.addEventListener('keyup', handleKeyup);
5777
+ return function () {
5778
+ window.removeEventListener('mouseup', handleMouseUp);
5779
+ window.removeEventListener('keyup', handleKeyup);
5780
+ };
5781
+ }, [visible]);
5782
+ var handleKeyup = function (event) {
5783
+ if (autoClose === false) {
5784
+ return;
5785
+ }
5786
+ if (event.key === 'Escape') {
5787
+ setVisible(false);
5788
+ }
5789
+ };
5790
+ var handleMouseUp = function (event) {
5791
+ var _a, _b;
5792
+ if (dropdownToggleRef && dropdownToggleRef.current.contains(event.target)) {
5793
+ return;
5794
+ }
5795
+ if (autoClose === true ||
5796
+ (autoClose === 'inside' && ((_a = dropdownMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) ||
5797
+ (autoClose === 'outside' && !((_b = dropdownMenuRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)))) {
5798
+ setTimeout(function () { return setVisible(false); }, 1);
5799
+ return;
5800
+ }
5801
+ };
5733
5802
  var _placement = placement;
5734
5803
  if (direction === 'dropup') {
5735
5804
  _placement = 'top-start';
@@ -5769,7 +5838,7 @@ var CDropdownMenu = function (_a) {
5769
5838
  })
5770
5839
  : children));
5771
5840
  };
5772
- return popper && visible ? (React__default["default"].createElement(Popper, { placement: _placement }, function (_a) {
5841
+ return popper && visible ? (React__default["default"].createElement(Popper, { innerRef: dropdownMenuRef, placement: _placement }, function (_a) {
5773
5842
  var ref = _a.ref, style = _a.style;
5774
5843
  return dropdownMenuComponent(style, ref);
5775
5844
  })) : (dropdownMenuComponent());
@@ -5782,8 +5851,8 @@ CDropdownMenu.propTypes = {
5782
5851
  CDropdownMenu.displayName = 'CDropdownMenu';
5783
5852
 
5784
5853
  var CDropdownToggle = function (_a) {
5785
- var children = _a.children, _b = _a.caret, caret = _b === void 0 ? true : _b, className = _a.className, split = _a.split, _c = _a.trigger, trigger = _c === void 0 ? 'click' : _c, rest = __rest(_a, ["children", "caret", "className", "split", "trigger"]);
5786
- var _d = React.useContext(CDropdownContext), popper = _d.popper, variant = _d.variant, visible = _d.visible, setVisible = _d.setVisible;
5854
+ var children = _a.children, _b = _a.caret, caret = _b === void 0 ? true : _b, custom = _a.custom, className = _a.className, split = _a.split, _c = _a.trigger, trigger = _c === void 0 ? 'click' : _c, rest = __rest(_a, ["children", "caret", "custom", "className", "split", "trigger"]);
5855
+ var _d = React.useContext(CDropdownContext), dropdownToggleRef = _d.dropdownToggleRef, popper = _d.popper, variant = _d.variant, visible = _d.visible, setVisible = _d.setVisible;
5787
5856
  var _className = classNames({
5788
5857
  'dropdown-toggle': caret,
5789
5858
  'dropdown-toggle-split': split,
@@ -5798,199 +5867,90 @@ var CDropdownToggle = function (_a) {
5798
5867
  onFocus: function () { return setVisible(true); },
5799
5868
  onBlur: function () { return setVisible(false); },
5800
5869
  }));
5801
- var togglerProps = __assign({ className: _className, 'aria-expanded': visible }, triggers);
5870
+ var togglerProps = __assign(__assign({ className: _className, 'aria-expanded': visible }, (!rest.disabled && __assign({}, triggers))), triggers);
5802
5871
  // We use any because Toggler can be `a` as well as `button`.
5803
5872
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5804
5873
  var Toggler = function (ref) {
5805
- return variant === 'nav-item' ? (React__default["default"].createElement("a", __assign({ href: "#" }, togglerProps, { ref: ref }), children)) : (React__default["default"].createElement(CButton, __assign({ type: "button" }, togglerProps, { tabIndex: 0 }, rest, { ref: ref }),
5874
+ return custom && React__default["default"].isValidElement(children) ? (React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].cloneElement(children, __assign(__assign({ 'aria-expanded': visible }, (!rest.disabled && __assign({}, triggers))), { ref: useForkedRef(ref, dropdownToggleRef) })))) : variant === 'nav-item' ? (React__default["default"].createElement("a", __assign({ href: "#" }, togglerProps, { ref: useForkedRef(ref, dropdownToggleRef) }), children)) : (React__default["default"].createElement(CButton, __assign({ type: "button" }, togglerProps, { tabIndex: 0 }, rest, { ref: useForkedRef(ref, dropdownToggleRef) }),
5806
5875
  children,
5807
5876
  split && React__default["default"].createElement("span", { className: "visually-hidden" }, "Toggle Dropdown")));
5808
5877
  };
5809
5878
  return popper ? React__default["default"].createElement(Reference, null, function (_a) {
5810
5879
  var ref = _a.ref;
5811
5880
  return Toggler(ref);
5812
- }) : Toggler();
5881
+ }) : Toggler(dropdownToggleRef);
5813
5882
  };
5814
5883
  CDropdownToggle.propTypes = {
5815
5884
  caret: PropTypes.bool,
5816
5885
  children: PropTypes.node,
5817
5886
  className: PropTypes.string,
5887
+ custom: PropTypes.bool,
5818
5888
  split: PropTypes.bool,
5819
5889
  trigger: triggerPropType,
5820
5890
  };
5821
5891
  CDropdownToggle.displayName = 'CDropdownToggle';
5822
5892
 
5823
- var BREAKPOINTS$3 = [
5824
- 'xxl',
5825
- 'xl',
5826
- 'lg',
5827
- 'md',
5828
- 'sm',
5829
- 'xs',
5830
- ];
5831
- var CCol = React.forwardRef(function (_a, ref) {
5832
- var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
5833
- var repsonsiveClassNames = [];
5834
- BREAKPOINTS$3.forEach(function (bp) {
5835
- var breakpoint = rest[bp];
5836
- delete rest[bp];
5837
- var infix = bp === 'xs' ? '' : "-".concat(bp);
5838
- if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
5839
- repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint));
5840
- }
5841
- if (typeof breakpoint === 'boolean') {
5842
- repsonsiveClassNames.push("col".concat(infix));
5843
- }
5844
- if (breakpoint && typeof breakpoint === 'object') {
5845
- if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
5846
- repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint.span));
5847
- }
5848
- if (typeof breakpoint.span === 'boolean') {
5849
- repsonsiveClassNames.push("col".concat(infix));
5850
- }
5851
- if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
5852
- repsonsiveClassNames.push("order".concat(infix, "-").concat(breakpoint.order));
5853
- }
5854
- if (typeof breakpoint.offset === 'number') {
5855
- repsonsiveClassNames.push("offset".concat(infix, "-").concat(breakpoint.offset));
5856
- }
5857
- }
5858
- });
5859
- var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'col', className);
5893
+ var CFooter = React.forwardRef(function (_a, ref) {
5894
+ var _b;
5895
+ var children = _a.children, className = _a.className, position = _a.position, rest = __rest(_a, ["children", "className", "position"]);
5896
+ var _className = classNames('footer', (_b = {}, _b["footer-".concat(position)] = position, _b), className);
5860
5897
  return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
5861
5898
  });
5862
- var span = PropTypes.oneOfType([
5863
- PropTypes.bool,
5864
- PropTypes.number,
5865
- PropTypes.string,
5866
- PropTypes.oneOf(['auto']),
5867
- ]);
5868
- var col = PropTypes.oneOfType([
5869
- span,
5870
- PropTypes.shape({
5871
- span: span,
5872
- offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
5873
- order: PropTypes.oneOfType([
5874
- PropTypes.oneOf(['first', 'last']),
5875
- PropTypes.number,
5876
- PropTypes.string,
5877
- ]),
5878
- }),
5879
- ]);
5880
- CCol.propTypes = {
5899
+ CFooter.propTypes = {
5881
5900
  children: PropTypes.node,
5882
5901
  className: PropTypes.string,
5883
- xs: col,
5884
- sm: col,
5902
+ position: PropTypes.oneOf(['fixed', 'sticky']),
5885
5903
  };
5886
- CCol.displayName = 'CCol';
5904
+ CFooter.displayName = 'CFooter';
5887
5905
 
5888
- var BREAKPOINTS$2 = [
5889
- 'xxl',
5890
- 'xl',
5891
- 'lg',
5892
- 'md',
5893
- 'sm',
5894
- 'fluid',
5895
- ];
5896
- var CContainer = React.forwardRef(function (_a, ref) {
5897
- var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
5898
- var repsonsiveClassNames = [];
5899
- BREAKPOINTS$2.forEach(function (bp) {
5900
- var breakpoint = rest[bp];
5901
- delete rest[bp];
5902
- breakpoint && repsonsiveClassNames.push("container-".concat(bp));
5903
- });
5904
- var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'container', className);
5905
- return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
5906
+ var CForm = React.forwardRef(function (_a, ref) {
5907
+ var children = _a.children, className = _a.className, validated = _a.validated, rest = __rest(_a, ["children", "className", "validated"]);
5908
+ var _className = classNames({ 'was-validated': validated }, className);
5909
+ return (React__default["default"].createElement("form", __assign({ className: _className }, rest, { ref: ref }), children));
5906
5910
  });
5907
- CContainer.propTypes = {
5911
+ CForm.propTypes = {
5908
5912
  children: PropTypes.node,
5909
5913
  className: PropTypes.string,
5910
- sm: PropTypes.bool,
5911
- md: PropTypes.bool,
5912
- lg: PropTypes.bool,
5913
- xl: PropTypes.bool,
5914
- xxl: PropTypes.bool,
5915
- fluid: PropTypes.bool,
5914
+ validated: PropTypes.bool,
5916
5915
  };
5917
- CContainer.displayName = 'CContainer';
5916
+ CForm.displayName = 'CForm';
5918
5917
 
5919
- var BREAKPOINTS$1 = [
5920
- 'xxl',
5921
- 'xl',
5922
- 'lg',
5923
- 'md',
5924
- 'sm',
5925
- 'xs',
5926
- ];
5927
- var CRow = React.forwardRef(function (_a, ref) {
5928
- var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
5929
- var repsonsiveClassNames = [];
5930
- BREAKPOINTS$1.forEach(function (bp) {
5931
- var breakpoint = rest[bp];
5932
- delete rest[bp];
5933
- var infix = bp === 'xs' ? '' : "-".concat(bp);
5934
- if (typeof breakpoint === 'object') {
5935
- if (breakpoint.cols) {
5936
- repsonsiveClassNames.push("row-cols".concat(infix, "-").concat(breakpoint.cols));
5937
- }
5938
- if (typeof breakpoint.gutter === 'number') {
5939
- repsonsiveClassNames.push("g".concat(infix, "-").concat(breakpoint.gutter));
5940
- }
5941
- if (typeof breakpoint.gutterX === 'number') {
5942
- repsonsiveClassNames.push("gx".concat(infix, "-").concat(breakpoint.gutterX));
5943
- }
5944
- if (typeof breakpoint.gutterY === 'number') {
5945
- repsonsiveClassNames.push("gy".concat(infix, "-").concat(breakpoint.gutterY));
5946
- }
5947
- }
5948
- });
5949
- var _className = classNames('row', repsonsiveClassNames, className);
5950
- return (React__default["default"].createElement("div", { className: _className, ref: ref }, children));
5918
+ var CFormFeedback = React.forwardRef(function (_a, ref) {
5919
+ var _b;
5920
+ var children = _a.children, className = _a.className, _c = _a.component, Component = _c === void 0 ? 'div' : _c, invalid = _a.invalid, tooltip = _a.tooltip, valid = _a.valid, rest = __rest(_a, ["children", "className", "component", "invalid", "tooltip", "valid"]);
5921
+ var _className = classNames((_b = {},
5922
+ _b["invalid-".concat(tooltip ? 'tooltip' : 'feedback')] = invalid,
5923
+ _b["valid-".concat(tooltip ? 'tooltip' : 'feedback')] = valid,
5924
+ _b), className);
5925
+ return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
5951
5926
  });
5952
- var bp = PropTypes.shape({
5953
- cols: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.string]),
5954
- gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
5955
- gutterX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
5956
- gutterY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
5957
- });
5958
- CRow.propTypes = {
5959
- children: PropTypes.node,
5960
- className: PropTypes.string,
5961
- xs: bp,
5962
- sm: bp,
5963
- md: bp,
5964
- lg: bp,
5965
- xl: bp,
5966
- xxl: bp,
5967
- };
5968
- CRow.displayName = 'CRow';
5969
-
5970
- var CFooter = React.forwardRef(function (_a, ref) {
5971
- var _b;
5972
- var children = _a.children, className = _a.className, position = _a.position, rest = __rest(_a, ["children", "className", "position"]);
5973
- var _className = classNames('footer', (_b = {}, _b["footer-".concat(position)] = position, _b), className);
5974
- return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
5975
- });
5976
- CFooter.propTypes = {
5927
+ CFormFeedback.propTypes = {
5977
5928
  children: PropTypes.node,
5978
5929
  className: PropTypes.string,
5979
- position: PropTypes.oneOf(['fixed', 'sticky']),
5930
+ component: PropTypes.elementType,
5931
+ invalid: PropTypes.bool,
5932
+ tooltip: PropTypes.bool,
5933
+ valid: PropTypes.bool,
5980
5934
  };
5981
- CFooter.displayName = 'CFooter';
5935
+ CFormFeedback.displayName = 'CFormFeedback';
5982
5936
 
5983
- var CForm = React.forwardRef(function (_a, ref) {
5984
- var children = _a.children, className = _a.className, validated = _a.validated, rest = __rest(_a, ["children", "className", "validated"]);
5985
- var _className = classNames({ 'was-validated': validated }, className);
5986
- return (React__default["default"].createElement("form", __assign({ className: _className }, rest, { ref: ref }), children));
5987
- });
5988
- CForm.propTypes = {
5989
- children: PropTypes.node,
5990
- className: PropTypes.string,
5991
- validated: PropTypes.bool,
5937
+ var CFormControlValidation = function (_a) {
5938
+ var describedby = _a.describedby, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, invalid = _a.invalid, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid;
5939
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
5940
+ feedback && (valid || invalid) && (React__default["default"].createElement(CFormFeedback, __assign({}, (invalid && { id: describedby }), { invalid: invalid, tooltip: tooltipFeedback, valid: valid }), feedback)),
5941
+ feedbackInvalid && (React__default["default"].createElement(CFormFeedback, { id: describedby, invalid: true, tooltip: tooltipFeedback }, feedbackInvalid)),
5942
+ feedbackValid && (React__default["default"].createElement(CFormFeedback, { valid: true, tooltip: tooltipFeedback }, feedbackValid))));
5943
+ };
5944
+ CFormControlValidation.propTypes = {
5945
+ describedby: PropTypes.string,
5946
+ feedback: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
5947
+ feedbackValid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
5948
+ feedbackInvalid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
5949
+ invalid: PropTypes.bool,
5950
+ tooltipFeedback: PropTypes.bool,
5951
+ valid: PropTypes.bool,
5992
5952
  };
5993
- CForm.displayName = 'CForm';
5953
+ CFormControlValidation.displayName = 'CFormControlValidation';
5994
5954
 
5995
5955
  var CFormLabel = React.forwardRef(function (_a, ref) {
5996
5956
  var children = _a.children, className = _a.className, customClassName = _a.customClassName, rest = __rest(_a, ["children", "className", "customClassName"]);
@@ -6006,7 +5966,7 @@ CFormLabel.displayName = 'CFormLabel';
6006
5966
 
6007
5967
  var CFormCheck = React.forwardRef(function (_a, ref) {
6008
5968
  var _b;
6009
- var className = _a.className, button = _a.button, hitArea = _a.hitArea, id = _a.id, indeterminate = _a.indeterminate, inline = _a.inline, invalid = _a.invalid, label = _a.label, _c = _a.type, type = _c === void 0 ? 'checkbox' : _c, valid = _a.valid, rest = __rest(_a, ["className", "button", "hitArea", "id", "indeterminate", "inline", "invalid", "label", "type", "valid"]);
5969
+ var className = _a.className, button = _a.button, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, tooltipFeedback = _a.tooltipFeedback, hitArea = _a.hitArea, id = _a.id, indeterminate = _a.indeterminate, inline = _a.inline, invalid = _a.invalid, label = _a.label, _c = _a.type, type = _c === void 0 ? 'checkbox' : _c, valid = _a.valid, rest = __rest(_a, ["className", "button", "feedback", "feedbackInvalid", "feedbackValid", "floatingLabel", "tooltipFeedback", "hitArea", "id", "indeterminate", "inline", "invalid", "label", "type", "valid"]);
6010
5970
  var inputRef = React.useRef(null);
6011
5971
  var forkedRef = useForkedRef(ref, inputRef);
6012
5972
  React.useEffect(function () {
@@ -6032,50 +5992,25 @@ var CFormCheck = React.forwardRef(function (_a, ref) {
6032
5992
  var formControl = function () {
6033
5993
  return React__default["default"].createElement("input", __assign({ type: type, className: inputClassName, id: id }, rest, { ref: forkedRef }));
6034
5994
  };
5995
+ var formValidation = function () { return (React__default["default"].createElement(CFormControlValidation, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, invalid: invalid, tooltipFeedback: tooltipFeedback, valid: valid })); };
6035
5996
  var formLabel = function () {
6036
5997
  return (React__default["default"].createElement(CFormLabel, __assign({ customClassName: labelClassName }, (id && { htmlFor: id })), label));
6037
5998
  };
6038
5999
  return button ? (React__default["default"].createElement(React__default["default"].Fragment, null,
6039
6000
  formControl(),
6040
- label && formLabel())) : label ? (hitArea ? (React__default["default"].createElement(CFormLabel, __assign({ customClassName: className }, (id && { htmlFor: id })),
6041
- formControl(),
6042
- label)) : (React__default["default"].createElement("div", { className: _className },
6001
+ label && formLabel(),
6002
+ formValidation())) : label ? (hitArea ? (React__default["default"].createElement(React__default["default"].Fragment, null,
6003
+ React__default["default"].createElement(CFormLabel, __assign({ customClassName: className }, (id && { htmlFor: id })),
6004
+ formControl(),
6005
+ label),
6006
+ formValidation())) : (React__default["default"].createElement("div", { className: _className },
6043
6007
  formControl(),
6044
- formLabel()))) : (formControl());
6008
+ formLabel(),
6009
+ formValidation()))) : (formControl());
6045
6010
  });
6046
- CFormCheck.propTypes = {
6047
- button: PropTypes.object,
6048
- className: PropTypes.string,
6049
- hitArea: PropTypes.oneOf(['full']),
6050
- id: PropTypes.string,
6051
- indeterminate: PropTypes.bool,
6052
- inline: PropTypes.bool,
6053
- invalid: PropTypes.bool,
6054
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
6055
- type: PropTypes.oneOf(['checkbox', 'radio']),
6056
- valid: PropTypes.bool,
6057
- };
6011
+ CFormCheck.propTypes = __assign({ button: PropTypes.object, className: PropTypes.string, hitArea: PropTypes.oneOf(['full']), id: PropTypes.string, indeterminate: PropTypes.bool, inline: PropTypes.bool, label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), type: PropTypes.oneOf(['checkbox', 'radio']) }, CFormControlValidation.propTypes);
6058
6012
  CFormCheck.displayName = 'CFormCheck';
6059
6013
 
6060
- var CFormFeedback = React.forwardRef(function (_a, ref) {
6061
- var _b;
6062
- var children = _a.children, className = _a.className, _c = _a.component, Component = _c === void 0 ? 'div' : _c, invalid = _a.invalid, tooltip = _a.tooltip, valid = _a.valid, rest = __rest(_a, ["children", "className", "component", "invalid", "tooltip", "valid"]);
6063
- var _className = classNames((_b = {},
6064
- _b["invalid-".concat(tooltip ? 'tooltip' : 'feedback')] = invalid,
6065
- _b["valid-".concat(tooltip ? 'tooltip' : 'feedback')] = valid,
6066
- _b), className);
6067
- return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
6068
- });
6069
- CFormFeedback.propTypes = {
6070
- children: PropTypes.node,
6071
- className: PropTypes.string,
6072
- component: PropTypes.elementType,
6073
- invalid: PropTypes.bool,
6074
- tooltip: PropTypes.bool,
6075
- valid: PropTypes.bool,
6076
- };
6077
- CFormFeedback.displayName = 'CFormFeedback';
6078
-
6079
6014
  var CFormFloating = React.forwardRef(function (_a, ref) {
6080
6015
  var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6081
6016
  var _className = classNames('form-floating', className);
@@ -6087,62 +6022,81 @@ CFormFloating.propTypes = {
6087
6022
  };
6088
6023
  CFormFloating.displayName = 'CFormFloating';
6089
6024
 
6025
+ var CFormText = React.forwardRef(function (_a, ref) {
6026
+ var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'div' : _b, rest = __rest(_a, ["children", "className", "component"]);
6027
+ var _className = classNames('form-text', className);
6028
+ return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
6029
+ });
6030
+ CFormText.propTypes = {
6031
+ children: PropTypes.node,
6032
+ className: PropTypes.string,
6033
+ component: PropTypes.elementType,
6034
+ };
6035
+ CFormText.displayName = 'CFormText';
6036
+
6037
+ var CFormControlWrapper = function (_a) {
6038
+ var children = _a.children, describedby = _a.describedby, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, id = _a.id, invalid = _a.invalid, label = _a.label, text = _a.text, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid;
6039
+ return floatingLabel ? (React__default["default"].createElement(CFormFloating, null,
6040
+ children,
6041
+ React__default["default"].createElement(CFormLabel, { htmlFor: id }, label || floatingLabel))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
6042
+ label && React__default["default"].createElement(CFormLabel, { htmlFor: id }, label),
6043
+ children,
6044
+ text && React__default["default"].createElement(CFormText, { id: describedby }, text),
6045
+ React__default["default"].createElement(CFormControlValidation, { describedby: describedby, feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, invalid: invalid, tooltipFeedback: tooltipFeedback, valid: valid })));
6046
+ };
6047
+ CFormControlWrapper.propTypes = __assign({ children: PropTypes.node, floatingLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), text: PropTypes.oneOfType([PropTypes.node, PropTypes.string]) }, CFormControlValidation.propTypes);
6048
+ CFormControlWrapper.displayName = 'CFormControlWrapper';
6049
+
6090
6050
  var CFormInput = React.forwardRef(function (_a, ref) {
6091
6051
  var _b;
6092
- var children = _a.children, className = _a.className, invalid = _a.invalid, plainText = _a.plainText, size = _a.size, _c = _a.type, type = _c === void 0 ? 'text' : _c, valid = _a.valid, rest = __rest(_a, ["children", "className", "invalid", "plainText", "size", "type", "valid"]);
6052
+ var children = _a.children, className = _a.className, _c = _a.delay, delay = _c === void 0 ? false : _c, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, id = _a.id, invalid = _a.invalid, label = _a.label, onChange = _a.onChange, plainText = _a.plainText, size = _a.size, text = _a.text, tooltipFeedback = _a.tooltipFeedback, _d = _a.type, type = _d === void 0 ? 'text' : _d, valid = _a.valid, rest = __rest(_a, ["children", "className", "delay", "feedback", "feedbackInvalid", "feedbackValid", "floatingLabel", "id", "invalid", "label", "onChange", "plainText", "size", "text", "tooltipFeedback", "type", "valid"]);
6053
+ var _e = React.useState(), value = _e[0], setValue = _e[1];
6054
+ React.useEffect(function () {
6055
+ var timeOutId = setTimeout(function () { return value && onChange && onChange(value); }, typeof delay === 'number' ? delay : 500);
6056
+ return function () { return clearTimeout(timeOutId); };
6057
+ }, [value]);
6093
6058
  var _className = classNames(plainText ? 'form-control-plaintext' : 'form-control', (_b = {},
6094
6059
  _b["form-control-".concat(size)] = size,
6095
6060
  _b['form-control-color'] = type === 'color',
6096
6061
  _b['is-invalid'] = invalid,
6097
6062
  _b['is-valid'] = valid,
6098
6063
  _b), className);
6099
- return (React__default["default"].createElement("input", __assign({ type: type, className: _className }, rest, { ref: ref }), children));
6064
+ return (React__default["default"].createElement(CFormControlWrapper, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, id: id, invalid: invalid, label: label, text: text, tooltipFeedback: tooltipFeedback, valid: valid },
6065
+ React__default["default"].createElement("input", __assign({ className: _className, id: id, type: type, onChange: function (event) { return (delay ? setValue(event) : onChange && onChange(event)); } }, rest, { ref: ref }), children)));
6100
6066
  });
6101
- CFormInput.propTypes = {
6102
- children: PropTypes.node,
6103
- className: PropTypes.string,
6104
- invalid: PropTypes.bool,
6105
- plainText: PropTypes.bool,
6106
- size: PropTypes.oneOf(['sm', 'lg']),
6107
- type: PropTypes.oneOfType([PropTypes.oneOf(['color', 'file', 'text']), PropTypes.string]),
6108
- valid: PropTypes.bool,
6109
- };
6067
+ CFormInput.propTypes = __assign({ className: PropTypes.string, id: PropTypes.string, delay: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]), plainText: PropTypes.bool, size: PropTypes.oneOf(['sm', 'lg']), type: PropTypes.oneOfType([PropTypes.oneOf(['color', 'file', 'text']), PropTypes.string]) }, CFormControlWrapper.propTypes);
6110
6068
  CFormInput.displayName = 'CFormInput';
6111
6069
 
6112
6070
  var CFormRange = React.forwardRef(function (_a, ref) {
6113
- var className = _a.className, rest = __rest(_a, ["className"]);
6071
+ var className = _a.className, label = _a.label, rest = __rest(_a, ["className", "label"]);
6114
6072
  var _className = classNames('form-range', className);
6115
- return React__default["default"].createElement("input", __assign({ type: "range", className: _className }, rest, { ref: ref }));
6073
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
6074
+ label && React__default["default"].createElement(CFormLabel, { htmlFor: rest.id }, label),
6075
+ React__default["default"].createElement("input", __assign({ type: "range", className: _className }, rest, { ref: ref }))));
6116
6076
  });
6117
6077
  CFormRange.propTypes = {
6118
6078
  className: PropTypes.string,
6079
+ label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
6119
6080
  };
6120
6081
  CFormRange.displayName = 'CFormRange';
6121
6082
 
6122
6083
  var CFormSelect = React.forwardRef(function (_a, ref) {
6123
6084
  var _b;
6124
- var children = _a.children, className = _a.className, htmlSize = _a.htmlSize, invalid = _a.invalid, options = _a.options, size = _a.size, valid = _a.valid, rest = __rest(_a, ["children", "className", "htmlSize", "invalid", "options", "size", "valid"]);
6085
+ var children = _a.children, className = _a.className, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, htmlSize = _a.htmlSize, id = _a.id, invalid = _a.invalid, label = _a.label, options = _a.options, size = _a.size, text = _a.text, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid, rest = __rest(_a, ["children", "className", "feedback", "feedbackInvalid", "feedbackValid", "floatingLabel", "htmlSize", "id", "invalid", "label", "options", "size", "text", "tooltipFeedback", "valid"]);
6125
6086
  var _className = classNames('form-select', (_b = {},
6126
6087
  _b["form-select-".concat(size)] = size,
6127
6088
  _b['is-invalid'] = invalid,
6128
6089
  _b['is-valid'] = valid,
6129
6090
  _b), className);
6130
- return (React__default["default"].createElement("select", __assign({ className: _className, size: htmlSize }, rest, { ref: ref }), options
6131
- ? options.map(function (option, index) {
6132
- return (React__default["default"].createElement("option", __assign({}, (typeof option === 'object' &&
6133
- option.disabled && { disabled: option.disabled }), (typeof option === 'object' && option.value && { value: option.value }), { key: index }), typeof option === 'string' ? option : option.label));
6134
- })
6135
- : children));
6091
+ return (React__default["default"].createElement(CFormControlWrapper, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, id: id, invalid: invalid, label: label, text: text, tooltipFeedback: tooltipFeedback, valid: valid },
6092
+ React__default["default"].createElement("select", __assign({ id: id, className: _className, size: htmlSize }, rest, { ref: ref }), options
6093
+ ? options.map(function (option, index) {
6094
+ return (React__default["default"].createElement("option", __assign({}, (typeof option === 'object' &&
6095
+ option.disabled && { disabled: option.disabled }), (typeof option === 'object' && option.value && { value: option.value }), { key: index }), typeof option === 'string' ? option : option.label));
6096
+ })
6097
+ : children)));
6136
6098
  });
6137
- CFormSelect.propTypes = {
6138
- children: PropTypes.node,
6139
- className: PropTypes.string,
6140
- htmlSize: PropTypes.number,
6141
- invalid: PropTypes.bool,
6142
- options: PropTypes.array,
6143
- size: PropTypes.oneOf(['sm', 'lg']),
6144
- valid: PropTypes.bool,
6145
- };
6099
+ CFormSelect.propTypes = __assign({ className: PropTypes.string, htmlSize: PropTypes.number, options: PropTypes.array }, CFormControlWrapper.propTypes);
6146
6100
  CFormSelect.displayName = 'CFormSelect';
6147
6101
 
6148
6102
  var CFormSwitch = React.forwardRef(function (_a, ref) {
@@ -6173,33 +6127,16 @@ CFormSwitch.propTypes = {
6173
6127
  };
6174
6128
  CFormSwitch.displayName = 'CFormSwitch';
6175
6129
 
6176
- var CFormText = React.forwardRef(function (_a, ref) {
6177
- var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'div' : _b, rest = __rest(_a, ["children", "className", "component"]);
6178
- var _className = classNames('form-text', className);
6179
- return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
6180
- });
6181
- CFormText.propTypes = {
6182
- children: PropTypes.node,
6183
- className: PropTypes.string,
6184
- component: PropTypes.elementType,
6185
- };
6186
- CFormText.displayName = 'CFormText';
6187
-
6188
6130
  var CFormTextarea = React.forwardRef(function (_a, ref) {
6189
- var children = _a.children, className = _a.className, invalid = _a.invalid, plainText = _a.plainText, valid = _a.valid, rest = __rest(_a, ["children", "className", "invalid", "plainText", "valid"]);
6131
+ var children = _a.children, className = _a.className, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, id = _a.id, invalid = _a.invalid, label = _a.label, plainText = _a.plainText, text = _a.text, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid, rest = __rest(_a, ["children", "className", "feedback", "feedbackInvalid", "feedbackValid", "floatingLabel", "id", "invalid", "label", "plainText", "text", "tooltipFeedback", "valid"]);
6190
6132
  var _className = classNames(plainText ? 'form-control-plaintext' : 'form-control', {
6191
6133
  'is-invalid': invalid,
6192
6134
  'is-valid': valid,
6193
6135
  }, className);
6194
- return (React__default["default"].createElement("textarea", __assign({ className: _className }, rest, { ref: ref }), children));
6136
+ return (React__default["default"].createElement(CFormControlWrapper, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, id: id, invalid: invalid, label: label, text: text, tooltipFeedback: tooltipFeedback, valid: valid },
6137
+ React__default["default"].createElement("textarea", __assign({ className: _className }, rest, { ref: ref }), children)));
6195
6138
  });
6196
- CFormTextarea.propTypes = {
6197
- children: PropTypes.node,
6198
- className: PropTypes.string,
6199
- invalid: PropTypes.bool,
6200
- plainText: PropTypes.bool,
6201
- valid: PropTypes.bool,
6202
- };
6139
+ CFormTextarea.propTypes = __assign({ className: PropTypes.string, id: PropTypes.string, plainText: PropTypes.bool }, CFormControlWrapper.propTypes);
6203
6140
  CFormTextarea.displayName = 'CFormTextarea';
6204
6141
 
6205
6142
  var CInputGroup = React.forwardRef(function (_a, ref) {
@@ -6229,6 +6166,153 @@ CInputGroupText.propTypes = {
6229
6166
  };
6230
6167
  CInputGroupText.displayName = 'CInputGroupText';
6231
6168
 
6169
+ var BREAKPOINTS$3 = [
6170
+ 'xxl',
6171
+ 'xl',
6172
+ 'lg',
6173
+ 'md',
6174
+ 'sm',
6175
+ 'xs',
6176
+ ];
6177
+ var CCol = React.forwardRef(function (_a, ref) {
6178
+ var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6179
+ var repsonsiveClassNames = [];
6180
+ BREAKPOINTS$3.forEach(function (bp) {
6181
+ var breakpoint = rest[bp];
6182
+ delete rest[bp];
6183
+ var infix = bp === 'xs' ? '' : "-".concat(bp);
6184
+ if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
6185
+ repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint));
6186
+ }
6187
+ if (typeof breakpoint === 'boolean') {
6188
+ repsonsiveClassNames.push("col".concat(infix));
6189
+ }
6190
+ if (breakpoint && typeof breakpoint === 'object') {
6191
+ if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
6192
+ repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint.span));
6193
+ }
6194
+ if (typeof breakpoint.span === 'boolean') {
6195
+ repsonsiveClassNames.push("col".concat(infix));
6196
+ }
6197
+ if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
6198
+ repsonsiveClassNames.push("order".concat(infix, "-").concat(breakpoint.order));
6199
+ }
6200
+ if (typeof breakpoint.offset === 'number') {
6201
+ repsonsiveClassNames.push("offset".concat(infix, "-").concat(breakpoint.offset));
6202
+ }
6203
+ }
6204
+ });
6205
+ var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'col', className);
6206
+ return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
6207
+ });
6208
+ var span = PropTypes.oneOfType([
6209
+ PropTypes.bool,
6210
+ PropTypes.number,
6211
+ PropTypes.string,
6212
+ PropTypes.oneOf(['auto']),
6213
+ ]);
6214
+ var col = PropTypes.oneOfType([
6215
+ span,
6216
+ PropTypes.shape({
6217
+ span: span,
6218
+ offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
6219
+ order: PropTypes.oneOfType([
6220
+ PropTypes.oneOf(['first', 'last']),
6221
+ PropTypes.number,
6222
+ PropTypes.string,
6223
+ ]),
6224
+ }),
6225
+ ]);
6226
+ CCol.propTypes = {
6227
+ children: PropTypes.node,
6228
+ className: PropTypes.string,
6229
+ xs: col,
6230
+ sm: col,
6231
+ };
6232
+ CCol.displayName = 'CCol';
6233
+
6234
+ var BREAKPOINTS$2 = [
6235
+ 'xxl',
6236
+ 'xl',
6237
+ 'lg',
6238
+ 'md',
6239
+ 'sm',
6240
+ 'fluid',
6241
+ ];
6242
+ var CContainer = React.forwardRef(function (_a, ref) {
6243
+ var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6244
+ var repsonsiveClassNames = [];
6245
+ BREAKPOINTS$2.forEach(function (bp) {
6246
+ var breakpoint = rest[bp];
6247
+ delete rest[bp];
6248
+ breakpoint && repsonsiveClassNames.push("container-".concat(bp));
6249
+ });
6250
+ var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'container', className);
6251
+ return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
6252
+ });
6253
+ CContainer.propTypes = {
6254
+ children: PropTypes.node,
6255
+ className: PropTypes.string,
6256
+ sm: PropTypes.bool,
6257
+ md: PropTypes.bool,
6258
+ lg: PropTypes.bool,
6259
+ xl: PropTypes.bool,
6260
+ xxl: PropTypes.bool,
6261
+ fluid: PropTypes.bool,
6262
+ };
6263
+ CContainer.displayName = 'CContainer';
6264
+
6265
+ var BREAKPOINTS$1 = [
6266
+ 'xxl',
6267
+ 'xl',
6268
+ 'lg',
6269
+ 'md',
6270
+ 'sm',
6271
+ 'xs',
6272
+ ];
6273
+ var CRow = React.forwardRef(function (_a, ref) {
6274
+ var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6275
+ var repsonsiveClassNames = [];
6276
+ BREAKPOINTS$1.forEach(function (bp) {
6277
+ var breakpoint = rest[bp];
6278
+ delete rest[bp];
6279
+ var infix = bp === 'xs' ? '' : "-".concat(bp);
6280
+ if (typeof breakpoint === 'object') {
6281
+ if (breakpoint.cols) {
6282
+ repsonsiveClassNames.push("row-cols".concat(infix, "-").concat(breakpoint.cols));
6283
+ }
6284
+ if (typeof breakpoint.gutter === 'number') {
6285
+ repsonsiveClassNames.push("g".concat(infix, "-").concat(breakpoint.gutter));
6286
+ }
6287
+ if (typeof breakpoint.gutterX === 'number') {
6288
+ repsonsiveClassNames.push("gx".concat(infix, "-").concat(breakpoint.gutterX));
6289
+ }
6290
+ if (typeof breakpoint.gutterY === 'number') {
6291
+ repsonsiveClassNames.push("gy".concat(infix, "-").concat(breakpoint.gutterY));
6292
+ }
6293
+ }
6294
+ });
6295
+ var _className = classNames('row', repsonsiveClassNames, className);
6296
+ return (React__default["default"].createElement("div", { className: _className, ref: ref }, children));
6297
+ });
6298
+ var bp = PropTypes.shape({
6299
+ cols: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.string]),
6300
+ gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
6301
+ gutterX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
6302
+ gutterY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
6303
+ });
6304
+ CRow.propTypes = {
6305
+ children: PropTypes.node,
6306
+ className: PropTypes.string,
6307
+ xs: bp,
6308
+ sm: bp,
6309
+ md: bp,
6310
+ lg: bp,
6311
+ xl: bp,
6312
+ xxl: bp,
6313
+ };
6314
+ CRow.displayName = 'CRow';
6315
+
6232
6316
  var CHeader = React.forwardRef(function (_a, ref) {
6233
6317
  var _b;
6234
6318
  var children = _a.children, className = _a.className, container = _a.container, position = _a.position, rest = __rest(_a, ["children", "className", "container", "position"]);
@@ -6431,11 +6515,12 @@ CModalDialog.displayName = 'CModalDialog';
6431
6515
 
6432
6516
  var CModalContext = React.createContext({});
6433
6517
  var CModal = React.forwardRef(function (_a, ref) {
6434
- var children = _a.children, alignment = _a.alignment, _b = _a.backdrop, backdrop = _b === void 0 ? true : _b, className = _a.className, _c = _a.duration, duration = _c === void 0 ? 150 : _c, fullscreen = _a.fullscreen, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onClose = _a.onClose, onClosePrevented = _a.onClosePrevented, onShow = _a.onShow, _e = _a.portal, portal = _e === void 0 ? true : _e, scrollable = _a.scrollable, size = _a.size, _f = _a.transition, transition = _f === void 0 ? true : _f, visible = _a.visible;
6518
+ var children = _a.children, alignment = _a.alignment, _b = _a.backdrop, backdrop = _b === void 0 ? true : _b, className = _a.className, _c = _a.duration, duration = _c === void 0 ? 150 : _c, fullscreen = _a.fullscreen, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onClose = _a.onClose, onClosePrevented = _a.onClosePrevented, onShow = _a.onShow, _e = _a.portal, portal = _e === void 0 ? true : _e, scrollable = _a.scrollable, size = _a.size, _f = _a.transition, transition = _f === void 0 ? true : _f, _g = _a.unmountOnClose, unmountOnClose = _g === void 0 ? true : _g, visible = _a.visible;
6435
6519
  var modalRef = React.useRef(null);
6520
+ var modalContentRef = React.useRef(null);
6436
6521
  var forkedRef = useForkedRef(ref, modalRef);
6437
- var _g = React.useState(visible), _visible = _g[0], setVisible = _g[1];
6438
- var _h = React.useState(false), staticBackdrop = _h[0], setStaticBackdrop = _h[1];
6522
+ var _h = React.useState(visible), _visible = _h[0], setVisible = _h[1];
6523
+ var _j = React.useState(false), staticBackdrop = _j[0], setStaticBackdrop = _j[1];
6439
6524
  React.useEffect(function () {
6440
6525
  setVisible(visible);
6441
6526
  }, [visible]);
@@ -6443,6 +6528,14 @@ var CModal = React.forwardRef(function (_a, ref) {
6443
6528
  visible: _visible,
6444
6529
  setVisible: setVisible,
6445
6530
  };
6531
+ React.useEffect(function () {
6532
+ modalRef.current && modalRef.current.addEventListener('click', handleClickOutside);
6533
+ modalRef.current && modalRef.current.addEventListener('keyup', handleKeyDown);
6534
+ return function () {
6535
+ modalRef.current && modalRef.current.removeEventListener('click', handleClickOutside);
6536
+ modalRef.current && modalRef.current.removeEventListener('keyup', handleKeyDown);
6537
+ };
6538
+ }, [_visible]);
6446
6539
  var handleDismiss = function () {
6447
6540
  if (backdrop === 'static') {
6448
6541
  return setStaticBackdrop(true);
@@ -6480,6 +6573,12 @@ var CModal = React.forwardRef(function (_a, ref) {
6480
6573
  }
6481
6574
  return function () { return document.body.classList.remove('modal-open'); };
6482
6575
  }, [_visible]);
6576
+ var handleClickOutside = function (event) {
6577
+ if (modalContentRef.current &&
6578
+ !modalContentRef.current.contains(event.target)) {
6579
+ handleDismiss();
6580
+ }
6581
+ };
6483
6582
  var handleKeyDown = React.useCallback(function (event) {
6484
6583
  if (event.key === 'Escape' && keyboard) {
6485
6584
  return handleDismiss();
@@ -6488,17 +6587,16 @@ var CModal = React.forwardRef(function (_a, ref) {
6488
6587
  var modal = function (ref, transitionClass) {
6489
6588
  return (React__default["default"].createElement(CModalContext.Provider, { value: contextValues },
6490
6589
  React__default["default"].createElement("div", { className: classNames(_className, transitionClass), tabIndex: -1, role: "dialog", ref: ref },
6491
- React__default["default"].createElement(CModalDialog, { alignment: alignment, fullscreen: fullscreen, scrollable: scrollable, size: size, onClick: function (event) { return event.stopPropagation(); } },
6492
- React__default["default"].createElement(CModalContent, null, children)))));
6590
+ React__default["default"].createElement(CModalDialog, { alignment: alignment, fullscreen: fullscreen, scrollable: scrollable, size: size },
6591
+ React__default["default"].createElement(CModalContent, { ref: modalContentRef }, children)))));
6493
6592
  };
6494
6593
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
6495
- React__default["default"].createElement("div", { onClick: handleDismiss, onKeyDown: handleKeyDown },
6496
- React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, onEnter: onShow, onExit: onClose, unmountOnExit: true, timeout: !transition ? 0 : duration }, function (state) {
6497
- var transitionClass = getTransitionClass(state);
6498
- return typeof window !== 'undefined' && portal
6499
- ? ReactDOM.createPortal(modal(forkedRef, transitionClass), document.body)
6500
- : modal(forkedRef, transitionClass);
6501
- })),
6594
+ React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: modalRef, onEnter: onShow, onExit: onClose, unmountOnExit: unmountOnClose, timeout: !transition ? 0 : duration }, function (state) {
6595
+ var transitionClass = getTransitionClass(state);
6596
+ return typeof window !== 'undefined' && portal
6597
+ ? ReactDOM.createPortal(modal(forkedRef, transitionClass), document.body)
6598
+ : modal(forkedRef, transitionClass);
6599
+ }),
6502
6600
  typeof window !== 'undefined' && portal
6503
6601
  ? backdrop && ReactDOM.createPortal(React__default["default"].createElement(CBackdrop, { visible: _visible }), document.body)
6504
6602
  : backdrop && React__default["default"].createElement(CBackdrop, { visible: _visible })));
@@ -6521,6 +6619,7 @@ CModal.propTypes = {
6521
6619
  scrollable: PropTypes.bool,
6522
6620
  size: PropTypes.oneOf(['sm', 'lg', 'xl']),
6523
6621
  transition: PropTypes.bool,
6622
+ unmountOnClose: PropTypes.bool,
6524
6623
  visible: PropTypes.bool,
6525
6624
  };
6526
6625
  CModal.displayName = 'CModal';
@@ -6671,7 +6770,7 @@ var CNavGroup = React.forwardRef(function (_a, ref) {
6671
6770
  var _className = classNames('nav-group', { show: _visible }, className);
6672
6771
  return (React__default["default"].createElement("li", __assign({ className: _className }, rest, { ref: ref }),
6673
6772
  toggler && (React__default["default"].createElement("a", { className: "nav-link nav-group-toggle", onClick: function (event) { return handleTogglerOnCLick(event); } }, toggler)),
6674
- React__default["default"].createElement(Transition$1, { in: _visible, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 300 }, function (state) { return (React__default["default"].createElement("ul", { className: classNames('nav-group-items', {
6773
+ React__default["default"].createElement(Transition$1, { in: _visible, nodeRef: navItemsRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 300 }, function (state) { return (React__default["default"].createElement("ul", { className: classNames('nav-group-items', {
6675
6774
  compact: compact,
6676
6775
  }), style: __assign(__assign({}, style), transitionStyles[state]), ref: navItemsRef }, React__default["default"].Children.map(children, function (child, index) {
6677
6776
  if (React__default["default"].isValidElement(child)) {
@@ -6783,46 +6882,150 @@ var CNavbarBrand = React.forwardRef(function (_a, ref) {
6783
6882
  var _className = classNames('navbar-brand', className);
6784
6883
  return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
6785
6884
  });
6786
- CNavbarBrand.propTypes = {
6885
+ CNavbarBrand.propTypes = {
6886
+ children: PropTypes.node,
6887
+ className: PropTypes.string,
6888
+ component: PropTypes.elementType,
6889
+ };
6890
+ CNavbarBrand.displayName = 'CNavbarBrand';
6891
+
6892
+ var CNavbarNav = React.forwardRef(function (_a, ref) {
6893
+ var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'ul' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
6894
+ var _className = classNames('navbar-nav', className);
6895
+ return (React__default["default"].createElement(Component, __assign({ className: _className, role: "navigation" }, rest, { ref: ref }), children));
6896
+ });
6897
+ CNavbarNav.propTypes = {
6898
+ children: PropTypes.node,
6899
+ className: PropTypes.string,
6900
+ component: PropTypes.elementType,
6901
+ };
6902
+ CNavbarNav.displayName = 'CNavbarNav';
6903
+
6904
+ var CNavbarText = React.forwardRef(function (_a, ref) {
6905
+ var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6906
+ var _className = classNames('navbar-text', className);
6907
+ return (React__default["default"].createElement("span", __assign({ className: _className }, rest, { ref: ref }), children));
6908
+ });
6909
+ CNavbarText.propTypes = {
6910
+ children: PropTypes.node,
6911
+ className: PropTypes.string,
6912
+ };
6913
+ CNavbarText.displayName = 'CNavbarText';
6914
+
6915
+ var CNavbarToggler = React.forwardRef(function (_a, ref) {
6916
+ var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6917
+ var _className = classNames('navbar-toggler', className);
6918
+ return (React__default["default"].createElement("button", __assign({ type: "button", className: _className }, rest, { ref: ref }), children ? children : React__default["default"].createElement("span", { className: "navbar-toggler-icon" })));
6919
+ });
6920
+ CNavbarToggler.propTypes = {
6921
+ children: PropTypes.node,
6922
+ className: PropTypes.string,
6923
+ };
6924
+ CNavbarToggler.displayName = 'CNavbarToggler';
6925
+
6926
+ var COffcanvas = React.forwardRef(function (_a, ref) {
6927
+ var _b;
6928
+ var children = _a.children, _c = _a.backdrop, backdrop = _c === void 0 ? true : _c, className = _a.className, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onHide = _a.onHide, onShow = _a.onShow, placement = _a.placement, _e = _a.portal, portal = _e === void 0 ? true : _e, _f = _a.scroll, scroll = _f === void 0 ? false : _f, _g = _a.visible, visible = _g === void 0 ? false : _g, rest = __rest(_a, ["children", "backdrop", "className", "keyboard", "onHide", "onShow", "placement", "portal", "scroll", "visible"]);
6929
+ var _h = React.useState(visible), _visible = _h[0], setVisible = _h[1];
6930
+ var offcanvasRef = React.useRef(null);
6931
+ var forkedRef = useForkedRef(ref, offcanvasRef);
6932
+ React.useEffect(function () {
6933
+ setVisible(visible);
6934
+ }, [visible]);
6935
+ React.useEffect(function () {
6936
+ if (_visible) {
6937
+ if (!scroll) {
6938
+ document.body.style.overflow = 'hidden';
6939
+ document.body.style.paddingRight = '0px';
6940
+ }
6941
+ return;
6942
+ }
6943
+ if (!scroll) {
6944
+ document.body.style.removeProperty('overflow');
6945
+ document.body.style.removeProperty('padding-right');
6946
+ }
6947
+ }, [_visible]);
6948
+ var _className = classNames('offcanvas', (_b = {},
6949
+ _b["offcanvas-".concat(placement)] = placement,
6950
+ _b.show = _visible,
6951
+ _b), className);
6952
+ var transitionStyles = {
6953
+ entering: { visibility: 'visible' },
6954
+ entered: { visibility: 'visible' },
6955
+ exiting: { visibility: 'visible' },
6956
+ exited: { visibility: 'hidden' },
6957
+ };
6958
+ var handleDismiss = function () {
6959
+ setVisible(false);
6960
+ };
6961
+ var handleKeyDown = React.useCallback(function (event) {
6962
+ if (event.key === 'Escape' && keyboard) {
6963
+ return handleDismiss();
6964
+ }
6965
+ }, [ref, handleDismiss]);
6966
+ var offcanvas = function (ref, state) {
6967
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
6968
+ React__default["default"].createElement("div", __assign({ className: _className, role: "dialog", style: __assign({}, transitionStyles[state]), tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: ref }), children)));
6969
+ };
6970
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
6971
+ React__default["default"].createElement(Transition$1, { in: _visible, nodeRef: offcanvasRef, onEnter: onShow, onEntered: function () { var _a; return (_a = offcanvasRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, onExit: onHide, timeout: 300 }, function (state) {
6972
+ return typeof window !== 'undefined' && portal
6973
+ ? ReactDOM.createPortal(offcanvas(forkedRef, state), document.body)
6974
+ : offcanvas(forkedRef, state);
6975
+ }),
6976
+ typeof window !== 'undefined' && portal
6977
+ ? backdrop &&
6978
+ ReactDOM.createPortal(React__default["default"].createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }), document.body)
6979
+ : backdrop && (React__default["default"].createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }))));
6980
+ });
6981
+ COffcanvas.propTypes = {
6982
+ backdrop: PropTypes.bool,
6787
6983
  children: PropTypes.node,
6788
6984
  className: PropTypes.string,
6789
- component: PropTypes.elementType,
6985
+ keyboard: PropTypes.bool,
6986
+ onHide: PropTypes.func,
6987
+ onShow: PropTypes.func,
6988
+ placement: PropTypes.oneOf(['start', 'end', 'top', 'bottom'])
6989
+ .isRequired,
6990
+ portal: PropTypes.bool,
6991
+ scroll: PropTypes.bool,
6992
+ visible: PropTypes.bool,
6790
6993
  };
6791
- CNavbarBrand.displayName = 'CNavbarBrand';
6994
+ COffcanvas.displayName = 'COffcanvas';
6792
6995
 
6793
- var CNavbarNav = React.forwardRef(function (_a, ref) {
6794
- var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'ul' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
6795
- var _className = classNames('navbar-nav', className);
6796
- return (React__default["default"].createElement(Component, __assign({ className: _className, role: "navigation" }, rest, { ref: ref }), children));
6996
+ var COffcanvasBody = React.forwardRef(function (_a, ref) {
6997
+ var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6998
+ var _className = classNames('offcanvas-body', className);
6999
+ return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
6797
7000
  });
6798
- CNavbarNav.propTypes = {
7001
+ COffcanvasBody.propTypes = {
6799
7002
  children: PropTypes.node,
6800
7003
  className: PropTypes.string,
6801
- component: PropTypes.elementType,
6802
7004
  };
6803
- CNavbarNav.displayName = 'CNavbarNav';
7005
+ COffcanvasBody.displayName = 'COffcanvasBody';
6804
7006
 
6805
- var CNavbarText = React.forwardRef(function (_a, ref) {
7007
+ var COffcanvasHeader = React.forwardRef(function (_a, ref) {
6806
7008
  var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6807
- var _className = classNames('navbar-text', className);
6808
- return (React__default["default"].createElement("span", __assign({ className: _className }, rest, { ref: ref }), children));
7009
+ var _className = classNames('offcanvas-header', className);
7010
+ return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
6809
7011
  });
6810
- CNavbarText.propTypes = {
7012
+ COffcanvasHeader.propTypes = {
6811
7013
  children: PropTypes.node,
6812
7014
  className: PropTypes.string,
6813
7015
  };
6814
- CNavbarText.displayName = 'CNavbarText';
7016
+ COffcanvasHeader.displayName = 'COffcanvasHeader';
6815
7017
 
6816
- var CNavbarToggler = React.forwardRef(function (_a, ref) {
6817
- var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
6818
- var _className = classNames('navbar-toggler', className);
6819
- return (React__default["default"].createElement("button", __assign({ type: "button", className: _className }, rest, { ref: ref }), children ? children : React__default["default"].createElement("span", { className: "navbar-toggler-icon" })));
7018
+ var COffcanvasTitle = React.forwardRef(function (_a, ref) {
7019
+ var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'h5' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
7020
+ var _className = classNames('offcanvas-title', className);
7021
+ return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
6820
7022
  });
6821
- CNavbarToggler.propTypes = {
7023
+ COffcanvasTitle.propTypes = {
6822
7024
  children: PropTypes.node,
6823
7025
  className: PropTypes.string,
7026
+ component: PropTypes.elementType,
6824
7027
  };
6825
- CNavbarToggler.displayName = 'CNavbarToggler';
7028
+ COffcanvasTitle.displayName = 'COffcanvasTitle';
6826
7029
 
6827
7030
  var CPagination = React.forwardRef(function (_a, ref) {
6828
7031
  var _b;
@@ -6897,66 +7100,6 @@ CPlaceholder.propTypes = {
6897
7100
  };
6898
7101
  CPlaceholder.displayName = 'CPlaceholder';
6899
7102
 
6900
- var CPopover = function (_a) {
6901
- var children = _a.children, content = _a.content, _b = _a.placement, placement = _b === void 0 ? 'top' : _b, _c = _a.offset, offset = _c === void 0 ? [0, 8] : _c, onHide = _a.onHide, onShow = _a.onShow, title = _a.title, _d = _a.trigger, trigger = _d === void 0 ? 'click' : _d, visible = _a.visible, rest = __rest(_a, ["children", "content", "placement", "offset", "onHide", "onShow", "title", "trigger", "visible"]);
6902
- var _e = React.useState(visible), _visible = _e[0], setVisible = _e[1];
6903
- var getTransitionClass = function (state) {
6904
- return state === 'entering'
6905
- ? 'fade'
6906
- : state === 'entered'
6907
- ? 'fade show'
6908
- : state === 'exiting'
6909
- ? 'fade'
6910
- : 'fade';
6911
- };
6912
- return (React__default["default"].createElement(Manager, null,
6913
- React__default["default"].createElement(Reference, null, function (_a) {
6914
- var ref = _a.ref;
6915
- return React__default["default"].cloneElement(children, __assign(__assign(__assign({ ref: ref }, ((trigger === 'click' || trigger.includes('click')) && {
6916
- onClick: function () { return setVisible(!_visible); },
6917
- })), ((trigger === 'focus' || trigger.includes('focus')) && {
6918
- onFocus: function () { return setVisible(true); },
6919
- onBlur: function () { return setVisible(false); },
6920
- })), ((trigger === 'hover' || trigger.includes('hover')) && {
6921
- onMouseEnter: function () { return setVisible(true); },
6922
- onMouseLeave: function () { return setVisible(false); },
6923
- })));
6924
- }),
6925
- typeof window !== 'undefined' &&
6926
- ReactDOM.createPortal(React__default["default"].createElement(Transition$1, { in: _visible, onEnter: onShow, onExit: onHide, mountOnEnter: true, timeout: {
6927
- enter: 0,
6928
- exit: 200,
6929
- }, unmountOnExit: true }, function (state) {
6930
- var transitionClass = getTransitionClass(state);
6931
- return (React__default["default"].createElement(Popper, { placement: placement, modifiers: [
6932
- {
6933
- name: 'offset',
6934
- options: {
6935
- offset: offset,
6936
- },
6937
- },
6938
- ] }, function (_a) {
6939
- var arrowProps = _a.arrowProps, style = _a.style, ref = _a.ref;
6940
- return (React__default["default"].createElement("div", __assign({ className: classNames("popover bs-popover-".concat(placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement), transitionClass), ref: ref, role: "tooltip", style: style }, rest),
6941
- React__default["default"].createElement("div", __assign({ className: "popover-arrow" }, arrowProps)),
6942
- React__default["default"].createElement("div", { className: "popover-header" }, title),
6943
- React__default["default"].createElement("div", { className: "popover-body" }, content)));
6944
- }));
6945
- }), document.body)));
6946
- };
6947
- CPopover.propTypes = {
6948
- children: PropTypes.any,
6949
- content: PropTypes.node,
6950
- placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
6951
- offset: PropTypes.any,
6952
- onHide: PropTypes.func,
6953
- onShow: PropTypes.func,
6954
- title: PropTypes.string,
6955
- trigger: triggerPropType,
6956
- visible: PropTypes.bool,
6957
- };
6958
- CPopover.displayName = 'CPopover';
6959
-
6960
7103
  var CProgressBar = React.forwardRef(function (_a, ref) {
6961
7104
  var _b;
6962
7105
  var children = _a.children, animated = _a.animated, className = _a.className, color = _a.color, _c = _a.value, value = _c === void 0 ? 0 : _c, variant = _a.variant, rest = __rest(_a, ["children", "animated", "className", "color", "value", "variant"]);
@@ -6995,6 +7138,69 @@ CProgress.propTypes = {
6995
7138
  };
6996
7139
  CProgress.displayName = 'CProgress';
6997
7140
 
7141
+ var CPopover = function (_a) {
7142
+ var children = _a.children, content = _a.content, _b = _a.offset, offset = _b === void 0 ? [0, 8] : _b, onHide = _a.onHide, onShow = _a.onShow, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, title = _a.title, _d = _a.trigger, trigger = _d === void 0 ? 'click' : _d, visible = _a.visible, rest = __rest(_a, ["children", "content", "offset", "onHide", "onShow", "placement", "title", "trigger", "visible"]);
7143
+ var _e = React.useState(visible), _visible = _e[0], setVisible = _e[1];
7144
+ var popoverRef = React.useRef();
7145
+ var _f = React.useState(null), referenceElement = _f[0], setReferenceElement = _f[1];
7146
+ var _g = React.useState(null), popperElement = _g[0], setPopperElement = _g[1];
7147
+ var _h = React.useState(null), arrowElement = _h[0], setArrowElement = _h[1];
7148
+ var _j = usePopper(referenceElement, popperElement, {
7149
+ modifiers: [
7150
+ { name: 'arrow', options: { element: arrowElement } },
7151
+ {
7152
+ name: 'offset',
7153
+ options: {
7154
+ offset: offset,
7155
+ },
7156
+ },
7157
+ ],
7158
+ placement: placement,
7159
+ }), styles = _j.styles, attributes = _j.attributes;
7160
+ var getTransitionClass = function (state) {
7161
+ return state === 'entering'
7162
+ ? 'fade'
7163
+ : state === 'entered'
7164
+ ? 'fade show'
7165
+ : state === 'exiting'
7166
+ ? 'fade'
7167
+ : 'fade';
7168
+ };
7169
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
7170
+ React__default["default"].cloneElement(children, __assign(__assign(__assign({ ref: setReferenceElement }, ((trigger === 'click' || trigger.includes('click')) && {
7171
+ onClick: function () { return setVisible(!_visible); },
7172
+ })), ((trigger === 'focus' || trigger.includes('focus')) && {
7173
+ onFocus: function () { return setVisible(true); },
7174
+ onBlur: function () { return setVisible(false); },
7175
+ })), ((trigger === 'hover' || trigger.includes('hover')) && {
7176
+ onMouseEnter: function () { return setVisible(true); },
7177
+ onMouseLeave: function () { return setVisible(false); },
7178
+ }))),
7179
+ typeof window !== 'undefined' &&
7180
+ ReactDOM.createPortal(React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: popoverRef, onEnter: onShow, onExit: onHide, timeout: {
7181
+ enter: 0,
7182
+ exit: 200,
7183
+ }, unmountOnExit: true }, function (state) {
7184
+ var transitionClass = getTransitionClass(state);
7185
+ return (React__default["default"].createElement("div", __assign({ className: classNames("popover bs-popover-".concat(placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement), transitionClass), ref: setPopperElement, role: "tooltip", style: styles.popper }, attributes.popper, rest),
7186
+ React__default["default"].createElement("div", { className: "popover-arrow", style: styles.arrow, ref: setArrowElement }),
7187
+ React__default["default"].createElement("div", { className: "popover-header" }, title),
7188
+ React__default["default"].createElement("div", { className: "popover-body" }, content)));
7189
+ }), document.body)));
7190
+ };
7191
+ CPopover.propTypes = {
7192
+ children: PropTypes.any,
7193
+ content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
7194
+ offset: PropTypes.any,
7195
+ onHide: PropTypes.func,
7196
+ onShow: PropTypes.func,
7197
+ placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
7198
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
7199
+ trigger: triggerPropType,
7200
+ visible: PropTypes.bool,
7201
+ };
7202
+ CPopover.displayName = 'CPopover';
7203
+
6998
7204
  var isOnMobile = function (element) {
6999
7205
  return Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'));
7000
7206
  };
@@ -7107,110 +7313,6 @@ CSidebar.propTypes = {
7107
7313
  };
7108
7314
  CSidebar.displayName = 'CSidebar';
7109
7315
 
7110
- var COffcanvas = React.forwardRef(function (_a, ref) {
7111
- var _b;
7112
- var children = _a.children, _c = _a.backdrop, backdrop = _c === void 0 ? true : _c, className = _a.className, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onHide = _a.onHide, onShow = _a.onShow, placement = _a.placement, _e = _a.portal, portal = _e === void 0 ? true : _e, _f = _a.scroll, scroll = _f === void 0 ? false : _f, _g = _a.visible, visible = _g === void 0 ? false : _g, rest = __rest(_a, ["children", "backdrop", "className", "keyboard", "onHide", "onShow", "placement", "portal", "scroll", "visible"]);
7113
- var _h = React.useState(visible), _visible = _h[0], setVisible = _h[1];
7114
- var offcanvasRef = React.useRef(null);
7115
- var forkedRef = useForkedRef(ref, offcanvasRef);
7116
- React.useEffect(function () {
7117
- setVisible(visible);
7118
- }, [visible]);
7119
- React.useEffect(function () {
7120
- if (_visible) {
7121
- if (!scroll) {
7122
- document.body.style.overflow = 'hidden';
7123
- document.body.style.paddingRight = '0px';
7124
- }
7125
- return;
7126
- }
7127
- if (!scroll) {
7128
- document.body.style.removeProperty('overflow');
7129
- document.body.style.removeProperty('padding-right');
7130
- }
7131
- }, [_visible]);
7132
- var _className = classNames('offcanvas', (_b = {},
7133
- _b["offcanvas-".concat(placement)] = placement,
7134
- _b.show = _visible,
7135
- _b), className);
7136
- var transitionStyles = {
7137
- entering: { visibility: 'visible' },
7138
- entered: { visibility: 'visible' },
7139
- exiting: { visibility: 'visible' },
7140
- exited: { visibility: 'hidden' },
7141
- };
7142
- var handleDismiss = function () {
7143
- setVisible(false);
7144
- };
7145
- var handleKeyDown = React.useCallback(function (event) {
7146
- if (event.key === 'Escape' && keyboard) {
7147
- return handleDismiss();
7148
- }
7149
- }, [ref, handleDismiss]);
7150
- var offcanvas = function (ref, state) {
7151
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
7152
- React__default["default"].createElement("div", __assign({ className: _className, role: "dialog", style: __assign({}, transitionStyles[state]), tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: ref }), children)));
7153
- };
7154
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
7155
- React__default["default"].createElement(Transition$1, { in: _visible, onEnter: onShow, onEntered: function () { var _a; return (_a = offcanvasRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, onExit: onHide, timeout: 300 }, function (state) {
7156
- return typeof window !== 'undefined' && portal
7157
- ? ReactDOM.createPortal(offcanvas(forkedRef, state), document.body)
7158
- : offcanvas(forkedRef, state);
7159
- }),
7160
- typeof window !== 'undefined' && portal
7161
- ? backdrop &&
7162
- ReactDOM.createPortal(React__default["default"].createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }), document.body)
7163
- : backdrop && (React__default["default"].createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }))));
7164
- });
7165
- COffcanvas.propTypes = {
7166
- backdrop: PropTypes.bool,
7167
- children: PropTypes.node,
7168
- className: PropTypes.string,
7169
- keyboard: PropTypes.bool,
7170
- onHide: PropTypes.func,
7171
- onShow: PropTypes.func,
7172
- placement: PropTypes.oneOf(['start', 'end', 'top', 'bottom'])
7173
- .isRequired,
7174
- portal: PropTypes.bool,
7175
- scroll: PropTypes.bool,
7176
- visible: PropTypes.bool,
7177
- };
7178
- COffcanvas.displayName = 'COffcanvas';
7179
-
7180
- var COffcanvasBody = React.forwardRef(function (_a, ref) {
7181
- var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
7182
- var _className = classNames('offcanvas-body', className);
7183
- return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
7184
- });
7185
- COffcanvasBody.propTypes = {
7186
- children: PropTypes.node,
7187
- className: PropTypes.string,
7188
- };
7189
- COffcanvasBody.displayName = 'COffcanvasBody';
7190
-
7191
- var COffcanvasHeader = React.forwardRef(function (_a, ref) {
7192
- var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
7193
- var _className = classNames('offcanvas-header', className);
7194
- return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
7195
- });
7196
- COffcanvasHeader.propTypes = {
7197
- children: PropTypes.node,
7198
- className: PropTypes.string,
7199
- };
7200
- COffcanvasHeader.displayName = 'COffcanvasHeader';
7201
-
7202
- var COffcanvasTitle = React.forwardRef(function (_a, ref) {
7203
- var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'h5' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
7204
- var _className = classNames('offcanvas-title', className);
7205
- return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
7206
- });
7207
- COffcanvasTitle.propTypes = {
7208
- children: PropTypes.node,
7209
- className: PropTypes.string,
7210
- component: PropTypes.elementType,
7211
- };
7212
- COffcanvasTitle.displayName = 'COffcanvasTitle';
7213
-
7214
7316
  var CSidebarBrand = React.forwardRef(function (_a, ref) {
7215
7317
  var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
7216
7318
  var _className = classNames('sidebar-brand', className);
@@ -7427,15 +7529,17 @@ CTabContent.displayName = 'CTabContent';
7427
7529
 
7428
7530
  var CTabPane = React.forwardRef(function (_a, ref) {
7429
7531
  var children = _a.children, className = _a.className, onHide = _a.onHide, onShow = _a.onShow, visible = _a.visible, rest = __rest(_a, ["children", "className", "onHide", "onShow", "visible"]);
7532
+ var tabPaneRef = React.useRef();
7533
+ var forkedRef = useForkedRef(ref, tabPaneRef);
7430
7534
  var getTransitionClass = function (state) {
7431
7535
  return state === 'entered' && 'show';
7432
7536
  };
7433
7537
  var _className = classNames('tab-pane', 'fade', {
7434
7538
  active: visible,
7435
7539
  }, className);
7436
- return (React__default["default"].createElement(Transition$1, { in: visible, onEnter: onShow, onExit: onHide, timeout: 150 }, function (state) {
7540
+ return (React__default["default"].createElement(Transition$1, { in: visible, nodeRef: tabPaneRef, onEnter: onShow, onExit: onHide, timeout: 150 }, function (state) {
7437
7541
  var transitionClass = getTransitionClass(state);
7438
- return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: ref }), children));
7542
+ return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: forkedRef }), children));
7439
7543
  }));
7440
7544
  });
7441
7545
  CTabPane.propTypes = {
@@ -7451,6 +7555,8 @@ var CToastContext = React.createContext({});
7451
7555
  var CToast = React.forwardRef(function (_a, ref) {
7452
7556
  var _b;
7453
7557
  var children = _a.children, _c = _a.animation, animation = _c === void 0 ? true : _c, _d = _a.autohide, autohide = _d === void 0 ? true : _d, className = _a.className, color = _a.color, _e = _a.delay, delay = _e === void 0 ? 5000 : _e, index = _a.index, key = _a.key, _f = _a.visible, visible = _f === void 0 ? false : _f, onClose = _a.onClose, onShow = _a.onShow, rest = __rest(_a, ["children", "animation", "autohide", "className", "color", "delay", "index", "key", "visible", "onClose", "onShow"]);
7558
+ var toastRef = React.useRef();
7559
+ var forkedRef = useForkedRef(ref, toastRef);
7454
7560
  var _g = React.useState(false), _visible = _g[0], setVisible = _g[1];
7455
7561
  var timeout = React.useRef();
7456
7562
  React.useEffect(function () {
@@ -7488,10 +7594,10 @@ var CToast = React.forwardRef(function (_a, ref) {
7488
7594
  ? 'showing'
7489
7595
  : 'fade';
7490
7596
  };
7491
- return (React__default["default"].createElement(Transition$1, { in: _visible, onEnter: function () { return onShow && onShow(index ? index : null); }, onExited: function () { return onClose && onClose(index ? index : null); }, timeout: 250, unmountOnExit: true }, function (state) {
7597
+ return (React__default["default"].createElement(Transition$1, { in: _visible, nodeRef: toastRef, onEnter: function () { return onShow && onShow(index ? index : null); }, onExited: function () { return onClose && onClose(index ? index : null); }, timeout: 250, unmountOnExit: true }, function (state) {
7492
7598
  var transitionClass = getTransitionClass(state);
7493
7599
  return (React__default["default"].createElement(CToastContext.Provider, { value: contextValues },
7494
- React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass), "aria-live": "assertive", "aria-atomic": "true", role: "alert", onMouseEnter: function () { return clearTimeout(timeout.current); }, onMouseLeave: function () { return _autohide; } }, rest, { key: key, ref: ref }), children)));
7600
+ React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass), "aria-live": "assertive", "aria-atomic": "true", role: "alert", onMouseEnter: function () { return clearTimeout(timeout.current); }, onMouseLeave: function () { return _autohide; } }, rest, { key: key, ref: forkedRef }), children)));
7495
7601
  }));
7496
7602
  });
7497
7603
  CToast.propTypes = {
@@ -7601,8 +7707,24 @@ CToaster.propTypes = {
7601
7707
  CToaster.displayName = 'CToaster';
7602
7708
 
7603
7709
  var CTooltip = function (_a) {
7604
- var children = _a.children, content = _a.content, _b = _a.placement, placement = _b === void 0 ? 'top' : _b, onHide = _a.onHide, onShow = _a.onShow, _c = _a.trigger, trigger = _c === void 0 ? 'hover' : _c, visible = _a.visible, rest = __rest(_a, ["children", "content", "placement", "onHide", "onShow", "trigger", "visible"]);
7605
- var _d = React.useState(visible), _visible = _d[0], setVisible = _d[1];
7710
+ var children = _a.children, content = _a.content, _b = _a.offset, offset = _b === void 0 ? [0, 0] : _b, onHide = _a.onHide, onShow = _a.onShow, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, _d = _a.trigger, trigger = _d === void 0 ? 'hover' : _d, visible = _a.visible, rest = __rest(_a, ["children", "content", "offset", "onHide", "onShow", "placement", "trigger", "visible"]);
7711
+ var tooltipRef = React.useRef();
7712
+ var _e = React.useState(visible), _visible = _e[0], setVisible = _e[1];
7713
+ var _f = React.useState(null), referenceElement = _f[0], setReferenceElement = _f[1];
7714
+ var _g = React.useState(null), popperElement = _g[0], setPopperElement = _g[1];
7715
+ var _h = React.useState(null), arrowElement = _h[0], setArrowElement = _h[1];
7716
+ var _j = usePopper(referenceElement, popperElement, {
7717
+ modifiers: [
7718
+ { name: 'arrow', options: { element: arrowElement } },
7719
+ {
7720
+ name: 'offset',
7721
+ options: {
7722
+ offset: offset,
7723
+ },
7724
+ },
7725
+ ],
7726
+ placement: placement,
7727
+ }), styles = _j.styles, attributes = _j.attributes;
7606
7728
  var getTransitionClass = function (state) {
7607
7729
  return state === 'entering'
7608
7730
  ? 'fade'
@@ -7612,39 +7734,34 @@ var CTooltip = function (_a) {
7612
7734
  ? 'fade'
7613
7735
  : 'fade';
7614
7736
  };
7615
- return (React__default["default"].createElement(Manager, null,
7616
- React__default["default"].createElement(Reference, null, function (_a) {
7617
- var ref = _a.ref;
7618
- return React__default["default"].cloneElement(children, __assign(__assign(__assign({ ref: ref }, ((trigger === 'click' || trigger.includes('click')) && {
7619
- onClick: function () { return setVisible(!_visible); },
7620
- })), ((trigger === 'focus' || trigger.includes('focus')) && {
7621
- onFocus: function () { return setVisible(true); },
7622
- onBlur: function () { return setVisible(false); },
7623
- })), ((trigger === 'hover' || trigger.includes('hover')) && {
7624
- onMouseEnter: function () { return setVisible(true); },
7625
- onMouseLeave: function () { return setVisible(false); },
7626
- })));
7627
- }),
7737
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
7738
+ React__default["default"].cloneElement(children, __assign(__assign(__assign({ ref: setReferenceElement }, ((trigger === 'click' || trigger.includes('click')) && {
7739
+ onClick: function () { return setVisible(!_visible); },
7740
+ })), ((trigger === 'focus' || trigger.includes('focus')) && {
7741
+ onFocus: function () { return setVisible(true); },
7742
+ onBlur: function () { return setVisible(false); },
7743
+ })), ((trigger === 'hover' || trigger.includes('hover')) && {
7744
+ onMouseEnter: function () { return setVisible(true); },
7745
+ onMouseLeave: function () { return setVisible(false); },
7746
+ }))),
7628
7747
  typeof window !== 'undefined' &&
7629
- ReactDOM.createPortal(React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, onEnter: onShow, onExit: onHide, timeout: {
7748
+ ReactDOM.createPortal(React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: tooltipRef, onEnter: onShow, onExit: onHide, timeout: {
7630
7749
  enter: 0,
7631
7750
  exit: 200,
7632
7751
  }, unmountOnExit: true }, function (state) {
7633
7752
  var transitionClass = getTransitionClass(state);
7634
- return (React__default["default"].createElement(Popper, { placement: placement }, function (_a) {
7635
- var arrowProps = _a.arrowProps, style = _a.style, ref = _a.ref;
7636
- return (React__default["default"].createElement("div", __assign({ className: classNames("tooltip bs-tooltip-".concat(placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement), transitionClass), ref: ref, role: "tooltip", style: style }, rest),
7637
- React__default["default"].createElement("div", __assign({ className: "tooltip-arrow" }, arrowProps)),
7638
- React__default["default"].createElement("div", { className: "tooltip-inner" }, content)));
7639
- }));
7753
+ return (React__default["default"].createElement("div", __assign({ className: classNames("tooltip bs-tooltip-".concat(placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement), transitionClass), ref: setPopperElement, role: "tooltip", style: styles.popper }, attributes.popper, rest),
7754
+ React__default["default"].createElement("div", { className: "tooltip-arrow", style: styles.arrow, ref: setArrowElement }),
7755
+ React__default["default"].createElement("div", { className: "tooltip-inner" }, content)));
7640
7756
  }), document.body)));
7641
7757
  };
7642
7758
  CTooltip.propTypes = {
7643
7759
  children: PropTypes.any,
7644
- content: PropTypes.node,
7645
- placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
7760
+ content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
7761
+ offset: PropTypes.any,
7646
7762
  onHide: PropTypes.func,
7647
7763
  onShow: PropTypes.func,
7764
+ placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
7648
7765
  trigger: triggerPropType,
7649
7766
  visible: PropTypes.bool,
7650
7767
  };