quirk-ui 0.0.25 → 0.0.26

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.
@@ -1,45 +1,46 @@
1
- import { jsxs as a, Fragment as p, jsx as o } from "react/jsx-runtime";
2
- import { useState as u } from "react";
3
- import { X as h } from "../../x-CnsEH4Ox.js";
4
- import '../../assets/index25.css';const f = "_overlay_nav1m_1", y = "_modal_nav1m_16", g = "_closeButton_nav1m_26", k = "_content_nav1m_37", n = {
5
- overlay: f,
6
- modal: y,
7
- closeButton: g,
8
- content: k
1
+ import { jsxs as r, Fragment as f, jsx as t } from "react/jsx-runtime";
2
+ import { useState as h } from "react";
3
+ import { X as p } from "../../x-CnsEH4Ox.js";
4
+ import '../../assets/index25.css';const y = "_overlay_nav1m_1", g = "_modal_nav1m_16", k = "_closeButton_nav1m_26", B = "_content_nav1m_37", o = {
5
+ overlay: y,
6
+ modal: g,
7
+ closeButton: k,
8
+ content: B
9
9
  };
10
- function b({
11
- content: i,
12
- trigger: r,
13
- isOpen: s,
14
- onClose: t,
15
- className: m
10
+ function j({
11
+ content: m,
12
+ trigger: d,
13
+ isOpen: l,
14
+ onOpen: e,
15
+ onClose: n,
16
+ className: v
16
17
  }) {
17
- const [d, v] = u(!1), c = s !== void 0, l = c ? s : d, e = () => {
18
- c ? t == null || t() : v(!l);
18
+ const [c, _] = h(!1), a = l !== void 0, i = a ? l : c, s = () => {
19
+ a ? c ? n == null || n() : e == null || e() : _(!i);
19
20
  };
20
- return /* @__PURE__ */ a(p, { children: [
21
- /* @__PURE__ */ o("div", { onClick: e, children: r }),
22
- l && /* @__PURE__ */ o("div", { className: n.overlay, onClick: e, children: /* @__PURE__ */ a(
21
+ return /* @__PURE__ */ r(f, { children: [
22
+ /* @__PURE__ */ t("div", { onClick: s, children: d }),
23
+ i && /* @__PURE__ */ t("div", { className: o.overlay, onClick: s, children: /* @__PURE__ */ r(
23
24
  "div",
24
25
  {
25
- className: `${m ?? ""} ${n.modal}`,
26
- onClick: (_) => _.stopPropagation(),
26
+ className: `${v ?? ""} ${o.modal}`,
27
+ onClick: (u) => u.stopPropagation(),
27
28
  children: [
28
- /* @__PURE__ */ o(
29
+ /* @__PURE__ */ t(
29
30
  "button",
30
31
  {
31
32
  "aria-label": "Close",
32
- className: n.closeButton,
33
- onClick: e,
34
- children: /* @__PURE__ */ o(h, { size: 21 })
33
+ className: o.closeButton,
34
+ onClick: s,
35
+ children: /* @__PURE__ */ t(p, { size: 21 })
35
36
  }
36
37
  ),
37
- /* @__PURE__ */ o("div", { className: n.content, children: i })
38
+ /* @__PURE__ */ t("div", { className: o.content, children: m })
38
39
  ]
39
40
  }
40
41
  ) })
41
42
  ] });
42
43
  }
43
44
  export {
44
- b as Modal
45
+ j as Modal
45
46
  };
@@ -3,8 +3,9 @@ type ModalProps = {
3
3
  content: React.ReactNode;
4
4
  trigger: React.ReactNode;
5
5
  isOpen?: boolean;
6
+ onOpen?: () => void;
6
7
  onClose?: () => void;
7
8
  className?: string;
8
9
  };
9
- export declare function Modal({ content, trigger, isOpen: controlledIsOpen, onClose, className, }: ModalProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function Modal({ content, trigger, isOpen: controlledIsOpen, onOpen, onClose, className, }: ModalProps): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.25",
4
+ "version": "0.0.26",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {