@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
21 lines • 2.27 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardImageStandAlone = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = __importDefault(require("react"));
const link_1 = require("../../components/link/link");
const position_1 = require("../../components/link/types/position");
const text_1 = require("../../components/text/text");
const component_1 = require("../../components/text/types/component");
const role_1 = require("../../types/role/role");
const cardImage_styled_1 = require("./cardImage.styled");
const CardImageStandAloneComponent = ({ ...props }, ref) => {
return ((0, jsx_runtime_1.jsxs)(cardImage_styled_1.CardImageStyled, { ref: ref, as: props.as, styles: props.styles, tabIndex: 0, onClick: props.onClick, children: [(0, jsx_runtime_1.jsx)(cardImage_styled_1.CardImageImageStyled
// avoid aria-label empty string
, { "aria-label": props.imageAltText ? props.imageAltText : undefined, image: props.image[props.device], role: props.imageAltText ? role_1.ROLES.IMG : undefined, styles: props.styles }), (0, jsx_runtime_1.jsxs)(cardImage_styled_1.CardImageContentStyled, { styles: props.styles, children: [(0, jsx_runtime_1.jsxs)(cardImage_styled_1.CardImageTesxtContainerStyled, { styles: props.styles, children: [(0, jsx_runtime_1.jsx)(cardImage_styled_1.CardImageTitleStyled, { as: text_1.Text, component: component_1.TextComponentType.H3, customTypography: props.styles.title, ...props.title, children: props.title.content }), (0, jsx_runtime_1.jsx)(cardImage_styled_1.CardImageSubTitleStyled, { as: text_1.Text, customTypography: props.styles.description, ...props.description, children: props.description?.content })] }), props.link && ((0, jsx_runtime_1.jsx)(cardImage_styled_1.CardImageLinkStyled, { styles: props.styles, children: (0, jsx_runtime_1.jsx)(link_1.Link, { iconPosition: position_1.LinkPositionType.RIGHT, ...props.link, children: props.link.content }) }))] })] }));
};
exports.CardImageStandAlone = react_1.default.forwardRef(CardImageStandAloneComponent);
//# sourceMappingURL=cardImageStandAlone.js.map