@anoki/fse-ui
Version:
FSE UI components library
105 lines (104 loc) • 3.22 kB
JavaScript
import { j as i } from "./index.es237.js";
import './components/ui/TitleSection/TitleSection.css';/* empty css */
import { clsx as c } from "./index.es239.js";
import { useState as d } from "react";
import { MoreActions as j } from "./index.es216.js";
import { ActionsPopup as h } from "./index.es20.js";
import { Row as n } from "./index.es116.js";
const y = ({
action1: a,
action2: t,
mainButton: l,
secondaryButton: s,
titleSection: m,
classNameTitle: p,
titleTag: x = "h1"
}) => {
const [o, r] = d(!1), e = [a, t].filter(Boolean);
return /* @__PURE__ */ i.jsxs("div", { children: [
/* @__PURE__ */ i.jsxs("div", { className: c("ui-title-section-container"), children: [
/* @__PURE__ */ i.jsxs("div", { className: "ui-title-row", children: [
/* @__PURE__ */ i.jsx(
x,
{
className: c(
p,
"py-x8 md-py-x16 fs-4 md-fs-2 fw-bold text-slate-28"
),
children: m
}
),
e.length === 2 && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsx(
"div",
{
onClick: () => r(!o),
className: "ui-mobile-actions",
children: /* @__PURE__ */ i.jsx(
j,
{
className: "cursor-pointer",
"aria-label": "Altre opzioni"
}
)
}
),
/* @__PURE__ */ i.jsx(
h,
{
isOpen: o,
onClickCloseBtn: () => r(!1),
actions: e,
className: "ui-mobile-actionspopup",
children: s && /* @__PURE__ */ i.jsx("div", { className: "ui-actions-popup-buttons", children: s })
}
)
] })
] }),
e.length === 1 && /* @__PURE__ */ i.jsx("div", { className: "ui-mobile-single-action", children: e[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: [
a,
t && /* @__PURE__ */ i.jsx("span", { className: "ui-divider-title-section" }),
t,
s && /* @__PURE__ */ i.jsx(
n,
{
as: "li",
text: "primary",
justifyContent: "center",
alignItems: "center",
gap: "x8",
children: s
}
),
l && /* @__PURE__ */ i.jsx(
n,
{
as: "li",
text: "primary",
justifyContent: "center",
alignItems: "center",
gap: "x8",
children: l
}
)
]
}
) })
] }),
/* @__PURE__ */ i.jsx("div", { className: "ui-mobile-main-button", children: l })
] });
};
export {
y as TitleSection
};
//# sourceMappingURL=index.es136.js.map