@payfit/unity-components
Version:
51 lines (50 loc) • 1.71 kB
JavaScript
import { CircularIconButton as e } from "../../icon-button/CircularIconButton.js";
import { forwardRef as t } from "react";
import { uyTv as n } from "@payfit/unity-themes";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { useTranslation as a } from "react-i18next";
import { Heading as o } from "react-aria-components/Heading";
//#region src/core/components/bottom-sheet/parts/BottomSheetHeader.tsx
var s = n({ slots: {
base: [
"uy:py-200 uy:px-300 uy:w-full",
"uy:flex uy:flex-col uy:shrink-0",
"uy:bg-surface-neutral uy:rounded-tl-200 uy:rounded-tr-200 uy:shadow-raising",
"uy:sticky uy:top-0 uy:z-10"
],
content: ["uy:flex uy:items-center uy:w-full"],
heading: ["uy:typography-h3 uy:text-center uy:text-content-neutral uy:truncate", "uy:flex-1 uy:min-w-0"],
buttonContainer: ["uy:flex-shrink-0 uy:flex-grow-0 uy:w-[28px]"]
} }), c = t(({ children: t, ...n }, c) => {
let { base: l, content: u, heading: d, buttonContainer: f } = s(), { t: p } = a("unity");
return /* @__PURE__ */ r("header", {
ref: c,
className: l(),
...n,
children: /* @__PURE__ */ i("div", {
className: u(),
children: [
/* @__PURE__ */ r("div", { className: f() }),
/* @__PURE__ */ r(o, {
slot: "title",
className: d(),
children: t
}),
/* @__PURE__ */ r("div", {
className: f(),
children: /* @__PURE__ */ r(e, {
asElement: "button",
slot: "close",
icon: "CloseOutlined",
title: p((e) => e.unity.component.common.close.label),
size: "large",
color: "content.neutral.low"
})
})
]
})
});
});
c.displayName = "BottomSheetHeader";
//#endregion
export { c as BottomSheetHeader, s as bottomSheetHeader };