@launchpad-ui/modal
Advanced tools
Comparing version 0.6.5 to 0.7.0
@@ -1,2 +0,2 @@ | ||
// src/Modal.tsx | ||
import './style.css'; | ||
import { IconButton } from "@launchpad-ui/button"; | ||
@@ -8,23 +8,51 @@ import { Close, IconSize } from "@launchpad-ui/icons"; | ||
import { LazyMotion, m } from "framer-motion"; | ||
import { useEffect, useRef } from "react"; | ||
import { useRef, useEffect, useState, Suspense } from "react"; | ||
import { jsx, jsxs } from "react/jsx-runtime"; | ||
var overlay = { | ||
visible: { opacity: 1, transition: { duration: 0.15 } }, | ||
hidden: { opacity: 0 } | ||
import { Progress } from "@launchpad-ui/progress"; | ||
import { createPortal } from "react-dom"; | ||
const overlay = { | ||
visible: { | ||
opacity: 1, | ||
transition: { | ||
duration: 0.15 | ||
} | ||
}, | ||
hidden: { | ||
opacity: 0 | ||
} | ||
}; | ||
var content = { | ||
const content = { | ||
pop: { | ||
hidden: { opacity: 0, scale: 0.9 }, | ||
visible: { opacity: 1, scale: 1, transition: { type: "spring", delay: 0.1, duration: 0.15 } } | ||
hidden: { | ||
opacity: 0, | ||
scale: 0.9 | ||
}, | ||
visible: { | ||
opacity: 1, | ||
scale: 1, | ||
transition: { | ||
type: "spring", | ||
delay: 0.1, | ||
duration: 0.15 | ||
} | ||
} | ||
}, | ||
slideRight: { | ||
hidden: { opacity: 0, x: "25%" }, | ||
hidden: { | ||
opacity: 0, | ||
x: "25%" | ||
}, | ||
visible: { | ||
opacity: 1, | ||
x: "0%", | ||
transition: { type: "spring", delay: 0.15, duration: 0.2, bounce: 0 } | ||
transition: { | ||
type: "spring", | ||
delay: 0.15, | ||
duration: 0.2, | ||
bounce: 0 | ||
} | ||
} | ||
} | ||
}; | ||
var loadFeatures = () => import( | ||
const loadFeatures = () => import( | ||
/* webpackChunkName: "lp-modal-framer-features" */ | ||
@@ -34,3 +62,3 @@ /* webpackExports: "domAnimation" */ | ||
).then((res) => res.domAnimation); | ||
var Modal = ({ | ||
const Modal$1 = ({ | ||
className, | ||
@@ -82,3 +110,5 @@ withCloseButton = false, | ||
variants: overlay, | ||
transition: { duration: 0.15 }, | ||
transition: { | ||
duration: 0.15 | ||
}, | ||
role: "presentation", | ||
@@ -99,14 +129,11 @@ className: "Modal-overlay", | ||
className: "Modal-content", | ||
children: [ | ||
withCloseButton && /* @__PURE__ */ jsx(IconButton, { | ||
"aria-label": "close", | ||
icon: /* @__PURE__ */ jsx(Close, { | ||
size: IconSize.MEDIUM | ||
}), | ||
className: "Modal-close", | ||
onClick: onCancel, | ||
"data-test-id": "Modal-close" | ||
children: [withCloseButton && /* @__PURE__ */ jsx(IconButton, { | ||
"aria-label": "close", | ||
icon: /* @__PURE__ */ jsx(Close, { | ||
size: IconSize.MEDIUM | ||
}), | ||
children | ||
] | ||
className: "Modal-close", | ||
onClick: onCancel, | ||
"data-test-id": "Modal-close" | ||
}), children] | ||
}) | ||
@@ -118,10 +145,10 @@ }) | ||
}; | ||
// src/ModalBody.tsx | ||
import { cx as cx2 } from "classix"; | ||
import "./styles/Modal.css"; | ||
import { jsx as jsx2 } from "react/jsx-runtime"; | ||
var ModalBody = ({ className, children, ...other }) => { | ||
const classes = cx2("Modal-body", className); | ||
return /* @__PURE__ */ jsx2("div", { | ||
const Modal = ""; | ||
const ModalBody = ({ | ||
className, | ||
children, | ||
...other | ||
}) => { | ||
const classes = cx("Modal-body", className); | ||
return /* @__PURE__ */ jsx("div", { | ||
className: classes, | ||
@@ -132,10 +159,9 @@ ...other, | ||
}; | ||
// src/ModalFooter.tsx | ||
import { cx as cx3 } from "classix"; | ||
import "./styles/Modal.css"; | ||
import { jsx as jsx3 } from "react/jsx-runtime"; | ||
var ModalFooter = ({ className, testId, children }) => { | ||
const classes = cx3("Modal-footer", className); | ||
return /* @__PURE__ */ jsx3("div", { | ||
const ModalFooter = ({ | ||
className, | ||
testId, | ||
children | ||
}) => { | ||
const classes = cx("Modal-footer", className); | ||
return /* @__PURE__ */ jsx("div", { | ||
className: classes, | ||
@@ -146,9 +172,3 @@ "data-test-id": testId, | ||
}; | ||
// src/ModalHeader.tsx | ||
import { Close as Close2, IconSize as IconSize2 } from "@launchpad-ui/icons"; | ||
import { cx as cx4 } from "classix"; | ||
import "./styles/Modal.css"; | ||
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime"; | ||
var ModalHeader = ({ | ||
const ModalHeader = ({ | ||
className, | ||
@@ -161,33 +181,23 @@ closeable = false, | ||
}) => { | ||
const classes = cx4("Modal-header", className); | ||
return /* @__PURE__ */ jsxs2("div", { | ||
const classes = cx("Modal-header", className); | ||
return /* @__PURE__ */ jsxs("div", { | ||
className: classes, | ||
children: [ | ||
/* @__PURE__ */ jsx4("h2", { | ||
id: titleID || "Modal-title", | ||
className: cx4("Modal-title", titleClassName), | ||
children | ||
}), | ||
closeable && /* @__PURE__ */ jsx4(Close2, { | ||
className: "Modal-close", | ||
onClick: onClose, | ||
size: IconSize2.TINY | ||
}) | ||
] | ||
children: [/* @__PURE__ */ jsx("h2", { | ||
id: titleID || "Modal-title", | ||
className: cx("Modal-title", titleClassName), | ||
children | ||
}), closeable && /* @__PURE__ */ jsx(Close, { | ||
className: "Modal-close", | ||
onClick: onClose, | ||
size: IconSize.TINY | ||
})] | ||
}); | ||
}; | ||
// src/ModalSheet.tsx | ||
import { Progress } from "@launchpad-ui/progress"; | ||
import { cx as cx5 } from "classix"; | ||
import { Suspense } from "react"; | ||
// src/Portal.tsx | ||
import { useEffect as useEffect2, useState } from "react"; | ||
import { createPortal } from "react-dom"; | ||
import "./styles/Modal.css"; | ||
import { jsx as jsx5 } from "react/jsx-runtime"; | ||
var Portal = ({ children, containerRef, ...props }) => { | ||
const Portal = ({ | ||
children, | ||
containerRef, | ||
...props | ||
}) => { | ||
const [portal, setPortal] = useState(null); | ||
useEffect2(() => { | ||
useEffect(() => { | ||
const portal2 = document.createElement("div"); | ||
@@ -201,16 +211,9 @@ portal2.classList.add("Portal"); | ||
}, []); | ||
return portal ? createPortal( | ||
/* @__PURE__ */ jsx5("div", { | ||
...props, | ||
ref: containerRef, | ||
children | ||
}), | ||
portal | ||
) : null; | ||
return portal ? createPortal(/* @__PURE__ */ jsx("div", { | ||
...props, | ||
ref: containerRef, | ||
children | ||
}), portal) : null; | ||
}; | ||
// src/ModalSheet.tsx | ||
import "./styles/Modal.css"; | ||
import { jsx as jsx6 } from "react/jsx-runtime"; | ||
var ModalSheet = ({ | ||
const ModalSheet = ({ | ||
size = "small", | ||
@@ -221,11 +224,11 @@ children, | ||
}) => { | ||
const classes = cx5("ModalSheet", `ModalSheet--${size}`); | ||
return /* @__PURE__ */ jsx6(Portal, { | ||
const classes = cx("ModalSheet", `ModalSheet--${size}`); | ||
return /* @__PURE__ */ jsx(Portal, { | ||
className: classes, | ||
children: /* @__PURE__ */ jsx6(Modal, { | ||
children: /* @__PURE__ */ jsx(Modal$1, { | ||
...props, | ||
transition: "slideRight", | ||
withCloseButton, | ||
children: /* @__PURE__ */ jsx6(Suspense, { | ||
fallback: /* @__PURE__ */ jsx6(Progress, {}), | ||
children: /* @__PURE__ */ jsx(Suspense, { | ||
fallback: /* @__PURE__ */ jsx(Progress, {}), | ||
children | ||
@@ -236,10 +239,9 @@ }) | ||
}; | ||
// src/Prompt.tsx | ||
import { cx as cx6 } from "classix"; | ||
import "./styles/Prompt.css"; | ||
import { jsx as jsx7 } from "react/jsx-runtime"; | ||
var Prompt = ({ className, children }) => { | ||
return /* @__PURE__ */ jsx7(Portal, { | ||
className: cx6("Prompt", className), | ||
const Prompt$1 = ""; | ||
const Prompt = ({ | ||
className, | ||
children | ||
}) => { | ||
return /* @__PURE__ */ jsx(Portal, { | ||
className: cx("Prompt", className), | ||
children | ||
@@ -249,3 +251,3 @@ }); | ||
export { | ||
Modal, | ||
Modal$1 as Modal, | ||
ModalBody, | ||
@@ -252,0 +254,0 @@ ModalFooter, |
@@ -0,72 +1,78 @@ | ||
require('./style.css'); | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
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 }); | ||
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); | ||
const button = require("@launchpad-ui/button"); | ||
const icons = require("@launchpad-ui/icons"); | ||
const focus = require("@react-aria/focus"); | ||
const overlays = require("@react-aria/overlays"); | ||
const classix = require("classix"); | ||
const framerMotion = require("framer-motion"); | ||
const react = require("react"); | ||
const jsxRuntime = require("react/jsx-runtime"); | ||
const progress = require("@launchpad-ui/progress"); | ||
const reactDom = require("react-dom"); | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) | ||
return e; | ||
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } }); | ||
if (e) { | ||
for (const k in e) { | ||
if (k !== "default") { | ||
const d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: () => e[k] | ||
}); | ||
} | ||
} | ||
} | ||
return to; | ||
n.default = e; | ||
return Object.freeze(n); | ||
} | ||
const overlay = { | ||
visible: { | ||
opacity: 1, | ||
transition: { | ||
duration: 0.15 | ||
} | ||
}, | ||
hidden: { | ||
opacity: 0 | ||
} | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
Modal: () => Modal, | ||
ModalBody: () => ModalBody, | ||
ModalFooter: () => ModalFooter, | ||
ModalHeader: () => ModalHeader, | ||
ModalSheet: () => ModalSheet, | ||
Portal: () => Portal, | ||
Prompt: () => Prompt | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
// src/Modal.tsx | ||
var import_button = require("@launchpad-ui/button"); | ||
var import_icons = require("@launchpad-ui/icons"); | ||
var import_focus = require("@react-aria/focus"); | ||
var import_overlays = require("@react-aria/overlays"); | ||
var import_classix = require("classix"); | ||
var import_framer_motion = require("framer-motion"); | ||
var import_react = require("react"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var overlay = { | ||
visible: { opacity: 1, transition: { duration: 0.15 } }, | ||
hidden: { opacity: 0 } | ||
}; | ||
var content = { | ||
const content = { | ||
pop: { | ||
hidden: { opacity: 0, scale: 0.9 }, | ||
visible: { opacity: 1, scale: 1, transition: { type: "spring", delay: 0.1, duration: 0.15 } } | ||
hidden: { | ||
opacity: 0, | ||
scale: 0.9 | ||
}, | ||
visible: { | ||
opacity: 1, | ||
scale: 1, | ||
transition: { | ||
type: "spring", | ||
delay: 0.1, | ||
duration: 0.15 | ||
} | ||
} | ||
}, | ||
slideRight: { | ||
hidden: { opacity: 0, x: "25%" }, | ||
hidden: { | ||
opacity: 0, | ||
x: "25%" | ||
}, | ||
visible: { | ||
opacity: 1, | ||
x: "0%", | ||
transition: { type: "spring", delay: 0.15, duration: 0.2, bounce: 0 } | ||
transition: { | ||
type: "spring", | ||
delay: 0.15, | ||
duration: 0.2, | ||
bounce: 0 | ||
} | ||
} | ||
} | ||
}; | ||
var loadFeatures = () => import( | ||
/* webpackChunkName: "lp-modal-framer-features" */ | ||
/* webpackExports: "domAnimation" */ | ||
"framer-motion" | ||
).then((res) => res.domAnimation); | ||
var Modal = ({ | ||
const loadFeatures = () => Promise.resolve().then(() => /* @__PURE__ */ _interopNamespace(require("framer-motion"))).then((res) => res.domAnimation); | ||
const Modal$1 = ({ | ||
className, | ||
@@ -81,5 +87,5 @@ withCloseButton = false, | ||
}) => { | ||
const ref = (0, import_react.useRef)(null); | ||
(0, import_overlays.usePreventScroll)(); | ||
(0, import_react.useEffect)(() => { | ||
const ref = react.useRef(null); | ||
overlays.usePreventScroll(); | ||
react.useEffect(() => { | ||
const handleEscape = (event) => { | ||
@@ -108,22 +114,24 @@ event.stopImmediatePropagation(); | ||
}; | ||
const modalClasses = (0, import_classix.cx)("Modal", className); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.LazyMotion, { | ||
const modalClasses = classix.cx("Modal", className); | ||
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.LazyMotion, { | ||
strict: true, | ||
features: loadFeatures, | ||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { | ||
children: /* @__PURE__ */ jsxRuntime.jsx("div", { | ||
className: modalClasses, | ||
ref, | ||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.m.div, { | ||
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.m.div, { | ||
initial: "hidden", | ||
animate: "visible", | ||
variants: overlay, | ||
transition: { duration: 0.15 }, | ||
transition: { | ||
duration: 0.15 | ||
}, | ||
role: "presentation", | ||
className: "Modal-overlay", | ||
onMouseDown: handleOverlayClick, | ||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_focus.FocusScope, { | ||
children: /* @__PURE__ */ jsxRuntime.jsx(focus.FocusScope, { | ||
autoFocus: true, | ||
restoreFocus: true, | ||
contain: true, | ||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_framer_motion.m.div, { | ||
children: /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.m.div, { | ||
initial: "hidden", | ||
@@ -136,14 +144,11 @@ animate: "visible", | ||
className: "Modal-content", | ||
children: [ | ||
withCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.IconButton, { | ||
"aria-label": "close", | ||
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Close, { | ||
size: import_icons.IconSize.MEDIUM | ||
}), | ||
className: "Modal-close", | ||
onClick: onCancel, | ||
"data-test-id": "Modal-close" | ||
children: [withCloseButton && /* @__PURE__ */ jsxRuntime.jsx(button.IconButton, { | ||
"aria-label": "close", | ||
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Close, { | ||
size: icons.IconSize.MEDIUM | ||
}), | ||
children | ||
] | ||
className: "Modal-close", | ||
onClick: onCancel, | ||
"data-test-id": "Modal-close" | ||
}), children] | ||
}) | ||
@@ -155,10 +160,10 @@ }) | ||
}; | ||
// src/ModalBody.tsx | ||
var import_classix2 = require("classix"); | ||
var import_Modal = require("./styles/Modal.css"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var ModalBody = ({ className, children, ...other }) => { | ||
const classes = (0, import_classix2.cx)("Modal-body", className); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { | ||
const Modal = ""; | ||
const ModalBody = ({ | ||
className, | ||
children, | ||
...other | ||
}) => { | ||
const classes = classix.cx("Modal-body", className); | ||
return /* @__PURE__ */ jsxRuntime.jsx("div", { | ||
className: classes, | ||
@@ -169,10 +174,9 @@ ...other, | ||
}; | ||
// src/ModalFooter.tsx | ||
var import_classix3 = require("classix"); | ||
var import_Modal2 = require("./styles/Modal.css"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var ModalFooter = ({ className, testId, children }) => { | ||
const classes = (0, import_classix3.cx)("Modal-footer", className); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { | ||
const ModalFooter = ({ | ||
className, | ||
testId, | ||
children | ||
}) => { | ||
const classes = classix.cx("Modal-footer", className); | ||
return /* @__PURE__ */ jsxRuntime.jsx("div", { | ||
className: classes, | ||
@@ -183,9 +187,3 @@ "data-test-id": testId, | ||
}; | ||
// src/ModalHeader.tsx | ||
var import_icons2 = require("@launchpad-ui/icons"); | ||
var import_classix4 = require("classix"); | ||
var import_Modal3 = require("./styles/Modal.css"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var ModalHeader = ({ | ||
const ModalHeader = ({ | ||
className, | ||
@@ -198,33 +196,23 @@ closeable = false, | ||
}) => { | ||
const classes = (0, import_classix4.cx)("Modal-header", className); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { | ||
const classes = classix.cx("Modal-header", className); | ||
return /* @__PURE__ */ jsxRuntime.jsxs("div", { | ||
className: classes, | ||
children: [ | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { | ||
id: titleID || "Modal-title", | ||
className: (0, import_classix4.cx)("Modal-title", titleClassName), | ||
children | ||
}), | ||
closeable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.Close, { | ||
className: "Modal-close", | ||
onClick: onClose, | ||
size: import_icons2.IconSize.TINY | ||
}) | ||
] | ||
children: [/* @__PURE__ */ jsxRuntime.jsx("h2", { | ||
id: titleID || "Modal-title", | ||
className: classix.cx("Modal-title", titleClassName), | ||
children | ||
}), closeable && /* @__PURE__ */ jsxRuntime.jsx(icons.Close, { | ||
className: "Modal-close", | ||
onClick: onClose, | ||
size: icons.IconSize.TINY | ||
})] | ||
}); | ||
}; | ||
// src/ModalSheet.tsx | ||
var import_progress = require("@launchpad-ui/progress"); | ||
var import_classix5 = require("classix"); | ||
var import_react3 = require("react"); | ||
// src/Portal.tsx | ||
var import_react2 = require("react"); | ||
var import_react_dom = require("react-dom"); | ||
var import_Modal4 = require("./styles/Modal.css"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var Portal = ({ children, containerRef, ...props }) => { | ||
const [portal, setPortal] = (0, import_react2.useState)(null); | ||
(0, import_react2.useEffect)(() => { | ||
const Portal = ({ | ||
children, | ||
containerRef, | ||
...props | ||
}) => { | ||
const [portal, setPortal] = react.useState(null); | ||
react.useEffect(() => { | ||
const portal2 = document.createElement("div"); | ||
@@ -238,16 +226,9 @@ portal2.classList.add("Portal"); | ||
}, []); | ||
return portal ? (0, import_react_dom.createPortal)( | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { | ||
...props, | ||
ref: containerRef, | ||
children | ||
}), | ||
portal | ||
) : null; | ||
return portal ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx("div", { | ||
...props, | ||
ref: containerRef, | ||
children | ||
}), portal) : null; | ||
}; | ||
// src/ModalSheet.tsx | ||
var import_Modal6 = require("./styles/Modal.css"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var ModalSheet = ({ | ||
const ModalSheet = ({ | ||
size = "small", | ||
@@ -258,11 +239,11 @@ children, | ||
}) => { | ||
const classes = (0, import_classix5.cx)("ModalSheet", `ModalSheet--${size}`); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, { | ||
const classes = classix.cx("ModalSheet", `ModalSheet--${size}`); | ||
return /* @__PURE__ */ jsxRuntime.jsx(Portal, { | ||
className: classes, | ||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modal, { | ||
children: /* @__PURE__ */ jsxRuntime.jsx(Modal$1, { | ||
...props, | ||
transition: "slideRight", | ||
withCloseButton, | ||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react3.Suspense, { | ||
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_progress.Progress, {}), | ||
children: /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { | ||
fallback: /* @__PURE__ */ jsxRuntime.jsx(progress.Progress, {}), | ||
children | ||
@@ -273,23 +254,19 @@ }) | ||
}; | ||
// src/Prompt.tsx | ||
var import_classix6 = require("classix"); | ||
var import_Prompt = require("./styles/Prompt.css"); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var Prompt = ({ className, children }) => { | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, { | ||
className: (0, import_classix6.cx)("Prompt", className), | ||
const Prompt$1 = ""; | ||
const Prompt = ({ | ||
className, | ||
children | ||
}) => { | ||
return /* @__PURE__ */ jsxRuntime.jsx(Portal, { | ||
className: classix.cx("Prompt", className), | ||
children | ||
}); | ||
}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
Modal, | ||
ModalBody, | ||
ModalFooter, | ||
ModalHeader, | ||
ModalSheet, | ||
Portal, | ||
Prompt | ||
}); | ||
exports.Modal = Modal$1; | ||
exports.ModalBody = ModalBody; | ||
exports.ModalFooter = ModalFooter; | ||
exports.ModalHeader = ModalHeader; | ||
exports.ModalSheet = ModalSheet; | ||
exports.Portal = Portal; | ||
exports.Prompt = Prompt; | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,4 @@ | ||
/// <reference types="react" /> | ||
import type { ReactNode } from 'react'; | ||
declare type ModalProps = { | ||
children?: React.ReactNode; | ||
children?: ReactNode; | ||
className?: string; | ||
@@ -5,0 +5,0 @@ withCloseButton?: boolean; |
@@ -1,7 +0,7 @@ | ||
/// <reference types="react" /> | ||
import type { KeyboardEvent, ReactNode } from 'react'; | ||
import './styles/Modal.css'; | ||
declare type ModalBodyProps = { | ||
children: React.ReactNode; | ||
children: ReactNode; | ||
className?: string; | ||
onKeyDown?: (e: React.KeyboardEvent) => void; | ||
onKeyDown?: (e: KeyboardEvent) => void; | ||
}; | ||
@@ -8,0 +8,0 @@ declare const ModalBody: ({ className, children, ...other }: ModalBodyProps) => JSX.Element; |
@@ -1,5 +0,5 @@ | ||
/// <reference types="react" /> | ||
import type { ReactNode } from 'react'; | ||
import './styles/Modal.css'; | ||
declare type ModalFooterProps = { | ||
children: React.ReactNode; | ||
children: ReactNode; | ||
className?: string; | ||
@@ -6,0 +6,0 @@ testId?: string; |
@@ -1,5 +0,5 @@ | ||
/// <reference types="react" /> | ||
import type { ReactNode } from 'react'; | ||
import './styles/Modal.css'; | ||
declare type ModalHeaderProps = { | ||
children: React.ReactNode; | ||
children: ReactNode; | ||
className?: string; | ||
@@ -6,0 +6,0 @@ closeable?: boolean; |
@@ -1,2 +0,2 @@ | ||
/// <reference types="react" /> | ||
import type { ReactNode } from 'react'; | ||
import './styles/Modal.css'; | ||
@@ -8,3 +8,3 @@ declare type ModalSheetProps = { | ||
withCloseButton?: boolean; | ||
children: React.ReactNode; | ||
children: ReactNode; | ||
}; | ||
@@ -11,0 +11,0 @@ declare const ModalSheet: ({ size, children, withCloseButton, ...props }: ModalSheetProps) => JSX.Element; |
@@ -1,8 +0,8 @@ | ||
import type { KeyboardEvent } from 'react'; | ||
import type { KeyboardEvent, ReactNode, RefObject } from 'react'; | ||
import './styles/Modal.css'; | ||
declare type PortalProps = { | ||
containerRef?: React.RefObject<HTMLDivElement>; | ||
containerRef?: RefObject<HTMLDivElement>; | ||
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void; | ||
className?: string; | ||
children?: React.ReactNode; | ||
children?: ReactNode; | ||
}; | ||
@@ -9,0 +9,0 @@ declare const Portal: ({ children, containerRef, ...props }: PortalProps) => import("react").ReactPortal | null; |
@@ -1,6 +0,6 @@ | ||
/// <reference types="react" /> | ||
import type { ReactNode } from 'react'; | ||
import './styles/Prompt.css'; | ||
declare type PromptProps = { | ||
className?: string; | ||
children?: React.ReactNode; | ||
children?: ReactNode; | ||
}; | ||
@@ -7,0 +7,0 @@ declare const Prompt: ({ className, children }: PromptProps) => JSX.Element; |
{ | ||
"name": "@launchpad-ui/modal", | ||
"version": "0.6.5", | ||
"version": "0.7.0", | ||
"status": "beta", | ||
@@ -25,9 +25,9 @@ "publishConfig": { | ||
"./package.json": "./package.json", | ||
"./styles/*": "./dist/styles/*" | ||
"./style.css": "./dist/style.css" | ||
}, | ||
"source": "src/index.ts", | ||
"dependencies": { | ||
"@launchpad-ui/button": "~0.5.0", | ||
"@launchpad-ui/icons": "~0.3.3", | ||
"@launchpad-ui/progress": "~0.3.2", | ||
"@launchpad-ui/button": "~0.6.0", | ||
"@launchpad-ui/icons": "~0.4.0", | ||
"@launchpad-ui/progress": "~0.4.0", | ||
"@launchpad-ui/tokens": "~0.1.5", | ||
@@ -48,3 +48,3 @@ "@react-aria/focus": "^3.8.0", | ||
"scripts": { | ||
"build": "tsc --project tsconfig.build.json && node ../../scripts/build.js", | ||
"build": "vite build -c ../../vite.config.ts && tsc --project tsconfig.build.json", | ||
"clean": "rm -rf dist", | ||
@@ -51,0 +51,0 @@ "e2e": "playwright test --config=../../playwright.config.ct.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
732
52525
25
+ Added@launchpad-ui/button@0.6.3(transitive)
+ Added@launchpad-ui/icons@0.4.0(transitive)
+ Added@launchpad-ui/progress@0.4.0(transitive)
- Removed@launchpad-ui/button@0.5.0(transitive)
- Removed@launchpad-ui/icons@0.3.3(transitive)
- Removed@launchpad-ui/progress@0.3.2(transitive)
Updated@launchpad-ui/button@~0.6.0
Updated@launchpad-ui/icons@~0.4.0