@coreui/react 4.10.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 +1 -1
- package/dist/components/accordion/CAccordionCollapse.d.ts +3 -0
- package/dist/components/close-button/CCloseButton.d.ts +6 -0
- package/dist/components/dropdown copy/CDropdown.d.ts +89 -0
- package/dist/components/dropdown copy/CDropdownDivider.d.ts +8 -0
- package/dist/components/dropdown copy/CDropdownHeader.d.ts +12 -0
- package/dist/components/dropdown copy/CDropdownItem.d.ts +13 -0
- package/dist/components/dropdown copy/CDropdownItemPlain.d.ts +12 -0
- package/dist/components/dropdown copy/CDropdownMenu.d.ts +13 -0
- package/dist/components/dropdown copy/CDropdownToggle.d.ts +24 -0
- package/dist/components/dropdown copy/index.d.ts +8 -0
- package/dist/components/nav/CNav.d.ts +1 -1
- package/dist/components/navbar/CNavbar.d.ts +1 -1
- package/dist/components/offcanvas/COffcanvas.d.ts +4 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/index.es.js +64 -15
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +64 -14
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/components/carousel/CCarousel.tsx +9 -5
- package/src/components/close-button/CCloseButton.tsx +9 -1
- package/src/components/dropdown/CDropdownMenu.tsx +1 -1
- package/src/components/nav/CNav.tsx +2 -2
- package/src/components/navbar/CNavbar.tsx +2 -2
- package/src/components/offcanvas/COffcanvas.tsx +7 -0
- package/src/hooks/index.ts +2 -1
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/
|
|
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
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { ElementType, HTMLAttributes, RefObject } from 'react';
|
|
2
|
+
import type { Placements } from '../../types';
|
|
3
|
+
export type Directions = 'start' | 'end';
|
|
4
|
+
export type Breakpoints = {
|
|
5
|
+
xs: Directions;
|
|
6
|
+
} | {
|
|
7
|
+
sm: Directions;
|
|
8
|
+
} | {
|
|
9
|
+
md: Directions;
|
|
10
|
+
} | {
|
|
11
|
+
lg: Directions;
|
|
12
|
+
} | {
|
|
13
|
+
xl: Directions;
|
|
14
|
+
} | {
|
|
15
|
+
xxl: Directions;
|
|
16
|
+
};
|
|
17
|
+
export type Alignments = Directions | Breakpoints;
|
|
18
|
+
export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIElement> {
|
|
19
|
+
/**
|
|
20
|
+
* Set aligment of dropdown menu.
|
|
21
|
+
*
|
|
22
|
+
* @type 'start' | 'end' | { xs: 'start' | 'end' } | { sm: 'start' | 'end' } | { md: 'start' | 'end' } | { lg: 'start' | 'end' } | { xl: 'start' | 'end'} | { xxl: 'start' | 'end'}
|
|
23
|
+
*/
|
|
24
|
+
alignment?: Alignments;
|
|
25
|
+
/**
|
|
26
|
+
* Configure the auto close behavior of the dropdown:
|
|
27
|
+
* - `true` - the dropdown will be closed by clicking outside or inside the dropdown menu.
|
|
28
|
+
* - `false` - the dropdown will be closed by clicking the toggle button and manually calling hide or toggle method. (Also will not be closed by pressing esc key)
|
|
29
|
+
* - `'inside'` - the dropdown will be closed (only) by clicking inside the dropdown menu.
|
|
30
|
+
* - `'outside'` - the dropdown will be closed (only) by clicking outside the dropdown menu.
|
|
31
|
+
*/
|
|
32
|
+
autoClose?: 'inside' | 'outside' | boolean;
|
|
33
|
+
/**
|
|
34
|
+
* A string of all className you want applied to the base component.
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
39
|
+
*/
|
|
40
|
+
component?: string | ElementType;
|
|
41
|
+
/**
|
|
42
|
+
* Sets a darker color scheme to match a dark navbar.
|
|
43
|
+
*/
|
|
44
|
+
dark?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Sets a specified direction and location of the dropdown menu.
|
|
47
|
+
*/
|
|
48
|
+
direction?: 'center' | 'dropup' | 'dropup-center' | 'dropend' | 'dropstart';
|
|
49
|
+
/**
|
|
50
|
+
* Callback fired when the component requests to be hidden.
|
|
51
|
+
*/
|
|
52
|
+
onHide?: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Callback fired when the component requests to be shown.
|
|
55
|
+
*/
|
|
56
|
+
onShow?: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Describes the placement of your component after Popper.js has applied all the modifiers that may have flipped or altered the originally provided placement property.
|
|
59
|
+
*
|
|
60
|
+
* @type 'auto' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end'
|
|
61
|
+
*/
|
|
62
|
+
placement?: Placements;
|
|
63
|
+
/**
|
|
64
|
+
* If you want to disable dynamic positioning set this property to `true`.
|
|
65
|
+
*/
|
|
66
|
+
popper?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Generates dropdown menu using createPortal.
|
|
69
|
+
*
|
|
70
|
+
* @since 4.8.0
|
|
71
|
+
*/
|
|
72
|
+
portal?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Set the dropdown variant to an btn-group, dropdown, input-group, and nav-item.
|
|
75
|
+
*/
|
|
76
|
+
variant?: 'btn-group' | 'dropdown' | 'input-group' | 'nav-item';
|
|
77
|
+
/**
|
|
78
|
+
* Toggle the visibility of dropdown menu component.
|
|
79
|
+
*/
|
|
80
|
+
visible?: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface ContextProps extends CDropdownProps {
|
|
83
|
+
dropdownToggleRef: RefObject<any> | undefined;
|
|
84
|
+
setVisible: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
85
|
+
portal: boolean;
|
|
86
|
+
}
|
|
87
|
+
export declare const CDropdownContext: React.Context<ContextProps>;
|
|
88
|
+
export declare const CDropdown: React.ForwardRefExoticComponent<CDropdownProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export interface CDropdownDividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
3
|
+
/**
|
|
4
|
+
* A string of all className you want applied to the component.
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CDropdownDivider: React.ForwardRefExoticComponent<CDropdownDividerProps & React.RefAttributes<HTMLHRElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
export interface CDropdownHeaderProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
3
|
+
/**
|
|
4
|
+
* A string of all className you want applied to the component.
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
9
|
+
*/
|
|
10
|
+
component?: string | ElementType;
|
|
11
|
+
}
|
|
12
|
+
export declare const CDropdownHeader: React.ForwardRefExoticComponent<CDropdownHeaderProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ElementType } from 'react';
|
|
2
|
+
import { CLinkProps } from '../link/CLink';
|
|
3
|
+
export interface CDropdownItemProps extends CLinkProps {
|
|
4
|
+
/**
|
|
5
|
+
* A string of all className you want applied to the component.
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
10
|
+
*/
|
|
11
|
+
component?: string | ElementType;
|
|
12
|
+
}
|
|
13
|
+
export declare const CDropdownItem: React.ForwardRefExoticComponent<CDropdownItemProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
export interface CDropdownItemPlainProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
/**
|
|
4
|
+
* A string of all className you want applied to the component.
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
9
|
+
*/
|
|
10
|
+
component?: string | ElementType;
|
|
11
|
+
}
|
|
12
|
+
export declare const CDropdownItemPlain: React.ForwardRefExoticComponent<CDropdownItemPlainProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementType, FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { PopperChildrenProps } from 'react-popper';
|
|
3
|
+
export interface CDropdownMenuProps extends HTMLAttributes<HTMLDivElement | HTMLUListElement>, Omit<PopperChildrenProps, 'arrowProps' | 'forceUpdate' | 'hasPopperEscaped' | 'isReferenceHidden' | 'placement' | 'ref' | 'style' | 'update'> {
|
|
4
|
+
/**
|
|
5
|
+
* A string of all className you want applied to the base component.
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
10
|
+
*/
|
|
11
|
+
component?: string | ElementType;
|
|
12
|
+
}
|
|
13
|
+
export declare const CDropdownMenu: FC<CDropdownMenuProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CButtonProps } from '../button/CButton';
|
|
3
|
+
import type { Triggers } from '../../types';
|
|
4
|
+
export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
|
|
5
|
+
/**
|
|
6
|
+
* Enables pseudo element caret on toggler.
|
|
7
|
+
*/
|
|
8
|
+
caret?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Create a custom toggler which accepts any content.
|
|
11
|
+
*/
|
|
12
|
+
custom?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Similarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of `.dropdown-toggle-split` className for proper spacing around the dropdown caret.
|
|
15
|
+
*/
|
|
16
|
+
split?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Sets which event handlers you’d like provided to your toggle prop. You can specify one trigger or an array of them.
|
|
19
|
+
*
|
|
20
|
+
* @type 'hover' | 'focus' | 'click'
|
|
21
|
+
*/
|
|
22
|
+
trigger?: Triggers | Triggers[];
|
|
23
|
+
}
|
|
24
|
+
export declare const CDropdownToggle: FC<CDropdownToggleProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CDropdown } from './CDropdown';
|
|
2
|
+
import { CDropdownDivider } from './CDropdownDivider';
|
|
3
|
+
import { CDropdownHeader } from './CDropdownHeader';
|
|
4
|
+
import { CDropdownItem } from './CDropdownItem';
|
|
5
|
+
import { CDropdownItemPlain } from './CDropdownItemPlain';
|
|
6
|
+
import { CDropdownMenu } from './CDropdownMenu';
|
|
7
|
+
import { CDropdownToggle } from './CDropdownToggle';
|
|
8
|
+
export { CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, };
|
|
@@ -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' | '
|
|
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
|
|
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/hooks/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -2475,6 +2475,54 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2475
2475
|
}) : {};
|
|
2476
2476
|
var CSSTransition$1 = CSSTransition;
|
|
2477
2477
|
|
|
2478
|
+
var getStoredTheme = function (localStorageItemName) {
|
|
2479
|
+
return typeof window !== 'undefined' && localStorage.getItem(localStorageItemName);
|
|
2480
|
+
};
|
|
2481
|
+
var setStoredTheme = function (localStorageItemName, colorMode) {
|
|
2482
|
+
return localStorage.setItem(localStorageItemName, colorMode);
|
|
2483
|
+
};
|
|
2484
|
+
var getPreferredColorScheme = function (localStorageItemName) {
|
|
2485
|
+
if (typeof window === 'undefined') {
|
|
2486
|
+
return 'light';
|
|
2487
|
+
}
|
|
2488
|
+
var storedTheme = getStoredTheme(localStorageItemName);
|
|
2489
|
+
if (storedTheme) {
|
|
2490
|
+
return storedTheme;
|
|
2491
|
+
}
|
|
2492
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
2493
|
+
};
|
|
2494
|
+
var setTheme = function (colorMode) {
|
|
2495
|
+
document.documentElement.dataset.coreuiTheme =
|
|
2496
|
+
colorMode === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
2497
|
+
? 'dark'
|
|
2498
|
+
: colorMode;
|
|
2499
|
+
var event = new Event('ColorSchemeChange');
|
|
2500
|
+
document.documentElement.dispatchEvent(event);
|
|
2501
|
+
};
|
|
2502
|
+
var useColorModes = function (localStorageItemName) {
|
|
2503
|
+
if (localStorageItemName === void 0) { localStorageItemName = 'coreui-react-color-scheme'; }
|
|
2504
|
+
var _a = useState(getPreferredColorScheme(localStorageItemName)), colorMode = _a[0], setColorMode = _a[1];
|
|
2505
|
+
useEffect(function () {
|
|
2506
|
+
if (colorMode) {
|
|
2507
|
+
setStoredTheme(localStorageItemName, colorMode);
|
|
2508
|
+
setTheme(colorMode);
|
|
2509
|
+
}
|
|
2510
|
+
}, [colorMode]);
|
|
2511
|
+
useEffect(function () {
|
|
2512
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function () {
|
|
2513
|
+
var storedTheme = getStoredTheme(localStorageItemName);
|
|
2514
|
+
if (storedTheme !== 'light' && storedTheme !== 'dark' && colorMode) {
|
|
2515
|
+
setTheme(colorMode);
|
|
2516
|
+
}
|
|
2517
|
+
});
|
|
2518
|
+
});
|
|
2519
|
+
return {
|
|
2520
|
+
colorMode: colorMode,
|
|
2521
|
+
isColorModeSet: function () { return Boolean(getStoredTheme(localStorageItemName)); },
|
|
2522
|
+
setColorMode: setColorMode,
|
|
2523
|
+
};
|
|
2524
|
+
};
|
|
2525
|
+
|
|
2478
2526
|
// code borrowed from https://github.com/reach/reach-ui
|
|
2479
2527
|
// problem described https://github.com/facebook/react/issues/13029
|
|
2480
2528
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -4515,13 +4563,14 @@ CAccordionHeader.propTypes = {
|
|
|
4515
4563
|
CAccordionHeader.displayName = 'CAccordionHeader';
|
|
4516
4564
|
|
|
4517
4565
|
var CCloseButton = forwardRef(function (_a, ref) {
|
|
4518
|
-
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"]);
|
|
4519
4567
|
return (React.createElement("button", __assign({ type: "button", className: classNames('btn', 'btn-close', {
|
|
4520
4568
|
'btn-close-white': white,
|
|
4521
|
-
}, 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 })));
|
|
4522
4570
|
});
|
|
4523
4571
|
CCloseButton.propTypes = {
|
|
4524
4572
|
className: PropTypes.string,
|
|
4573
|
+
dark: PropTypes.bool,
|
|
4525
4574
|
disabled: PropTypes.bool,
|
|
4526
4575
|
white: PropTypes.bool,
|
|
4527
4576
|
};
|
|
@@ -5025,17 +5074,18 @@ var CCarousel = forwardRef(function (_a, ref) {
|
|
|
5025
5074
|
setTouchPosition(touchDown);
|
|
5026
5075
|
};
|
|
5027
5076
|
return (React.createElement("div", __assign({ className: classNames('carousel slide', {
|
|
5028
|
-
'carousel-dark': dark,
|
|
5029
5077
|
'carousel-fade': transition === 'crossfade',
|
|
5030
|
-
}, 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 }),
|
|
5031
5079
|
React.createElement(CCarouselContext.Provider, { value: {
|
|
5032
5080
|
setAnimating: setAnimating,
|
|
5033
5081
|
setCustomInterval: setCustomInterval,
|
|
5034
5082
|
} },
|
|
5035
|
-
indicators && (React.createElement("
|
|
5036
|
-
return (React.createElement("
|
|
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 () {
|
|
5037
5085
|
!animating && handleIndicatorClick(index);
|
|
5038
|
-
}, className:
|
|
5086
|
+
}, className: classNames({
|
|
5087
|
+
active: active === index
|
|
5088
|
+
}), "data-coreui-target": "" }, (active === index && { 'aria-current': true }), { "aria-label": "Slide ".concat(index + 1) })));
|
|
5039
5089
|
}))),
|
|
5040
5090
|
React.createElement("div", { className: "carousel-inner" }, Children.map(children, function (child, index) {
|
|
5041
5091
|
if (React.isValidElement(child)) {
|
|
@@ -5363,9 +5413,8 @@ var CDropdownMenu = forwardRef(function (_a, ref) {
|
|
|
5363
5413
|
var forkedRef = useForkedRef(ref, dropdownMenuRef);
|
|
5364
5414
|
return (React.createElement(CConditionalPortal, { portal: portal !== null && portal !== void 0 ? portal : false },
|
|
5365
5415
|
React.createElement(Component, __assign({ className: classNames('dropdown-menu', {
|
|
5366
|
-
'dropdown-menu-dark': dark,
|
|
5367
5416
|
show: visible,
|
|
5368
|
-
}, 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'
|
|
5369
5418
|
? React.Children.map(children, function (child, index) {
|
|
5370
5419
|
if (React.isValidElement(child)) {
|
|
5371
5420
|
return React.createElement("li", { key: index }, React.cloneElement(child));
|
|
@@ -6202,7 +6251,7 @@ CNav.propTypes = {
|
|
|
6202
6251
|
className: PropTypes.string,
|
|
6203
6252
|
component: PropTypes.elementType,
|
|
6204
6253
|
layout: PropTypes.oneOf(['fill', 'justified']),
|
|
6205
|
-
variant: PropTypes.oneOf(['tabs', '
|
|
6254
|
+
variant: PropTypes.oneOf(['pills', 'tabs', 'underline']),
|
|
6206
6255
|
};
|
|
6207
6256
|
CNav.displayName = 'CNav';
|
|
6208
6257
|
|
|
@@ -6356,9 +6405,8 @@ var CNavbar = forwardRef(function (_a, ref) {
|
|
|
6356
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"]);
|
|
6357
6406
|
return (React.createElement(Component, __assign({ className: classNames('navbar', (_b = {},
|
|
6358
6407
|
_b["bg-".concat(color)] = color,
|
|
6359
|
-
_b["navbar-".concat(colorScheme)] = colorScheme,
|
|
6360
6408
|
_b[typeof expand === 'boolean' ? 'navbar-expand' : "navbar-expand-".concat(expand)] = expand,
|
|
6361
|
-
_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))));
|
|
6362
6410
|
});
|
|
6363
6411
|
CNavbar.propTypes = {
|
|
6364
6412
|
children: PropTypes.node,
|
|
@@ -6429,7 +6477,7 @@ CNavbarToggler.propTypes = {
|
|
|
6429
6477
|
CNavbarToggler.displayName = 'CNavbarToggler';
|
|
6430
6478
|
|
|
6431
6479
|
var COffcanvas = forwardRef(function (_a, ref) {
|
|
6432
|
-
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"]);
|
|
6433
6481
|
var _h = useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
6434
6482
|
var offcanvasRef = useRef(null);
|
|
6435
6483
|
var forkedRef = useForkedRef(ref, offcanvasRef);
|
|
@@ -6470,7 +6518,7 @@ var COffcanvas = forwardRef(function (_a, ref) {
|
|
|
6470
6518
|
_a.showing = state === 'entering',
|
|
6471
6519
|
_a.show = state === 'entered',
|
|
6472
6520
|
_a['show hiding'] = state === 'exiting',
|
|
6473
|
-
_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)));
|
|
6474
6522
|
}),
|
|
6475
6523
|
backdrop && (React.createElement(CConditionalPortal, { portal: portal },
|
|
6476
6524
|
React.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleBackdropDismiss, visible: _visible })))));
|
|
@@ -6479,6 +6527,7 @@ COffcanvas.propTypes = {
|
|
|
6479
6527
|
backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['static'])]),
|
|
6480
6528
|
children: PropTypes.node,
|
|
6481
6529
|
className: PropTypes.string,
|
|
6530
|
+
dark: PropTypes.bool,
|
|
6482
6531
|
keyboard: PropTypes.bool,
|
|
6483
6532
|
onHide: PropTypes.func,
|
|
6484
6533
|
onShow: PropTypes.func,
|
|
@@ -7490,5 +7539,5 @@ CWidgetStatsF.propTypes = {
|
|
|
7490
7539
|
};
|
|
7491
7540
|
CWidgetStatsF.displayName = 'CWidgetStatsF';
|
|
7492
7541
|
|
|
7493
|
-
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, CAlert, CAlertHeading, CAlertLink, CAvatar, CBackdrop, CBadge, CBreadcrumb, CBreadcrumbItem, CButton, CButtonGroup, CButtonToolbar, CCallout, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCloseButton, CCol, CCollapse, CConditionalPortal, CContainer, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, CFooter, CForm, CFormCheck, CFormControlValidation, CFormControlWrapper, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler, CImage, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle, CPagination, CPaginationItem, CPlaceholder, CPopover, CProgress, CProgressBar, CProgressStacked, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarToggler, CSpinner, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTableRow, CToast, CToastBody, CToastClose, CToastHeader, CToaster, CTooltip, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, useForkedRef, usePopper };
|
|
7542
|
+
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem, CAlert, CAlertHeading, CAlertLink, CAvatar, CBackdrop, CBadge, CBreadcrumb, CBreadcrumbItem, CButton, CButtonGroup, CButtonToolbar, CCallout, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCloseButton, CCol, CCollapse, CConditionalPortal, CContainer, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, CFooter, CForm, CFormCheck, CFormControlValidation, CFormControlWrapper, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler, CImage, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle, CPagination, CPaginationItem, CPlaceholder, CPopover, CProgress, CProgressBar, CProgressStacked, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarToggler, CSpinner, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTableRow, CToast, CToastBody, CToastClose, CToastHeader, CToaster, CTooltip, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF, useColorModes, useForkedRef, usePopper };
|
|
7494
7543
|
//# sourceMappingURL=index.es.js.map
|