UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

30 lines (29 loc) 1.42 kB
import { jsx as d } from "../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js"; import n from "classnames"; import o from "../Typography/Typography.js"; import S from "../../../core/Context/useCoreContext.js"; import { TypographyVariant as _, TypographyElement as e } from "../Typography/types.js"; /* empty css */ import { Divider as T } from "../Divider/Divider.js"; const $ = "adyen-pe-header", P = ({ baseClassName: m = $, children: a, hasDivider: v, hideTitle: y, titleKey: c, subtitleKey: p, subtitleConfig: r }) => { const { i18n: h } = S(); return /* @__PURE__ */ d("header", { className: m, children: [ /* @__PURE__ */ d("div", { className: `${m}__headings`, children: [ !y && c && /* @__PURE__ */ d("div", { className: `${m}__title`, children: /* @__PURE__ */ d(o, { el: e.SPAN, variant: _.TITLE, medium: !0, children: h.get(c) }) }), p && /* @__PURE__ */ d("div", { className: n(`${m}__subtitle`, r == null ? void 0 : r.classNames), children: /* @__PURE__ */ d( o, { el: (r == null ? void 0 : r.typographyEl) ?? e.SPAN, variant: (r == null ? void 0 : r.variant) ?? _.BODY, children: h.get(p) } ) }), v && /* @__PURE__ */ d(T, { className: `${m}__divider` }) ] }), a && /* @__PURE__ */ d("div", { className: `${m}__controls`, children: a }) ] }); }; export { $ as BASE_CLASS, P as Header };