@payfit/unity-components
Version:
34 lines (33 loc) • 1.32 kB
JavaScript
import { ScrollArea as e } from "../../scroll-area/ScrollArea.js";
import { Children as t, forwardRef as n, isValidElement as r } from "react";
import { uyMerge as i } from "@payfit/unity-themes";
import { jsx as a } from "react/jsx-runtime";
//#region src/core/components/attachment/parts/AttachmentGroup.tsx
function o({ items: n, children: o, orientation: s = "horizontal", className: c, "aria-label": l }, u) {
let d = n && typeof o == "function" ? Array.from(n, (e) => /* @__PURE__ */ a("li", {
className: "uy:shrink-0 uy:snap-start",
children: o(e)
}, e.id)) : t.toArray(o).map((e, t) => /* @__PURE__ */ a("li", {
className: "uy:shrink-0 uy:snap-start",
children: e
}, r(e) ? e.key : t));
return /* @__PURE__ */ a(e, {
ref: u,
axis: s === "horizontal" ? "inline" : "block",
fade: "both",
className: i("uy:min-w-0", c),
viewportProps: {
role: "group",
"aria-label": l,
tabIndex: 0,
className: "uy:rounded-100 uy:focus-visible:outline-2 uy:focus-visible:outline-offset-[-2px] uy:focus-visible:outline-utility-focus-ring"
},
children: /* @__PURE__ */ a("ul", {
className: i("uy:flex uy:list-none uy:gap-100 uy:p-50", s === "horizontal" ? "uy:w-max uy:flex-row" : "uy:w-full uy:flex-col"),
children: d
})
});
}
var s = n(o);
//#endregion
export { s as AttachmentGroup };