@coreui/react-pro 4.9.0-next.0 → 4.9.0

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 (239) hide show
  1. package/README.md +1 -1
  2. package/dist/components/alert/CAlert.d.ts +1 -1
  3. package/dist/components/avatar/CAvatar.d.ts +1 -1
  4. package/dist/components/badge/CBadge.d.ts +1 -1
  5. package/dist/components/button/CButton.d.ts +1 -1
  6. package/dist/components/calendar/utils.d.ts +0 -1
  7. package/dist/components/callout/CCallout.d.ts +1 -1
  8. package/dist/components/card/CCard.d.ts +1 -1
  9. package/dist/components/conditional-portal/CConditionalPortal.d.ts +12 -0
  10. package/dist/components/conditional-portal/index.d.ts +2 -0
  11. package/dist/components/date-range-picker/CDateRangePicker.d.ts +1 -1
  12. package/dist/components/date-range-picker/utils.d.ts +1 -0
  13. package/dist/components/dropdown/CDropdown.d.ts +1 -1
  14. package/dist/components/dropdown/CDropdownToggle.d.ts +1 -1
  15. package/dist/components/form/CFormCheck.d.ts +8 -2
  16. package/dist/components/form/CFormSwitch.d.ts +6 -0
  17. package/dist/components/index.d.ts +1 -0
  18. package/dist/components/list-group/CListGroupItem.d.ts +4 -5
  19. package/dist/components/multi-select/CMultiSelect.d.ts +1 -13
  20. package/dist/components/multi-select/CMultiSelectNativeSelect.d.ts +1 -1
  21. package/dist/components/multi-select/CMultiSelectOptions.d.ts +1 -1
  22. package/dist/components/multi-select/CMultiSelectSelection.d.ts +1 -1
  23. package/dist/components/multi-select/types.d.ts +14 -0
  24. package/dist/components/multi-select/utils.d.ts +6 -0
  25. package/dist/components/navbar/CNavbar.d.ts +1 -1
  26. package/dist/components/picker/CPicker.d.ts +1 -1
  27. package/dist/components/placeholder/CPlaceholder.d.ts +1 -1
  28. package/dist/components/popover/CPopover.d.ts +1 -1
  29. package/dist/components/progress/CProgressBar.d.ts +1 -1
  30. package/dist/components/smart-table/CSmartTableHead.d.ts +1 -1
  31. package/dist/components/smart-table/CSmartTableInterface.d.ts +8 -0
  32. package/dist/components/smart-table/types.d.ts +1 -1
  33. package/dist/components/spinner/CSpinner.d.ts +1 -1
  34. package/dist/components/table/CTable.d.ts +2 -18
  35. package/dist/components/table/CTableBody.d.ts +1 -1
  36. package/dist/components/table/CTableDataCell.d.ts +1 -1
  37. package/dist/components/table/CTableFoot.d.ts +1 -1
  38. package/dist/components/table/CTableHead.d.ts +1 -1
  39. package/dist/components/table/CTableHeaderCell.d.ts +1 -1
  40. package/dist/components/table/CTableResponsiveWrapper.d.ts +0 -1
  41. package/dist/components/table/CTableRow.d.ts +1 -1
  42. package/dist/components/table/types.d.ts +17 -0
  43. package/dist/components/table/utils.d.ts +5 -0
  44. package/dist/components/toast/CToast.d.ts +1 -1
  45. package/dist/components/toast/CToastClose.d.ts +1 -1
  46. package/dist/components/tooltip/CTooltip.d.ts +1 -1
  47. package/dist/components/virtual-scroller/CVirtualScroller.d.ts +0 -8
  48. package/dist/components/widgets/CWidgetStatsA.d.ts +1 -1
  49. package/dist/components/widgets/CWidgetStatsB.d.ts +1 -1
  50. package/dist/components/widgets/CWidgetStatsC.d.ts +1 -1
  51. package/dist/components/widgets/CWidgetStatsD.d.ts +1 -1
  52. package/dist/components/widgets/CWidgetStatsF.d.ts +1 -1
  53. package/dist/index.es.js +696 -927
  54. package/dist/index.es.js.map +1 -1
  55. package/dist/index.js +695 -925
  56. package/dist/index.js.map +1 -1
  57. package/dist/props.d.ts +8 -0
  58. package/dist/types.d.ts +7 -0
  59. package/dist/utils/index.d.ts +1 -3
  60. package/package.json +11 -6
  61. package/src/components/accordion/CAccordion.tsx +7 -3
  62. package/src/components/accordion/CAccordionBody.tsx +2 -2
  63. package/src/components/accordion/CAccordionButton.tsx +1 -3
  64. package/src/components/accordion/CAccordionCollapse.tsx +1 -0
  65. package/src/components/accordion/CAccordionHeader.tsx +1 -3
  66. package/src/components/accordion/CAccordionItem.tsx +2 -4
  67. package/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.tsx.snap +2 -2
  68. package/src/components/alert/CAlert.tsx +21 -28
  69. package/src/components/alert/CAlertHeading.tsx +1 -3
  70. package/src/components/alert/CAlertLink.tsx +1 -3
  71. package/src/components/alert/__tests__/__snapshots__/CAlert.spec.tsx.snap +1 -1
  72. package/src/components/avatar/CAvatar.tsx +16 -19
  73. package/src/components/backdrop/CBackdrop.tsx +10 -13
  74. package/src/components/badge/CBadge.tsx +21 -27
  75. package/src/components/breadcrumb/CBreadcrumb.tsx +1 -2
  76. package/src/components/breadcrumb/CBreadcrumbItem.tsx +12 -8
  77. package/src/components/button/CButton.tsx +10 -10
  78. package/src/components/button-group/CButtonGroup.tsx +9 -7
  79. package/src/components/button-group/CButtonToolbar.tsx +1 -3
  80. package/src/components/calendar/utils.ts +7 -55
  81. package/src/components/callout/CCallout.tsx +13 -10
  82. package/src/components/card/CCard.tsx +14 -11
  83. package/src/components/card/CCardBody.tsx +1 -3
  84. package/src/components/card/CCardFooter.tsx +1 -3
  85. package/src/components/card/CCardGroup.tsx +1 -3
  86. package/src/components/card/CCardHeader.tsx +1 -3
  87. package/src/components/card/CCardImage.tsx +5 -3
  88. package/src/components/card/CCardImageOverlay.tsx +1 -3
  89. package/src/components/card/CCardLink.tsx +1 -3
  90. package/src/components/card/CCardSubtitle.tsx +1 -3
  91. package/src/components/card/CCardText.tsx +1 -3
  92. package/src/components/card/CCardTitle.tsx +1 -3
  93. package/src/components/carousel/CCarousel.tsx +8 -8
  94. package/src/components/carousel/CCarouselCaption.tsx +1 -3
  95. package/src/components/carousel/CCarouselItem.tsx +11 -9
  96. package/src/components/close-button/CCloseButton.tsx +9 -10
  97. package/src/components/collapse/CCollapse.tsx +8 -20
  98. package/src/components/collapse/__tests__/CCollapse.spec.tsx +2 -3
  99. package/src/components/conditional-portal/CConditionalPortal.tsx +29 -0
  100. package/src/components/conditional-portal/index.ts +3 -0
  101. package/src/components/date-range-picker/CDateRangePicker.tsx +11 -13
  102. package/src/components/date-range-picker/utils.ts +49 -0
  103. package/src/components/dropdown/CDropdown.tsx +26 -23
  104. package/src/components/dropdown/CDropdownDivider.tsx +1 -3
  105. package/src/components/dropdown/CDropdownHeader.tsx +1 -3
  106. package/src/components/dropdown/CDropdownItem.tsx +7 -5
  107. package/src/components/dropdown/CDropdownItemPlain.tsx +1 -3
  108. package/src/components/dropdown/CDropdownMenu.tsx +29 -32
  109. package/src/components/dropdown/CDropdownToggle.tsx +34 -27
  110. package/src/components/dropdown/__tests__/CDropdown.spec.tsx +2 -4
  111. package/src/components/dropdown/__tests__/__snapshots__/CDropdown.spec.tsx.snap +1 -1
  112. package/src/components/footer/CFooter.tsx +5 -3
  113. package/src/components/form/CForm.tsx +5 -2
  114. package/src/components/form/CFormCheck.tsx +90 -66
  115. package/src/components/form/CFormControlValidation.tsx +0 -1
  116. package/src/components/form/CFormControlWrapper.tsx +3 -4
  117. package/src/components/form/CFormFeedback.tsx +11 -8
  118. package/src/components/form/CFormFloating.tsx +1 -2
  119. package/src/components/form/CFormInput.tsx +18 -16
  120. package/src/components/form/CFormLabel.tsx +1 -2
  121. package/src/components/form/CFormRange.tsx +2 -4
  122. package/src/components/form/CFormSelect.tsx +16 -12
  123. package/src/components/form/CFormSwitch.tsx +31 -20
  124. package/src/components/form/CFormText.tsx +1 -2
  125. package/src/components/form/CFormTextarea.tsx +14 -11
  126. package/src/components/form/CInputGroup.tsx +11 -8
  127. package/src/components/form/CInputGroupText.tsx +1 -2
  128. package/src/components/form/__tests__/CFormRange.spec.tsx +1 -1
  129. package/src/components/form/__tests__/__snapshots__/CForm.spec.tsx.snap +2 -6
  130. package/src/components/form/__tests__/__snapshots__/CFormRange.spec.tsx.snap +2 -2
  131. package/src/components/grid/CCol.tsx +8 -6
  132. package/src/components/grid/CContainer.tsx +8 -6
  133. package/src/components/grid/CRow.tsx +4 -3
  134. package/src/components/header/CHeader.tsx +12 -13
  135. package/src/components/header/CHeaderBrand.tsx +1 -3
  136. package/src/components/header/CHeaderBrand.tsx~HEAD +1 -3
  137. package/src/components/header/CHeaderDivider.tsx +1 -3
  138. package/src/components/header/CHeaderNav.tsx +6 -3
  139. package/src/components/header/CHeaderText.tsx +1 -3
  140. package/src/components/header/CHeaderToggler.tsx +2 -4
  141. package/src/components/image/CImage.tsx +17 -10
  142. package/src/components/image/__tests__/__snapshots__/CImage.spec.tsx.snap +1 -3
  143. package/src/components/index.ts +1 -0
  144. package/src/components/link/CLink.tsx +2 -4
  145. package/src/components/list-group/CListGroup.tsx +11 -10
  146. package/src/components/list-group/CListGroupItem.tsx +21 -20
  147. package/src/components/list-group/CListGroupItem.tsx~HEAD +3 -1
  148. package/src/components/loading-button/CLoadingButton.tsx +1 -3
  149. package/src/components/modal/CModal.tsx +57 -72
  150. package/src/components/modal/CModalBody.tsx +1 -3
  151. package/src/components/modal/CModalContent.tsx +1 -3
  152. package/src/components/modal/CModalDialog.tsx +16 -14
  153. package/src/components/modal/CModalFooter.tsx +1 -3
  154. package/src/components/modal/CModalHeader.tsx +4 -4
  155. package/src/components/modal/CModalTitle.tsx +1 -3
  156. package/src/components/modal/__tests__/CModal.spec.tsx +19 -20
  157. package/src/components/multi-select/CMultiSelect.tsx +34 -93
  158. package/src/components/multi-select/CMultiSelectNativeSelect.tsx +1 -1
  159. package/src/components/multi-select/CMultiSelectOptions.tsx +2 -2
  160. package/src/components/multi-select/CMultiSelectSelection.tsx +1 -1
  161. package/src/components/multi-select/types.ts +15 -0
  162. package/src/components/multi-select/utils.ts +92 -0
  163. package/src/components/nav/CNav.tsx +13 -10
  164. package/src/components/nav/CNavGroup.tsx +1 -3
  165. package/src/components/nav/CNavGroupItems.tsx +1 -2
  166. package/src/components/nav/CNavItem.tsx +9 -10
  167. package/src/components/nav/CNavLink.tsx +4 -5
  168. package/src/components/nav/CNavTitle.tsx +1 -2
  169. package/src/components/navbar/CNavbar.tsx +23 -23
  170. package/src/components/navbar/CNavbarBrand.tsx +2 -3
  171. package/src/components/navbar/CNavbarNav.tsx +6 -3
  172. package/src/components/navbar/CNavbarText.tsx +1 -3
  173. package/src/components/navbar/CNavbarToggler.tsx +2 -4
  174. package/src/components/offcanvas/COffcanvas.tsx +42 -68
  175. package/src/components/offcanvas/COffcanvasBody.tsx +1 -3
  176. package/src/components/offcanvas/COffcanvasHeader.tsx +1 -3
  177. package/src/components/offcanvas/COffcanvasTitle.tsx +1 -3
  178. package/src/components/offcanvas/__tests__/COffcanvas.spec.tsx +7 -2
  179. package/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.tsx.snap +9 -4
  180. package/src/components/pagination/CPagination.tsx +12 -9
  181. package/src/components/pagination/CPaginationItem.tsx +12 -11
  182. package/src/components/pagination/__tests__/CPagination.spec.tsx +3 -3
  183. package/src/components/pagination/__tests__/CPaginationItem.spec.tsx +3 -3
  184. package/src/components/picker/CPicker.tsx +7 -7
  185. package/src/components/placeholder/CPlaceholder.tsx +15 -12
  186. package/src/components/popover/CPopover.tsx +24 -34
  187. package/src/components/progress/CProgress.tsx +13 -10
  188. package/src/components/progress/CProgressBar.tsx +11 -12
  189. package/src/components/sidebar/CSidebar.tsx +22 -19
  190. package/src/components/sidebar/CSidebarBrand.tsx +1 -2
  191. package/src/components/sidebar/CSidebarFooter.tsx +1 -2
  192. package/src/components/sidebar/CSidebarHeader.tsx +1 -2
  193. package/src/components/sidebar/CSidebarNav.tsx +2 -2
  194. package/src/components/sidebar/CSidebarToggler.tsx +1 -2
  195. package/src/components/smart-pagination/CSmartPagination.tsx +22 -20
  196. package/src/components/smart-table/CSmartTable.tsx +5 -9
  197. package/src/components/smart-table/CSmartTableBody.tsx +82 -81
  198. package/src/components/smart-table/CSmartTableHead.tsx +5 -2
  199. package/src/components/smart-table/CSmartTableInterface.tsx +8 -0
  200. package/src/components/smart-table/{utils.tsx → utils.ts} +4 -5
  201. package/src/components/spinner/CSpinner.tsx +13 -9
  202. package/src/components/table/CTable.tsx +45 -77
  203. package/src/components/table/CTableBody.tsx +14 -9
  204. package/src/components/table/CTableDataCell.tsx +16 -11
  205. package/src/components/table/CTableFoot.tsx +14 -9
  206. package/src/components/table/CTableHead.tsx +14 -9
  207. package/src/components/table/CTableHeaderCell.tsx +14 -9
  208. package/src/components/table/CTableResponsiveWrapper.tsx +2 -3
  209. package/src/components/table/CTableRow.tsx +16 -11
  210. package/src/components/table/__tests__/__snapshots__/CTable.spec.tsx.snap +1 -5
  211. package/src/components/table/types.ts +20 -0
  212. package/src/components/table/utils.ts +24 -0
  213. package/src/components/tabs/CTabContent.tsx +1 -2
  214. package/src/components/tabs/CTabPane.tsx +18 -20
  215. package/src/components/tabs/__tests__/CTabPane.spec.tsx +2 -5
  216. package/src/components/tabs/__tests__/__snapshots__/CTabPane.spec.tsx.snap +1 -1
  217. package/src/components/time-picker/CTimePicker.tsx +14 -18
  218. package/src/components/toast/CToast.tsx +32 -45
  219. package/src/components/toast/CToastBody.tsx +1 -2
  220. package/src/components/toast/CToastClose.tsx +4 -2
  221. package/src/components/toast/CToastHeader.tsx +1 -2
  222. package/src/components/toast/CToaster.tsx +27 -26
  223. package/src/components/toast/__tests__/CToast.spec.tsx +2 -1
  224. package/src/components/toast/__tests__/__snapshots__/CToast.spec.tsx.snap +1 -66
  225. package/src/components/tooltip/CTooltip.tsx +24 -34
  226. package/src/components/virtual-scroller/CVirtualScroller.tsx +35 -60
  227. package/src/components/widgets/CWidgetStatsA.tsx +11 -9
  228. package/src/components/widgets/CWidgetStatsB.tsx +4 -4
  229. package/src/components/widgets/CWidgetStatsC.tsx +4 -4
  230. package/src/components/widgets/CWidgetStatsD.tsx +13 -15
  231. package/src/components/widgets/CWidgetStatsE.tsx +2 -5
  232. package/src/components/widgets/CWidgetStatsF.tsx +4 -8
  233. package/src/{components/Types.tsx → props.ts} +1 -68
  234. package/src/types.ts +68 -0
  235. package/src/utils/index.ts +1 -3
  236. package/src/components/multi-select/CMultiSelectCleaner.tsx +0 -18
  237. package/src/utils/getNextSibling.ts +0 -18
  238. package/src/utils/getPreviousSibling.ts +0 -18
  239. package/src/components/smart-table/{types.tsx → types.ts} +1 -1
