UNPKG

@teamsparta/stack-custom-modal

Version:
46 lines (42 loc) 1.14 kB
"use client"; import { CustomModalCloseButton } from "./chunk-B6YGOVPG.mjs"; import { useCustomModal } from "./chunk-VHPHVMAP.mjs"; import { headerCss, headerHasScrollCss } from "./chunk-IEPAP3BO.mjs"; import { __objRest, __spreadProps, __spreadValues } from "./chunk-FUJQIYOF.mjs"; // src/compounds/CustomModalHeader.tsx import { Flex } from "@teamsparta/stack-flex"; import { forwardRef } from "react"; import { jsx, jsxs } from "@emotion/react/jsx-runtime"; var CustomModalHeader = forwardRef((_a, ref) => { var _b = _a, { children, direction = "column" } = _b, restProps = __objRest(_b, ["children", "direction"]); const { hasScroll, hideCloseButton } = useCustomModal("CustomModalHeader"); return /* @__PURE__ */ jsxs( Flex, __spreadProps(__spreadValues({ ref, as: "header", direction, css: [headerCss, hasScroll && headerHasScrollCss] }, restProps), { children: [ children, !hideCloseButton && /* @__PURE__ */ jsx(CustomModalCloseButton, {}) ] }) ); }); CustomModalHeader.displayName = "CustomModalHeader"; export { CustomModalHeader };