@coreui/react 4.1.2 → 4.2.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 (118) hide show
  1. package/README.md +1 -1
  2. package/dist/components/accordion/index.d.ts +7 -0
  3. package/dist/components/alert/index.d.ts +4 -0
  4. package/dist/components/avatar/index.d.ts +2 -0
  5. package/dist/components/backdrop/index.d.ts +2 -0
  6. package/dist/components/badge/index.d.ts +2 -0
  7. package/dist/components/breadcrumb/index.d.ts +3 -0
  8. package/dist/components/button/index.d.ts +2 -0
  9. package/dist/components/button-group/index.d.ts +3 -0
  10. package/dist/components/callout/index.d.ts +2 -0
  11. package/dist/components/card/index.d.ts +12 -0
  12. package/dist/components/carousel/index.d.ts +4 -0
  13. package/dist/components/close-button/index.d.ts +2 -0
  14. package/dist/components/collapse/index.d.ts +2 -0
  15. package/dist/components/dropdown/CDropdown.d.ts +10 -1
  16. package/dist/components/dropdown/CDropdownToggle.d.ts +4 -0
  17. package/dist/components/dropdown/index.d.ts +8 -0
  18. package/dist/components/footer/index.d.ts +2 -0
  19. package/dist/components/form/CForm.d.ts +2 -2
  20. package/dist/components/form/CFormCheck.d.ts +2 -1
  21. package/dist/components/form/CFormControlValidation.d.ts +46 -0
  22. package/dist/components/form/CFormControlWrapper.d.ts +31 -0
  23. package/dist/components/form/CFormInput.d.ts +6 -9
  24. package/dist/components/form/CFormRange.d.ts +7 -1
  25. package/dist/components/form/CFormSelect.d.ts +3 -10
  26. package/dist/components/form/CFormTextarea.d.ts +2 -9
  27. package/dist/components/form/index.d.ts +14 -0
  28. package/dist/components/grid/index.d.ts +4 -0
  29. package/dist/components/header/index.d.ts +7 -0
  30. package/dist/components/image/index.d.ts +2 -0
  31. package/dist/components/index.d.ts +35 -0
  32. package/dist/components/link/index.d.ts +2 -0
  33. package/dist/components/list-group/index.d.ts +3 -0
  34. package/dist/components/modal/CModal.d.ts +3 -0
  35. package/dist/components/modal/index.d.ts +8 -0
  36. package/dist/components/nav/index.d.ts +7 -0
  37. package/dist/components/navbar/index.d.ts +6 -0
  38. package/dist/components/offcanvas/index.d.ts +5 -0
  39. package/dist/components/pagination/index.d.ts +3 -0
  40. package/dist/components/placeholder/index.d.ts +2 -0
  41. package/dist/components/popover/CPopover.d.ts +2 -2
  42. package/dist/components/popover/index.d.ts +2 -0
  43. package/dist/components/progress/index.d.ts +3 -0
  44. package/dist/components/sidebar/index.d.ts +7 -0
  45. package/dist/components/spinner/index.d.ts +2 -0
  46. package/dist/components/table/index.d.ts +9 -0
  47. package/dist/components/tabs/index.d.ts +3 -0
  48. package/dist/components/toast/index.d.ts +6 -0
  49. package/dist/components/tooltip/CTooltip.d.ts +6 -2
  50. package/dist/components/tooltip/index.d.ts +2 -0
  51. package/dist/index.d.ts +0 -120
  52. package/dist/index.es.js +585 -512
  53. package/dist/index.es.js.map +1 -1
  54. package/dist/index.js +585 -512
  55. package/dist/index.js.map +1 -1
  56. package/package.json +13 -12
  57. package/src/components/accordion/CAccordionButton.tsx +2 -1
  58. package/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap +2 -0
  59. package/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap +2 -0
  60. package/src/components/accordion/index.ts +15 -0
  61. package/src/components/alert/CAlert.tsx +14 -3
  62. package/src/components/alert/index.ts +5 -0
  63. package/src/components/avatar/index.ts +3 -0
  64. package/src/components/backdrop/CBackdrop.tsx +10 -3
  65. package/src/components/backdrop/index.ts +3 -0
  66. package/src/components/badge/index.ts +3 -0
  67. package/src/components/breadcrumb/index.ts +4 -0
  68. package/src/components/button/index.ts +3 -0
  69. package/src/components/button-group/index.ts +4 -0
  70. package/src/components/callout/index.ts +3 -0
  71. package/src/components/card/index.ts +25 -0
  72. package/src/components/carousel/index.ts +5 -0
  73. package/src/components/close-button/index.ts +3 -0
  74. package/src/components/collapse/CCollapse.tsx +1 -0
  75. package/src/components/collapse/index.ts +3 -0
  76. package/src/components/dropdown/CDropdown.tsx +19 -24
  77. package/src/components/dropdown/CDropdownItem.tsx +1 -1
  78. package/src/components/dropdown/CDropdownMenu.tsx +55 -3
  79. package/src/components/dropdown/CDropdownToggle.tsx +28 -5
  80. package/src/components/dropdown/index.ts +17 -0
  81. package/src/components/footer/index.ts +3 -0
  82. package/src/components/form/CForm.tsx +2 -2
  83. package/src/components/form/CFormCheck.tsx +32 -7
  84. package/src/components/form/CFormControlValidation.tsx +97 -0
  85. package/src/components/form/CFormControlWrapper.tsx +85 -0
  86. package/src/components/form/CFormInput.tsx +75 -19
  87. package/src/components/form/CFormRange.tsx +18 -4
  88. package/src/components/form/CFormSelect.tsx +60 -32
  89. package/src/components/form/CFormTextarea.tsx +45 -17
  90. package/src/components/form/index.ts +29 -0
  91. package/src/components/grid/index.ts +5 -0
  92. package/src/components/header/index.ts +8 -0
  93. package/src/components/image/index.ts +3 -0
  94. package/src/components/index.ts +35 -0
  95. package/src/components/link/index.ts +3 -0
  96. package/src/components/list-group/index.ts +4 -0
  97. package/src/components/modal/CModal.tsx +3 -2
  98. package/src/components/modal/index.ts +9 -0
  99. package/src/components/nav/CNavGroup.tsx +1 -0
  100. package/src/components/nav/index.ts +8 -0
  101. package/src/components/navbar/index.ts +7 -0
  102. package/src/components/offcanvas/COffcanvas.tsx +1 -0
  103. package/src/components/offcanvas/index.ts +6 -0
  104. package/src/components/pagination/index.ts +4 -0
  105. package/src/components/placeholder/index.ts +3 -0
  106. package/src/components/popover/CPopover.tsx +59 -57
  107. package/src/components/popover/index.ts +3 -0
  108. package/src/components/progress/index.ts +4 -0
  109. package/src/components/sidebar/index.ts +8 -0
  110. package/src/components/spinner/index.ts +3 -0
  111. package/src/components/table/index.ts +19 -0
  112. package/src/components/tabs/CTabPane.tsx +7 -3
  113. package/src/components/tabs/index.ts +4 -0
  114. package/src/components/toast/CToast.tsx +6 -1
  115. package/src/components/toast/index.ts +7 -0
  116. package/src/components/tooltip/CTooltip.tsx +63 -45
  117. package/src/components/tooltip/index.ts +3 -0
  118. package/src/index.ts +0 -242
