File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import React , { forwardRef , HTMLAttributes } from 'react'
2+ import PropTypes from 'prop-types'
3+ import classNames from 'classnames'
4+
5+ export interface CCardImageOverlayProps extends HTMLAttributes < HTMLDivElement > {
6+ /**
7+ * A string of all className you want applied to the base component. [docs]
8+ */
9+ className ?: string
10+ }
11+
12+ export const CCardImageOverlay = forwardRef < HTMLDivElement , CCardImageOverlayProps > (
13+ ( { children, className, ...rest } , ref ) => {
14+ const _className = classNames ( 'card-img-overlay' , className )
15+
16+ return (
17+ < div className = { _className } { ...rest } ref = { ref } >
18+ { children }
19+ </ div >
20+ )
21+ } ,
22+ )
23+
24+ CCardImageOverlay . propTypes = {
25+ children : PropTypes . node ,
26+ className : PropTypes . string ,
27+ }
28+
29+ CCardImageOverlay . displayName = 'CCardImageOverlay'
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import { CCardFooter } from './components/card/CCardFooter'
2222import { CCardGroup } from './components/card/CCardGroup'
2323import { CCardHeader } from './components/card/CCardHeader'
2424import { CCardImage } from './components/card/CCardImage'
25+ import { CCardImageOverlay } from './components/card/CCardImageOverlay'
2526import { CCardLink } from './components/card/CCardLink'
2627import { CCardSubtitle } from './components/card/CCardSubtitle'
2728import { CCardText } from './components/card/CCardText'
@@ -152,6 +153,7 @@ export {
152153 CCardFooter ,
153154 CCardHeader ,
154155 CCardImage ,
156+ CCardImageOverlay ,
155157 CCardLink ,
156158 CCardSubtitle ,
157159 CCardText ,
You can’t perform that action at this time.
0 commit comments