UNPKG

@teamsparta/stack-custom-modal

Version:
790 lines (767 loc) 27 kB
"use client"; "use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/compounds/index.ts var compounds_exports = {}; __export(compounds_exports, { CustomModalBody: () => CustomModalBody, CustomModalButton: () => CustomModalButton, CustomModalButtonGroup: () => CustomModalButtonGroup, CustomModalCaption: () => CustomModalCaption, CustomModalClose: () => CustomModalClose, CustomModalCloseButton: () => CustomModalCloseButton, CustomModalContent: () => CustomModalContent, CustomModalDescription: () => CustomModalDescription, CustomModalFooter: () => CustomModalFooter, CustomModalHeader: () => CustomModalHeader, CustomModalOverlay: () => CustomModalOverlay, CustomModalRoot: () => CustomModalRoot, CustomModalSubTitle: () => CustomModalSubTitle, CustomModalTitle: () => CustomModalTitle, CustomModalTrigger: () => CustomModalTrigger }); module.exports = __toCommonJS(compounds_exports); // src/compounds/CustomModalBody.tsx var import_react3 = require("@teamsparta/react"); var import_stack_utils3 = require("@teamsparta/stack-utils"); var import_react4 = require("react"); // src/context.ts var import_stack_utils = require("@teamsparta/stack-utils"); var [CustomModalProvider, useCustomModal] = (0, import_stack_utils.createContext)("CustomModalRoot"); // src/style.ts var import_react = require("@emotion/react"); var import_stack_tokens = require("@teamsparta/stack-tokens"); var import_stack_utils2 = require("@teamsparta/stack-utils"); var import_stack_z_index = require("@teamsparta/stack-z-index"); var descriptionMarginVar = "--stack-modal-description-margin"; var contentMaxWidthVar = "--stack-modal-content-max-width"; var contentMaxHeightVar = "--stack-modal-content-max-height"; var contentMaxHeightDvhVar = "--stack-modal-content-max-height-dvh"; var contentHeightVar = "--stack-modal-content-height"; var contentHeightDvhVar = "--stack-modal-content-height-dvh"; var contentRadiusVar = "--stack-modal-content-radius"; var modalSizeVariants = { md: { [contentMaxWidthVar]: "460px", [contentMaxHeightVar]: "calc(100vh - 40px)", [contentMaxHeightDvhVar]: "calc(100dvh - 40px)", [contentHeightVar]: "auto", [contentHeightDvhVar]: "auto", [contentRadiusVar]: "16px", [descriptionMarginVar]: "4px 0 0 0" }, lg: { [contentMaxWidthVar]: "640px", [contentMaxHeightVar]: "calc(100vh - 40px)", [contentMaxHeightDvhVar]: "calc(100dvh - 40px)", [contentHeightVar]: "auto", [contentHeightDvhVar]: "auto", [contentRadiusVar]: "16px", [descriptionMarginVar]: "12px 0 0 0" }, xl: { [contentMaxWidthVar]: "1024px", [contentMaxHeightVar]: "100vh", [contentMaxHeightDvhVar]: "100dvh", [contentHeightVar]: "100vh", [contentHeightDvhVar]: "100dvh", [contentRadiusVar]: "0px", [descriptionMarginVar]: "12px 0 0 0" } }; var overlayCss = (0, import_react.css)({ backgroundColor: import_stack_tokens.vars.dimm.default, position: "fixed", inset: 0, zIndex: import_stack_z_index.zIndex.overlay }); var contentWrapperCss = (0, import_react.css)({ position: "fixed", transform: "translate(-50%, -50%)", top: "50%", left: "50%", zIndex: import_stack_z_index.zIndex.modal, "&:focus": { outline: "none" } }); var contentCss = (0, import_react.css)({ display: "flex", flexDirection: "column", maxWidth: (0, import_stack_utils2.getVar)(contentMaxWidthVar), width: "100vw", maxHeight: (0, import_stack_utils2.getVar)(contentMaxHeightVar), height: (0, import_stack_utils2.getVar)(contentHeightVar), backgroundColor: import_stack_tokens.vars.background.modal, boxShadow: import_stack_tokens.vars.shadow.elevation1, borderRadius: (0, import_stack_utils2.getVar)(contentRadiusVar), "@supports (height: 100dvh)": { maxHeight: (0, import_stack_utils2.getVar)(contentMaxHeightDvhVar), height: (0, import_stack_utils2.getVar)(contentHeightDvhVar) } }); var bodyCss = (0, import_react.css)({ padding: "0 32px", flex: 1 }); var headerCss = (0, import_react.css)({ position: "relative" }); var headerHasScrollCss = (0, import_react.css)({ padding: "32px 32px 24px 32px", borderBottom: `1px solid ${import_stack_tokens.vars.line.nonClickable}` }); var titleCss = (0, import_react.css)({ wordBreak: "keep-all", whiteSpace: "pre-wrap" }); var descriptionCss = (0, import_react.css)({ wordBreak: "keep-all", whiteSpace: "pre-wrap", margin: (0, import_stack_utils2.getVar)(descriptionMarginVar) }); var footerHasScrollCss = (0, import_react.css)({ padding: "24px 32px 32px 32px", borderTop: `1px solid ${import_stack_tokens.vars.line.nonClickable}` }); var captionCss = (0, import_react.css)({ width: "100%", marginTop: 16, wordBreak: "keep-all", whiteSpace: "pre-wrap" }); var scrollAreaRootCss = (0, import_react.css)({ height: "100%", width: "100%", overflow: "hidden", display: "flex", flexDirection: "column" }); var scrollAreaContentCss = (0, import_react.css)({ flex: 1, overflow: "auto" }); var scrollAreaScrollbarCss = (0, import_react.css)({ width: "12px", display: "flex", userSelect: "none", touchAction: "none", paddingInline: "4px", transition: "background-color 160ms ease-out" }); var scrollAreaThumbCss = (0, import_react.css)({ flex: 1, backgroundColor: import_stack_tokens.vars.neutral[30], borderRadius: "10px", position: "relative", transition: "background-color 160ms ease-out" }); var closeButtonCss = (0, import_react.css)({ position: "absolute", right: 32, top: 32, zIndex: 1, display: "inline-flex", alignItems: "center", justifyContent: "center", padding: 0, width: "28px", height: "28px", flexShrink: 0, borderRadius: "50%", backgroundColor: import_stack_tokens.vars.fill.subtle, border: "none", cursor: "pointer" }); var EASE_OUT_CUSTOM = [0.32, 0.72, 0, 1]; var overlayVariants = { initial: { opacity: 0 }, animate: { opacity: 1, transition: { duration: 0.3, ease: EASE_OUT_CUSTOM } }, exit: { opacity: 0, transition: { duration: 0.3, ease: EASE_OUT_CUSTOM } } }; var contentVariants = { initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1, transition: { duration: 0.3, ease: EASE_OUT_CUSTOM } }, exit: { scale: 0.9, opacity: 0, transition: { duration: 0.3, ease: EASE_OUT_CUSTOM } } }; // src/compounds/ScrollArea.tsx var RadixScrollArea = __toESM(require("@radix-ui/react-scroll-area")); var import_react2 = require("react"); var import_jsx_runtime = require("@emotion/react/jsx-runtime"); var ScrollArea = (0, import_react2.forwardRef)((_a, ref) => { var _b = _a, { children, scrollHideDelay = 100 } = _b, restProps = __objRest(_b, ["children", "scrollHideDelay"]); return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)( RadixScrollArea.Root, __spreadProps(__spreadValues({ ref, scrollHideDelay, css: scrollAreaRootCss }, restProps), { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadixScrollArea.Viewport, { css: scrollAreaContentCss, children }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)( RadixScrollArea.Scrollbar, { orientation: "vertical", css: scrollAreaScrollbarCss, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadixScrollArea.Thumb, { css: scrollAreaThumbCss }) } ) ] }) ); }); ScrollArea.displayName = "ScrollArea"; // src/compounds/CustomModalBody.tsx var import_jsx_runtime2 = require("@emotion/react/jsx-runtime"); var CustomModalBody = (0, import_react4.forwardRef)( (_a, ref) => { var _b = _a, { children } = _b, restProps = __objRest(_b, ["children"]); const { setHasScroll } = useCustomModal("CustomModalBody"); const scrollAreaRef = (0, import_react4.useRef)(null); const resizeObserverRef = (0, import_react3.useResizeObserver)({ onResize: ({ target }) => { var _a2, _b2; const { scrollHeight } = target; setHasScroll( scrollHeight > ((_b2 = (_a2 = scrollAreaRef == null ? void 0 : scrollAreaRef.current) == null ? void 0 : _a2.clientHeight) != null ? _b2 : 0) ); } }); const combinedRef = (0, import_stack_utils3.useComposedRefs)(ref, resizeObserverRef); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ScrollArea, { ref: scrollAreaRef, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", __spreadProps(__spreadValues({ ref: combinedRef, css: bodyCss }, restProps), { children })) }); } ); CustomModalBody.displayName = "CustomModalBody"; // src/compounds/CustomModalButton.tsx var import_stack_button = require("@teamsparta/stack-button"); var import_react5 = require("react"); var import_jsx_runtime3 = require("@emotion/react/jsx-runtime"); var CustomModalButton = (0, import_react5.forwardRef)( (_a, ref) => { var _b = _a, { children, variant = "solid", colorScheme = "primary", size = "md", fullWidth = true } = _b, restProps = __objRest(_b, [ "children", "variant", "colorScheme", "size", "fullWidth" ]); return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( import_stack_button.Button, __spreadProps(__spreadValues({ ref, variant, colorScheme, size, fullWidth }, restProps), { children }) ); } ); CustomModalButton.displayName = "CustomModalButton"; // src/compounds/CustomModalButtonGroup.tsx var import_stack_flex = require("@teamsparta/stack-flex"); var import_react6 = require("react"); var import_jsx_runtime4 = require("@emotion/react/jsx-runtime"); var CustomModalButtonGroup = (0, import_react6.forwardRef)( (_a, ref) => { var _b = _a, { children, gap = 8, direction = "row", align = "start", justify = "start", fullWidth = true } = _b, restProps = __objRest(_b, [ "children", "gap", "direction", "align", "justify", "fullWidth" ]); return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( import_stack_flex.Flex, __spreadProps(__spreadValues({ ref, gap, direction, fullWidth, align, justify }, restProps), { children }) ); } ); CustomModalButtonGroup.displayName = "CustomModalButtonGroup"; // src/compounds/CustomModalCaption.tsx var import_stack_text = require("@teamsparta/stack-text"); var import_stack_tokens2 = require("@teamsparta/stack-tokens"); var import_react7 = require("react"); var import_jsx_runtime5 = require("@emotion/react/jsx-runtime"); var CustomModalCaption = (0, import_react7.forwardRef)( (_a, ref) => { var _b = _a, { children, font = "captionM", color = import_stack_tokens2.vars.text.quaternary, align = "center" } = _b, restProps = __objRest(_b, [ "children", "font", "color", "align" ]); return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( import_stack_text.Text, __spreadProps(__spreadValues({ ref, as: "p", font, color, align, css: captionCss }, restProps), { children }) ); } ); CustomModalCaption.displayName = "CustomModalCaption"; // src/compounds/CustomModalClose.tsx var Dialog = __toESM(require("@radix-ui/react-dialog")); var import_react8 = require("react"); var import_jsx_runtime6 = require("@emotion/react/jsx-runtime"); var CustomModalClose = (0, import_react8.forwardRef)((_a, ref) => { var _b = _a, { asChild = true, children } = _b, restProps = __objRest(_b, ["asChild", "children"]); return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Close, __spreadProps(__spreadValues({ ref, asChild }, restProps), { children })); }); CustomModalClose.displayName = "CustomModalClose"; // src/compounds/CustomModalCloseButton.tsx var Dialog2 = __toESM(require("@radix-ui/react-dialog")); var import_stack_icons = require("@teamsparta/stack-icons"); var import_stack_tokens3 = require("@teamsparta/stack-tokens"); var import_react9 = require("react"); var import_jsx_runtime7 = require("@emotion/react/jsx-runtime"); var CustomModalCloseButton = (0, import_react9.forwardRef)((_a, ref) => { var _b = _a, { asChild = true } = _b, restProps = __objRest(_b, ["asChild"]); return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog2.Close, __spreadProps(__spreadValues({ ref, asChild }, restProps), { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", css: closeButtonCss, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_stack_icons.NavigationClose, { size: 16, color: import_stack_tokens3.vars.icon.quaternary }) }) })); }); CustomModalCloseButton.displayName = "CustomModalCloseButton"; // src/compounds/CustomModalContent.tsx var Dialog4 = __toESM(require("@radix-ui/react-dialog")); var import_react12 = require("@teamsparta/react"); var import_stack_core = require("@teamsparta/stack-core"); var import_react13 = require("motion/react"); var import_react14 = require("react"); // src/compounds/CustomModalOverlay.tsx var Dialog3 = __toESM(require("@radix-ui/react-dialog")); var import_react10 = require("motion/react"); var import_react11 = require("react"); var import_jsx_runtime8 = require("@emotion/react/jsx-runtime"); var CustomModalOverlay = (0, import_react11.forwardRef)((_a, ref) => { var _b = _a, { asChild = true, children } = _b, restProps = __objRest(_b, ["asChild", "children"]); return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Dialog3.Overlay, __spreadProps(__spreadValues({ ref, asChild }, restProps), { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)( import_react10.motion.div, { css: overlayCss, variants: overlayVariants, initial: "initial", animate: "animate", exit: "exit", children } ) })); }); CustomModalOverlay.displayName = "CustomModalOverlay"; // src/compounds/CustomModalContent.tsx var import_jsx_runtime9 = require("@emotion/react/jsx-runtime"); var noop = () => { }; var CustomModalContent = (0, import_react14.forwardRef)( (_a, ref) => { var _b = _a, { children, onInteractOutside, style: styleFromProps, asChild = true, overlay = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CustomModalOverlay, { forceMount: true }) } = _b, restProps = __objRest(_b, [ "children", "onInteractOutside", "style", "asChild", "overlay" ]); const { open, closeOnInteractOutside: closeOnInteractOutsideFromContext, size, theme } = useCustomModal("CustomModalContent"); const onInteractOutsideCallbackRef = (0, import_react12.usePreserveCallback)( onInteractOutside != null ? onInteractOutside : noop ); const style = __spreadValues(__spreadValues({}, modalSizeVariants[size]), styleFromProps); const hasOverlay = overlay !== null; const closeOnInteractOutside = hasOverlay ? closeOnInteractOutsideFromContext : false; const handleInteractOutside = (0, import_react14.useCallback)( (e) => { const { target } = e.detail.originalEvent; if (target instanceof Element && target.closest("[data-stack-toast]")) { e.preventDefault(); onInteractOutsideCallbackRef(e); return; } if (!closeOnInteractOutside) { e.preventDefault(); } onInteractOutsideCallbackRef(e); }, [onInteractOutsideCallbackRef, closeOnInteractOutside] ); return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react13.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Dialog4.Portal, { forceMount: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_stack_core.StackThemeProvider, { theme, children: [ overlay, /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( Dialog4.Content, __spreadProps(__spreadValues({ ref, asChild, style, onOpenAutoFocus: (e) => e.preventDefault(), onInteractOutside: handleInteractOutside }, restProps), { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { css: contentWrapperCss, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( import_react13.motion.div, { css: contentCss, variants: contentVariants, initial: "initial", animate: "animate", exit: "exit", children } ) }) }) ) ] }) }) }); } ); CustomModalContent.displayName = "CustomModalContent"; // src/compounds/CustomModalDescription.tsx var Dialog5 = __toESM(require("@radix-ui/react-dialog")); var import_stack_text2 = require("@teamsparta/stack-text"); var import_stack_tokens4 = require("@teamsparta/stack-tokens"); var import_react15 = require("react"); var import_jsx_runtime10 = require("@emotion/react/jsx-runtime"); var CustomModalDescription = (0, import_react15.forwardRef)( (_a, ref) => { var _b = _a, { children, font = "bodyCompact", color = import_stack_tokens4.vars.text.tertiary } = _b, restProps = __objRest(_b, [ "children", "font", "color" ]); return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog5.Description, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( import_stack_text2.Text, __spreadProps(__spreadValues({ ref, as: "p", font, color, css: descriptionCss }, restProps), { children }) ) }); } ); CustomModalDescription.displayName = "CustomModalDescription"; // src/compounds/CustomModalFooter.tsx var import_stack_flex2 = require("@teamsparta/stack-flex"); var import_react16 = require("react"); var import_jsx_runtime11 = require("@emotion/react/jsx-runtime"); var CustomModalFooter = (0, import_react16.forwardRef)( (_a, ref) => { var _b = _a, { children, direction = "column", padding = "16px 32px 32px 32px", align = "start", justify = "start" } = _b, restProps = __objRest(_b, [ "children", "direction", "padding", "align", "justify" ]); const { hasScroll } = useCustomModal("CustomModalFooter"); return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)( import_stack_flex2.Flex, __spreadProps(__spreadValues({ ref, as: "footer", direction, padding, css: [hasScroll && footerHasScrollCss], align, justify }, restProps), { children }) ); } ); CustomModalFooter.displayName = "CustomModalFooter"; // src/compounds/CustomModalHeader.tsx var import_stack_flex3 = require("@teamsparta/stack-flex"); var import_react17 = require("react"); var import_jsx_runtime12 = require("@emotion/react/jsx-runtime"); var CustomModalHeader = (0, import_react17.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__ */ (0, import_jsx_runtime12.jsxs)( import_stack_flex3.Flex, __spreadProps(__spreadValues({ ref, as: "header", direction, padding, css: [headerCss, hasScroll && headerHasScrollCss], align, justify }, restProps), { children: [ children, !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CustomModalCloseButton, {}) ] }) ); } ); CustomModalHeader.displayName = "CustomModalHeader"; // src/compounds/CustomModalRoot.tsx var Dialog6 = __toESM(require("@radix-ui/react-dialog")); var import_stack_core2 = require("@teamsparta/stack-core"); var import_stack_utils4 = require("@teamsparta/stack-utils"); var import_react18 = require("react"); var import_jsx_runtime13 = require("@emotion/react/jsx-runtime"); var CustomModalRoot = (_a) => { var _b = _a, { children, open: openFromProps, onOpenChange: onOpenChangeFromProps, defaultOpen: defaultOpenFromProps, closeOnInteractOutside = true, size = "md", theme: themeFromProps, hideCloseButton = false } = _b, restProps = __objRest(_b, [ "children", "open", "onOpenChange", "defaultOpen", "closeOnInteractOutside", "size", "theme", "hideCloseButton" ]); const [hasScroll, setHasScroll] = (0, import_react18.useState)(false); const [open = false, onOpenChange] = (0, import_stack_utils4.useControllableState)({ prop: openFromProps, defaultProp: defaultOpenFromProps, onChange: onOpenChangeFromProps }); const { theme: themeFromContext } = (0, import_stack_core2.useThemeContext)("CustomModal"); const theme = themeFromProps != null ? themeFromProps : themeFromContext; return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( CustomModalProvider, { open, onOpenChange, closeOnInteractOutside, size, theme, hasScroll, setHasScroll, hideCloseButton, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Dialog6.Root, __spreadProps(__spreadValues({ open, onOpenChange }, restProps), { children })) } ); }; // src/compounds/CustomModalSubTitle.tsx var import_stack_text3 = require("@teamsparta/stack-text"); var import_stack_tokens5 = require("@teamsparta/stack-tokens"); var import_react19 = require("react"); var import_jsx_runtime14 = require("@emotion/react/jsx-runtime"); var CustomModalSubTitle = (0, import_react19.forwardRef)( (_a, ref) => { var _b = _a, { children, font = "bodyB", color = import_stack_tokens5.vars.text.quaternary } = _b, restProps = __objRest(_b, ["children", "font", "color"]); return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_stack_text3.Text, __spreadProps(__spreadValues({ ref, as: "h3", font, color }, restProps), { children })); } ); CustomModalSubTitle.displayName = "CustomModalSubTitle"; // src/compounds/CustomModalTitle.tsx var Dialog7 = __toESM(require("@radix-ui/react-dialog")); var import_stack_text4 = require("@teamsparta/stack-text"); var import_stack_tokens6 = require("@teamsparta/stack-tokens"); var import_react20 = require("react"); var import_jsx_runtime15 = require("@emotion/react/jsx-runtime"); var CustomModalTitle = (0, import_react20.forwardRef)( (_a, ref) => { var _b = _a, { children, font = "subTitle1", color = import_stack_tokens6.vars.text.primary } = _b, restProps = __objRest(_b, ["children", "font", "color"]); return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Dialog7.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( import_stack_text4.Text, __spreadProps(__spreadValues({ ref, as: "h2", font, color, css: titleCss }, restProps), { children }) ) }); } ); CustomModalTitle.displayName = "CustomModalTitle"; // src/compounds/CustomModalTrigger.tsx var Dialog8 = __toESM(require("@radix-ui/react-dialog")); var import_react21 = require("react"); var import_jsx_runtime16 = require("@emotion/react/jsx-runtime"); var CustomModalTrigger = (0, import_react21.forwardRef)((_a, ref) => { var _b = _a, { children, asChild = true } = _b, restProps = __objRest(_b, ["children", "asChild"]); return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dialog8.Trigger, __spreadProps(__spreadValues({ ref, asChild }, restProps), { children })); }); CustomModalTrigger.displayName = "CustomModalTrigger"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { CustomModalBody, CustomModalButton, CustomModalButtonGroup, CustomModalCaption, CustomModalClose, CustomModalCloseButton, CustomModalContent, CustomModalDescription, CustomModalFooter, CustomModalHeader, CustomModalOverlay, CustomModalRoot, CustomModalSubTitle, CustomModalTitle, CustomModalTrigger });