UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

15 lines 1.81 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import React from 'react'; import { Link } from '../../components/link/link'; import { LinkPositionType } from '../../components/link/types/position'; import { Text } from '../../components/text/text'; import { TextComponentType } from '../../components/text/types/component'; import { ROLES } from '../../types/role/role'; import { CardImageContentStyled, CardImageImageStyled, CardImageLinkStyled, CardImageStyled, CardImageSubTitleStyled, CardImageTesxtContainerStyled, CardImageTitleStyled, } from './cardImage.styled'; const CardImageStandAloneComponent = ({ ...props }, ref) => { return (_jsxs(CardImageStyled, { ref: ref, as: props.as, styles: props.styles, tabIndex: 0, onClick: props.onClick, children: [_jsx(CardImageImageStyled // avoid aria-label empty string , { "aria-label": props.imageAltText ? props.imageAltText : undefined, image: props.image[props.device], role: props.imageAltText ? ROLES.IMG : undefined, styles: props.styles }), _jsxs(CardImageContentStyled, { styles: props.styles, children: [_jsxs(CardImageTesxtContainerStyled, { styles: props.styles, children: [_jsx(CardImageTitleStyled, { as: Text, component: TextComponentType.H3, customTypography: props.styles.title, ...props.title, children: props.title.content }), _jsx(CardImageSubTitleStyled, { as: Text, customTypography: props.styles.description, ...props.description, children: props.description?.content })] }), props.link && (_jsx(CardImageLinkStyled, { styles: props.styles, children: _jsx(Link, { iconPosition: LinkPositionType.RIGHT, ...props.link, children: props.link.content }) }))] })] })); }; export const CardImageStandAlone = React.forwardRef(CardImageStandAloneComponent); //# sourceMappingURL=cardImageStandAlone.js.map