@coreui/react 5.0.0-alpha.0 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  Several quick start options are available:
48
48
 
49
- - [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.0.zip)
49
+ - [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.1.zip)
50
50
  - Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
51
51
  - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
52
52
  - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
@@ -4,12 +4,18 @@ export interface CCloseButtonProps extends HTMLAttributes<HTMLButtonElement> {
4
4
  * A string of all className you want applied to the base component.
5
5
  */
6
6
  className?: string;
7
+ /**
8
+ * Invert the default color.
9
+ */
10
+ dark?: boolean;
7
11
  /**
8
12
  * Toggle the disabled state for the component.
9
13
  */
10
14
  disabled?: boolean;
11
15
  /**
12
16
  * Change the default color to white.
17
+ *
18
+ * @deprecated 5.0.0
13
19
  */
14
20
  white?: boolean;
15
21
  }
@@ -16,6 +16,12 @@ export interface CModalProps extends HTMLAttributes<HTMLDivElement> {
16
16
  * @ignore
17
17
  */
18
18
  duration?: number;
19
+ /**
20
+ * Puts the focus on the modal when shown.
21
+ *
22
+ * @since v4.10.0
23
+ */
24
+ focus?: boolean;
19
25
  /**
20
26
  * Set modal to covers the entire user viewport.
21
27
  */
@@ -15,6 +15,6 @@ export interface CNavProps extends HTMLAttributes<HTMLDivElement | HTMLUListElem
15
15
  /**
16
16
  * Set the nav variant to tabs or pills.
17
17
  */
18
- variant?: 'tabs' | 'pills';
18
+ variant?: 'pills' | 'tabs' | 'underline';
19
19
  }
20
20
  export declare const CNav: React.ForwardRefExoticComponent<CNavProps & React.RefAttributes<HTMLDivElement | HTMLOListElement | HTMLUListElement>>;
@@ -12,7 +12,7 @@ export interface CNavbarProps extends HTMLAttributes<HTMLDivElement> {
12
12
  */
13
13
  color?: Colors;
14
14
  /**
15
- * Sets if the color of text should be colored for a light or dark dark background.
15
+ * Sets if the color of text should be colored for a light or dark background.
16
16
  */
17
17
  colorScheme?: 'dark' | 'light';
18
18
  /**
@@ -8,6 +8,10 @@ export interface COffcanvasProps extends HTMLAttributes<HTMLDivElement> {
8
8
  * A string of all className you want applied to the base component.
9
9
  */
10
10
  className?: string;
11
+ /**
12
+ * Sets a darker color scheme.
13
+ */
14
+ dark?: boolean;
11
15
  /**
12
16
  * Closes the offcanvas when escape key is pressed.
13
17
  */
package/dist/index.es.js CHANGED
@@ -4357,14 +4357,103 @@ var createPopper = /*#__PURE__*/popperGenerator({
4357
4357
  defaultModifiers: defaultModifiers
4358
4358
  }); // eslint-disable-next-line import/no-unused-modules
4359
4359
 
4360
+ var getTransitionDurationFromElement = function (element) {
4361
+ if (!element) {
4362
+ return 0;
4363
+ }
4364
+ // Get transition-duration of the element
4365
+ var _a = window.getComputedStyle(element), transitionDuration = _a.transitionDuration, transitionDelay = _a.transitionDelay;
4366
+ var floatTransitionDuration = Number.parseFloat(transitionDuration);
4367
+ var floatTransitionDelay = Number.parseFloat(transitionDelay);
4368
+ // Return 0 if element or transition duration is not found
4369
+ if (!floatTransitionDuration && !floatTransitionDelay) {
4370
+ return 0;
4371
+ }
4372
+ // If multiple durations are defined, take the first
4373
+ transitionDuration = transitionDuration.split(',')[0];
4374
+ transitionDelay = transitionDelay.split(',')[0];
4375
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * 1000;
4376
+ };
4377
+
4378
+ var execute = function (callback) {
4379
+ if (typeof callback === 'function') {
4380
+ callback();
4381
+ }
4382
+ };
4383
+ var triggerTransitionEnd = function (element) {
4384
+ element.dispatchEvent(new Event('transitionend'));
4385
+ };
4386
+ var executeAfterTransition = function (callback, transitionElement, waitForTransition) {
4387
+ if (waitForTransition === void 0) { waitForTransition = true; }
4388
+ if (!waitForTransition) {
4389
+ execute(callback);
4390
+ return;
4391
+ }
4392
+ var durationPadding = 5;
4393
+ var emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
4394
+ var called = false;
4395
+ var handler = function (_a) {
4396
+ var target = _a.target;
4397
+ if (target !== transitionElement) {
4398
+ return;
4399
+ }
4400
+ called = true;
4401
+ transitionElement.removeEventListener('transitionend', handler);
4402
+ execute(callback);
4403
+ };
4404
+ transitionElement.addEventListener('transitionend', handler);
4405
+ setTimeout(function () {
4406
+ if (!called) {
4407
+ triggerTransitionEnd(transitionElement);
4408
+ }
4409
+ }, emulatedDuration);
4410
+ };
4411
+
4412
+ var isRTL = function (element) {
4413
+ if (typeof document !== 'undefined' && document.documentElement.dir === 'rtl') {
4414
+ return true;
4415
+ }
4416
+ if (element) {
4417
+ return element.closest('[dir="rtl"]') !== null;
4418
+ }
4419
+ return false;
4420
+ };
4421
+
4422
+ var getRTLPlacement = function (placement, element) {
4423
+ switch (placement) {
4424
+ case 'right': {
4425
+ return isRTL(element) ? 'left' : 'right';
4426
+ }
4427
+ case 'left': {
4428
+ return isRTL(element) ? 'right' : 'left';
4429
+ }
4430
+ default: {
4431
+ return placement;
4432
+ }
4433
+ }
4434
+ };
4435
+
4436
+ var isInViewport = function (element) {
4437
+ var rect = element.getBoundingClientRect();
4438
+ return (Math.floor(rect.top) >= 0 &&
4439
+ Math.floor(rect.left) >= 0 &&
4440
+ Math.floor(rect.bottom) <= (window.innerHeight || document.documentElement.clientHeight) &&
4441
+ Math.floor(rect.right) <= (window.innerWidth || document.documentElement.clientWidth));
4442
+ };
4443
+
4360
4444
  var usePopper = function () {
4361
4445
  var _popper = useRef();
4446
+ var el = useRef();
4362
4447
  var initPopper = function (reference, popper, options) {
4363
4448
  _popper.current = createPopper(reference, popper, options);
4449
+ el.current = popper;
4364
4450
  };
4365
4451
  var destroyPopper = function () {
4366
- if (_popper.current) {
4367
- _popper.current.destroy();
4452
+ var popperInstance = _popper.current;
4453
+ if (popperInstance && el.current) {
4454
+ executeAfterTransition(function () {
4455
+ popperInstance.destroy();
4456
+ }, el.current);
4368
4457
  }
4369
4458
  _popper.current = undefined;
4370
4459
  };
@@ -4474,13 +4563,14 @@ CAccordionHeader.propTypes = {
4474
4563
  CAccordionHeader.displayName = 'CAccordionHeader';
4475
4564
 
4476
4565
  var CCloseButton = forwardRef(function (_a, ref) {
4477
- var className = _a.className, disabled = _a.disabled, white = _a.white, rest = __rest(_a, ["className", "disabled", "white"]);
4566
+ var className = _a.className, dark = _a.dark, disabled = _a.disabled, white = _a.white, rest = __rest(_a, ["className", "dark", "disabled", "white"]);
4478
4567
  return (React.createElement("button", __assign({ type: "button", className: classNames('btn', 'btn-close', {
4479
4568
  'btn-close-white': white,
4480
- }, disabled, className), "aria-label": "Close", disabled: disabled }, rest, { ref: ref })));
4569
+ }, disabled, className), "aria-label": "Close", disabled: disabled }, (dark && { 'data-coreui-theme': 'dark' }), rest, { ref: ref })));
4481
4570
  });
4482
4571
  CCloseButton.propTypes = {
4483
4572
  className: PropTypes.string,
4573
+ dark: PropTypes.bool,
4484
4574
  disabled: PropTypes.bool,
4485
4575
  white: PropTypes.bool,
4486
4576
  };
@@ -4880,38 +4970,6 @@ CCardTitle.propTypes = {
4880
4970
  };
4881
4971
  CCardTitle.displayName = 'CCardTitle';
4882
4972
 
4883
- var isRTL = function (element) {
4884
- if (typeof document !== 'undefined' && document.documentElement.dir === 'rtl') {
4885
- return true;
4886
- }
4887
- if (element) {
4888
- return element.closest('[dir="rtl"]') !== null;
4889
- }
4890
- return false;
4891
- };
4892
-
4893
- var getRTLPlacement = function (placement, element) {
4894
- switch (placement) {
4895
- case 'right': {
4896
- return isRTL(element) ? 'left' : 'right';
4897
- }
4898
- case 'left': {
4899
- return isRTL(element) ? 'right' : 'left';
4900
- }
4901
- default: {
4902
- return placement;
4903
- }
4904
- }
4905
- };
4906
-
4907
- var isInViewport = function (element) {
4908
- var rect = element.getBoundingClientRect();
4909
- return (Math.floor(rect.top) >= 0 &&
4910
- Math.floor(rect.left) >= 0 &&
4911
- Math.floor(rect.bottom) <= (window.innerHeight || document.documentElement.clientHeight) &&
4912
- Math.floor(rect.right) <= (window.innerWidth || document.documentElement.clientWidth));
4913
- };
4914
-
4915
4973
  var CCarouselContext = createContext({});
