UNPKG

@anoki/fse-ui

Version:

FSE UI components library

93 lines (92 loc) 2.63 kB
import { j as t } from "./index.es244.js"; import { clsx as u } from "./index.es246.js"; import F, { useMemo as T } from "react"; import { InfoPopup as C } from "./index.es75.js"; import "./index.es365.js"; import { Favourite as N } from "./index.es185.js"; import { Row as m } from "./index.es9.js"; const z = ({ iconColor: c, icon: x = /* @__PURE__ */ t.jsx(N, { color: c }), noIcon: l = !1, textLabel: h = "Default text", handleAction: d = () => { }, handleIconAction: n = () => { }, classNameComponent: O = "fs-7", classNameText: R = "", disablePointer: i = !1, iconPosition: r = "left", popupInfo: e, positionPopUp: k = "right", justifyContent: v = "center", alignItems: w = "center", children: j = void 0 }) => { const g = (s) => { !i && n && (s.stopPropagation(), e && f(!a), n()); }, [a, f] = F.useState(!1), B = T(() => x || /* @__PURE__ */ t.jsx(N, { color: c }), [c, x]); return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs( m, { justifyContent: v, alignItems: w, gap: "x8", className: u( i ? "text-muted" : "cursor-pointer text-primary", O ), onClick: () => d && !i && d(), children: [ !l && (r === "left" || r == null) && !e ? /* @__PURE__ */ t.jsx(m, { alignItems: "center", onClick: (s) => g(s), children: B }) : e && !l && (r === "left" || r == null) && /* @__PURE__ */ t.jsx( C, { title: e.title, description: e.description, isOpen: a, positionPopUp: k, onClickCloseBtn: () => f(!a), className: e.className } ), /* @__PURE__ */ t.jsx("p", { className: u("fw-bold", R), children: h }), !l && r === "right" && !e ? /* @__PURE__ */ t.jsxs( m, { gap: "x24", alignItems: "center", onClick: (s) => g(s), children: [ j, x ] } ) : e && !l && r === "right" && /* @__PURE__ */ t.jsx( C, { title: e.title, description: e.description, isOpen: a, positionPopUp: k, onClickCloseBtn: () => f(!a), className: e.className } ), l && j && /* @__PURE__ */ t.jsx( m, { gap: "x24", alignItems: "center", onClick: (s) => g(s), children: j } ) ] } ) }); }; export { z as ActionIconText }; //# sourceMappingURL=index.es67.js.map