@payfit/unity-components
Version:
44 lines (43 loc) • 1.37 kB
JavaScript
import { Text as e } from "../../text/Text.js";
import { useCarousel as t } from "../Carousel.context.js";
import { CarouselNav as n } from "./CarouselNav.js";
import { forwardRef as r } from "react";
import { uyTv as i } from "@payfit/unity-themes";
import { jsx as a, jsxs as o } from "react/jsx-runtime";
import { useIntl as s } from "react-intl";
//#region src/components/carousel/parts/CarouselHeader.tsx
var c = i({ slots: {
root: "uy:flex uy:items-center uy:justify-between",
title: "uy:flex-1",
slot: "uy:shrink-0",
nav: "uy:hidden uy:md:flex"
} }), l = r(({ title: r, actionSlot: i, className: l }, u) => {
let { a11yIds: d } = t(), f = s(), { root: p, title: m, slot: h, nav: g } = c();
return /* @__PURE__ */ o("header", {
ref: u,
className: p({ class: l }),
children: [
/* @__PURE__ */ a(e, {
id: d.title,
"data-dd-privacy": "allow",
variant: "h3",
color: "content.neutral",
className: m(),
children: r
}),
i && /* @__PURE__ */ a("div", {
role: "group",
"aria-label": f.formatMessage({
id: "unity:component:carousel:header:actions:label",
defaultMessage: "{title} actions"
}, { title: r }),
className: h(),
children: i
}),
/* @__PURE__ */ a(n, { className: g() })
]
});
});
l.displayName = "CarouselHeader";
//#endregion
export { l as CarouselHeader, c as carouselHeader };