4916
4974
  var CCarousel = forwardRef(function (_a, ref) {
4917
4975
  var children = _a.children, _b = _a.activeIndex, activeIndex = _b === void 0 ? 0 : _b, className = _a.className, controls = _a.controls, dark = _a.dark, indicators = _a.indicators, _c = _a.interval, interval = _c === void 0 ? 5000 : _c, onSlid = _a.onSlid, onSlide = _a.onSlide, _d = _a.pause, pause = _d === void 0 ? 'hover' : _d, _e = _a.touch, touch = _e === void 0 ? true : _e, transition = _a.transition, _f = _a.wrap, wrap = _f === void 0 ? true : _f, rest = __rest(_a, ["children", "activeIndex", "className", "controls", "dark", "indicators", "interval", "onSlid", "onSlide", "pause", "touch", "transition", "wrap"]);
@@ -5016,17 +5074,18 @@ var CCarousel = forwardRef(function (_a, ref) {
5016
5074
  setTouchPosition(touchDown);
5017
5075
  };
5018
5076
  return (React.createElement("div", __assign({ className: classNames('carousel slide', {
5019
- 'carousel-dark': dark,
5020
5077
  'carousel-fade': transition === 'crossfade',
5021
- }, className), onMouseEnter: _pause, onMouseLeave: cycle }, (touch && { onTouchStart: handleTouchStart, onTouchMove: handleTouchMove }), rest, { ref: forkedRef }),
5078
+ }, className) }, (dark && { 'data-coreui-theme': 'dark' }), { onMouseEnter: _pause, onMouseLeave: cycle }, (touch && { onTouchStart: handleTouchStart, onTouchMove: handleTouchMove }), rest, { ref: forkedRef }),
5022
5079
  React.createElement(CCarouselContext.Provider, { value: {
5023
5080
  setAnimating: setAnimating,
5024
5081
  setCustomInterval: setCustomInterval,
5025
5082
  } },
5026
- indicators && (React.createElement("ol", { className: "carousel-indicators" }, Array.from({ length: itemsNumber }, function (_, i) { return i; }).map(function (index) {
5027
- return (React.createElement("li", { key: "indicator".concat(index), onClick: function () {
5083
+ indicators && (React.createElement("div", { className: "carousel-indicators" }, Array.from({ length: itemsNumber }, function (_, i) { return i; }).map(function (index) {
5084
+ return (React.createElement("button", __assign({ key: "indicator".concat(index), onClick: function () {
5028
5085
  !animating && handleIndicatorClick(index);
5029
- }, className: active === index ? 'active' : '', "data-coreui-target": "" }));
5086
+ }, className: classNames({
5087
+ active: active === index
5088
+ }), "data-coreui-target": "" }, (active === index && { 'aria-current': true }), { "aria-label": "Slide ".concat(index + 1) })));
5030
5089
  }))),
5031
5090
  React.createElement("div", { className: "carousel-inner" }, Children.map(children, function (child, index) {
5032
5091
  if (React.isValidElement(child)) {
@@ -5354,9 +5413,8 @@ var CDropdownMenu = forwardRef(function (_a, ref) {
5354
5413
  var forkedRef = useForkedRef(ref, dropdownMenuRef);
5355
5414
  return (React.createElement(CConditionalPortal, { portal: portal !== null && portal !== void 0 ? portal : false },
5356
5415
  React.createElement(Component, __assign({ className: classNames('dropdown-menu', {
5357
- 'dropdown-menu-dark': dark,
5358
5416
  show: visible,
5359
- }, alignment && alignmentClassNames(alignment), className), ref: forkedRef, role: "menu", "aria-hidden": !visible }, (!popper && { 'data-coreui-popper': 'static' }), rest), Component === 'ul'
5417
+ }, alignment && alignmentClassNames(alignment), className), ref: forkedRef, role: "menu", "aria-hidden": !visible }, (!popper && { 'data-coreui-popper': 'static' }), (dark && { 'data-coreui-theme': 'dark' }), rest), Component === 'ul'
5360
5418
  ? React.Children.map(children, function (child, index) {
5361
5419
  if (React.isValidElement(child)) {
5362
5420
  return React.createElement("li", { key: index }, React.cloneElement(child));
@@ -6017,12 +6075,13 @@ CModalDialog.displayName = 'CModalDialog';
6017
6075
 
6018
6076
  var CModalContext = createContext({});
6019
6077
  var CModal = forwardRef(function (_a, ref) {
6020
- 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, rest = __rest(_a, ["children", "alignment", "backdrop", "className", "duration", "fullscreen", "keyboard", "onClose", "onClosePrevented", "onShow", "portal", "scrollable", "size", "transition", "unmountOnClose", "visible"]);
6078
+ 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, _d = _a.focus, focus = _d === void 0 ? true : _d, fullscreen = _a.fullscreen, _e = _a.keyboard, keyboard = _e === void 0 ? true : _e, onClose = _a.onClose, onClosePrevented = _a.onClosePrevented, onShow = _a.onShow, _f = _a.portal, portal = _f === void 0 ? true : _f, scrollable = _a.scrollable, size = _a.size, _g = _a.transition, transition = _g === void 0 ? true : _g, _h = _a.unmountOnClose, unmountOnClose = _h === void 0 ? true : _h, visible = _a.visible, rest = __rest(_a, ["children", "alignment", "backdrop", "className", "duration", "focus", "fullscreen", "keyboard", "onClose", "onClosePrevented", "onShow", "portal", "scrollable", "size", "transition", "unmountOnClose", "visible"]);
6079
+ var activeElementRef = useRef(null);
6021
6080
  var modalRef = useRef(null);
6022
6081
  var modalContentRef = useRef(null);
6023
6082
  var forkedRef = useForkedRef(ref, modalRef);
6024
- var _h = useState(visible), _visible = _h[0], setVisible = _h[1];
6025
- var _j = useState(false), staticBackdrop = _j[0], setStaticBackdrop = _j[1];
6083
+ var _j = useState(visible), _visible = _j[0], setVisible = _j[1];
6084
+ var _k = useState(false), staticBackdrop = _k[0], setStaticBackdrop = _k[1];
6026
6085
  var contextValues = {
6027
6086
  visible: _visible,
6028
6087
  setVisible: setVisible,
@@ -6031,10 +6090,17 @@ var CModal = forwardRef(function (_a, ref) {
6031
6090
  setVisible(visible);
6032
6091
  }, [visible]);
6033
6092
  useEffect(function () {
6034
- document.addEventListener('click', handleClickOutside);
6035
- document.addEventListener('keydown', handleKeyDown);
6093
+ var _a;
6094
+ if (_visible) {
6095
+ activeElementRef.current = document.activeElement;
6096
+ document.addEventListener('mouseup', handleClickOutside);
6097
+ document.addEventListener('keydown', handleKeyDown);
6098
+ }
6099
+ else {
6100
+ (_a = activeElementRef.current) === null || _a === void 0 ? void 0 : _a.focus();
6101
+ }
6036
6102
  return function () {
6037
- document.removeEventListener('click', handleClickOutside);
6103
+ document.removeEventListener('mouseup', handleClickOutside);
6038
6104
  document.removeEventListener('keydown', handleKeyDown);
6039
6105
  };
6040
6106
  }, [_visible]);
@@ -6059,7 +6125,7 @@ var CModal = forwardRef(function (_a, ref) {
6059
6125
  }
6060
6126
  setTimeout(function () {
6061
6127
  var _a;
6062
- (_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.focus();
6128
+ focus && ((_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.focus());
6063
6129
  }, transition ? duration : 0);
6064
6130
  }
6065
6131
  else {
@@ -6091,13 +6157,15 @@ var CModal = forwardRef(function (_a, ref) {
6091
6157
  return (React.createElement(React.Fragment, null,
6092
6158
  React.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: modalRef, onEnter: onShow, onExit: onClose, unmountOnExit: unmountOnClose, timeout: transition ? duration : 0 }, function (state) { return (React.createElement(CConditionalPortal, { portal: portal },
6093
6159
  React.createElement(CModalContext.Provider, { value: contextValues },
6094
- React.createElement("div", { className: classNames('modal', {
6160
+ React.createElement("div", __assign({ className: classNames('modal', {
6095
6161
  'modal-static': staticBackdrop,
6096
6162
  fade: transition,
6097
6163
  show: state === 'entered',
6098
- }, className), tabIndex: -1, role: "dialog", style: __assign({}, (state !== 'exited' && { display: 'block' })), ref: forkedRef },
6164
+ }, className), tabIndex: -1 }, (_visible
6165
+ ? { 'aria-modal': true, role: 'dialog' }
6166
+ : { 'aria-hidden': 'true' }), { style: __assign({}, (state !== 'exited' && { display: 'block' })) }, rest, { ref: forkedRef }),
6099
6167
  React.createElement(CModalDialog, { alignment: alignment, fullscreen: fullscreen, scrollable: scrollable, size: size },
6100
- React.createElement(CModalContent, __assign({}, rest, { ref: modalContentRef }), children)))))); }),
6168
+ React.createElement(CModalContent, { ref: modalContentRef }, children)))))); }),
6101
6169
  backdrop && (React.createElement(CConditionalPortal, { portal: portal },
6102
6170
  React.createElement(CBackdrop, { visible: _visible })))));
6103
6171
  });
@@ -6107,6 +6175,7 @@ CModal.propTypes = {
6107
6175
  children: PropTypes.node,
6108
6176
  className: PropTypes.string,
6109
6177
  duration: PropTypes.number,
6178
+ focus: PropTypes.bool,
6110
6179
  fullscreen: PropTypes.oneOfType([
6111
6180
  PropTypes.bool,
6112
6181
  PropTypes.oneOf(['sm', 'md', 'lg', 'xl', 'xxl']),
@@ -6182,7 +6251,7 @@ CNav.propTypes = {
6182
6251
  className: PropTypes.string,
6183
6252
  component: PropTypes.elementType,
6184
6253
  layout: PropTypes.oneOf(['fill', 'justified']),
6185
- variant: PropTypes.oneOf(['tabs', 'pills']),
6254
+ variant: PropTypes.oneOf(['pills', 'tabs', 'underline']),
6186
6255
  };
6187
6256
  CNav.displayName = 'CNav';
6188
6257
 
@@ -6221,14 +6290,19 @@ CSidebarNav.propTypes = {
6221
6290
  };
6222
6291
  CSidebarNav.displayName = 'CSidebarNav';
6223
6292
 
6293
+ var isInVisibleGroup = function (el1, el2) {
6294
+ var array1 = el1.toString().split('.');
6295
+ var array2 = el2.toString().split('.');
6296
+ return array2.every(function (item, index) { return item === array1[index]; });
6297
+ };
6224
6298
  var CNavGroup = forwardRef(function (_a, ref) {
6225
6299
  var children = _a.children, className = _a.className, compact = _a.compact, idx = _a.idx, toggler = _a.toggler, visible = _a.visible, rest = __rest(_a, ["children", "className", "compact", "idx", "toggler", "visible"]);
6226
6300
  var _b = useState(), height = _b[0], setHeight = _b[1];
6227
6301
  var navItemsRef = useRef(null);
6228
6302
  var _c = useContext(CNavContext), visibleGroup = _c.visibleGroup, setVisibleGroup = _c.setVisibleGroup;
6229
- var _d = useState(Boolean(visible || (idx && visibleGroup && visibleGroup.toString().startsWith(idx.toString())))), _visible = _d[0], setVisible = _d[1];
6303
+ var _d = useState(Boolean(visible || (idx && visibleGroup && isInVisibleGroup(visibleGroup, idx)))), _visible = _d[0], setVisible = _d[1];
6230
6304
  useEffect(function () {
6231
- setVisible(Boolean(idx && visibleGroup && visibleGroup.toString().startsWith(idx.toString())));
6305
+ setVisible(Boolean(idx && visibleGroup && isInVisibleGroup(visibleGroup, idx)));
6232
6306
  }, [visibleGroup]);
6233
6307
  var handleTogglerOnCLick = function (event) {
6234
6308
  event.preventDefault();
@@ -6331,9 +6405,8 @@ var CNavbar = forwardRef(function (_a, ref) {
6331
6405
  var children = _a.children, className = _a.className, color = _a.color, colorScheme = _a.colorScheme, _c = _a.component, Component = _c === void 0 ? 'nav' : _c, container = _a.container, expand = _a.expand, placement = _a.placement, rest = __rest(_a, ["children", "className", "color", "colorScheme", "component", "container", "expand", "placement"]);
6332
6406
  return (React.createElement(Component, __assign({ className: classNames('navbar', (_b = {},
6333
6407
  _b["bg-".concat(color)] = color,
6334
- _b["navbar-".concat(colorScheme)] = colorScheme,
6335
6408
  _b[typeof expand === 'boolean' ? 'navbar-expand' : "navbar-expand-".concat(expand)] = expand,
6336
- _b), placement, className) }, rest, { ref: ref }), container ? (React.createElement("div", { className: typeof container === 'string' ? "container-".concat(container) : 'container' }, children)) : (React.createElement(React.Fragment, null, children))));
6409
+ _b), placement, className) }, (colorScheme && { 'data-coreui-theme': colorScheme }), rest, { ref: ref }), container ? (React.createElement("div", { className: typeof container === 'string' ? "container-".concat(container) : 'container' }, children)) : (React.createElement(React.Fragment, null, children))));
6337
6410
  });
6338
6411
  CNavbar.propTypes = {
6339
6412
  children: PropTypes.node,
@@ -6404,7 +6477,7 @@ CNavbarToggler.propTypes = {
6404
6477
  CNavbarToggler.displayName = 'CNavbarToggler';
6405
6478
 
6406
6479
  var COffcanvas = forwardRef(function (_a, ref) {
6407
- var children = _a.children, _b = _a.backdrop, backdrop = _b === void 0 ? true : _b, className = _a.className, _c = _a.keyboard, keyboard = _c === void 0 ? true : _c, onHide = _a.onHide, onShow = _a.onShow, placement = _a.placement, _d = _a.portal, portal = _d === void 0 ? false : _d, _e = _a.responsive, responsive = _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", "responsive", "scroll", "visible"]);
6480
+ var children = _a.children, _b = _a.backdrop, backdrop = _b === void 0 ? true : _b, className = _a.className, dark = _a.dark, _c = _a.keyboard, keyboard = _c === void 0 ? true : _c, onHide = _a.onHide, onShow = _a.onShow, placement = _a.placement, _d = _a.portal, portal = _d === void 0 ? false : _d, _e = _a.responsive, responsive = _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", "dark", "keyboard", "onHide", "onShow", "placement", "portal", "responsive", "scroll", "visible"]);
6408
6481
  var _h = useState(visible), _visible = _h[0], setVisible = _h[1];
6409
6482
  var offcanvasRef = useRef(null);
6410
6483
  var forkedRef = useForkedRef(ref, offcanvasRef);
@@ -6445,7 +6518,7 @@ var COffcanvas = forwardRef(function (_a, ref) {
6445
6518
  _a.showing = state === 'entering',
6446
6519
  _a.show = state === 'entered',
6447
6520
  _a['show hiding'] = state === 'exiting',
6448
- _a), className), role: "dialog", tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: forkedRef }), children)));
6521
+ _a), className), role: "dialog", tabIndex: -1, onKeyDown: handleKeyDown }, (dark && { 'data-coreui-theme': 'dark' }), rest, { ref: forkedRef }), children)));
6449
6522
  }),
6450
6523
  backdrop && (React.createElement(CConditionalPortal, { portal: portal },
6451
6524
  React.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleBackdropDismiss, visible: _visible })))));
@@ -6454,6 +6527,7 @@ COffcanvas.propTypes = {
6454
6527
  backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['static'])]),
6455
6528
  children: PropTypes.node,
6456
6529
  className: PropTypes.string,
6530
+ dark: PropTypes.bool,
6457
6531
  keyboard: PropTypes.bool,
6458
6532
  onHide: PropTypes.func,
6459
6533
  onShow: PropTypes.func,
@@ -6697,7 +6771,7 @@ var CPopover = function (_a) {
6697
6771
  typeof window !== 'undefined' &&
6698
6772
  createPortal(React.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: popoverRef, onEnter: onShow, onExit: onHide, timeout: {
6699
6773
  enter: 0,
6700
- exit: 200,
6774
+ exit: popoverRef.current ? getTransitionDurationFromElement(popoverRef.current) + 50 : 200,
6701
6775
  }, unmountOnExit: true }, function (state) { return (React.createElement("div", __assign({ className: classNames('popover', 'bs-popover-auto', {
6702
6776
  fade: animation,
6703
6777
  show: state === 'entered',
@@ -7310,7 +7384,7 @@ var CTooltip = function (_a) {
7310
7384
  typeof window !== 'undefined' &&
7311
7385
  createPortal(React.createElement(Transition$1, { in: _visible, mountOnEnter: true, onEnter: onShow, onExit: onHide, timeout: {
7312
7386
  enter: 0,
7313
- exit: 200,
7387
+ exit: tooltipRef.current ? getTransitionDurationFromElement(tooltipRef.current) + 50 : 200,
7314
7388
  }, unmountOnExit: true }, function (state) { return (React.createElement("div", __assign({ className: classNames('tooltip', 'bs-tooltip-auto', {
7315
7389
  fade: animation,
7316
7390
  show: state === 'entered',