@sayz3r/react-modal-wh 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +14 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,19 +1,24 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import { forwardRef as e, useImperativeHandle as t, useState as n } from "react";
2
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
3
  //#region src/modal.jsx
3
- function n({ isOpen: n, onClose: r, children: i }) {
4
- return n ? /* @__PURE__ */ e("div", {
4
+ var a = e(({ children: e }, a) => {
5
+ let [o, s] = n(!1);
6
+ return t(a, () => ({
7
+ open: () => s(!0),
8
+ close: () => s(!1)
9
+ })), o ? /* @__PURE__ */ r("div", {
5
10
  className: "modal-overlay",
6
- onClick: r,
7
- children: /* @__PURE__ */ t("div", {
11
+ onClick: () => s(!1),
12
+ children: /* @__PURE__ */ i("div", {
8
13
  className: "modal-content",
9
14
  onClick: (e) => e.stopPropagation(),
10
- children: [i, /* @__PURE__ */ e("button", {
15
+ children: [e, /* @__PURE__ */ r("button", {
11
16
  className: "modal-close",
12
- onClick: r,
17
+ onClick: () => s(!1),
13
18
  children: "Close"
14
19
  })]
15
20
  })
16
21
  }) : null;
17
- }
22
+ });
18
23
  //#endregion
19
- export { n as default };
24
+ export { a as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayz3r/react-modal-wh",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "A simple React modal component",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",