UNPKG

@payfit/unity-components

Version:

35 lines (34 loc) 1.16 kB
import { RawLink as e } from "../../link/RawLink.js"; import { useFieldA11yContext as t } from "../TanstackFormField.context.js"; import { forwardRef as n } from "react"; import { useUnityTheme as r } from "@payfit/unity-themes"; import { jsx as i } from "react/jsx-runtime"; import { Button as a } from "react-aria-components/Button"; //#region src/components/form-field/parts/TanstackRawFormContextualLink.tsx var o = n((n, o) => { let { children: s, href: c, onPress: l, ...u } = n, d = t(), { theme: f } = r(), p = f === "rebrand" ? "primary" : "secondary"; return c ? /* @__PURE__ */ i(e, { id: d.contextualLinkId || n.id, size: "small", color: p, variant: "standalone", "data-unity-slot": "form-field-contextual-link", href: c, ref: o, "data-dd-privacy": "allow", ...u, children: s }) : /* @__PURE__ */ i(a, { id: d.contextualLinkId || n.id, onPress: l, "data-unity-slot": "contextual-link", className: "uy:typography-body-small uy:w-fit", ref: o, "data-dd-privacy": "allow", ...u, children: s }); }); o.displayName = "TanstackRawFormContextualLink"; //#endregion export { o as TanstackRawFormContextualLink };