@nice2dev/ui 1.0.10 → 1.0.11

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 (42) hide show
  1. package/dist/NiceErrorBoundary-BZEHCXNM.cjs +1 -0
  2. package/dist/NiceErrorBoundary-D6jw6wwD.js +762 -0
  3. package/dist/NiceForm-BgR-m8T9.cjs +382 -0
  4. package/dist/NiceForm-DYKciCeR.js +5131 -0
  5. package/dist/NiceModal-Br3J9jOV.cjs +1 -0
  6. package/dist/NiceModal-DVAsBzHP.js +95 -0
  7. package/dist/NiceModuleLifecyclePanel-D3azLDdj.js +5249 -0
  8. package/dist/NiceModuleLifecyclePanel-DEfAIhFf.cjs +1 -0
  9. package/dist/NicePagination-CbB5P1N_.js +171 -0
  10. package/dist/NicePagination-UGjzvRUS.cjs +1 -0
  11. package/dist/NicePinCodeInput-BmRO9HSQ.js +11830 -0
  12. package/dist/NicePinCodeInput-D91uvVsF.cjs +419 -0
  13. package/dist/NiceSavedQueryPanel-7nZe46t8.cjs +596 -0
  14. package/dist/NiceSavedQueryPanel-BSGzs7Oc.js +6449 -0
  15. package/dist/NiceTabs-BeaxZzAO.js +1636 -0
  16. package/dist/NiceTabs-DcbYFIWR.cjs +1 -0
  17. package/dist/NiceWindow-Bga9fOkg.js +1409 -0
  18. package/dist/NiceWindow-CxWTj5xH.cjs +1 -0
  19. package/dist/charts-BcvKWYUl.cjs +759 -0
  20. package/dist/charts-DZvmvfhM.js +4621 -0
  21. package/dist/charts.cjs +1 -1
  22. package/dist/charts.mjs +1 -1
  23. package/dist/core-B4b1BmHt.js +22177 -0
  24. package/dist/core-CjmLbclt.cjs +96 -0
  25. package/dist/data.cjs +1 -1
  26. package/dist/data.mjs +1 -1
  27. package/dist/editors.cjs +1 -1
  28. package/dist/editors.mjs +3 -3
  29. package/dist/feedback.cjs +1 -1
  30. package/dist/feedback.mjs +2 -2
  31. package/dist/index-DlHlXz8e.js +57319 -0
  32. package/dist/index-Dx726U90.cjs +5192 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.mjs +45 -45
  36. package/dist/lazy.cjs +1 -1
  37. package/dist/lazy.mjs +3 -3
  38. package/dist/navigation.cjs +1 -1
  39. package/dist/navigation.mjs +17 -17
  40. package/dist/overlays.cjs +1 -1
  41. package/dist/overlays.mjs +71 -71
  42. package/package.json +4 -4
@@ -1,10 +1,10 @@
1
- import { D as ae, a as ie, b as ce, c as se, d as le, e as re, N as te, f as oe, g as de, h as ue, i as be, j as me, k as _e, l as he, m as pe, n as Ne, o as ve, p as ke, q as ye, r as fe, s as ge, t as $e, u as xe, v as Me, w as we, x as Ce, y as De, z as Se, A as Ee, B as Ie, C as Te, E as Ae, F as We, G as Le, H as Pe, I as Re, J as Be, K as Ke, L as Oe, M as Fe, O as He, P as je, S as ze } from "./NiceModuleLifecyclePanel-CMrPbSw9.js";
1
+ import { D as ae, a as ie, b as ce, c as se, d as le, e as re, N as te, f as oe, g as de, h as ue, i as be, j as me, k as _e, l as he, m as pe, n as Ne, o as ve, p as ke, q as ye, r as fe, s as ge, t as $e, u as xe, v as Me, w as we, x as Ce, y as De, z as Se, A as Ee, B as Ie, C as Te, E as Ae, F as We, G as Le, H as Pe, I as Re, J as Be, K as Ke, L as Oe, M as Fe, O as He, P as je, S as ze } from "./NiceModuleLifecyclePanel-D3azLDdj.js";
2
2
  import { jsx as e, jsxs as o } from "react/jsx-runtime";
