UNPKG

@anoki/fse-ui

Version:

FSE UI components library

98 lines (97 loc) 2.75 kB
import { j as t } from "./index.es237.js"; import { clsx as N } from "./index.es239.js"; import u, { useMemo as B } from "react"; import { InfoPopup as f } from "./index.es103.js"; import "./index.es294.js"; import { Favourite as n } from "./index.es198.js"; import { Row as i } from "./index.es116.js"; const S = ({ iconColor: m, icon: c = /* @__PURE__ */ t.jsx(n, { color: m }), noIcon: l = !1, textLabel: w = "Default text", handleAction: h = () => { }, handleIconAction: k = () => { }, classNameComponent: L = "fs-7", classNameText: O = "", disablePointer: x = !1, iconPosition: s = "left", popupInfo: e, positionPopUp: C = "right", justifyContent: R = "center", alignItems: b = "center", children: d = void 0 }) => { const j = (r) => { !x && k && (r.stopPropagation(), e && g(!a), k()); }, [a, g] = u.useState(!1), v = B(() => c || /* @__PURE__ */ t.jsx(n, { color: m }), [m, c]); return /* @__PURE__ */ t.jsxs( i, { justifyContent: R, alignItems: b, gap: "x8", className: N( "position-relative", x ? "text-muted" : "cursor-pointer text-primary", L ), onClick: () => h && !x && h(), children: [ !l && (s === "left" || s == null) && !e ? /* @__PURE__ */ t.jsx(i, { alignItems: "center", onClick: (r) => j(r), children: v }) : e && !l && (s === "left" || s == null) && /* @__PURE__ */ t.jsx( f, { title: e.title, description: e.description, isOpen: a, positionPopUp: C, onClickCloseBtn: () => g(!a), className: e.className, ariaLabel: e.ariaLabel, width: e.width, children: e.children } ), /* @__PURE__ */ t.jsx("p", { className: N("fw-bold", O), children: w }), !l && s === "right" && !e ? /* @__PURE__ */ t.jsxs( i, { gap: "x24", alignItems: "center", onClick: (r) => j(r), children: [ d, c ] } ) : e && !l && s === "right" && /* @__PURE__ */ t.jsx( f, { title: e.title, description: e.description, isOpen: a, positionPopUp: C, onClickCloseBtn: () => g(!a), className: e.className, ariaLabel: e.ariaLabel } ), l && d && /* @__PURE__ */ t.jsx( i, { gap: "x24", alignItems: "center", onClick: (r) => j(r), children: d } ) ] } ); }; export { S as ActionIconText }; //# sourceMappingURL=index.es18.js.map