quirk-ui 0.0.455 → 0.0.456

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index33.css');const e=require("react/jsx-runtime"),y=require("react"),j=require("react-dom"),x=require("../../../x-Dft9NVe_.cjs"),f="_overlay_140ia_1",h="_modal_140ia_16",g="_closeButton_140ia_26",$="_content_140ia_37",t={overlay:f,modal:h,closeButton:g,content:$};function b({content:d,trigger:u,isOpen:l,onOpen:o,onClose:s,className:c}){const[a,m]=y.useState(!1),i=l!==void 0,r=i?l:a,n=()=>{i?a?s==null||s():o==null||o():m(!r)},_=r?e.jsx("div",{className:t.overlay,onClick:n,children:e.jsxs("div",{className:`${c??""} ${t.modal}`,onClick:v=>v.stopPropagation(),children:[e.jsx("button",{"aria-label":"Close",className:`${t.closeButton} modalClose`,onClick:n,children:e.jsx(x.X,{size:21})}),e.jsx("div",{className:`${t.content} modalContent`,children:d})]})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:c??void 0,onClick:n,children:u}),typeof window<"u"&&j.createPortal(_,document.body)]})}exports.Modal=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index33.css');const e=require("react/jsx-runtime"),v=require("react"),_=require("react-dom"),h=require("../../../x-Dft9NVe_.cjs"),j="_overlay_140ia_1",x="_modal_140ia_16",b="_closeButton_140ia_26",g="_content_140ia_37",o={overlay:j,modal:x,closeButton:b,content:g};function $({content:r,trigger:u,isOpen:l,onOpen:t,onClose:n,className:c}){const[i,m]=v.useState(!1),d=l!==void 0,a=d?l:i,s=()=>{d?i?(n==null||n(),typeof document<"u"&&(document.body.style.overflow="")):(t==null||t(),typeof document<"u"&&(document.body.style.overflow="hidden")):m(!a)},f=a?e.jsx("div",{className:o.overlay,onClick:s,children:e.jsxs("div",{className:`${c??""} ${o.modal}`,onClick:y=>y.stopPropagation(),children:[e.jsx("button",{"aria-label":"Close",className:`${o.closeButton} modalClose`,onClick:s,children:e.jsx(h.X,{size:21})}),e.jsx("div",{className:`${o.content} modalContent`,children:r})]})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:c??void 0,onClick:s,children:u}),typeof window<"u"&&_.createPortal(f,document.body)]})}exports.Modal=$;
@@ -1,47 +1,47 @@
1
- import { jsxs as r, Fragment as h, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as r, Fragment as _, jsx as o } from "react/jsx-runtime";
2
2
  import { useState as p } from "react";
3
- import { createPortal as y } from "react-dom";
4
- import { X as C } from "../../../x-CnsEH4Ox.js";
5
- import '../../../assets/index33.css';const g = "_overlay_140ia_1", k = "_modal_140ia_16", B = "_closeButton_140ia_26", N = "_content_140ia_37", t = {
6
- overlay: g,
7
- modal: k,
8
- closeButton: B,
9
- content: N
3
+ import { createPortal as h } from "react-dom";
4
+ import { X as b } from "../../../x-CnsEH4Ox.js";
5
+ import '../../../assets/index33.css';const C = "_overlay_140ia_1", g = "_modal_140ia_16", k = "_closeButton_140ia_26", w = "_content_140ia_37", e = {
6
+ overlay: C,
7
+ modal: g,
8
+ closeButton: k,
9
+ content: w
10
10
  };
11
- function w({
11
+ function j({
12
12
  content: m,
13
- trigger: _,
14
- isOpen: a,
15
- onOpen: e,
16
- onClose: l,
17
- className: i
13
+ trigger: f,
14
+ isOpen: i,
15
+ onOpen: t,
16
+ onClose: n,
17
+ className: c
18
18
  }) {
19
- const [s, u] = p(!1), c = a !== void 0, d = c ? a : s, n = () => {
20
- c ? s ? l == null || l() : e == null || e() : u(!d);
21
- }, f = d ? /* @__PURE__ */ o("div", { className: t.overlay, onClick: n, children: /* @__PURE__ */ r(
19
+ const [d, u] = p(!1), s = i !== void 0, a = s ? i : d, l = () => {
20
+ s ? d ? (n == null || n(), typeof document < "u" && (document.body.style.overflow = "")) : (t == null || t(), typeof document < "u" && (document.body.style.overflow = "hidden")) : u(!a);
21
+ }, y = a ? /* @__PURE__ */ o("div", { className: e.overlay, onClick: l, children: /* @__PURE__ */ r(
22
22
  "div",
23
23
  {
24
- className: `${i ?? ""} ${t.modal}`,
24
+ className: `${c ?? ""} ${e.modal}`,
25
25
  onClick: (v) => v.stopPropagation(),
26
26
  children: [
27
27
  /* @__PURE__ */ o(
28
28
  "button",
29
29
  {
30
30
  "aria-label": "Close",
31
- className: `${t.closeButton} modalClose`,
32
- onClick: n,
33
- children: /* @__PURE__ */ o(C, { size: 21 })
31
+ className: `${e.closeButton} modalClose`,
32
+ onClick: l,
33
+ children: /* @__PURE__ */ o(b, { size: 21 })
34
34
  }
35
35
  ),
36
- /* @__PURE__ */ o("div", { className: `${t.content} modalContent`, children: m })
36
+ /* @__PURE__ */ o("div", { className: `${e.content} modalContent`, children: m })
37
37
  ]
38
38
  }
39
39
  ) }) : null;
40
- return /* @__PURE__ */ r(h, { children: [
41
- /* @__PURE__ */ o("div", { className: i ?? void 0, onClick: n, children: _ }),
42
- typeof window < "u" && y(f, document.body)
40
+ return /* @__PURE__ */ r(_, { children: [
41
+ /* @__PURE__ */ o("div", { className: c ?? void 0, onClick: l, children: f }),
42
+ typeof window < "u" && h(y, document.body)
43
43
  ] });
44
44
  }
45
45
  export {
46
- w as Modal
46
+ j as Modal
47
47
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.455",
4
+ "version": "0.0.456",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {