@adyen/adyen-platform-experience-web
Version:

23 lines (22 loc) • 1.11 kB
JavaScript
import { jsx as A } from "../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
import C from "../Button/hooks/useButton.js";
import { DEFAULT_BUTTON_CLASSNAME as N, BUTTON_ANCHOR_CLASSNAME as B } from "../Button/constants.js";
import { ButtonVariant as h } from "../Button/types.js";
import { useMemo as t } from "../../../external/preact/hooks/dist/hooks.module.js";
import { fixedForwardRef as p } from "../../../utils/preact/fixedForwardRef.js";
import { parseClassName as T } from "../../../utils/preact/className.js";
import { parseBooleanProp as k } from "../../../utils/preact/props.js";
const M = (o, n) => {
const { variant: i = h.PRIMARY, disabled: a = !1, onClick: l, classNameModifiers: m = [], className: e } = o, c = t(() => T("", e) || "", [e]), f = t(() => k(a), [a]), { click: r, allChildren: u, allProps: s } = C(
c,
[...m, i],
`${N} ${B}`,
f,
o,
l
), d = t(() => ({ ...s, ...o.onClick && r ? { onClick: r } : {} }), [r, s, o.onClick]);
return /* @__PURE__ */ A("a", { ...d, href: o.href, ref: n, children: u });
}, U = p(M);
export {
U as default
};