package/README.md CHANGED
@@ -42,7 +42,7 @@
42
42
 
43
43
  Several quick start options are available:
44
44
 
45
- - [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.9.0-next.0.zip)
45
+ - [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.9.0.zip)
46
46
  - Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
47
47
  - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
48
48
  - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CAlertProps extends HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors, Shapes, TextColors } from '../Types';
2
+ import type { Colors, Shapes, TextColors } from '../../types';
3
3
  export interface CAvatarProps extends HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,5 +1,5 @@
1
1
  import React, { ElementType, HTMLAttributes } from 'react';
2
- import { Colors, Gradients, Shapes, TextColors } from '../Types';
2
+ import type { Colors, Gradients, Shapes, TextColors } from '../../types';
3
3
  export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,6 +1,6 @@
1
1
  import React, { ElementType } from 'react';
2
- import { Colors, Shapes } from '../Types';
3
2
  import { CLinkProps } from '../link/CLink';
3
+ import type { Colors, Shapes } from '../../types';
4
4
  export interface CButtonProps extends Omit<CLinkProps, 'size'> {
5
5
  /**
6
6
  * Toggle the active state for the component.
@@ -3,7 +3,6 @@ export declare const convertToLocalTime: (d: Date, locale: string, options?: {})
3
3
  export declare const createGroupsInArray: <T>(arr: T[], numberOfGroups: number) => T[][];
4
4
  export declare const getCurrentYear: () => number;
5
5
  export declare const getCurrentMonth: () => number;
6
- export declare const getLocalDateFromString: (string: string, locale: string, time?: boolean) => Date | undefined;
7
6
  export declare const getMonthName: (month: number, locale: string) => string;
8
7
  export declare const getMonthsNames: (locale: string) => string[];
9
8
  export declare const getYears: (year: number) => number[];
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CCalloutProps extends HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the base component.
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors, Gradients } from '../Types';
2
+ import type { Colors, Gradients } from '../../types';
3
3
  export interface CCardProps extends HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the base component.
@@ -0,0 +1,12 @@
1
+ import { FC, ReactNode } from 'react';
2
+ export interface CConditionalPortalProps {
3
+ /**
4
+ * @ignore
5
+ */
6
+ children: ReactNode;
7
+ /**
8
+ * Render some children into a different part of the DOM
9
+ */
10
+ portal: boolean;
11
+ }
12
+ export declare const CConditionalPortal: FC<CConditionalPortalProps>;
@@ -0,0 +1,2 @@
1
+ import { CConditionalPortal } from './CConditionalPortal';
2
+ export { CConditionalPortal };
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  import { CCalendarProps } from '../calendar/CCalendar';
3
3
  import { CFormControlWrapperProps } from '../form/CFormControlWrapper';
