@anoki/fse-ui
Version:
FSE UI components library
124 lines (123 loc) • 4.2 kB
JavaScript
import { j as i } from "./index.es278.js";
import './components/ui/TitleSection/TitleSection.css';/* empty css */
import { clsx as d } from "./index.es280.js";
import { useState as N } from "react";
import { ArrowLink as v } from "./index.es21.js";
import { MoreActions as b } from "./index.es194.js";
import { ActionsPopup as g } from "./index.es12.js";
import { Row as n } from "./index.es219.js";
const R = ({
action1: o,
action2: l,
mainButton: t,
secondaryButton: e,
titleSection: x,
subtitle: r,
classNameTitle: j,
borderBottom: h = !0,
titleTag: u = "h1",
gotoLinkHref: a,
gotoLinkLabel: c,
gotoLinkAsLink: f = "a"
}) => {
const [m, p] = N(!1), s = [o, l].filter(Boolean);
return console.log("popupActions", s), /* @__PURE__ */ i.jsxs("div", { children: [
/* @__PURE__ */ i.jsxs(
"div",
{
className: d(
"ui-title-section-container",
h ? "" : "no-border-bottom"
),
children: [
/* @__PURE__ */ i.jsxs("div", { className: "ui-title-row", children: [
/* @__PURE__ */ i.jsxs("div", { className: "ui-title-container", children: [
/* @__PURE__ */ i.jsx(
u,
{
className: d(
j,
"py-x8 md-py-x16 fs-4 md-fs-2 fw-bold text-slate-28"
),
children: x
}
),
r && /* @__PURE__ */ i.jsx("div", { children: r })
] }),
a && c && /* @__PURE__ */ i.jsx("div", { className: "ui-title-goto-link", children: /* @__PURE__ */ i.jsx(v, { href: a, asLink: f, fs: "7", children: c.toUpperCase() }) }),
s.length === 2 && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsx(
"div",
{
onClick: () => p(!m),
className: "ui-mobile-actions",
children: /* @__PURE__ */ i.jsx(
b,
{
className: "cursor-pointer",
"aria-label": "Altre opzioni"
}
)
}
),
/* @__PURE__ */ i.jsx(
g,
{
isOpen: m,
onClickCloseBtn: () => p(!1),
actions: s,
className: "ui-mobile-actionspopup",
children: e && /* @__PURE__ */ i.jsx("div", { className: "ui-actions-popup-buttons", children: e })
}
)
] })
] }),
s.length === 1 && /* @__PURE__ */ i.jsx("div", { className: "ui-mobile-single-action", children: s[0] }),
/* @__PURE__ */ i.jsx("nav", { className: "ui-desktop-actions", "aria-label": "Azioni principali", children: /* @__PURE__ */ i.jsxs(
n,
{
as: "ul",
gap: "x20",
fw: "semibold",
text: "primary",
fs: "8",
className: "list-style-none",
children: [
o,
l && /* @__PURE__ */ i.jsx("span", { className: "ui-divider-title-section" }),
l,
e && /* @__PURE__ */ i.jsx(
n,
{
as: "li",
text: "primary",
justifyContent: "center",
alignItems: "center",
gap: "x8",
children: e
}
),
t && /* @__PURE__ */ i.jsx(
n,
{
as: "li",
text: "primary",
justifyContent: "center",
alignItems: "center",
gap: "x8",
children: t
}
)
]
}
) })
]
}
),
/* @__PURE__ */ i.jsx("div", { className: "ui-mobile-main-button", children: t })
] });
};
export {
R as TitleSection
};
//# sourceMappingURL=index.es261.js.map