UNPKG

@anoki/fse-marche-ui

Version:

FSE UI components library

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