@coreui/react-pro 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 (92) 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/calendar/CCalendar.d.ts +25 -7
  5. package/dist/components/calendar/utils.d.ts +12 -3
  6. package/dist/components/card/CCard.d.ts +1 -1
  7. package/dist/components/close-button/CCloseButton.d.ts +6 -0
  8. package/dist/components/dropdown/CDropdown.d.ts +1 -0
  9. package/dist/components/modal/CModal.d.ts +6 -0
  10. package/dist/components/multi-select/types.d.ts +2 -2
  11. package/dist/components/multi-select/utils.d.ts +2 -2
  12. package/dist/components/nav/CNav.d.ts +1 -1
  13. package/dist/components/navbar/CNavbar.d.ts +1 -1
  14. package/dist/components/offcanvas/COffcanvas.d.ts +4 -0
  15. package/dist/components/smart-table/CSmartTableBody.d.ts +2 -1
  16. package/dist/components/smart-table/CSmartTableHead.d.ts +1 -1
  17. package/dist/components/smart-table/CSmartTableInterface.d.ts +1 -3
  18. package/dist/components/smart-table/types.d.ts +2 -2
  19. package/dist/components/smart-table/utils.d.ts +3 -1
  20. package/dist/index.es.js +1468 -1130
  21. package/dist/index.es.js.map +1 -1
  22. package/dist/index.js +1468 -1130
  23. package/dist/index.js.map +1 -1
  24. package/dist/types.d.ts +1 -1
  25. package/dist/utils/executeAfterTransition.d.ts +2 -0
  26. package/dist/utils/getTransitionDurationFromElement.d.ts +2 -0
  27. package/dist/utils/index.d.ts +3 -1
  28. package/package.json +2 -2
  29. package/src/components/avatar/CAvatar.tsx +1 -1
  30. package/src/components/badge/CBadge.tsx +1 -1
  31. package/src/components/button/CButton.tsx +1 -1
  32. package/src/components/button/__tests__/__snapshots__/CButton.spec.tsx.snap +0 -1
  33. package/src/components/calendar/CCalendar.tsx +396 -193
  34. package/src/components/calendar/utils.ts +91 -4
  35. package/src/components/card/CCard.tsx +1 -1
  36. package/src/components/carousel/CCarousel.tsx +9 -5
  37. package/src/components/carousel/__tests__/__snapshots__/CCarousel.spec.tsx.snap +9 -5
  38. package/src/components/close-button/CCloseButton.tsx +9 -1
  39. package/src/components/date-range-picker/CDateRangePicker.tsx +49 -45
  40. package/src/components/dropdown/CDropdown.tsx +43 -1
  41. package/src/components/dropdown/CDropdownMenu.tsx +1 -1
  42. package/src/components/dropdown/CDropdownToggle.tsx +3 -12
  43. package/src/components/modal/CModal.tsx +25 -9
  44. package/src/components/multi-select/CMultiSelect.tsx +3 -3
  45. package/src/components/multi-select/CMultiSelectNativeSelect.tsx +1 -1
  46. package/src/components/multi-select/CMultiSelectOptions.tsx +1 -1
  47. package/src/components/multi-select/CMultiSelectSelection.tsx +3 -3
  48. package/src/components/multi-select/types.ts +2 -2
  49. package/src/components/multi-select/utils.ts +5 -5
  50. package/src/components/nav/CNav.tsx +2 -2
  51. package/src/components/nav/CNavGroup.tsx +9 -2
  52. package/src/components/nav/__tests__/__snapshots__/CNav.spec.tsx.snap +5 -4
  53. package/src/components/navbar/CNavbar.tsx +2 -2
  54. package/src/components/navbar/__tests__/CNavbar.spec.tsx +1 -1
  55. package/src/components/navbar/__tests__/__snapshots__/CNavbar.spec.tsx.snap +2 -1
  56. package/src/components/offcanvas/COffcanvas.tsx +8 -1
  57. package/src/components/popover/CPopover.tsx +2 -2
  58. package/src/components/progress/__tests__/__snapshots__/CProgress.spec.tsx.snap +10 -5
  59. package/src/components/progress/__tests__/__snapshots__/CProgressBar.spec.tsx.snap +0 -8
  60. package/src/components/sidebar/CSidebar.tsx +1 -1
  61. package/src/components/smart-table/CSmartTable.tsx +13 -6
  62. package/src/components/smart-table/CSmartTableBody.tsx +11 -5
  63. package/src/components/smart-table/CSmartTableHead.tsx +31 -11
  64. package/src/components/smart-table/CSmartTableInterface.tsx +1 -3
  65. package/src/components/smart-table/types.ts +2 -2
  66. package/src/components/smart-table/utils.ts +40 -5
  67. package/src/components/time-picker/CTimePicker.tsx +2 -2
  68. package/src/components/time-picker/utils.ts +5 -1
  69. package/src/components/tooltip/CTooltip.tsx +2 -2
  70. package/src/components/widgets/CWidgetStatsA.tsx +1 -1
  71. package/src/components/widgets/CWidgetStatsB.tsx +2 -2
  72. package/src/components/widgets/CWidgetStatsC.tsx +4 -12
  73. package/src/components/widgets/CWidgetStatsD.tsx +1 -1
  74. package/src/components/widgets/CWidgetStatsE.tsx +1 -1
  75. package/src/components/widgets/CWidgetStatsF.tsx +1 -1
  76. package/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx +1 -1
  77. package/src/components/widgets/__tests__/CWidgetStatsB.spec.tsx +1 -1
  78. package/src/components/widgets/__tests__/CWidgetStatsC.spec.tsx +1 -1
  79. package/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx +1 -1
  80. package/src/components/widgets/__tests__/CWidgetStatsE.spec.tsx +1 -1
  81. package/src/components/widgets/__tests__/CWidgetStatsF.spec.tsx +1 -1
  82. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsA.spec.tsx.snap +1 -1
  83. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsB.spec.tsx.snap +12 -7
  84. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsC.spec.tsx.snap +14 -9
  85. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsD.spec.tsx.snap +2 -2
  86. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsE.spec.tsx.snap +1 -1
  87. package/src/components/widgets/__tests__/__snapshots__/CWidgetStatsF.spec.tsx.snap +2 -2
  88. package/src/hooks/usePopper.ts +10 -2
  89. package/src/types.ts +14 -7
  90. package/src/utils/executeAfterTransition.ts +46 -0
  91. package/src/utils/getTransitionDurationFromElement.ts +24 -0
  92. package/src/utils/index.ts +10 -1
