@teamsparta/stack-custom-modal
Version:
stack custom modal
63 lines (59 loc) • 1.4 kB
JavaScript
"use client";
import {
CustomModalCloseButton
} from "./chunk-MW7IZDLW.mjs";
import {
useCustomModal
} from "./chunk-VHPHVMAP.mjs";
import {
headerCss,
headerHasScrollCss
} from "./chunk-YJGPPUJG.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",
align = "start",
justify = "start",
padding = "32px 32px 16px 32px"
} = _b, restProps = __objRest(_b, [
"children",
"direction",
"align",
"justify",
"padding"
]);
const { hasScroll, hideCloseButton } = useCustomModal("CustomModalHeader");
return /* @__PURE__ */ jsxs(
Flex,
__spreadProps(__spreadValues({
ref,
as: "header",
direction,
padding,
css: [headerCss, hasScroll && headerHasScrollCss],
align,
justify
}, restProps), {
children: [
children,
!hideCloseButton && /* @__PURE__ */ jsx(CustomModalCloseButton, {})
]
})
);
}
);
CustomModalHeader.displayName = "CustomModalHeader";
export {
CustomModalHeader
};