3
- import { forwardRef as E, useState as W, useCallback as L, useEffect as z } from "react";
4
- import { b as I, h as T, W as B } from "./core-Da43q-pO.js";
5
- import { f as Ve } from "./NiceTabs-DzLHzwuA.js";
6
- import { N as Je } from "./NicePagination-DbE-uOkl.js";
7
- const U = E(
3
+ import { c as E, N as I, W as B } from "./core-B4b1BmHt.js";
4
+ import { forwardRef as T, useState as W, useCallback as L, useEffect as z } from "react";
5
+ import { f as Ve } from "./NiceTabs-BeaxZzAO.js";
6
+ import { N as Je } from "./NicePagination-CbB5P1N_.js";
7
+ const U = T(
8
8
  ({
9
9
  items: b,
10
10
  activeKey: m,
@@ -22,7 +22,7 @@ const U = E(
22
22
  accessMode: x,
23
23
  ...M
24
24
  }, N) => {
25
- const i = I(y), t = T(x, y), [s, u] = W(/* @__PURE__ */ new Set()), r = L((n) => {
25
+ const i = E(y), t = I(x, y), [s, u] = W(/* @__PURE__ */ new Set()), r = L((n) => {
26
26
  u((D) => {
27
27
  const a = new Set(D);
28
28
  return a.has(n) ? a.delete(n) : a.add(n), a;
@@ -71,7 +71,7 @@ const U = E(
71
71
  }
72
72
  );
73
73
  U.displayName = "NiceSidebarMenu";
74
- const V = E(
74
+ const V = T(
75
75
  ({
76
76
  items: b,
77
77
  activeKey: m,
@@ -85,7 +85,7 @@ const V = E(
85
85
  accessMode: _,
86
86
  ...g
87
87
  }, $) => {
88
- const y = I(d), x = T(_, d), [M, N] = W(null);
88
+ const y = E(d), x = I(_, d), [M, N] = W(null);
89
89
  return x === "hidden" ? null : /* @__PURE__ */ o(
90
90
  "nav",
91
91
  {
@@ -151,7 +151,7 @@ const V = E(
151
151
  }
152
152
  );
153
153
  V.displayName = "NiceTopMenu";
154
- const q = E(
154
+ const q = T(
155
155
  ({
156
156
  tabs: b,
157
157
  activeTab: m,
@@ -166,7 +166,7 @@ const q = E(
166
166
  accessMode: g,
167
167
  ...$
168
168
  }, y) => {
169
- const x = I(_), M = T(g, _), [N, i] = W(m ?? b[0]?.key), t = m ?? N, s = b.find((r) => r.key === t), u = L(
169
+ const x = E(_), M = I(g, _), [N, i] = W(m ?? b[0]?.key), t = m ?? N, s = b.find((r) => r.key === t), u = L(
170
170
  (r) => {
171
171
  i(r), c?.(r);
172
172
  },
@@ -228,7 +228,7 @@ const q = E(
228
228
  }
229
229
  );
230
230
  q.displayName = "NiceRibbonMenu";
231
- const J = E(
231
+ const J = T(
232
232
  ({
233
233
  items: b,
234
234
  activeKey: m,
@@ -243,7 +243,7 @@ const J = E(
243
243
  accessMode: g,
244
244
  ...$
245
245
  }, y) => {
246
- const x = I(_), M = T(g, _), [N, i] = W(!1), t = !l || N;
246
+ const x = E(_), M = I(g, _), [N, i] = W(!1), t = !l || N;
247
247
  return M === "hidden" ? null : /* @__PURE__ */ e(
248
248
  "div",
249
249
  {
@@ -275,7 +275,7 @@ const J = E(
275
275
  }
276
276
  );
277
277
  J.displayName = "NiceDockMenu";
278
- const Q = E(
278
+ const Q = T(
279
279
  ({
280
280
  items: b,
281
281
  activeKey: m,
@@ -293,7 +293,7 @@ const Q = E(
293
293
  accessMode: x,
294
294
  ...M
295
295
  }, N) => {
296
- const i = I(y), t = T(x, y), { t: s } = B(), [u, r] = W(!1), h = p ?? u, n = L(() => {
296
+ const i = E(y), t = I(x, y), { t: s } = B(), [u, r] = W(!1), h = p ?? u, n = L(() => {
297
297
  const a = !h;
298
298
  r(a), l?.(a);
299
299
  }, [h, l]), D = L(
@@ -365,7 +365,7 @@ const Q = E(
365
365
  }
366
366
  );
367
367
  Q.displayName = "NiceHamburgerMenu";
368
- const X = E(
368
+ const X = T(
369
369
  ({
370
370
  canGoBack: b = !1,
371
371
  canGoForward: m = !1,
@@ -391,7 +391,7 @@ const X = E(
391
391
  disabled: h,
392
392
  ...n
393
393
  }, D) => {
394
- const a = I(u), A = T(r, u), { t: w } = B();
394
+ const a = E(u), A = I(r, u), { t: w } = B();
395
395
  if (z(() => {
396
396
  if (!v || h)
397
397
  return;
package/dist/overlays.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-CVgkxcCz.cjs"),r=require("react/jsx-runtime"),e=require("react"),I=require("react-dom"),M=require("./core-C2ZmWe_u.cjs");function B(){const t=e.useContext(M.NiceThemeContext);return t?.portalTarget?t.portalTarget:typeof document<"u"?document.body:null}const O=({open:t,onClose:i,children:v,title:o,size:g="md",closeOnBackdropClick:l=!0,closeOnEscape:d=!0,disableFocusTrap:u=!1,disableBodyScroll:T=!0,zIndex:p=1e3,className:_,style:C})=>{const w=e.useRef(null);M.useFocusTrap(w,t&&!u);const y=B();e.useEffect(()=>{if(!T&&t){const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}}},[t,T]),e.useEffect(()=>{if(!d||!t)return;const n=x=>{x.key==="Escape"&&(x.preventDefault(),i())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[d,t,i]);const f=e.useCallback(n=>{l&&n.target===n.currentTarget&&i()},[l,i]);if(!t)return null;const s={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[g];return I.createPortal(r.jsx("div",{className:"nice-modal__overlay",style:{zIndex:p},onClick:f,role:"presentation",children:r.jsx("div",{ref:w,className:`nice-modal ${s} ${_||""}`,role:"dialog","aria-modal":"true","aria-label":o,style:C,tabIndex:-1,children:v})}),y)},W=({children:t,showClose:i=!0,onClose:v,className:o})=>r.jsxs("div",{className:`nice-modal__header ${o||""}`,children:[r.jsx("div",{className:"nice-modal__title",children:t}),i&&v&&r.jsx("button",{type:"button",className:"nice-modal__close",onClick:v,"aria-label":"Close",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),F=({children:t,className:i})=>r.jsx("div",{className:`nice-modal__body ${i||""}`,children:t}),X=({children:t,className:i})=>r.jsx("div",{className:`nice-modal__footer ${i||""}`,children:t}),q=({open:t,onClose:i,children:v,position:o="right",size:g=320,title:l,closeOnBackdropClick:d=!0,closeOnEscape:u=!0,swipeToClose:T=!0,zIndex:p=1e3,className:_,style:C})=>{const w=e.useRef(null),[y,f]=e.useState(!1),[s,n]=e.useState(0);M.useFocusTrap(w,t);const x=B();e.useEffect(()=>{if(!u||!t)return;const a=k=>{k.key==="Escape"&&(k.preventDefault(),i())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[u,t,i]);const h=e.useCallback(a=>{let k=0;switch(o){case"left":k=Math.min(0,a.deltaX);break;case"right":k=Math.max(0,a.deltaX);break;case"top":k=Math.min(0,a.deltaY);break;case"bottom":k=Math.max(0,a.deltaY);break}n(k)},[o]),D=e.useCallback(a=>{let P=!1;switch(o){case"left":P=a.deltaX<-100;break;case"right":P=a.deltaX>100;break;case"top":P=a.deltaY<-100;break;case"bottom":P=a.deltaY>100;break}P&&(M.triggerHaptic("light"),i()),n(0),f(!1)},[o,i]),{ref:E}=M.usePan({enabled:T&&t,onPanStart:()=>f(!0),onPan:h,onPanEnd:D}),$=e.useCallback(a=>{d&&a.target===a.currentTarget&&i()},[d,i]);if(!t)return null;const S=o==="left"||o==="right",L=S?{width:typeof g=="number"?`${g}px`:g}:{height:typeof g=="number"?`${g}px`:g},c=()=>{if(y)return S?`translateX(${s}px)`:`translateY(${s}px)`};return I.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-drawer__overlay ${t?"nice-drawer__overlay--visible":""}`,style:{zIndex:p},onClick:$}),r.jsx("div",{ref:a=>{w.current=a,E.current=a},className:`nice-drawer nice-drawer--${o} ${t?"nice-drawer--open":""} ${_||""}`,style:{...L,zIndex:p+1,transform:c(),transition:y?"none":void 0,...C},role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:v})]}),x)},K=({open:t,onClose:i,children:v,title:o,showHandle:g=!0,snapPoints:l=[.5,.9],initialSnap:d=0,expandable:u=!0,closeOnBackdropClick:T=!0,closeOnEscape:p=!0,hapticFeedback:_=!0,zIndex:C=1e3,className:w,style:y})=>{const f=e.useRef(null),s=e.useRef(null),[n,x]=e.useState(d),[h,D]=e.useState(!1),[E,$]=e.useState(0),S=e.useRef(0);e.useEffect(()=>{t&&(x(d),$(0))},[t,d]),M.useFocusTrap(f,t);const L=B();e.useEffect(()=>{if(!p||!t)return;const m=b=>{b.key==="Escape"&&(b.preventDefault(),i())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[p,t,i]),e.useEffect(()=>{if(t){const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[t]);const c=e.useCallback(m=>{const b=m.target.closest(".nice-bottom-sheet__handle"),H=s.current,Y=!H||H.scrollTop<=0;!b&&!Y||(D(!0),S.current=m.touches[0].clientY)},[]),a=e.useCallback(m=>{if(!h)return;const b=m.touches[0].clientY-S.current;(b>0||n<l.length-1)&&$(b)},[h,n,l.length]),k=e.useCallback(()=>{if(!h)return;const m=window.innerHeight;l[n]*m;const b=-E,H=m*.15;b>H&&u&&n<l.length-1?(x(n+1),_&&M.triggerHaptic("selection")):b<-H&&(n>0?(x(n-1),_&&M.triggerHaptic("selection")):(_&&M.triggerHaptic("light"),i())),D(!1),$(0)},[h,E,n,l,u,_,i]),P=e.useCallback(()=>{T&&i()},[T,i]);if(!t)return null;const j=l[n]*100,R=h?E:0;return I.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-bottom-sheet__overlay ${t?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:C},onClick:P}),r.jsxs("div",{ref:f,className:`nice-bottom-sheet ${t?"nice-bottom-sheet--open":""} ${w||""}`,style:{zIndex:C+1,height:`${j}vh`,transform:`translateY(${Math.max(0,R)}px)`,transition:h?"none":"transform 0.3s ease-out, height 0.3s ease-out",...y},role:"dialog","aria-modal":"true","aria-label":o,tabIndex:-1,onTouchStart:c,onTouchMove:a,onTouchEnd:k,children:[g&&r.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),o&&r.jsx("div",{className:"nice-bottom-sheet__title",children:o}),r.jsx("div",{ref:s,className:"nice-bottom-sheet__content",children:v})]})]}),L)},z=({trigger:t,children:i,placement:v="bottom",triggerMode:o="click",open:g,onOpenChange:l,hoverDelay:d=200,offset:u=8,className:T,showArrow:p=!0})=>{const[_,C]=e.useState(!1),w=e.useRef(null),y=e.useRef(null),f=e.useRef(null),s=B(),n=g!==void 0,x=n?g:_,h=e.useCallback(c=>{n||C(c),l?.(c)},[n,l]);M.useClickOutside(y,()=>{o!=="manual"&&x&&h(!1)});const D=e.useCallback(()=>{o==="click"&&h(!x)},[o,x,h]),E=e.useCallback(()=>{o==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!0),d))},[o,d,h]),$=e.useCallback(()=>{o==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!1),d))},[o,d,h]),[S,L]=e.useState({top:0,left:0});return e.useEffect(()=>{if(!x||!w.current||!y.current)return;const c=w.current.getBoundingClientRect(),a=y.current.getBoundingClientRect(),k=window.innerWidth,P=window.innerHeight;let j=0,R=0;const[m,b="center"]=v.split("-");switch(m){case"top":j=c.top-a.height-u,R=c.left+(c.width-a.width)/2;break;case"bottom":j=c.bottom+u,R=c.left+(c.width-a.width)/2;break;case"left":j=c.top+(c.height-a.height)/2,R=c.left-a.width-u;break;case"right":j=c.top+(c.height-a.height)/2,R=c.right+u;break}m==="top"||m==="bottom"?(b==="start"&&(R=c.left),b==="end"&&(R=c.right-a.width)):(b==="start"&&(j=c.top),b==="end"&&(j=c.bottom-a.height)),R=Math.max(8,Math.min(k-a.width-8,R)),j=Math.max(8,Math.min(P-a.height-8,j)),L({top:j,left:R})},[x,v,u]),r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,className:"nice-popover__trigger",onClick:D,onMouseEnter:E,onMouseLeave:$,style:{display:"inline-block"},children:t}),x&&I.createPortal(r.jsxs("div",{ref:y,className:`nice-popover nice-popover--${v} ${T||""}`,style:{position:"fixed",top:S.top,left:S.left,zIndex:1100},onMouseEnter:E,onMouseLeave:$,role:"tooltip",children:[p&&r.jsx("div",{className:"nice-popover__arrow"}),r.jsx("div",{className:"nice-popover__content",children:i})]}),s)]})},A=({items:t,children:i,onOpen:v,onClose:o,className:g})=>{const[l,d]=e.useState(!1),[u,T]=e.useState({x:0,y:0}),p=e.useRef(null),_=e.useRef(null),C=B();M.useClickOutside(p,()=>{l&&(d(!1),o?.())});const w=e.useCallback(s=>{s.preventDefault(),T({x:s.clientX,y:s.clientY}),d(!0),v?.()},[v]),y=e.useCallback(s=>{!s.disabled&&s.onClick&&(s.onClick(),d(!1),o?.())},[o]);e.useEffect(()=>{if(!l)return;const s=n=>{n.key==="Escape"&&(d(!1),o?.())};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[l,o]);const f=s=>r.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:s.map(n=>n.divider?r.jsx("li",{className:"nice-context-menu__divider",role:"separator"},n.key):r.jsx("li",{role:"presentation",children:r.jsxs("button",{type:"button",className:`nice-context-menu__item ${n.disabled?"nice-context-menu__item--disabled":""} ${n.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:n.disabled,onClick:()=>y(n),children:[n.icon&&r.jsx("span",{className:"nice-context-menu__icon",children:n.icon}),r.jsx("span",{className:"nice-context-menu__label",children:n.label})]})},n.key))});return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:_,onContextMenu:w,style:{display:"contents"},children:i}),l&&I.createPortal(r.jsx("div",{ref:p,className:`nice-context-menu ${g||""}`,style:{position:"fixed",left:u.x,top:u.y,zIndex:1200},role:"menu",children:f(t)}),C)]})};exports.NiceActionSheet=N.NiceActionSheet;exports.NiceBlockUI=N.NiceBlockUI;exports.NiceBox=N.NiceBox;exports.NiceCommandPaletteProvider=N.NiceCommandPaletteProvider;exports.NiceLoadPanel=N.NiceLoadPanel;exports.NicePopover=N.NicePopover;exports.NiceResizable=N.NiceResizable;exports.NiceResponsiveBox=N.NiceResponsiveBox;exports.NiceScrollView=N.NiceScrollView;exports.NiceTutorial=N.NiceTutorial;exports.NiceTutorialProvider=N.NiceTutorialProvider;exports.NiceWindow=N.NiceWindow;exports.NiceWindowManager=N.NiceWindowManager;exports.useCommandPalette=N.useCommandPalette;exports.useRegisterCommands=N.useRegisterCommands;exports.NiceBottomSheet=K;exports.NiceContextMenu=A;exports.NiceDrawer=q;exports.NiceModal=O;exports.NiceModalBody=F;exports.NiceModalFooter=X;exports.NiceModalHeader=W;exports.NiceOverlayPopover=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-CxWTj5xH.cjs"),r=require("react/jsx-runtime"),M=require("./core-CjmLbclt.cjs"),e=require("react"),B=require("react-dom");function Y(){const t=e.useContext(M.Qt);return t?.portalTarget?t.portalTarget:typeof document<"u"?document.body:null}const W=({open:t,onClose:s,children:v,title:a,size:g="md",closeOnBackdropClick:l=!0,closeOnEscape:d=!0,disableFocusTrap:u=!1,disableBodyScroll:j=!0,zIndex:_=1e3,className:p,style:C})=>{const w=e.useRef(null);M.fs(w,t&&!u);const y=Y();e.useEffect(()=>{if(!j&&t){const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}}},[t,j]),e.useEffect(()=>{if(!d||!t)return;const n=x=>{x.key==="Escape"&&(x.preventDefault(),s())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[d,t,s]);const f=e.useCallback(n=>{l&&n.target===n.currentTarget&&s()},[l,s]);if(!t)return null;const i={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[g];return B.createPortal(r.jsx("div",{className:"nice-modal__overlay",style:{zIndex:_},onClick:f,role:"presentation",children:r.jsx("div",{ref:w,className:`nice-modal ${i} ${p||""}`,role:"dialog","aria-modal":"true","aria-label":a,style:C,tabIndex:-1,children:v})}),y)},O=({children:t,showClose:s=!0,onClose:v,className:a})=>r.jsxs("div",{className:`nice-modal__header ${a||""}`,children:[r.jsx("div",{className:"nice-modal__title",children:t}),s&&v&&r.jsx("button",{type:"button",className:"nice-modal__close",onClick:v,"aria-label":"Close",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),X=({children:t,className:s})=>r.jsx("div",{className:`nice-modal__body ${s||""}`,children:t}),q=({children:t,className:s})=>r.jsx("div",{className:`nice-modal__footer ${s||""}`,children:t}),K=({open:t,onClose:s,children:v,position:a="right",size:g=320,title:l,closeOnBackdropClick:d=!0,closeOnEscape:u=!0,swipeToClose:j=!0,zIndex:_=1e3,className:p,style:C})=>{const w=e.useRef(null),[y,f]=e.useState(!1),[i,n]=e.useState(0);M.fs(w,t);const x=Y();e.useEffect(()=>{if(!u||!t)return;const o=k=>{k.key==="Escape"&&(k.preventDefault(),s())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[u,t,s]);const h=e.useCallback(o=>{let k=0;switch(a){case"left":k=Math.min(0,o.deltaX);break;case"right":k=Math.max(0,o.deltaX);break;case"top":k=Math.min(0,o.deltaY);break;case"bottom":k=Math.max(0,o.deltaY);break}n(k)},[a]),L=e.useCallback(o=>{let E=!1;switch(a){case"left":E=o.deltaX<-100;break;case"right":E=o.deltaX>100;break;case"top":E=o.deltaY<-100;break;case"bottom":E=o.deltaY>100;break}E&&(M.Lr("light"),s()),n(0),f(!1)},[a,s]),{ref:P}=M.Ts({enabled:j&&t,onPanStart:()=>f(!0),onPan:h,onPanEnd:L}),$=e.useCallback(o=>{d&&o.target===o.currentTarget&&s()},[d,s]);if(!t)return null;const S=a==="left"||a==="right",D=S?{width:typeof g=="number"?`${g}px`:g}:{height:typeof g=="number"?`${g}px`:g},c=()=>{if(y)return S?`translateX(${i}px)`:`translateY(${i}px)`};return B.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-drawer__overlay ${t?"nice-drawer__overlay--visible":""}`,style:{zIndex:_},onClick:$}),r.jsx("div",{ref:o=>{w.current=o,P.current=o},className:`nice-drawer nice-drawer--${a} ${t?"nice-drawer--open":""} ${p||""}`,style:{...D,zIndex:_+1,transform:c(),transition:y?"none":void 0,...C},role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:v})]}),x)},F=({open:t,onClose:s,children:v,title:a,showHandle:g=!0,snapPoints:l=[.5,.9],initialSnap:d=0,expandable:u=!0,closeOnBackdropClick:j=!0,closeOnEscape:_=!0,hapticFeedback:p=!0,zIndex:C=1e3,className:w,style:y})=>{const f=e.useRef(null),i=e.useRef(null),[n,x]=e.useState(d),[h,L]=e.useState(!1),[P,$]=e.useState(0),S=e.useRef(0);e.useEffect(()=>{t&&(x(d),$(0))},[t,d]),M.fs(f,t);const D=Y();e.useEffect(()=>{if(!_||!t)return;const m=b=>{b.key==="Escape"&&(b.preventDefault(),s())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[_,t,s]),e.useEffect(()=>{if(t){const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[t]);const c=e.useCallback(m=>{const b=m.target.closest(".nice-bottom-sheet__handle"),I=i.current,H=!I||I.scrollTop<=0;!b&&!H||(L(!0),S.current=m.touches[0].clientY)},[]),o=e.useCallback(m=>{if(!h)return;const b=m.touches[0].clientY-S.current;(b>0||n<l.length-1)&&$(b)},[h,n,l.length]),k=e.useCallback(()=>{if(!h)return;const m=window.innerHeight;l[n]*m;const b=-P,I=m*.15;b>I&&u&&n<l.length-1?(x(n+1),p&&M.Lr("selection")):b<-I&&(n>0?(x(n-1),p&&M.Lr("selection")):(p&&M.Lr("light"),s())),L(!1),$(0)},[h,P,n,l,u,p,s]),E=e.useCallback(()=>{j&&s()},[j,s]);if(!t)return null;const R=l[n]*100,T=h?P:0;return B.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-bottom-sheet__overlay ${t?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:C},onClick:E}),r.jsxs("div",{ref:f,className:`nice-bottom-sheet ${t?"nice-bottom-sheet--open":""} ${w||""}`,style:{zIndex:C+1,height:`${R}vh`,transform:`translateY(${Math.max(0,T)}px)`,transition:h?"none":"transform 0.3s ease-out, height 0.3s ease-out",...y},role:"dialog","aria-modal":"true","aria-label":a,tabIndex:-1,onTouchStart:c,onTouchMove:o,onTouchEnd:k,children:[g&&r.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),a&&r.jsx("div",{className:"nice-bottom-sheet__title",children:a}),r.jsx("div",{ref:i,className:"nice-bottom-sheet__content",children:v})]})]}),D)},z=({trigger:t,children:s,placement:v="bottom",triggerMode:a="click",open:g,onOpenChange:l,hoverDelay:d=200,offset:u=8,className:j,showArrow:_=!0})=>{const[p,C]=e.useState(!1),w=e.useRef(null),y=e.useRef(null),f=e.useRef(null),i=Y(),n=g!==void 0,x=n?g:p,h=e.useCallback(c=>{n||C(c),l?.(c)},[n,l]);M.ds(y,()=>{a!=="manual"&&x&&h(!1)});const L=e.useCallback(()=>{a==="click"&&h(!x)},[a,x,h]),P=e.useCallback(()=>{a==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!0),d))},[a,d,h]),$=e.useCallback(()=>{a==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!1),d))},[a,d,h]),[S,D]=e.useState({top:0,left:0});return e.useEffect(()=>{if(!x||!w.current||!y.current)return;const c=w.current.getBoundingClientRect(),o=y.current.getBoundingClientRect(),k=window.innerWidth,E=window.innerHeight;let R=0,T=0;const[m,b="center"]=v.split("-");switch(m){case"top":R=c.top-o.height-u,T=c.left+(c.width-o.width)/2;break;case"bottom":R=c.bottom+u,T=c.left+(c.width-o.width)/2;break;case"left":R=c.top+(c.height-o.height)/2,T=c.left-o.width-u;break;case"right":R=c.top+(c.height-o.height)/2,T=c.right+u;break}m==="top"||m==="bottom"?(b==="start"&&(T=c.left),b==="end"&&(T=c.right-o.width)):(b==="start"&&(R=c.top),b==="end"&&(R=c.bottom-o.height)),T=Math.max(8,Math.min(k-o.width-8,T)),R=Math.max(8,Math.min(E-o.height-8,R)),D({top:R,left:T})},[x,v,u]),r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,className:"nice-popover__trigger",onClick:L,onMouseEnter:P,onMouseLeave:$,style:{display:"inline-block"},children:t}),x&&B.createPortal(r.jsxs("div",{ref:y,className:`nice-popover nice-popover--${v} ${j||""}`,style:{position:"fixed",top:S.top,left:S.left,zIndex:1100},onMouseEnter:P,onMouseLeave:$,role:"tooltip",children:[_&&r.jsx("div",{className:"nice-popover__arrow"}),r.jsx("div",{className:"nice-popover__content",children:s})]}),i)]})},A=({items:t,children:s,onOpen:v,onClose:a,className:g})=>{const[l,d]=e.useState(!1),[u,j]=e.useState({x:0,y:0}),_=e.useRef(null),p=e.useRef(null),C=Y();M.ds(_,()=>{l&&(d(!1),a?.())});const w=e.useCallback(i=>{i.preventDefault(),j({x:i.clientX,y:i.clientY}),d(!0),v?.()},[v]),y=e.useCallback(i=>{!i.disabled&&i.onClick&&(i.onClick(),d(!1),a?.())},[a]);e.useEffect(()=>{if(!l)return;const i=n=>{n.key==="Escape"&&(d(!1),a?.())};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[l,a]);const f=i=>r.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:i.map(n=>n.divider?r.jsx("li",{className:"nice-context-menu__divider",role:"separator"},n.key):r.jsx("li",{role:"presentation",children:r.jsxs("button",{type:"button",className:`nice-context-menu__item ${n.disabled?"nice-context-menu__item--disabled":""} ${n.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:n.disabled,onClick:()=>y(n),children:[n.icon&&r.jsx("span",{className:"nice-context-menu__icon",children:n.icon}),r.jsx("span",{className:"nice-context-menu__label",children:n.label})]})},n.key))});return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,onContextMenu:w,style:{display:"contents"},children:s}),l&&B.createPortal(r.jsx("div",{ref:_,className:`nice-context-menu ${g||""}`,style:{position:"fixed",left:u.x,top:u.y,zIndex:1200},role:"menu",children:f(t)}),C)]})};exports.NiceActionSheet=N.NiceActionSheet;exports.NiceBlockUI=N.NiceBlockUI;exports.NiceBox=N.NiceBox;exports.NiceCommandPaletteProvider=N.NiceCommandPaletteProvider;exports.NiceLoadPanel=N.NiceLoadPanel;exports.NicePopover=N.NicePopover;exports.NiceResizable=N.NiceResizable;exports.NiceResponsiveBox=N.NiceResponsiveBox;exports.NiceScrollView=N.NiceScrollView;exports.NiceTutorial=N.NiceTutorial;exports.NiceTutorialProvider=N.NiceTutorialProvider;exports.NiceWindow=N.NiceWindow;exports.NiceWindowManager=N.NiceWindowManager;exports.useCommandPalette=N.useCommandPalette;exports.useRegisterCommands=N.useRegisterCommands;exports.NiceBottomSheet=F;exports.NiceContextMenu=A;exports.NiceDrawer=K;exports.NiceModal=W;exports.NiceModalBody=X;exports.NiceModalFooter=q;exports.NiceModalHeader=O;exports.NiceOverlayPopover=z;
package/dist/overlays.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as Ne, u as _e, m as ke } from "./NiceWindow-DeC83yfE.js";
2
- import { jsxs as C, Fragment as K, jsx as a } from "react/jsx-runtime";
3
- import { useRef as E, useState as P, useEffect as Y, useCallback as b, useContext as U } from "react";
1
+ import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as ke } from "./NiceWindow-Bga9fOkg.js";
2
+ import { jsxs as H, Fragment as O, jsx as a } from "react/jsx-runtime";
3
+ import { f as j, L as K, a as Q, T as A, Q as U } from "./core-B4b1BmHt.js";
4
+ import { useRef as E, useState as L, useEffect as Y, useCallback as b, useContext as V } from "react";
4
5
  import { createPortal as X } from "react-dom";
5
- import { e as j, t as W, f as z, g as V, N as q } from "./core-Da43q-pO.js";
6
- function O() {
7
- const e = U(q);
6
+ function W() {
7
+ const e = V(U);
8
8
  return e?.portalTarget ? e.portalTarget : typeof document < "u" ? document.body : null;
9
9
  }
10
- const Z = ({
10
+ const F = ({
11
11
  open: e,
12
12
  onClose: o,
13
13
  children: m,
@@ -17,13 +17,13 @@ const Z = ({
17
17
  closeOnEscape: s = !0,
18
18
  disableFocusTrap: d = !1,
19
19
  disableBodyScroll: x = !0,
20
- zIndex: _ = 1e3,
20
+ zIndex: N = 1e3,
21
21
  className: k,
22
22
  style: M
23
23
  }) => {
24
24
  const y = E(null);
25
25
  j(y, e && !d);
26
- const p = O();
26
+ const p = W();
27
27
  Y(() => {
28
28
  if (!x && e) {
29
29
  const t = document.body.style.overflow;
@@ -59,7 +59,7 @@ const Z = ({
59
59
  "div",
60
60
  {
61
61
  className: "nice-modal__overlay",
62
- style: { zIndex: _ },
62
+ style: { zIndex: N },
63
63
  onClick: u,
64
64
  role: "presentation",
65
65
  children: /* @__PURE__ */ a(
@@ -84,7 +84,7 @@ const Z = ({
84
84
  showClose: o = !0,
85
85
  onClose: m,
86
86
  className: r
87
- }) => /* @__PURE__ */ C("div", { className: `nice-modal__header ${r || ""}`, children: [
87
+ }) => /* @__PURE__ */ H("div", { className: `nice-modal__header ${r || ""}`, children: [
88
88
  /* @__PURE__ */ a("div", { className: "nice-modal__title", children: e }),
89
89
  o && m && /* @__PURE__ */ a("button", { type: "button", className: "nice-modal__close", onClick: m, "aria-label": "Close", children: /* @__PURE__ */ a(
90
90
  "svg",
@@ -108,42 +108,42 @@ const Z = ({
108
108
  closeOnBackdropClick: s = !0,
109
109
  closeOnEscape: d = !0,
110
110
  swipeToClose: x = !0,
111
- zIndex: _ = 1e3,
111
+ zIndex: N = 1e3,
112
112
  className: k,
113
113
  style: M
114
114
  }) => {
115
- const y = E(null), [p, u] = P(!1), [c, t] = P(0);
115
+ const y = E(null), [p, u] = L(!1), [c, t] = L(0);
116
116
  j(y, e);
117
- const g = O();
117
+ const g = W();
118
118
  Y(() => {
119
119
  if (!d || !e)
120
120
  return;
121
- const n = (N) => {
122
- N.key === "Escape" && (N.preventDefault(), o());
121
+ const n = (_) => {
122
+ _.key === "Escape" && (_.preventDefault(), o());
123
123
  };
124
124
  return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
125
125
  }, [d, e, o]);
126
126
  const h = b(
127
127
  (n) => {
128
- let N = 0;
128
+ let _ = 0;
129
129
  switch (r) {
130
130
  case "left":
131
- N = Math.min(0, n.deltaX);
131
+ _ = Math.min(0, n.deltaX);
132
132
  break;
133
133
  case "right":
134
- N = Math.max(0, n.deltaX);
134
+ _ = Math.max(0, n.deltaX);
135
135
  break;
136
136
  case "top":
137
- N = Math.min(0, n.deltaY);
137
+ _ = Math.min(0, n.deltaY);
138
138
  break;
139
139
  case "bottom":
140
- N = Math.max(0, n.deltaY);
140
+ _ = Math.max(0, n.deltaY);
141
141
  break;
142
142
  }
143
- t(N);
143
+ t(_);
144
144
  },
145
145
  [r]
146
- ), H = b(
146
+ ), S = b(
147
147
  (n) => {
148
148
  let R = !1;
149
149
  switch (r) {
@@ -160,15 +160,15 @@ const Z = ({
160
160
  R = n.deltaY > 100;
161
161
  break;
162
162
  }
163
- R && (W("light"), o()), t(0), u(!1);
163
+ R && (K("light"), o()), t(0), u(!1);
164
164
  },
165
165
  [r, o]
166
- ), { ref: D } = V({
166
+ ), { ref: D } = A({
167
167
  enabled: x && e,
168
168
  onPanStart: () => u(!0),
169
169
  onPan: h,
170
- onPanEnd: H
171
- }), L = b(
170
+ onPanEnd: S
171
+ }), P = b(
172
172
  (n) => {
173
173
  s && n.target === n.currentTarget && o();
174
174
  },
@@ -176,18 +176,18 @@ const Z = ({
176
176
  );
177
177
  if (!e)
178
178
  return null;
179
- const I = r === "left" || r === "right", S = I ? { width: typeof v == "number" ? `${v}px` : v } : { height: typeof v == "number" ? `${v}px` : v }, i = () => {
179
+ const I = r === "left" || r === "right", B = I ? { width: typeof v == "number" ? `${v}px` : v } : { height: typeof v == "number" ? `${v}px` : v }, i = () => {
180
180
  if (p)
181
181
  return I ? `translateX(${c}px)` : `translateY(${c}px)`;
182
182
  };
183
183
  return X(
184
- /* @__PURE__ */ C(K, { children: [
184
+ /* @__PURE__ */ H(O, { children: [
185
185
  /* @__PURE__ */ a(
186
186
  "div",
187
187
  {
188
188
  className: `nice-drawer__overlay ${e ? "nice-drawer__overlay--visible" : ""}`,
189
- style: { zIndex: _ },
190
- onClick: L
189
+ style: { zIndex: N },
190
+ onClick: P
191
191
  }
192
192
  ),
193
193
  /* @__PURE__ */ a(
@@ -198,8 +198,8 @@ const Z = ({
198
198
  },
199
199
  className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${k || ""}`,
200
200
  style: {
201
- ...S,
202
- zIndex: _ + 1,
201
+ ...B,
202
+ zIndex: N + 1,
203
203
  transform: i(),
204
204
  transition: p ? "none" : void 0,
205
205
  ...M
@@ -224,25 +224,25 @@ const Z = ({
224
224
  initialSnap: s = 0,
225
225
  expandable: d = !0,
226
226
  closeOnBackdropClick: x = !0,
227
- closeOnEscape: _ = !0,
227
+ closeOnEscape: N = !0,
228
228
  hapticFeedback: k = !0,
229
229
  zIndex: M = 1e3,
230
230
  className: y,
231
231
  style: p
232
232
  }) => {
233
- const u = E(null), c = E(null), [t, g] = P(s), [h, H] = P(!1), [D, L] = P(0), I = E(0);
233
+ const u = E(null), c = E(null), [t, g] = L(s), [h, S] = L(!1), [D, P] = L(0), I = E(0);
234
234
  Y(() => {
235
- e && (g(s), L(0));
235
+ e && (g(s), P(0));
236
236
  }, [e, s]), j(u, e);
237
- const S = O();
237
+ const B = W();
238
238
  Y(() => {
239
- if (!_ || !e)
239
+ if (!N || !e)
240
240
  return;
241
241
  const f = (w) => {
242
242
  w.key === "Escape" && (w.preventDefault(), o());
243
243
  };
244
244
  return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
245
- }, [_, e, o]), Y(() => {
245
+ }, [N, e, o]), Y(() => {
246
246
  if (e) {
247
247
  const f = document.body.style.overflow;
248
248
  return document.body.style.overflow = "hidden", () => {
@@ -251,23 +251,23 @@ const Z = ({
251
251
  }
252
252
  }, [e]);
253
253
  const i = b((f) => {
254
- const w = f.target.closest(".nice-bottom-sheet__handle"), B = c.current, A = !B || B.scrollTop <= 0;
255
- !w && !A || (H(!0), I.current = f.touches[0].clientY);
254
+ const w = f.target.closest(".nice-bottom-sheet__handle"), C = c.current, z = !C || C.scrollTop <= 0;
255
+ !w && !z || (S(!0), I.current = f.touches[0].clientY);
256
256
  }, []), n = b(
257
257
  (f) => {
258
258
  if (!h)
259
259
  return;
260
260
  const w = f.touches[0].clientY - I.current;
261
- (w > 0 || t < l.length - 1) && L(w);
261
+ (w > 0 || t < l.length - 1) && P(w);
262
262
  },
263
263
  [h, t, l.length]
264
- ), N = b(() => {
264
+ ), _ = b(() => {
265
265
  if (!h)
266
266
  return;
267
267
  const f = window.innerHeight;
268
268
  l[t] * f;
269
- const w = -D, B = f * 0.15;
270
- w > B && d && t < l.length - 1 ? (g(t + 1), k && W("selection")) : w < -B && (t > 0 ? (g(t - 1), k && W("selection")) : (k && W("light"), o())), H(!1), L(0);
269
+ const w = -D, C = f * 0.15;
270
+ w > C && d && t < l.length - 1 ? (g(t + 1), k && K("selection")) : w < -C && (t > 0 ? (g(t - 1), k && K("selection")) : (k && K("light"), o())), S(!1), P(0);
271
271
  }, [h, D, t, l, d, k, o]), R = b(() => {
272
272
  x && o();
273
273
  }, [x, o]);
@@ -275,7 +275,7 @@ const Z = ({
275
275
  return null;
276
276
  const T = l[t] * 100, $ = h ? D : 0;
277
277
  return X(
278
- /* @__PURE__ */ C(K, { children: [
278
+ /* @__PURE__ */ H(O, { children: [
279
279
  /* @__PURE__ */ a(
280
280
  "div",
281
281
  {
@@ -284,7 +284,7 @@ const Z = ({
284
284
  onClick: R
285
285
  }
286
286
  ),
287
- /* @__PURE__ */ C(
287
+ /* @__PURE__ */ H(
288
288
  "div",
289
289
  {
290
290
  ref: u,
@@ -302,7 +302,7 @@ const Z = ({
302
302
  tabIndex: -1,
303
303
  onTouchStart: i,
304
304
  onTouchMove: n,
305
- onTouchEnd: N,
305
+ onTouchEnd: _,
306
306
  children: [
307
307
  v && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__handle", "aria-hidden": "true" }),
308
308
  r && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__title", children: r }),
@@ -311,7 +311,7 @@ const Z = ({
311
311
  }
312
312
  )
313
313
  ] }),
314
- S
314
+ B
315
315
  );
316
316
  }, ae = ({
317
317
  trigger: e,
@@ -323,28 +323,28 @@ const Z = ({
323
323
  hoverDelay: s = 200,
324
324
  offset: d = 8,
325
325
  className: x,
326
- showArrow: _ = !0
326
+ showArrow: N = !0
327
327
  }) => {
328
- const [k, M] = P(!1), y = E(null), p = E(null), u = E(null), c = O(), t = v !== void 0, g = t ? v : k, h = b(
328
+ const [k, M] = L(!1), y = E(null), p = E(null), u = E(null), c = W(), t = v !== void 0, g = t ? v : k, h = b(
329
329
  (i) => {
330
330
  t || M(i), l?.(i);
331
331
  },
332
332
  [t, l]
333
333
  );
334
- z(p, () => {
334
+ Q(p, () => {
335
335
  r !== "manual" && g && h(!1);
336
336
  });
337
- const H = b(() => {
337
+ const S = b(() => {
338
338
  r === "click" && h(!g);
339
339
  }, [r, g, h]), D = b(() => {
340
340
  r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!0), s));
341
- }, [r, s, h]), L = b(() => {
341
+ }, [r, s, h]), P = b(() => {
342
342
  r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!1), s));
343
- }, [r, s, h]), [I, S] = P({ top: 0, left: 0 });
343
+ }, [r, s, h]), [I, B] = L({ top: 0, left: 0 });
344
344
  return Y(() => {
345
345
  if (!g || !y.current || !p.current)
346
346
  return;
347
- const i = y.current.getBoundingClientRect(), n = p.current.getBoundingClientRect(), N = window.innerWidth, R = window.innerHeight;
347
+ const i = y.current.getBoundingClientRect(), n = p.current.getBoundingClientRect(), _ = window.innerWidth, R = window.innerHeight;
348
348
  let T = 0, $ = 0;
349
349
  const [f, w = "center"] = m.split("-");
350
350
  switch (f) {
@@ -361,22 +361,22 @@ const Z = ({
361
361
  T = i.top + (i.height - n.height) / 2, $ = i.right + d;
362
362
  break;
363
363
  }
364
- f === "top" || f === "bottom" ? (w === "start" && ($ = i.left), w === "end" && ($ = i.right - n.width)) : (w === "start" && (T = i.top), w === "end" && (T = i.bottom - n.height)), $ = Math.max(8, Math.min(N - n.width - 8, $)), T = Math.max(8, Math.min(R - n.height - 8, T)), S({ top: T, left: $ });
365
- }, [g, m, d]), /* @__PURE__ */ C(K, { children: [
364
+ f === "top" || f === "bottom" ? (w === "start" && ($ = i.left), w === "end" && ($ = i.right - n.width)) : (w === "start" && (T = i.top), w === "end" && (T = i.bottom - n.height)), $ = Math.max(8, Math.min(_ - n.width - 8, $)), T = Math.max(8, Math.min(R - n.height - 8, T)), B({ top: T, left: $ });
365
+ }, [g, m, d]), /* @__PURE__ */ H(O, { children: [
366
366
  /* @__PURE__ */ a(
367
367
  "div",
368
368
  {
369
369
  ref: y,
370
370
  className: "nice-popover__trigger",
371
- onClick: H,
371
+ onClick: S,
372
372
  onMouseEnter: D,
373
- onMouseLeave: L,
373
+ onMouseLeave: P,
374
374
  style: { display: "inline-block" },
375
375
  children: e
376
376
  }
377
377
  ),
378
378
  g && X(
379
- /* @__PURE__ */ C(
379
+ /* @__PURE__ */ H(
380
380
  "div",
381
381
  {
382
382
  ref: p,
@@ -388,10 +388,10 @@ const Z = ({
388
388
  zIndex: 1100
389
389
  },
390
390
  onMouseEnter: D,
391
- onMouseLeave: L,
391
+ onMouseLeave: P,
392
392
  role: "tooltip",
393
393
  children: [
394
- _ && /* @__PURE__ */ a("div", { className: "nice-popover__arrow" }),
394
+ N && /* @__PURE__ */ a("div", { className: "nice-popover__arrow" }),
395
395
  /* @__PURE__ */ a("div", { className: "nice-popover__content", children: o })
396
396
  ]
397
397
  }
@@ -406,8 +406,8 @@ const Z = ({
406
406
  onClose: r,
407
407
  className: v
408
408
  }) => {
409
- const [l, s] = P(!1), [d, x] = P({ x: 0, y: 0 }), _ = E(null), k = E(null), M = O();
410
- z(_, () => {
409
+ const [l, s] = L(!1), [d, x] = L({ x: 0, y: 0 }), N = E(null), k = E(null), M = W();
410
+ Q(N, () => {
411
411
  l && (s(!1), r?.());
412
412
  });
413
413
  const y = b(
@@ -429,7 +429,7 @@ const Z = ({
429
429
  };
430
430
  return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
431
431
  }, [l, r]);
432
- const u = (c) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: c.map((t) => t.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, t.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ C(
432
+ const u = (c) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: c.map((t) => t.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, t.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ H(
433
433
  "button",
434
434
  {
435
435
  type: "button",
@@ -443,13 +443,13 @@ const Z = ({
443
443
  ]
444
444
  }
445
445
  ) }, t.key)) });
446
- return /* @__PURE__ */ C(K, { children: [
446
+ return /* @__PURE__ */ H(O, { children: [
447
447
  /* @__PURE__ */ a("div", { ref: k, onContextMenu: y, style: { display: "contents" }, children: o }),
448
448
  l && X(
449
449
  /* @__PURE__ */ a(
450
450
  "div",
451
451
  {
452
- ref: _,
452
+ ref: N,
453
453
  className: `nice-context-menu ${v || ""}`,
454
454
  style: {
455
455
  position: "fixed",
@@ -474,7 +474,7 @@ export {
474
474
  ie as NiceContextMenu,
475
475
  re as NiceDrawer,
476
476
  fe as NiceLoadPanel,
477
- Z as NiceModal,
477
+ F as NiceModal,
478
478
  te as NiceModalBody,
479
479
  ne as NiceModalFooter,
480
480
  ee as NiceModalHeader,
@@ -486,7 +486,7 @@ export {
486
486
  be as NiceTutorial,
487
487
  ye as NiceTutorialProvider,
488
488
  pe as NiceWindow,
489
- Ne as NiceWindowManager,
490
- _e as useCommandPalette,
489
+ _e as NiceWindowManager,
490
+ Ne as useCommandPalette,
491
491
  ke as useRegisterCommands
492
492
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nice2dev/ui",
3
- "version": "1.0.10",
4
- "description": "Nice2Dev UI Universal, themeable, i18n-ready React component library",
3
+ "version": "1.0.11",
4
+ "description": "Nice2Dev UI — Universal, themeable, i18n-ready React component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
@@ -95,8 +95,8 @@
95
95
  "react-dom": ">=17.0.0"
96
96
  },
97
97
  "dependencies": {
98
- "@nice2dev/i18n": "^1.0.10",
99
- "@nice2dev/ui-core": "^1.0.10"
98
+ "@nice2dev/i18n": "1.0.11",
99
+ "@nice2dev/ui-core": "1.0.11"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@playwright/test": "^1.49.0",