@coreui/react 5.0.0-alpha.0 → 5.0.0-alpha.2
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/avatar/CAvatar.d.ts +1 -1
- package/dist/components/badge/CBadge.d.ts +1 -1
- package/dist/components/card/CCard.d.ts +1 -1
- package/dist/components/close-button/CCloseButton.d.ts +6 -0
- package/dist/components/dropdown/CDropdown.d.ts +1 -0
- package/dist/components/modal/CModal.d.ts +6 -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/index.es.js +177 -81
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +177 -81
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/executeAfterTransition.d.ts +2 -0
- package/dist/utils/getTransitionDurationFromElement.d.ts +2 -0
- package/dist/utils/index.d.ts +3 -1
- package/package.json +2 -2
- package/src/components/avatar/CAvatar.tsx +1 -1
- package/src/components/badge/CBadge.tsx +1 -1
- package/src/components/button/CButton.tsx +1 -1
- package/src/components/button/__tests__/__snapshots__/CButton.spec.tsx.snap +0 -1
- package/src/components/card/CCard.tsx +1 -1
- package/src/components/carousel/CCarousel.tsx +9 -5
- package/src/components/carousel/__tests__/__snapshots__/CCarousel.spec.tsx.snap +9 -5
- package/src/components/close-button/CCloseButton.tsx +9 -1
- package/src/components/dropdown/CDropdown.tsx +43 -1
- package/src/components/dropdown/CDropdownMenu.tsx +1 -1
- package/src/components/dropdown/CDropdownToggle.tsx +3 -12
- package/src/components/modal/CModal.tsx +25 -9
- package/src/components/nav/CNav.tsx +2 -2
- package/src/components/nav/CNavGroup.tsx +9 -2
- package/src/components/nav/__tests__/__snapshots__/CNav.spec.tsx.snap +5 -4
- package/src/components/navbar/CNavbar.tsx +2 -2
- package/src/components/navbar/__tests__/CNavbar.spec.tsx +1 -1
- package/src/components/navbar/__tests__/__snapshots__/CNavbar.spec.tsx.snap +2 -1
- package/src/components/offcanvas/COffcanvas.tsx +8 -1
- package/src/components/popover/CPopover.tsx +2 -2
- package/src/components/progress/__tests__/__snapshots__/CProgress.spec.tsx.snap +10 -5
- package/src/components/progress/__tests__/__snapshots__/CProgressBar.spec.tsx.snap +0 -8
- package/src/components/sidebar/CSidebar.tsx +1 -1
- package/src/components/tooltip/CTooltip.tsx +2 -2
- package/src/components/widgets/CWidgetStatsA.tsx +1 -1
- package/src/components/widgets/CWidgetStatsB.tsx +2 -2
- package/src/components/widgets/CWidgetStatsC.tsx +4 -12
- package/src/components/widgets/CWidgetStatsD.tsx +1 -1
- package/src/components/widgets/CWidgetStatsE.tsx +1 -1
- package/src/components/widgets/CWidgetStatsF.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsB.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsC.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsE.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsF.spec.tsx +1 -1
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsA.spec.tsx.snap +1 -1
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsB.spec.tsx.snap +12 -7
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsC.spec.tsx.snap +14 -9
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsD.spec.tsx.snap +2 -2
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsE.spec.tsx.snap +1 -1
- package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsF.spec.tsx.snap +2 -2
- package/src/hooks/usePopper.ts +10 -2
- package/src/types.ts +14 -7
- package/src/utils/executeAfterTransition.ts +46 -0
- package/src/utils/getTransitionDurationFromElement.ts +24 -0
- package/src/utils/index.ts +9 -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/v5.0.0-alpha.
|
|
49
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-alpha.2.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`
|
|
@@ -34,7 +34,7 @@ export interface CAvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
34
34
|
/**
|
|
35
35
|
* Sets the text color of the component to one of CoreUI’s themed colors.
|
|
36
36
|
*
|
|
37
|
-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | '
|
|
37
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
38
38
|
*/
|
|
39
39
|
textColor?: TextColors;
|
|
40
40
|
}
|
|
@@ -32,7 +32,7 @@ export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanEle
|
|
|
32
32
|
/**
|
|
33
33
|
* Sets the text color of the component to one of CoreUI’s themed colors.
|
|
34
34
|
*
|
|
35
|
-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | '
|
|
35
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
36
36
|
*/
|
|
37
37
|
textColor?: TextColors;
|
|
38
38
|
}
|
|
@@ -14,7 +14,7 @@ export interface CCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
14
14
|
/**
|
|
15
15
|
* Sets the text color context of the component to one of CoreUI’s themed colors.
|
|
16
16
|
*
|
|
17
|
-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | '
|
|
17
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
18
18
|
*/
|
|
19
19
|
textColor?: string;
|
|
20
20
|
}
|
|
@@ -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
|
}
|
|
@@ -91,6 +91,7 @@ interface ContextProps extends CDropdownProps {
|
|
|
91
91
|
setVisible: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
92
92
|
portal: boolean;
|
|
93
93
|
}
|
|
94
|
+
export declare const getNextActiveElement: (list: HTMLElement[], activeElement: HTMLElement, shouldGetNext: boolean, isCycleAllowed: boolean) => HTMLElement;
|
|
94
95
|
export declare const CDropdownContext: React.Context<ContextProps>;
|
|
95
96
|
export declare const CDropdown: React.ForwardRefExoticComponent<CDropdownProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
96
97
|
export {};
|
|
@@ -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' | '
|
|
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
|
*/
|