UNPKG

@adyen/kyc-components

Version:

This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.

94 lines (93 loc) 4.08 kB
try { let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack; n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7108c73f-cf73-434a-a263-a4e9c4432b7f", e._sentryDebugIdIdentifier = "sentry-dbid-7108c73f-cf73-434a-a263-a4e9c4432b7f"); } catch (e) {} import { t as StackLayout } from "./StackLayout-Bhbj68nx.js"; import { t as TaskVerificationStatus } from "./TaskVerificationStatus-kCWYhocq.js"; import cx from "classnames"; import { jsx, jsxs } from "preact/jsx-runtime"; import { defineSlots } from "named-slots"; var Header_module_default = { header: "adyen-kyc-header", "header-margin": "adyen-kyc-header-margin", headerMargin: "adyen-kyc-header-margin", "header-margin-secondary": "adyen-kyc-header-margin-secondary", headerMarginSecondary: "adyen-kyc-header-margin-secondary", "header-left": "adyen-kyc-header-left", headerLeft: "adyen-kyc-header-left", "header-center": "adyen-kyc-header-center", headerCenter: "adyen-kyc-header-center", "header-right": "adyen-kyc-header-right", headerRight: "adyen-kyc-header-right", "header-content": "adyen-kyc-header-content", headerContent: "adyen-kyc-header-content", "header-actions": "adyen-kyc-header-actions", headerActions: "adyen-kyc-header-actions", "header-title": "adyen-kyc-header-title", headerTitle: "adyen-kyc-header-title", "header-title-primary": "adyen-kyc-header-title-primary", headerTitlePrimary: "adyen-kyc-header-title-primary", "header-title-secondary": "adyen-kyc-header-title-secondary", headerTitleSecondary: "adyen-kyc-header-title-secondary", "header-description": "adyen-kyc-header-description", headerDescription: "adyen-kyc-header-description", "header-description-primary": "adyen-kyc-header-description-primary", headerDescriptionPrimary: "adyen-kyc-header-description-primary", "header-description-secondary": "adyen-kyc-header-description-secondary", headerDescriptionSecondary: "adyen-kyc-header-description-secondary" }; //#endregion //#region src/components/ui/atoms/Header/Header.tsx var alignmentStyles = { left: Header_module_default.headerLeft, center: Header_module_default.headerCenter, right: Header_module_default.headerRight }; var Header = ({ align = "left", children, description, secondary = false, status, title }) => { const { Slot, hasSlot } = defineSlots(children ?? [], ["actions", "description"]); const HeadingElement = secondary ? "h2" : "h1"; const rootClassname = cx(Header_module_default.header, alignmentStyles[align], { [Header_module_default.headerMargin]: !secondary, [Header_module_default.headerMarginSecondary]: secondary }); const titleClassname = cx(Header_module_default.headerTitle, { [Header_module_default.headerTitlePrimary]: !secondary, [Header_module_default.headerTitleSecondary]: secondary }); const descriptionClassname = cx(Header_module_default.headerDescription, { [Header_module_default.headerDescriptionPrimary]: !secondary, [Header_module_default.headerDescriptionSecondary]: secondary }); return /* @__PURE__ */ jsxs("header", { className: rootClassname, children: [ status && /* @__PURE__ */ jsx(TaskVerificationStatus, { status, responsive: false }), /* @__PURE__ */ jsxs("div", { className: Header_module_default.headerContent, children: [/* @__PURE__ */ jsx(HeadingElement, { className: titleClassname, children: title }), (hasSlot("description") || description) && /* @__PURE__ */ jsx("div", { className: descriptionClassname, children: /* @__PURE__ */ jsx(Slot, { name: "description", children: description }) })] }), hasSlot("actions") && /* @__PURE__ */ jsx("div", { className: Header_module_default.headerActions, children: /* @__PURE__ */ jsx(StackLayout, { gap: "small", horizontal: true, children: /* @__PURE__ */ jsx(Slot, { name: "actions" }) }) }) ] }); }; //#endregion export { Header as t };