@anoki/fse-ui
Version:
FSE UI components library
64 lines (63 loc) • 1.94 kB
JavaScript
import { j as r } from "./index.es278.js";
import { Button as l } from "./index.es36.js";
import { Attachment as o } from "./index.es24.js";
import { ArrowLink as t } from "./index.es21.js";
const d = (a) => ({
/**
* Renders a link component with optional action handler
*/
link: ({ text: s, href: i, handleAction: e }) => e ? /* @__PURE__ */ r.jsx(t, { asButton: !0, onClick: e, children: s }) : /* @__PURE__ */ r.jsx(t, { asLink: a, href: i ?? "", children: s }),
/**
* Renders a basic button component
*/
button: ({ text: s, icon: i, handleAction: e }) => /* @__PURE__ */ r.jsxs(l, { size: "2", className: "w-full ", onClick: e, children: [
i && /* @__PURE__ */ r.jsx(o, { className: "mr-x8" }),
/* @__PURE__ */ r.jsx("p", { className: "fs-6 fw-bold", children: s })
] }),
/**
* Renders an outline button with optional icon and action handler
*/
outlineButton: ({ text: s, icon: i, handleAction: e }) => /* @__PURE__ */ r.jsxs(
l,
{
size: "2",
textColor: "primary",
className: "w-full bg-inherit",
border: "primary",
onClick: e,
children: [
i && /* @__PURE__ */ r.jsx(o, { className: "mr-x8" }),
/* @__PURE__ */ r.jsx("p", { className: "fs-6 fw-bold", children: s })
]
}
),
/**
* Renders an outline button that acts as a link
*/
outlineButtonHref: ({
text: s,
href: i,
icon: e,
target: n,
isExternal: m
}) => /* @__PURE__ */ r.jsxs(
l,
{
size: "2",
textColor: "primary",
className: "w-full bg-inherit",
border: "primary",
asLink: "a",
target: n ?? (m ? "_blank" : void 0),
href: i ?? "",
children: [
e && /* @__PURE__ */ r.jsx(o, { className: "mr-x8" }),
/* @__PURE__ */ r.jsx("p", { className: "fs-6 fw-bold", children: s })
]
}
)
});
export {
d as CTA_COMPONENTS
};
//# sourceMappingURL=index.es494.js.map