@anoki/fse-ui
Version:
FSE UI components library
129 lines (128 loc) • 3.86 kB
JavaScript
import { j as e } from "./index.es237.js";
import { Section as d, SectionHeading as h } from "./index.es123.js";
import { clsx as v } from "./index.es238.js";
import { l as t } from "./index.es241.js";
import { useMemo as f } from "react";
import { RichText as g } from "./index.es143.js";
import './sections/Services/Services.css';/* empty css */
import { Col as j } from "./index.es61.js";
import { ArrowLink as w } from "./index.es25.js";
import { CardCategory as F } from "./index.es36.js";
const o = {
LayoutOne: "LayoutOne",
LayoutTwo: "LayoutTwo",
LayoutThree: "LayoutThree",
LayoutFour: "LayoutFour",
LayoutFive: "LayoutFive"
}, _ = ({
title: i,
description: p,
goToLabel: l,
href: y,
asLink: L = "a",
items: a,
layout: n = o.LayoutOne,
className: m
}) => {
const x = ((r) => {
switch (r) {
case o.LayoutOne:
return "ui-service-items-layout-one";
case o.LayoutTwo:
return "ui-service-items-layout-two";
case o.LayoutThree:
return "ui-service-items-layout-three";
case o.LayoutFour:
return "ui-service-items-layout-four";
case o.LayoutFive:
return "ui-service-items-layout-five";
default:
return "";
}
})(n), u = f(() => {
switch (n) {
/**
* In this layout, we remove the image from all items.
*/
case o.LayoutOne:
return a.map((r) => ({
...t.omit(r, ["image"])
}));
/**
* In this layout, we remove the image from all items except the second one.
*/
case o.LayoutTwo:
return a.map((r, s) => {
const c = s !== 1;
return {
...t.omit(r, c ? ["image"] : [])
};
});
/**
* In this layout, we remove the image from all items.
*/
case o.LayoutThree:
return a.map((r) => ({
...t.omit(r, ["image"])
}));
/**
* In this layout, we remove the image from all items.
*/
case o.LayoutFour:
return a.map((r, s) => {
const c = s !== 0;
return {
...t.omit(r, c ? ["image"] : [])
};
});
case o.LayoutFive:
return a.map((r) => ({
...t.omit(r, ["image"])
}));
default:
return a;
}
}, [a, n]);
return /* @__PURE__ */ e.jsxs(d, { className: v("base-col ui-service-items-section", m), children: [
/* @__PURE__ */ e.jsx(j, { className: "ui-service-items-sectirron-content", children: /* @__PURE__ */ e.jsx(
h,
{
fs: "2",
mdFs: "2",
className: "ui-service-items-section-title",
titleMarginBottom: "mb-x0",
descriptionMarginBottom: "mb-x0",
color: "slate-20",
title: i,
description: /* @__PURE__ */ e.jsx(g, { description: p }),
children: l && y && /* @__PURE__ */ e.jsx(w, { href: y, asLink: L, fs: "7", children: l.toUpperCase() })
}
) }),
/* @__PURE__ */ e.jsx(
"ul",
{
role: "list",
"aria-label": `Lista di ${i}`,
className: `list-style-none ${x}`,
children: u == null ? void 0 : u.map((r, s) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
F,
{
title: r == null ? void 0 : r.name,
description: r == null ? void 0 : r.description,
image: r == null ? void 0 : r.image,
href: (r == null ? void 0 : r.link) || (r == null ? void 0 : r.externalLink),
showIcon: r == null ? void 0 : r.externalLink,
asLink: L,
isExternal: r == null ? void 0 : r.externalLink
},
[r._id, s].join("-")
) }, [r._id, s].join("-")))
}
)
] });
};
export {
o as SERVICES_LAYOUTS,
_ as Services
};
//# sourceMappingURL=index.es144.js.map