UNPKG

@prokodo/ui

Version:

UI components for production-grade Next.js + Headless CMS (Strapi, Contentful, Headless WordPress) websites by prokodo – built for Core Web Vitals & SEO.

98 lines (97 loc) 3.33 kB
var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); import { jsxs, jsx } from "react/jsx-runtime"; import { create } from "../../helpers/bem.js"; import { isString } from "../../helpers/validations.js"; import styles from "./Quote.module.scss.js"; import { Headline } from "../headline/Headline.js"; import { Card } from "../card/Card.js"; import { RichText } from "../rich-text/RichText.js"; import { Avatar } from "../avatar/Avatar.js"; const bem = create(styles, "Quote"); const Quote = /* @__PURE__ */ __name(({ className, variant = "primary", title, subTitle, content, author }) => /* @__PURE__ */ jsxs( "figure", { itemScope: true, className: bem(void 0, void 0, className), itemType: "https://schema.org/Quotation", children: [ subTitle && /* @__PURE__ */ jsx( Headline, { highlight: true, className: bem("sub_headline", void 0, subTitle == null ? void 0 : subTitle.className), size: "sm", type: "h3", ...subTitle, variant: subTitle.variant ?? variant, children: subTitle == null ? void 0 : subTitle.content } ), title && /* @__PURE__ */ jsx( Headline, { className: bem("headline", void 0, title == null ? void 0 : title.className), size: "lg", type: "h2", ...title, children: title.content } ), /* @__PURE__ */ jsxs( Card, { animated: true, highlight: true, className: bem("card__container"), contentClassName: bem("card"), customAnimation: "left-right", variant: "white", children: [ /* @__PURE__ */ jsx("blockquote", { className: bem("quote"), children: /* @__PURE__ */ jsx(RichText, { className: bem("quote__content"), itemProp: "text", children: content }) }), author && /* @__PURE__ */ jsx("figcaption", { children: /* @__PURE__ */ jsxs( "div", { itemScope: true, className: bem("caption"), itemType: "https://schema.org/Person", children: [ (author == null ? void 0 : author.avatar) && /* @__PURE__ */ jsx( Avatar, { className: bem("caption__avatar"), ...author.avatar, variant } ), /* @__PURE__ */ jsxs("div", { className: bem("caption__author"), children: [ /* @__PURE__ */ jsx("span", { className: bem("caption__author__name"), itemProp: "name", children: author.name }), isString(author == null ? void 0 : author.position) && /* @__PURE__ */ jsx( "span", { className: bem("caption__author__position"), itemProp: "jobTitle", children: author.position } ) ] }) ] } ) }) ] } ) ] } ), "Quote"); Quote.displayName = "Quote"; export { Quote };