@@ -0,0 +1,29 @@
1
+ import { CForm } from './CForm'
2
+ import { CFormCheck } from './CFormCheck'
3
+ import { CFormFeedback } from './CFormFeedback'
4
+ import { CFormFloating } from './CFormFloating'
5
+ import { CFormInput } from './CFormInput'
6
+ import { CFormLabel } from './CFormLabel'
7
+ import { CFormRange } from './CFormRange'
8
+ import { CFormSelect } from './CFormSelect'
9
+ import { CFormSwitch } from './CFormSwitch'
10
+ import { CFormText } from './CFormText'
11
+ import { CFormTextarea } from './CFormTextarea'
12
+ import { CInputGroup } from './CInputGroup'
13
+ import { CInputGroupText } from './CInputGroupText'
14
+
15
+ export {
16
+ CForm,
17
+ CFormCheck,
18
+ CFormFeedback,
19
+ CFormFloating,
20
+ CFormInput,
21
+ CFormLabel,
22
+ CFormRange,
23
+ CFormSelect,
24
+ CFormSwitch,
25
+ CFormText,
26
+ CFormTextarea,
27
+ CInputGroup,
28
+ CInputGroupText,
29
+ }
@@ -0,0 +1,5 @@
1
+ import { CCol } from './CCol'
2
+ import { CContainer } from './CContainer'
3
+ import { CRow } from './CRow'
4
+
5
+ export { CCol, CContainer, CRow }
@@ -0,0 +1,8 @@
1
+ import { CHeader } from './CHeader'
2
+ import { CHeaderBrand } from './CHeaderBrand'
3
+ import { CHeaderDivider } from './CHeaderDivider'
4
+ import { CHeaderNav } from './CHeaderNav'
5
+ import { CHeaderText } from './CHeaderText'
6
+ import { CHeaderToggler } from './CHeaderToggler'
7
+
8
+ export { CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler }
@@ -0,0 +1,3 @@
1
+ import { CImage } from './CImage'
2
+
3
+ export { CImage }
@@ -1 +1,36 @@
1
+ export * from './accordion'
2
+ export * from './alert'
3
+ export * from './avatar'
4
+ export * from './backdrop'
5
+ export * from './badge'
6
+ export * from './breadcrumb'
7
+ export * from './button'
8
+ export * from './button-group'
9
+ export * from './callout'
10
+ export * from './card'
11
+ export * from './carousel'
12
+ export * from './close-button'
13
+ export * from './collapse'
14
+ export * from './dropdown'
15
+ export * from './footer'
16
+ export * from './form'
17
+ export * from './grid'
18
+ export * from './header'
19
+ export * from './image'
20
+ export * from './link'
21
+ export * from './list-group'
22
+ export * from './modal'
23
+ export * from './nav'
24
+ export * from './navbar'
25
+ export * from './offcanvas'
26
+ export * from './pagination'
27
+ export * from './placeholder'
28
+ export * from './progress'
29
+ export * from './popover'
30
+ export * from './sidebar'
31
+ export * from './spinner'
32
+ export * from './table'
33
+ export * from './tabs'
34
+ export * from './toast'
35
+ export * from './tooltip'
1
36
  export * from './widgets'
