UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

31 lines (30 loc) 1.04 kB
import { jsxs as m, jsx as o } from "react/jsx-runtime"; import { clsx as d } from "clsx"; import { createContext as c, useContext as f } from "react"; import { FormattedMessage as p } from "react-intl"; import i from "react-modal"; /* empty css */ const t = c({}); t.displayName = "ModalContext"; const _ = ({ isOpen: a, closeModal: e, className: s, children: l }) => { const { parentSelector: r, ariaHideApp: n } = f(t); return /* @__PURE__ */ m(i, { isOpen: a, onRequestClose: e, className: d("offb-modal__content", s), overlayClassName: "offb-modal__overlay", portalClassName: "offb-modal", parentSelector: r, ariaHideApp: n, children: [ /* @__PURE__ */ o("button", { type: "button", className: "offb-modal__close btn btn-secondary btn-sm", onClick: e, children: /* @__PURE__ */ o("span", { className: "sr-only", children: /* @__PURE__ */ o(p, { id: "yGAl1a", defaultMessage: [{ type: 0, value: "Close" }] }) }) }), l ] }); }; export { t as ModalContext, _ as default };