package/dist/types.d.ts CHANGED
@@ -3,5 +3,5 @@ export type Colors = 'primary' | 'secondary' | 'success' | 'danger' | 'warning'
3
3
  export type Gradients = 'primary-gradient' | 'secondary-gradient' | 'success-gradient' | 'danger-gradient' | 'warning-gradient' | 'info-gradient' | 'dark-gradient' | 'light-gradient';
4
4
  export type Placements = 'auto' | 'auto-start' | 'auto-end' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end' | undefined;
5
5
  export type Shapes = 'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string;
6
- export type TextColors = Colors | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string;
6
+ export type TextColors = Colors | '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;
7
7
  export type Triggers = 'hover' | 'focus' | 'click';
@@ -0,0 +1,2 @@
1
+ declare const executeAfterTransition: (callback: () => void, transitionElement: HTMLElement, waitForTransition?: boolean) => void;
2
+ export default executeAfterTransition;
@@ -0,0 +1,2 @@
1
+ declare const getTransitionDurationFromElement: (element: HTMLElement) => number;
2
+ export default getTransitionDurationFromElement;
@@ -1,5 +1,7 @@
1
+ import executeAfterTransition from './executeAfterTransition';
1
2
  import getRTLPlacement from './getRTLPlacement';
3
+ import getTransitionDurationFromElement from './getTransitionDurationFromElement';
2
4
  import isInViewport from './isInViewport';
3
5
  import isObjectInArray from './isObjectInArray';
4
6
  import isRTL from './isRTL';
5
- export { getRTLPlacement, isInViewport, isObjectInArray, isRTL };
7
+ export { executeAfterTransition, getRTLPlacement, getTransitionDurationFromElement, isInViewport, isObjectInArray, isRTL, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreui/react-pro",
3
- "version": "5.0.0-alpha.0",
3
+ "version": "5.0.0-alpha.2",
4
4
  "description": "UI Components Library for React.js",
5
5
  "keywords": [
6
6
  "react",
@@ -64,7 +64,7 @@
64
64
  "typescript": "^5.1.6"
65
65
  },
66
66
  "peerDependencies": {
67
- "@coreui/coreui-pro": ">=5.0.0-alpha.0",
67
+ "@coreui/coreui-pro": ">=5.0.0-alpha.2",
68
68
  "react": ">=17",
69
69
  "react-dom": ">=17"
70
70
  }
@@ -39,7 +39,7 @@ export interface CAvatarProps extends HTMLAttributes<HTMLDivElement> {
39
39
  /**
40
40
  * Sets the text color of the component to one of CoreUI’s themed colors.
41
41
  *
42
- * @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
42
+ * @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
43
43
  */
44
44
  textColor?: TextColors
45
45
  }
@@ -37,7 +37,7 @@ export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanEle
37
37
  /**
38
38
  * Sets the text color of the component to one of CoreUI’s themed colors.
39
39
  *
40
- * @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
40
+ * @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
41
41
  */
42
42
  textColor?: TextColors
43
43
  }
@@ -77,7 +77,7 @@ export const CButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, CButton
77
77
  return (
78
78
  <CLink
79
79
  component={rest.href ? 'a' : component}
80
- type={type}
80
+ {...(!rest.href && { type: type })}
81
81
  className={classNames(
82
82
  'btn',
83
83
  variant ? `btn-${variant}-${color}` : `btn-${color}`,
@@ -19,7 +19,6 @@ exports[`CButton customize witch href 1`] = `
19
19
  <a
20
20
  class="btn btn-primary"
21
21
  href="/bazinga"
22
- type="button"
23
22
  >
24
23
  Test
25
24
  </a>