@@ -0,0 +1,3 @@
1
+ import { CLink } from './CLink'
2
+
3
+ export { CLink }
@@ -0,0 +1,4 @@
1
+ import { CListGroup } from './CListGroup'
2
+ import { CListGroupItem } from './CListGroupItem'
3
+
4
+ export { CListGroup, CListGroupItem }
@@ -72,8 +72,8 @@ export interface CModalProps extends HTMLAttributes<HTMLDivElement> {
72
72
  * Remove animation to create modal that simply appear rather than fade in to view.
73
73
  */
74
74
  transition?: boolean
75
- /*
76
- * By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false
75
+ /**
76
+ * By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false.
77
77
  */
78
78
  unmountOnClose?: boolean
79
79
  /**
@@ -228,6 +228,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
228
228
  <Transition
229
229
  in={_visible}
230
230
  mountOnEnter
231
+ nodeRef={modalRef}
231
232
  onEnter={onShow}
232
233
  onExit={onClose}
233
234
  unmountOnExit={unmountOnClose}
@@ -0,0 +1,9 @@
1
+ import { CModal } from './CModal'
2
+ import { CModalBody } from './CModalBody'
3
+ import { CModalContent } from './CModalContent'
4
+ import { CModalDialog } from './CModalDialog'
5
+ import { CModalFooter } from './CModalFooter'
6
+ import { CModalHeader } from './CModalHeader'
7
+ import { CModalTitle } from './CModalTitle'
8
+
9
+ export { CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle }
@@ -106,6 +106,7 @@ export const CNavGroup = forwardRef<HTMLLIElement, CNavGroupProps>(
106
106
  )}
107
107
  <Transition
108
108
  in={_visible}
109
+ nodeRef={navItemsRef}
109
110
  onEntering={onEntering}
110
111
  onEntered={onEntered}
111
112
  onExit={onExit}
@@ -0,0 +1,8 @@
1
+ import { CNav } from './CNav'
2
+ import { CNavGroupItems } from './CNavGroupItems'
3
+ import { CNavGroup } from './CNavGroup'
4
+ import { CNavItem } from './CNavItem'
5
+ import { CNavLink } from './CNavLink'
6
+ import { CNavTitle } from './CNavTitle'
7
+
8
+ export { CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle }
@@ -0,0 +1,7 @@
1
+ import { CNavbar } from './CNavbar'
2
+ import { CNavbarBrand } from './CNavbarBrand'
3
+ import { CNavbarNav } from './CNavbarNav'
4
+ import { CNavbarText } from './CNavbarText'
5
+ import { CNavbarToggler } from './CNavbarToggler'
6
+
7
+ export { CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler }
@@ -137,6 +137,7 @@ export const COffcanvas = forwardRef<HTMLDivElement, COffcanvasProps>(
137
137
  <>
138
138
  <Transition
139
139
  in={_visible}
140
+ nodeRef={offcanvasRef}
140
141
  onEnter={onShow}
141
142
  onEntered={() => offcanvasRef.current?.focus()}
142
143
  onExit={onHide}
@@ -0,0 +1,6 @@
1
+ import { COffcanvas } from './COffcanvas'
2
+ import { COffcanvasBody } from './COffcanvasBody'
3
+ import { COffcanvasHeader } from './COffcanvasHeader'
4
+ import { COffcanvasTitle } from './COffcanvasTitle'
5
+
6
+ export { COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle }
@@ -0,0 +1,4 @@
1
+ import { CPagination } from './CPagination'
2
+ import { CPaginationItem } from './CPaginationItem'
3
+
4
+ export { CPagination, CPaginationItem }
@@ -0,0 +1,3 @@
1
+ import { CPlaceholder } from './CPlaceholder'
2
+
3
+ export { CPlaceholder }
@@ -1,15 +1,16 @@
1
- import React, { FC, ReactElement, ReactNode, useState } from 'react'
1
+ import React, { FC, ReactNode, useRef, useState } from 'react'
2
2
  import { createPortal } from 'react-dom'
3
- import PropTypes from 'prop-types'
3
+
4
4
  import classNames from 'classnames'
5
- import { Manager, Popper, Reference } from 'react-popper'
5
+ import PropTypes from 'prop-types'
6
+ import { usePopper } from 'react-popper'
6
7
  import { Transition } from 'react-transition-group'
7
8
 
8
- // import { CPopoverContent } from './CPopoverContent'
9
9
  import { Triggers, triggerPropType } from '../Types'
10
10
 
11
11
  export interface CPopoverProps {
12
- children: ReactElement
12
+ // TODO: find solution to not use any
13
+ children: any
13
14
  /**
14
15
  * Content node for your component.
15
16
  */
@@ -49,16 +50,33 @@ export interface CPopoverProps {
49
50
  export const CPopover: FC<CPopoverProps> = ({
50
51
  children,
51
52
  content,
52
- placement = 'top',
53
53
  offset = [0, 8],
54
54
  onHide,
55
55
  onShow,
56
+ placement = 'top',
56
57
  title,
57
58
  trigger = 'click',
58
59
  visible,
59
60
  ...rest
60
61
  }) => {
61
62
  const [_visible, setVisible] = useState(visible)
63
+ const popoverRef = useRef()
64
+
65
+ const [referenceElement, setReferenceElement] = useState(null)
66
+ const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null)
67
+ const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null)
68
+ const { styles, attributes } = usePopper(referenceElement, popperElement, {
69
+ modifiers: [
70
+ { name: 'arrow', options: { element: arrowElement } },
71
+ {
72
+ name: 'offset',
73
+ options: {
74
+ offset: offset,
75
+ },
76
+ },
77
+ ],
78
+ placement: placement,
79
+ })
62
80
 
63
81
  const getTransitionClass = (state: string) => {
64
82
  return state === 'entering'
@@ -71,32 +89,29 @@ export const CPopover: FC<CPopoverProps> = ({
71
89
  }
72
90
 
73
91
  return (
74
- <Manager>
75
- <Reference>
76
- {({ ref }) =>
77
- React.cloneElement(children, {
78
- ref: ref,
79
- ...((trigger === 'click' || trigger.includes('click')) && {
80
- onClick: () => setVisible(!_visible),
81
- }),
82
- ...((trigger === 'focus' || trigger.includes('focus')) && {
83
- onFocus: () => setVisible(true),
84
- onBlur: () => setVisible(false),
85
- }),
86
- ...((trigger === 'hover' || trigger.includes('hover')) && {
87
- onMouseEnter: () => setVisible(true),
88
- onMouseLeave: () => setVisible(false),
89
- }),
90
- })
91
- }
92
- </Reference>
92
+ <>
93
+ {React.cloneElement(children, {
94
+ ref: setReferenceElement,
95
+ ...((trigger === 'click' || trigger.includes('click')) && {
96
+ onClick: () => setVisible(!_visible),
97
+ }),
98
+ ...((trigger === 'focus' || trigger.includes('focus')) && {
99
+ onFocus: () => setVisible(true),
100
+ onBlur: () => setVisible(false),
101
+ }),
102
+ ...((trigger === 'hover' || trigger.includes('hover')) && {
103
+ onMouseEnter: () => setVisible(true),
104
+ onMouseLeave: () => setVisible(false),
105
+ }),
106
+ })}
93
107
  {typeof window !== 'undefined' &&
94
108
  createPortal(
95
109
  <Transition
96
110
  in={_visible}
111
+ mountOnEnter
112
+ nodeRef={popoverRef}
97
113
  onEnter={onShow}
98
114
  onExit={onHide}
99
- mountOnEnter
100
115
  timeout={{
101
116
  enter: 0,
102
117
  exit: 200,
@@ -106,52 +121,39 @@ export const CPopover: FC<CPopoverProps> = ({
106
121
  {(state) => {
107
122
  const transitionClass = getTransitionClass(state)
108
123
  return (
109
- <Popper
110
- placement={placement}
111
- modifiers={[
112
- {
113
- name: 'offset',
114
- options: {
115
- offset: offset,
116
- },
117
- },
118
- ]}
119
- >
120
- {({ arrowProps, style, ref }) => (
121
- <div
122
- className={classNames(
123
- `popover bs-popover-${
124
- placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement
125
- }`,
126
- transitionClass,
127
- )}
128
- ref={ref}
129
- role="tooltip"
130
- style={style}
131
- {...rest}
132
- >
133
- <div className="popover-arrow" {...arrowProps}></div>
134
- <div className="popover-header">{title}</div>
135
- <div className="popover-body">{content}</div>
136
- </div>
124
+ <div
125
+ className={classNames(
126
+ `popover bs-popover-${
127
+ placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement
128
+ }`,
129
+ transitionClass,
137
130
  )}
138
- </Popper>
131
+ ref={setPopperElement}
132
+ role="tooltip"
133
+ style={styles.popper}
134
+ {...attributes.popper}
135
+ {...rest}
136
+ >
137
+ <div className="popover-arrow" style={styles.arrow} ref={setArrowElement}></div>
138
+ <div className="popover-header">{title}</div>
139
+ <div className="popover-body">{content}</div>
140
+ </div>
139
141
  )
140
142
  }}
141
143
  </Transition>,
142
144
  document.body,
143
145
  )}
144
- </Manager>
146
+ </>
145
147
  )
146
148
  }
147
149
 
148
150
  CPopover.propTypes = {
149
151
  children: PropTypes.any,
150
152
  content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
151
- placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
152
153
  offset: PropTypes.any, // TODO: find good proptype
153
154
  onHide: PropTypes.func,
154
155
  onShow: PropTypes.func,
156
+ placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
155
157
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
156
158
  trigger: triggerPropType,
157
159
  visible: PropTypes.bool,
@@ -0,0 +1,3 @@
1
+ import { CPopover } from './CPopover'
2
+
3
+ export { CPopover }
@@ -0,0 +1,4 @@
1
+ import { CProgress } from './CProgress'
2
+ import { CProgressBar } from './CProgressBar'
3
+
4
+ export { CProgress, CProgressBar }
@@ -0,0 +1,8 @@
1
+ import { CSidebar } from './CSidebar'
2
+ import { CSidebarBrand } from './CSidebarBrand'
3
+ import { CSidebarFooter } from './CSidebarFooter'
4
+ import { CSidebarToggler } from './CSidebarToggler'
5
+ import { CSidebarHeader } from './CSidebarHeader'
6
+ import { CSidebarNav } from './CSidebarNav'
7
+
8
+ export { CSidebar, CSidebarBrand, CSidebarFooter, CSidebarToggler, CSidebarHeader, CSidebarNav }
@@ -0,0 +1,3 @@
1
+ import { CSpinner } from './CSpinner'
2
+
3
+ export { CSpinner }
@@ -0,0 +1,19 @@
1
+ import { CTable } from './CTable'
2
+ import { CTableBody } from './CTableBody'
3
+ import { CTableCaption } from './CTableCaption'
4
+ import { CTableDataCell } from './CTableDataCell'
5
+ import { CTableFoot } from './CTableFoot'
6
+ import { CTableHead } from './CTableHead'
7
+ import { CTableHeaderCell } from './CTableHeaderCell'
8
+ import { CTableRow } from './CTableRow'
9
+
10
+ export {
11
+ CTable,
12
+ CTableBody,
13
+ CTableCaption,
14
+ CTableDataCell,
15
+ CTableFoot,
16
+ CTableHead,
17
+ CTableHeaderCell,
18
+ CTableRow,
19
+ }
@@ -1,8 +1,9 @@
1
- import React, { HTMLAttributes, forwardRef } from 'react'
1
+ import React, { HTMLAttributes, forwardRef, useRef } from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import classNames from 'classnames'
4
4
  import { Transition } from 'react-transition-group'
5
5
 
6
+ import { useForkedRef } from '../../utils/hooks'
6
7
  export interface CTabPaneProps extends HTMLAttributes<HTMLDivElement> {
7
8
  /**
8
9
  * A string of all className you want applied to the base component.
@@ -24,6 +25,9 @@ export interface CTabPaneProps extends HTMLAttributes<HTMLDivElement> {
24
25
 
25
26
  export const CTabPane = forwardRef<HTMLDivElement, CTabPaneProps>(
26
27
  ({ children, className, onHide, onShow, visible, ...rest }, ref) => {
28
+ const tabPaneRef = useRef()
29
+ const forkedRef = useForkedRef(ref, tabPaneRef)
30
+
27
31
  const getTransitionClass = (state: string) => {
28
32
  return state === 'entered' && 'show'
29
33
  }
@@ -37,11 +41,11 @@ export const CTabPane = forwardRef<HTMLDivElement, CTabPaneProps>(
37
41
  className,
38
42
  )
39
43
  return (
40
- <Transition in={visible} onEnter={onShow} onExit={onHide} timeout={150}>
44
+ <Transition in={visible} nodeRef={tabPaneRef} onEnter={onShow} onExit={onHide} timeout={150}>
41
45
  {(state) => {
42
46
  const transitionClass = getTransitionClass(state)
43
47
  return (
44
- <div className={classNames(_className, transitionClass)} {...rest} ref={ref}>
48
+ <div className={classNames(_className, transitionClass)} {...rest} ref={forkedRef}>
45
49
  {children}
46
50
  </div>
47
51
  )
@@ -0,0 +1,4 @@
1
+ import { CTabContent } from './CTabContent'
2
+ import { CTabPane } from './CTabPane'
3
+
4
+ export { CTabContent, CTabPane }
@@ -12,6 +12,8 @@ import classNames from 'classnames'
12
12
 
13
13
  import { Colors, colorPropType } from '../Types'
14
14
 
15
+ import { useForkedRef } from '../../utils/hooks'
16
+
15
17
  export interface CToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
16
18
  /**
17
19
  * Apply a CSS fade transition to the toast.
@@ -82,6 +84,8 @@ export const CToast = forwardRef<HTMLDivElement, CToastProps>(
82
84
  },
83
85
  ref,
84
86
  ) => {
87
+ const toastRef = useRef()
88
+ const forkedRef = useForkedRef(ref, toastRef)
85
89
  const [_visible, setVisible] = useState(false)
86
90
  const timeout = useRef<number>()
87
91
 
@@ -133,6 +137,7 @@ export const CToast = forwardRef<HTMLDivElement, CToastProps>(
133
137
  return (
134
138
  <Transition
135
139
  in={_visible}
140
+ nodeRef={toastRef}
136
141
  onEnter={() => onShow && onShow(index ? index : null)}
137
142
  onExited={() => onClose && onClose(index ? index : null)}
138
143
  timeout={250}
@@ -151,7 +156,7 @@ export const CToast = forwardRef<HTMLDivElement, CToastProps>(
151
156
  onMouseLeave={() => _autohide}
152
157
  {...rest}
153
158
  key={key}
154
- ref={ref}
159
+ ref={forkedRef}
155
160
  >
156
161
  {children}
157
162
  </div>
@@ -0,0 +1,7 @@
1
+ import { CToast } from './CToast'
2
+ import { CToastBody } from './CToastBody'
3
+ import { CToastClose } from './CToastClose'
4
+ import { CToastHeader } from './CToastHeader'
5
+ import { CToaster } from './CToaster'
6
+
7
+ export { CToast, CToastBody, CToastClose, CToastHeader, CToaster }