@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.
73 lines (72 loc) • 2.92 kB
JavaScript
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] = "7ce8f842-e809-4f3e-9dca-0a49b045ec40", e._sentryDebugIdIdentifier = "sentry-dbid-7ce8f842-e809-4f3e-9dca-0a49b045ec40");
} catch (e) {}
import { i as Typography, r as useTranslation } from "./translation-BYvhW5zA.js";
import { k as Header } from "./resolveEnvironment-DNmu53Rr.js";
import { n as IconButton } from "./Button-i8I2dHP8.js";
import { t as StackLayout } from "./StackLayout-IUdNMDgW.js";
import { i as useAnalyticsContext } from "./Modal-BLP2aF-u.js";
import { t as List } from "./List-ywoRPg-q.js";
import { t as StructuredList } from "./StructuredList-CUyo9-3i.js";
import { t as trackNavigation } from "./trackNavigation-DR70qR8T.js";
import { jsx, jsxs } from "preact/jsx-runtime";
import { defineSlots } from "named-slots";
var SummarySection_module_default = {
"summary-header": "_summary-header_jps0f_1",
summaryHeader: "_summary-header_jps0f_1"
};
//#endregion
//#region src/components/Shared/SummarySection/SummarySection.tsx
var SummarySection = ({ formId, label, items, action }) => /* @__PURE__ */ jsxs(List, {
variant: "grouped-secondary",
children: [/* @__PURE__ */ jsxs("header", {
className: SummarySection_module_default.summaryHeader,
children: [/* @__PURE__ */ jsx(Typography, {
el: "h2",
variant: "title",
children: label
}), action]
}), /* @__PURE__ */ jsx(StructuredList, { items: items ?? [] })]
}, formId);
//#endregion
//#region src/components/Shared/NewSummary/NewSummary.tsx
var NewSummary = ({ children, handleEditForm, sections }) => {
const { t } = useTranslation("common");
const { Slot } = defineSlots(children, ["errorPanel", "extraContent"]);
const userEvents = useAnalyticsContext();
return /* @__PURE__ */ jsxs("div", {
role: "region",
children: [/* @__PURE__ */ jsx(Header, {
title: t(($) => $["summary"]),
description: t(($) => $["summaryDescription"])
}), /* @__PURE__ */ jsxs(StackLayout, { children: [
/* @__PURE__ */ jsx(Slot, { name: "errorPanel" }),
sections.map(({ formId, label, items }) => {
if (formId === "summary") return;
return /* @__PURE__ */ jsx(SummarySection, {
formId,
label,
items,
action: /* @__PURE__ */ jsx(IconButton, {
variant: "tertiary",
icon: "edit",
onClick: () => {
trackNavigation({
userEvents,
actionType: "edit",
toForm: label,
label: "Pencil icon"
});
handleEditForm(formId);
},
ariaLabel: t(($) => $["editForm"], { formName: label })
})
}, formId);
}),
/* @__PURE__ */ jsx(Slot, { name: "extraContent" })
] })]
});
};
//#endregion
export { SummarySection as n, NewSummary as t };