4
4
  import { CPickerProps } from '../picker/CPicker';
5
- import { Colors } from '../Types';
5
+ import { Colors } from '../../types';
6
6
  export interface CDateRangePickerProps extends Omit<CFormControlWrapperProps, 'floatingLabel'>, Omit<CPickerProps, 'autoClose' | 'component' | 'dark' | 'placeholder' | 'variant'>, Omit<CCalendarProps, 'onCalendarCellHover' | 'onCalendarDateChange'> {
7
7
  /**
8
8
  * The number of calendars that render on desktop devices.
@@ -0,0 +1 @@
1
+ export declare const getLocalDateFromString: (string: string, locale: string, time?: boolean) => Date | undefined;
@@ -1,5 +1,5 @@
1
1
  import React, { ElementType, HTMLAttributes, RefObject } from 'react';
2
- import { Placements } from '../Types';
2
+ import type { Placements } from '../../types';
3
3
  export type Directions = 'start' | 'end';
4
4
  export type Breakpoints = {
5
5
  xs: Directions;
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
- import { Triggers } from '../Types';
3
2
  import { CButtonProps } from '../button/CButton';
3
+ import type { Triggers } from '../../types';
4
4
  export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
5
5
  /**
6
6
  * Enables pseudo element caret on toggler.
@@ -1,6 +1,6 @@
1
1
  import React, { InputHTMLAttributes, ReactNode } from 'react';
2
- import { Colors, Shapes } from '../Types';
3
2
  import { CFormControlValidationProps } from './CFormControlValidation';
3
+ import type { Colors, Shapes } from '../../types';
4
4
  export type ButtonObject = {
5
5
  /**
6
6
  * Sets the color context of the component to one of CoreUI’s themed colors.
@@ -45,7 +45,7 @@ export interface CFormCheckProps extends CFormControlValidationProps, InputHTMLA
45
45
  */
46
46
  indeterminate?: boolean;
47
47
  /**
48
- * Group checkboxes or radios on the same horizontal row by adding.
48
+ * Group checkboxes or radios on the same horizontal row.
49
49
  */
50
50
  inline?: boolean;
51
51
  /**
@@ -56,6 +56,12 @@ export interface CFormCheckProps extends CFormControlValidationProps, InputHTMLA
56
56
  * The element represents a caption for a component.
57
57
  */
58
58
  label?: string | ReactNode;
59
+ /**
60
+ * Put checkboxes or radios on the opposite side.
61
+ *
62
+ * @sinve 4.7.0
63
+ */
64
+ reverse?: boolean;
59
65
  /**
60
66
  * Specifies the type of component.
61
67
  */
@@ -16,6 +16,12 @@ export interface CFormSwitchProps extends Omit<InputHTMLAttributes<HTMLInputElem
16
16
  * The element represents a caption for a component.
17
17
  */
18
18
  label?: string | ReactNode;
19
+ /**
20
+ * Put switch on the opposite side.
21
+ *
22
+ * @sinve 4.7.0
23
+ */
24
+ reverse?: boolean;
19
25
  /**
20
26
  * Size the component large or extra large. Works only with `switch`.
21
27
  */
@@ -11,6 +11,7 @@ export * from './card';
11
11
  export * from './carousel';
12
12
  export * from './close-button';
13
13
  export * from './collapse';
14
+ export * from './conditional-portal';
14
15
  export * from './date-picker';
15
16
  export * from './date-range-picker';
16
17
  export * from './dropdown';
@@ -1,6 +1,6 @@
1
- import React, { ElementType, HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
3
- export interface CListGroupItemProps extends HTMLAttributes<HTMLLIElement | HTMLAnchorElement | HTMLButtonElement | HTMLLinkElement> {
1
+ import React, { ElementType, AnchorHTMLAttributes } from 'react';
2
+ import type { Colors } from '../../types';
3
+ export interface CListGroupItemProps extends AnchorHTMLAttributes<HTMLLIElement | HTMLAnchorElement | HTMLButtonElement> {
4
4
  /**
5
5
  * Toggle the active state for the component.
6
6
  */
@@ -23,6 +23,5 @@ export interface CListGroupItemProps extends HTMLAttributes<HTMLLIElement | HTML
23
23
  * Component used for the root node. Either a string to use a HTML element or a component.
24
24
  */
25
25
  component?: string | ElementType;
26
- href?: string;
27
26
  }
28
- export declare const CListGroupItem: React.ForwardRefExoticComponent<CListGroupItemProps & React.RefAttributes<HTMLButtonElement | HTMLLinkElement | HTMLAnchorElement | HTMLLIElement>>;
27
+ export declare const CListGroupItem: React.ForwardRefExoticComponent<CListGroupItemProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement | HTMLLIElement>>;
@@ -1,5 +1,6 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
2
  import { CFormControlWrapperProps } from './../form/CFormControlWrapper';
3
+ import type { Option } from './types';
3
4
  export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'floatingClassName' | 'floatingLabel'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
5
  /**
5
6
  * A string of all className you want applied to the base component.
@@ -89,17 +90,4 @@ export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'float
89
90
  */
90
91
  visibleItems?: number;
91
92
  }
92
- export interface Option {
93
- disabled?: boolean;
94
- label?: string;
95
- options?: Option[];
96
- selected?: boolean;
97
- text?: string;
98
- value?: number | string;
99
- }
100
- export interface SelectedOption {
101
- disabled?: boolean;
102
- text: string;
103
- value: number | string;
104
- }
105
93
  export declare const CMultiSelect: React.ForwardRefExoticComponent<CMultiSelectProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Option } from './CMultiSelect';
2
+ import type { Option } from './types';
3
3
  export interface CMultiSelectNativeSelectProps extends Omit<HTMLAttributes<HTMLSelectElement>, 'options'> {
4
4
  multiple?: boolean;
5
5
  options: Option[] | undefined;
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
- import { Option } from './CMultiSelect';
2
+ import type { Option } from './types';
3
3
  export interface CMultiSelectOptionsProps extends HTMLAttributes<HTMLDivElement> {
4
4
  handleOptionOnClick?: (option: Option) => void;
5
5
  options: Option[];
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import type { SelectedOption } from './CMultiSelect';
2
+ import type { SelectedOption } from './types';
3
3
  export interface CMultiSelectSelectionProps extends HTMLAttributes<HTMLSpanElement> {
4
4
  multiple?: boolean;
5
5
  onRemove?: (option: SelectedOption) => void;
@@ -0,0 +1,14 @@
1
+ export type Option = {
2
+ disabled?: boolean;
3
+ label?: string;
4
+ options?: Option[];
5
+ order?: number;
6
+ selected?: boolean;
7
+ text: string;
8
+ value: number | string;
9
+ };
10
+ export type SelectedOption = {
11
+ disabled?: boolean;
12
+ text: string;
13
+ value: number | string;
14
+ };
@@ -0,0 +1,6 @@
1
+ import type { Option, SelectedOption } from './types';
2
+ export declare const filterOptionsList: (search: string, _options: Option[]) => Option[];
3
+ export declare const flattenArray: (options: Option[]) => Option[];
4
+ export declare const getNextSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
5
+ export declare const getPreviousSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
6
+ export declare const selectOptions: (options: Option[], selected: SelectedOption[], deselected?: Option[]) => SelectedOption[];
@@ -1,5 +1,5 @@
1
1
  import React, { ElementType, HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CNavbarProps extends HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { CDropdownProps } from '../dropdown/CDropdown';
3
- import { Colors } from '../Types';
3
+ import { Colors } from '../../types';
4
4
  export interface CPickerProps extends Omit<CDropdownProps, 'variant'> {
5
5
  /**
6
6
  * Toggle visibility or set the content of cancel button.
@@ -1,5 +1,5 @@
1
1
  import React, { ElementType, HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CPlaceholderProps extends HTMLAttributes<HTMLSpanElement> {
4
4
  /**
5
5
  * Set animation type to better convey the perception of something being actively loaded.
@@ -1,5 +1,5 @@
1
1
  import { FC, HTMLAttributes, ReactNode } from 'react';
2
- import { Triggers } from '../Types';
2
+ import type { Triggers } from '../../types';
3
3
  export interface CPopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors, Gradients } from '../Types';
2
+ import type { Colors, Gradients } from '../../types';
3
3
  export interface CProgressBarProps extends HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * Use to animate the stripes right to left via CSS3 animations.
@@ -1,6 +1,6 @@
1
1
  import React, { ElementType, ReactNode } from 'react';
2
- import type { ColumnFilter, ColumnFilterValue, Column, Item, Sorter, SorterValue } from './types';
3
2
  import { CTableHeadProps } from '../table/CTableHead';
3
+ import type { ColumnFilter, ColumnFilterValue, Column, Item, Sorter, SorterValue } from './types';
4
4
  export interface CSmartTableHeadProps extends CTableHeadProps {
5
5
  columnFilter?: boolean | ColumnFilter;
6
6
  columnFilterState?: ColumnFilterValue;
@@ -78,6 +78,8 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
78
78
  *
79
79
  * Example item:
80
80
  * `{ name: 'John' , age: 12, _props: { color: 'success' }, _cellProps: { age: { className: 'fw-bold'}}}`
81
+ *
82
+ * @since 4.9.0
81
83
  */
82
84
  items?: Item[];
83
85
  /**
@@ -133,6 +135,8 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
133
135
  onRowClick?: (item: Item, index: number, columnName: string, event: MouseEvent | boolean) => void;
134
136
  /**
135
137
  * Select all callback.
138
+ *
139
+ * @since 4.9.0
136
140
  */
137
141
  onSelectAll?: () => void;
138
142
  /**
@@ -168,6 +172,8 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
168
172
  *
169
173
  * Can be customized, by passing prop as object with additional options as keys. Available options:
170
174
  * - external (Boolean) - Disables automatic selection inside the component.
175
+ *
176
+ * @since 4.9.0
171
177
  */
172
178
  selectAll?: boolean | {
173
179
  external?: boolean;
@@ -176,6 +182,8 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
176
182
  * Array of selected objects, where each object represents one item - row in table.
177
183
  *
178
184
  * Example item: `{ name: 'John' , age: 12 }`
185
+ *
186
+ * @since 4.9.0
179
187
  */
180
188
  selected?: Item[];
181
189
  /**
@@ -4,8 +4,8 @@ import { CTableHeaderCellProps } from '../table/CTableHeaderCell';
4
4
  import { CTableRowProps } from '../table/CTableRow';
5
5
  export type Column = {
6
6
  filter?: boolean | ((values: any[], onChange: (value: any) => void) => ReactNode);
7
- label?: string;
8
7
  key: string;
8
+ label?: string;
9
9
  sorter?: boolean;
10
10
  _style?: any;
11
11
  _props?: CTableHeaderCellProps;
@@ -1,5 +1,5 @@
1
1
  import React, { ElementType, HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CSpinnerProps extends HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,10 +1,8 @@
1
1
  import React, { TableHTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
3
2
  import { CTableHeadProps } from './CTableHead';
4
- import { CTableHeaderCellProps } from './CTableHeaderCell';
5
- import { CTableDataCellProps } from './CTableDataCell';
6
- import { CTableRowProps } from './CTableRow';
7
3
  import { CTableFootProps } from './CTableFoot';
4
+ import type { Colors } from '../../types';
5
+ import type { Column, FooterItem, Item } from './types';
8
6
  export interface CTableProps extends Omit<TableHTMLAttributes<HTMLTableElement>, 'align'> {
9
7
  /**
10
8
  * Set the vertical aligment.
@@ -115,18 +113,4 @@ export interface CTableProps extends Omit<TableHTMLAttributes<HTMLTableElement>,
115
113
  */
116
114
  tableHeadProps?: CTableHeadProps;
117
115
  }
118
- export interface Column {
119
- label?: string;
120
- key: string;
121
- _style?: any;
122
- _props?: CTableHeaderCellProps;
123
- }
124
- export interface Item {
125
- [key: string]: number | string | any;
126
- _props?: CTableRowProps;
127
- }
128
- export interface FooterItem {
129
- label?: string;
130
- _props?: CTableDataCellProps;
131
- }
132
116
  export declare const CTable: React.ForwardRefExoticComponent<CTableProps & React.RefAttributes<HTMLTableElement>>;
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CTableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,5 +1,5 @@
1
1
  import React, { TdHTMLAttributes, ThHTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CTableDataCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'>, Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> {
4
4
  /**
5
5
  * Highlight a table row or cell.
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CTableFootProps extends HTMLAttributes<HTMLTableSectionElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CTableHeadProps extends HTMLAttributes<HTMLTableSectionElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,5 +1,5 @@
1
1
  import React, { ThHTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CTableHeaderCellProps extends ThHTMLAttributes<HTMLTableCellElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -1,6 +1,5 @@
1
1
  import { FC, HTMLAttributes } from 'react';
2
2
  export interface CTableResponsiveWrapperProps extends HTMLAttributes<HTMLDivElement> {
3
- children: any;
4
3
  /**
5
4
  * Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to.
6
5
  */
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CTableRowProps extends HTMLAttributes<HTMLTableRowElement> {
4
4
  /**
5
5
  * Highlight a table row or cell..
@@ -0,0 +1,17 @@
1
+ import { CTableDataCellProps } from '../table/CTableDataCell';
2
+ import { CTableHeaderCellProps } from '../table/CTableHeaderCell';
3
+ import { CTableRowProps } from '../table/CTableRow';
4
+ export type Column = {
5
+ label?: string;
6
+ key: string;
7
+ _style?: any;
8
+ _props?: CTableHeaderCellProps;
9
+ };
10
+ export type FooterItem = {
11
+ label?: string;
12
+ _props?: CTableDataCellProps;
13
+ };
14
+ export type Item = {
15
+ [key: string]: number | string | any;
16
+ _props?: CTableRowProps;
17
+ };
@@ -0,0 +1,5 @@
1
+ import type { Column, Item } from './types';
2
+ export declare const pretifyName: (name: string) => string;
3
+ export declare const getColumnLabel: (column: Column | string) => string;
4
+ export declare const getColumnNames: (columns: (string | Column)[] | undefined, items?: Item[]) => string[] | undefined;
5
+ export declare const getColumnNamesFromItems: (items: Item[]) => string[];
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
4
  /**
5
5
  * Apply a CSS fade transition to the toast.
@@ -1,6 +1,6 @@
1
1
  import React, { ElementType } from 'react';
2
+ import { CButtonProps } from '../button/CButton';
2
3
  import { CCloseButtonProps } from '../close-button/CCloseButton';
3
- import type { CButtonProps } from '../button/CButton';
4
4
  type CombineButtonProps = CCloseButtonProps & CButtonProps;
5
5
  export interface CToastCloseProps extends CombineButtonProps {
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { FC, HTMLAttributes, ReactNode } from 'react';
2
- import { Triggers } from '../Types';
2
+ import type { Triggers } from '../../types';
3
3
  export interface CTooltipProps extends HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * A string of all className you want applied to the component.
@@ -4,14 +4,6 @@ export interface CVirtualScrollerProps extends Omit<HTMLAttributes<HTMLDivElemen
4
4
  * A string of all className you want applied to the base component.
5
5
  */
6
6
  className?: string;
7
- /**
8
- * Single item height.
9
- */
10
- itemHeight?: number | 'auto';
11
- /**
12
- * Number of items.
13
- */
14
- itemsNumber?: number;
15
7
  /**
16
8
  * Event fires when the component has been scrolled.
17
9
  */
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CWidgetStatsAProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
4
  /**
5
5
  * Action node for your component.
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
- import { Colors } from '../Types';
3
2
  import { CProgressProps } from '../progress/CProgress';
3
+ import type { Colors } from '../../types';
4
4
  export interface CWidgetStatsBProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
5
5
  /**
6
6
  * A string of all className you want applied to the base component.
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
- import { Colors } from '../Types';
3
2
  import { CProgressProps } from '../progress/CProgress';
3
+ import type { Colors } from '../../types';
4
4
  export interface CWidgetStatsCProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
5
5
  /**
6
6
  * A string of all className you want applied to the base component.
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  type Value = {
4
4
  title?: string | ReactNode;
5
5
  value?: number | string | ReactNode;
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
- import { Colors } from '../Types';
2
+ import type { Colors } from '../../types';
3
3
  export interface CWidgetStatsFProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
4
  /**
5
5
  * A string of all className you want applied to the base component.