@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.
Files changed (66) hide show
  1. package/README.md +1 -1
  2. package/dist/components/avatar/CAvatar.d.ts +1 -1
  3. package/dist/components/badge/CBadge.d.ts +1 -1
  4. package/dist/components/card/CCard.d.ts +1 -1
  5. package/dist/components/close-button/CCloseButton.d.ts +6 -0
  6. package/dist/components/dropdown/CDropdown.d.ts +1 -0
  7. package/dist/components/modal/CModal.d.ts +6 -0
  8. package/dist/components/nav/CNav.d.ts +1 -1
  9. package/dist/components/navbar/CNavbar.d.ts +1 -1
  10. package/dist/components/offcanvas/COffcanvas.d.ts +4 -0
  11. package/dist/index.es.js +177 -81
  12. package/dist/index.es.js.map +1 -1
  13. package/dist/index.js +177 -81
  14. package/dist/index.js.map +1 -1
  15. package/dist/types.d.ts +1 -1
  16. package/dist/utils/executeAfterTransition.d.ts +2 -0
  17. package/dist/utils/getTransitionDurationFromElement.d.ts +2 -0
  18. package/dist/utils/index.d.ts +3 -1
  19. package/package.json +2 -2
  20. package/src/components/avatar/CAvatar.tsx +1 -1
  21. package/src/components/badge/CBadge.tsx +1 -1
  22. package/src/components/button/CButton.tsx +1 -1
  23. package/src/components/button/__tests__/__snapshots__/CButton.spec.tsx.snap +0 -1
  24. package/src/components/card/CCard.tsx +1 -1
  25. package/src/components/carousel/CCarousel.tsx +9 -5
  26. package/src/components/carousel/__tests__/__snapshots__/CCarousel.spec.tsx.snap +9 -5
  27. package/src/components/close-button/CCloseButton.tsx +9 -1
  28. package/src/components/dropdown/CDropdown.tsx +43 -1
  29. package/src/components/dropdown/CDropdownMenu.tsx +1 -1
  30. package/src/components/dropdown/CDropdownToggle.tsx +3 -12
  31. package/src/components/modal/CModal.tsx +25 -9
  32. package/src/components/nav/CNav.tsx +2 -2
  33. package/src/components/nav/CNavGroup.tsx +9 -2
  34. package/src/components/nav/__tests__/__snapshots__/CNav.spec.tsx.snap +5 -4
  35. package/src/components/navbar/CNavbar.tsx +2 -2
  36. package/src/components/navbar/__tests__/CNavbar.spec.tsx +1 -1
  37. package/src/components/navbar/__tests__/__snapshots__/CNavbar.spec.tsx.snap +2 -1
  38. package/src/components/offcanvas/COffcanvas.tsx +8 -1
  39. package/src/components/popover/CPopover.tsx +2 -2
  40. package/src/components/progress/__tests__/__snapshots__/CProgress.spec.tsx.snap +10 -5
  41. package/src/components/progress/__tests__/__snapshots__/CProgressBar.spec.tsx.snap +0 -8
  42. package/src/components/sidebar/CSidebar.tsx +1 -1
  43. package/src/components/tooltip/CTooltip.tsx +2 -2
  44. package/src/components/widgets/CWidgetStatsA.tsx +1 -1
  45. package/src/components/widgets/CWidgetStatsB.tsx +2 -2
  46. package/src/components/widgets/CWidgetStatsC.tsx +4 -12
  47. package/src/components/widgets/CWidgetStatsD.tsx +1 -1
  48. package/src/components/widgets/CWidgetStatsE.tsx +1 -1
  49. package/src/components/widgets/CWidgetStatsF.tsx +1 -1
  50. package/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx +1 -1
  51. package/src/components/widgets/__tests__/CWidgetStatsB.spec.tsx +1 -1
  52. package/src/components/widgets/__tests__/CWidgetStatsC.spec.tsx +1 -1
  53. package/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx +1 -1
  54. package/src/components/widgets/__tests__/CWidgetStatsE.spec.tsx +1 -1
  55. package/src/components/widgets/__tests__/CWidgetStatsF.spec.tsx +1 -1
  56. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsA.spec.tsx.snap +1 -1
  57. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsB.spec.tsx.snap +12 -7
  58. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsC.spec.tsx.snap +14 -9
  59. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsD.spec.tsx.snap +2 -2
  60. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsE.spec.tsx.snap +1 -1
  61. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsF.spec.tsx.snap +2 -2
  62. package/src/hooks/usePopper.ts +10 -2
  63. package/src/types.ts +14 -7
  64. package/src/utils/executeAfterTransition.ts +46 -0
  65. package/src/utils/getTransitionDurationFromElement.ts +24 -0
  66. 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.0.zip)
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' | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string
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' | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string
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' | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string
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' | '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
  */