UNPKG

@anoki/fse-ui

Version:

FSE UI components library

63 lines (62 loc) 1.88 kB
import { j as t } from "./index.es180.js"; import { clsx as u } from "./index.es182.js"; import N, { useMemo as R } from "react"; import { InfoPopup as O } from "./index.es66.js"; import "./index.es268.js"; import { Favourite as j } from "./index.es138.js"; import { Row as n } from "./index.es9.js"; const B = ({ iconColor: l, icon: m = /* @__PURE__ */ t.jsx(j, { color: l }), noIcon: a = !1, textLabel: g = "Default text", handleAction: o = () => { }, handleIconAction: x = () => { }, classNameComponent: d = "", classNameText: h = "", disablePointer: i = !1, iconPosition: c = "left", popupInfo: e, positionPopUp: k = "right" }) => { const f = (s) => { !i && x && (s.stopPropagation(), e && p(!r), x()); }, [r, p] = N.useState(!1), C = R(() => m || /* @__PURE__ */ t.jsx(j, { color: l }), [l, m]); return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [ /* @__PURE__ */ t.jsxs( n, { justifyContent: "center", alignItems: "center", gap: "x8", className: u( i ? "text-muted" : "cursor-pointer text-primary", d ), onClick: () => o && !i && o(), children: [ !a && (c === "left" || c == null) && /* @__PURE__ */ t.jsx(n, { alignItems: "center", onClick: (s) => f(s), children: C }), /* @__PURE__ */ t.jsx("p", { className: u(h, "fw-semibold fs-7"), children: g }), !a && c === "right" && /* @__PURE__ */ t.jsx(n, { alignItems: "center", onClick: (s) => f(s), children: m }) ] } ), r && e && /* @__PURE__ */ t.jsx( O, { title: e.title, description: e.description, isOpen: r, positionPopUp: k, onClickCloseBtn: () => p(!r), className: e.className } ) ] }); }; export { B as ActionIconText }; //# sourceMappingURL=index.es59.js.map