@nice2dev/ui 1.0.6 → 1.0.8

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 (99) hide show
  1. package/dist/NiceAPIFlow.doc-DnQLPUie.js +30 -0
  2. package/dist/NiceAPIFlow.doc-Dx4qw1lm.cjs +6 -0
  3. package/dist/NiceBranchManager.doc-BXjiENlD.cjs +6 -0
  4. package/dist/NiceBranchManager.doc-xLB82YwU.js +30 -0
  5. package/dist/NiceButton-CDiS45Ya.cjs +1 -0
  6. package/dist/NiceButton-D9l39Rs7.js +595 -0
  7. package/dist/NiceCodeTemplate.doc-BWxTE4C_.cjs +6 -0
  8. package/dist/NiceCodeTemplate.doc-CA2U5F-v.js +30 -0
  9. package/dist/NiceDataBranchGraph.doc-CkitupWc.js +29 -0
  10. package/dist/NiceDataBranchGraph.doc-DDUgipqH.cjs +5 -0
  11. package/dist/NiceDataBranchManager.doc-B0ODKOs4.js +30 -0
  12. package/dist/NiceDataBranchManager.doc-CC5o8ihs.cjs +6 -0
  13. package/dist/NiceDataConflictResolver.doc-CdzScNie.cjs +5 -0
  14. package/dist/NiceDataConflictResolver.doc-V8vxYAeo.js +29 -0
  15. package/dist/NiceDataDiffViewer.doc-CR14Bq3A.cjs +6 -0
  16. package/dist/NiceDataDiffViewer.doc-w2I2QjhX.js +30 -0
  17. package/dist/NiceDataMapper.doc-C7jSyHRM.js +30 -0
  18. package/dist/NiceDataMapper.doc-DXjQHz87.cjs +6 -0
  19. package/dist/NiceDataMergeBuilder.doc-CV32WC_w.cjs +6 -0
  20. package/dist/NiceDataMergeBuilder.doc-DtuYb3nx.js +30 -0
  21. package/dist/NiceDataSnapshot.doc-CFLkY3ry.js +30 -0
  22. package/dist/NiceDataSnapshot.doc-CpZyQ17u.cjs +6 -0
  23. package/dist/NiceErrorBoundary-BAeqfoSc.cjs +1 -0
  24. package/dist/NiceErrorBoundary-niMx1aSJ.js +837 -0
  25. package/dist/NiceEventOrchestrator.doc-C4SJfIDV.js +30 -0
  26. package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +6 -0
  27. package/dist/NiceGitBlame.doc-BG3_K9_0.cjs +6 -0
  28. package/dist/NiceGitBlame.doc-DrJABEat.js +30 -0
  29. package/dist/NiceGitConflictResolver.doc-BK7hAfz6.js +30 -0
  30. package/dist/NiceGitConflictResolver.doc-CgroGM9_.cjs +6 -0
  31. package/dist/NiceGitDiffViewer.doc-BAwgcY_3.cjs +6 -0
  32. package/dist/NiceGitDiffViewer.doc-BXKJeP-E.js +30 -0
  33. package/dist/NiceGitGraph.doc-B-WtGuzn.cjs +5 -0
  34. package/dist/NiceGitGraph.doc-DxnDPCgC.js +29 -0
  35. package/dist/NiceGitHooks.doc-BrEizvMp.js +29 -0
  36. package/dist/NiceGitHooks.doc-C4EdV5zj.cjs +5 -0
  37. package/dist/NiceMergeRequestBuilder.doc-C5p8mYuh.cjs +6 -0
  38. package/dist/NiceMergeRequestBuilder.doc-Ct9RCmU8.js +30 -0
  39. package/dist/NiceModuleLifecyclePanel-Brg1RLwi.cjs +1 -0
  40. package/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5053 -0
  41. package/dist/NicePinCodeInput-CrMfdxxc.js +15287 -0
  42. package/dist/NicePinCodeInput-D0aF9MK8.cjs +692 -0
  43. package/dist/NicePipelineEditor.doc-0eGt8zbX.cjs +5 -0
  44. package/dist/NicePipelineEditor.doc-DTmaOebn.js +29 -0
  45. package/dist/NicePipelineMonitor.doc-67CmsRcf.cjs +5 -0
  46. package/dist/NicePipelineMonitor.doc-mSMdhuG8.js +29 -0
  47. package/dist/NiceSavedQueryPanel-BZNvqSQW.cjs +596 -0
  48. package/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6190 -0
  49. package/dist/NiceStateDesigner.doc-B36u0hNU.js +29 -0
  50. package/dist/NiceStateDesigner.doc-MPmvNHSx.cjs +5 -0
  51. package/dist/NiceTestBuilder.doc-BFInj8GJ.js +30 -0
  52. package/dist/NiceTestBuilder.doc-CB03U_uR.cjs +6 -0
  53. package/dist/NiceToggle-CaY1u82g.js +277 -0
  54. package/dist/NiceToggle-DFJFQv_Z.cjs +1 -0
  55. package/dist/NiceWindow-IdHAcP70.cjs +1 -0
  56. package/dist/NiceWindow-SiCaREbq.js +1408 -0
  57. package/dist/charts-Bx_kNBsE.js +4280 -0
  58. package/dist/charts-DECVsCHX.cjs +754 -0
  59. package/dist/charts.cjs +1 -1
  60. package/dist/charts.css +1 -0
  61. package/dist/charts.d.ts +3 -3
  62. package/dist/charts.mjs +1 -1
  63. package/dist/core-BZBTsGWN.cjs +96 -0
  64. package/dist/core-BpghV7Ls.js +17555 -0
  65. package/dist/data-branching-De4ExX-S.cjs +1 -0
  66. package/dist/data-branching-DiRfob1f.js +6071 -0
  67. package/dist/data-branching.cjs +1 -0
  68. package/dist/data-branching.d.ts +401 -0
  69. package/dist/data-branching.mjs +9 -0
  70. package/dist/data.cjs +1 -1
  71. package/dist/data.mjs +1 -1
  72. package/dist/devops-BnYinjkT.cjs +17 -0
  73. package/dist/devops-Ckh57eti.js +7198 -0
  74. package/dist/devops.cjs +1 -0
  75. package/dist/devops.d.ts +758 -0
  76. package/dist/devops.mjs +12 -0
  77. package/dist/editors.cjs +1 -1
  78. package/dist/editors.mjs +3 -3
  79. package/dist/feedback.cjs +1 -1
  80. package/dist/feedback.mjs +1 -1
  81. package/dist/index-CBIZ6mTQ.cjs +5734 -0
  82. package/dist/index-CIl98Vbm.js +72951 -0
  83. package/dist/index.cjs +1 -1
  84. package/dist/index.css +1 -1
  85. package/dist/index.d.ts +3643 -93
  86. package/dist/index.mjs +1001 -952
  87. package/dist/lazy.cjs +1 -0
  88. package/dist/lazy.d.ts +1880 -0
  89. package/dist/lazy.mjs +98 -0
  90. package/dist/navigation.cjs +1 -1
  91. package/dist/navigation.mjs +69 -12
  92. package/dist/no-code-BCuadkm4.cjs +332 -0
  93. package/dist/no-code-TL7PyulA.js +7005 -0
  94. package/dist/no-code.cjs +1 -0
  95. package/dist/no-code.d.ts +870 -0
  96. package/dist/no-code.mjs +13 -0
  97. package/dist/overlays.cjs +1 -1
  98. package/dist/overlays.mjs +480 -24
  99. package/package.json +21 -1
@@ -0,0 +1,13 @@
1
+ import { N as i, a as s, b as c, c as o, d as r, e as t, f as N, g as d, h as n, i as p } from "./no-code-TL7PyulA.js";
2
+ export {
3
+ i as NiceAPIFlow,
4
+ s as NiceCodePreview,
5
+ c as NiceCodeTemplate,
6
+ o as NiceComponentDesigner,
7
+ r as NiceDataMapper,
8
+ t as NiceEventOrchestrator,
9
+ N as NiceLowCodeStudio,
10
+ d as NicePageBuilder,
11
+ n as NiceStateDesigner,
12
+ p as NiceTestBuilder
13
+ };
package/dist/overlays.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NiceWindow-yARTUJsg.cjs");exports.NiceActionSheet=e.NiceActionSheet;exports.NiceBlockUI=e.NiceBlockUI;exports.NiceBottomSheet=e.NiceBottomSheet;exports.NiceBox=e.NiceBox;exports.NiceCommandPaletteProvider=e.NiceCommandPaletteProvider;exports.NiceContextMenu=e.NiceContextMenu;exports.NiceDrawer=e.NiceDrawer;exports.NiceLoadPanel=e.NiceLoadPanel;exports.NiceModal=e.NiceModal;exports.NiceModalBody=e.NiceModalBody;exports.NiceModalFooter=e.NiceModalFooter;exports.NiceModalHeader=e.NiceModalHeader;exports.NiceOverlayPopover=e.NicePopover;exports.NicePopover=e.NicePopover$1;exports.NiceResizable=e.NiceResizable;exports.NiceResponsiveBox=e.NiceResponsiveBox;exports.NiceScrollView=e.NiceScrollView;exports.NiceTutorial=e.NiceTutorial;exports.NiceTutorialProvider=e.NiceTutorialProvider;exports.NiceWindow=e.NiceWindow;exports.NiceWindowManager=e.NiceWindowManager;exports.useCommandPalette=e.useCommandPalette;exports.useRegisterCommands=e.useRegisterCommands;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./NiceWindow-IdHAcP70.cjs"),t=require("react/jsx-runtime"),e=require("react"),H=require("react-dom"),C=require("./core-BZBTsGWN.cjs"),B=({open:n,onClose:i,children:m,title:a,size:v="md",closeOnBackdropClick:d=!0,closeOnEscape:u=!0,disableFocusTrap:f=!1,disableBodyScroll:p=!0,zIndex:k=1e3,className:_,style:M})=>{const x=e.useRef(null);C.useFocusTrap(x,n&&!f),e.useEffect(()=>{if(!p&&n){const o=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=o}}},[n,p]),e.useEffect(()=>{if(!u||!n)return;const o=l=>{l.key==="Escape"&&(l.preventDefault(),i())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[u,n,i]);const N=e.useCallback(o=>{d&&o.target===o.currentTarget&&i()},[d,i]);if(!n)return null;const c={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[v];return H.createPortal(t.jsx("div",{className:"nice-modal__overlay",style:{zIndex:k},onClick:N,role:"presentation",children:t.jsx("div",{ref:x,className:`nice-modal ${c} ${_||""}`,role:"dialog","aria-modal":"true","aria-label":a,style:M,tabIndex:-1,children:m})}),document.body)},Y=({children:n,showClose:i=!0,onClose:m,className:a})=>t.jsxs("div",{className:`nice-modal__header ${a||""}`,children:[t.jsx("div",{className:"nice-modal__title",children:n}),i&&m&&t.jsx("button",{type:"button",className:"nice-modal__close",onClick:m,"aria-label":"Close",children:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:t.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),W=({children:n,className:i})=>t.jsx("div",{className:`nice-modal__body ${i||""}`,children:n}),F=({children:n,className:i})=>t.jsx("div",{className:`nice-modal__footer ${i||""}`,children:n}),O=({open:n,onClose:i,children:m,position:a="right",size:v=320,title:d,closeOnBackdropClick:u=!0,closeOnEscape:f=!0,swipeToClose:p=!0,zIndex:k=1e3,className:_,style:M})=>{const x=e.useRef(null),[N,c]=e.useState(!1),[o,l]=e.useState(0);C.useFocusTrap(x,n),e.useEffect(()=>{if(!f||!n)return;const r=y=>{y.key==="Escape"&&(y.preventDefault(),i())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[f,n,i]);const w=e.useCallback(r=>{let y=0;switch(a){case"left":y=Math.min(0,r.deltaX);break;case"right":y=Math.max(0,r.deltaX);break;case"top":y=Math.min(0,r.deltaY);break;case"bottom":y=Math.max(0,r.deltaY);break}l(y)},[a]),T=e.useCallback(r=>{let P=!1;switch(a){case"left":P=r.deltaX<-100;break;case"right":P=r.deltaX>100;break;case"top":P=r.deltaY<-100;break;case"bottom":P=r.deltaY>100;break}P&&(C.triggerHaptic("light"),i()),l(0),c(!1)},[a,i]),{ref:S}=C.usePan({enabled:p&&n,onPanStart:()=>c(!0),onPan:w,onPanEnd:T}),$=e.useCallback(r=>{u&&r.target===r.currentTarget&&i()},[u,i]);if(!n)return null;const E=a==="left"||a==="right",D=E?{width:typeof v=="number"?`${v}px`:v}:{height:typeof v=="number"?`${v}px`:v},s=()=>{if(N)return E?`translateX(${o}px)`:`translateY(${o}px)`};return H.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`nice-drawer__overlay ${n?"nice-drawer__overlay--visible":""}`,style:{zIndex:k},onClick:$}),t.jsx("div",{ref:r=>{x.current=r,S.current=r},className:`nice-drawer nice-drawer--${a} ${n?"nice-drawer--open":""} ${_||""}`,style:{...D,zIndex:k+1,transform:s(),transition:N?"none":void 0,...M},role:"dialog","aria-modal":"true","aria-label":d,tabIndex:-1,children:m})]}),document.body)},X=({open:n,onClose:i,children:m,title:a,showHandle:v=!0,snapPoints:d=[.5,.9],initialSnap:u=0,expandable:f=!0,closeOnBackdropClick:p=!0,closeOnEscape:k=!0,hapticFeedback:_=!0,zIndex:M=1e3,className:x,style:N})=>{const c=e.useRef(null),o=e.useRef(null),[l,w]=e.useState(u),[T,S]=e.useState(!1),[$,E]=e.useState(0),D=e.useRef(0);e.useEffect(()=>{n&&(w(u),E(0))},[n,u]),C.useFocusTrap(c,n),e.useEffect(()=>{if(!k||!n)return;const h=b=>{b.key==="Escape"&&(b.preventDefault(),i())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[k,n,i]),e.useEffect(()=>{if(n){const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}}},[n]);const s=e.useCallback(h=>{const b=h.target.closest(".nice-bottom-sheet__handle"),L=o.current,I=!L||L.scrollTop<=0;!b&&!I||(S(!0),D.current=h.touches[0].clientY)},[]),r=e.useCallback(h=>{if(!T)return;const b=h.touches[0].clientY-D.current;(b>0||l<d.length-1)&&E(b)},[T,l,d.length]),y=e.useCallback(()=>{if(!T)return;const h=window.innerHeight;d[l]*h;const b=-$,L=h*.15;b>L&&f&&l<d.length-1?(w(l+1),_&&C.triggerHaptic("selection")):b<-L&&(l>0?(w(l-1),_&&C.triggerHaptic("selection")):(_&&C.triggerHaptic("light"),i())),S(!1),E(0)},[T,$,l,d,f,_,i]),P=e.useCallback(()=>{p&&i()},[p,i]);if(!n)return null;const j=d[l]*100,R=T?$:0;return H.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`nice-bottom-sheet__overlay ${n?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:M},onClick:P}),t.jsxs("div",{ref:c,className:`nice-bottom-sheet ${n?"nice-bottom-sheet--open":""} ${x||""}`,style:{zIndex:M+1,height:`${j}vh`,transform:`translateY(${Math.max(0,R)}px)`,transition:T?"none":"transform 0.3s ease-out, height 0.3s ease-out",...N},role:"dialog","aria-modal":"true","aria-label":a,tabIndex:-1,onTouchStart:s,onTouchMove:r,onTouchEnd:y,children:[v&&t.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),a&&t.jsx("div",{className:"nice-bottom-sheet__title",children:a}),t.jsx("div",{ref:o,className:"nice-bottom-sheet__content",children:m})]})]}),document.body)},q=({trigger:n,children:i,placement:m="bottom",triggerMode:a="click",open:v,onOpenChange:d,hoverDelay:u=200,offset:f=8,className:p,showArrow:k=!0})=>{const[_,M]=e.useState(!1),x=e.useRef(null),N=e.useRef(null),c=e.useRef(null),o=v!==void 0,l=o?v:_,w=e.useCallback(s=>{o||M(s),d?.(s)},[o,d]);C.useClickOutside(N,()=>{a!=="manual"&&l&&w(!1)});const T=e.useCallback(()=>{a==="click"&&w(!l)},[a,l,w]),S=e.useCallback(()=>{a==="hover"&&(c.current&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>w(!0),u))},[a,u,w]),$=e.useCallback(()=>{a==="hover"&&(c.current&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>w(!1),u))},[a,u,w]),[E,D]=e.useState({top:0,left:0});return e.useEffect(()=>{if(!l||!x.current||!N.current)return;const s=x.current.getBoundingClientRect(),r=N.current.getBoundingClientRect(),y=window.innerWidth,P=window.innerHeight;let j=0,R=0;const[h,b="center"]=m.split("-");switch(h){case"top":j=s.top-r.height-f,R=s.left+(s.width-r.width)/2;break;case"bottom":j=s.bottom+f,R=s.left+(s.width-r.width)/2;break;case"left":j=s.top+(s.height-r.height)/2,R=s.left-r.width-f;break;case"right":j=s.top+(s.height-r.height)/2,R=s.right+f;break}h==="top"||h==="bottom"?(b==="start"&&(R=s.left),b==="end"&&(R=s.right-r.width)):(b==="start"&&(j=s.top),b==="end"&&(j=s.bottom-r.height)),R=Math.max(8,Math.min(y-r.width-8,R)),j=Math.max(8,Math.min(P-r.height-8,j)),D({top:j,left:R})},[l,m,f]),t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:x,className:"nice-popover__trigger",onClick:T,onMouseEnter:S,onMouseLeave:$,style:{display:"inline-block"},children:n}),l&&H.createPortal(t.jsxs("div",{ref:N,className:`nice-popover nice-popover--${m} ${p||""}`,style:{position:"fixed",top:E.top,left:E.left,zIndex:1100},onMouseEnter:S,onMouseLeave:$,role:"tooltip",children:[k&&t.jsx("div",{className:"nice-popover__arrow"}),t.jsx("div",{className:"nice-popover__content",children:i})]}),document.body)]})},K=({items:n,children:i,onOpen:m,onClose:a,className:v})=>{const[d,u]=e.useState(!1),[f,p]=e.useState({x:0,y:0}),k=e.useRef(null),_=e.useRef(null);C.useClickOutside(k,()=>{d&&(u(!1),a?.())});const M=e.useCallback(c=>{c.preventDefault(),p({x:c.clientX,y:c.clientY}),u(!0),m?.()},[m]),x=e.useCallback(c=>{!c.disabled&&c.onClick&&(c.onClick(),u(!1),a?.())},[a]);e.useEffect(()=>{if(!d)return;const c=o=>{o.key==="Escape"&&(u(!1),a?.())};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[d,a]);const N=c=>t.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:c.map(o=>o.divider?t.jsx("li",{className:"nice-context-menu__divider",role:"separator"},o.key):t.jsx("li",{role:"presentation",children:t.jsxs("button",{type:"button",className:`nice-context-menu__item ${o.disabled?"nice-context-menu__item--disabled":""} ${o.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:o.disabled,onClick:()=>x(o),children:[o.icon&&t.jsx("span",{className:"nice-context-menu__icon",children:o.icon}),t.jsx("span",{className:"nice-context-menu__label",children:o.label})]})},o.key))});return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:_,onContextMenu:M,style:{display:"contents"},children:i}),d&&H.createPortal(t.jsx("div",{ref:k,className:`nice-context-menu ${v||""}`,style:{position:"fixed",left:f.x,top:f.y,zIndex:1200},role:"menu",children:N(n)}),document.body)]})};exports.NiceActionSheet=g.NiceActionSheet;exports.NiceBlockUI=g.NiceBlockUI;exports.NiceBox=g.NiceBox;exports.NiceCommandPaletteProvider=g.NiceCommandPaletteProvider;exports.NiceLoadPanel=g.NiceLoadPanel;exports.NicePopover=g.NicePopover;exports.NiceResizable=g.NiceResizable;exports.NiceResponsiveBox=g.NiceResponsiveBox;exports.NiceScrollView=g.NiceScrollView;exports.NiceTutorial=g.NiceTutorial;exports.NiceTutorialProvider=g.NiceTutorialProvider;exports.NiceWindow=g.NiceWindow;exports.NiceWindowManager=g.NiceWindowManager;exports.useCommandPalette=g.useCommandPalette;exports.useRegisterCommands=g.useRegisterCommands;exports.NiceBottomSheet=X;exports.NiceContextMenu=K;exports.NiceDrawer=O;exports.NiceModal=B;exports.NiceModalBody=W;exports.NiceModalFooter=F;exports.NiceModalHeader=Y;exports.NiceOverlayPopover=q;
package/dist/overlays.mjs CHANGED
@@ -1,26 +1,482 @@
1
- import { N as i, a as o, b as s, c, d as N, e as r, f as t, g as d, h as l, i as n, j as m, k as v, l as P, m as u, n as M, o as p, p as B, q as w, r as x, s as C, t as g, u as h, v as R } from "./NiceWindow-D1awkyFl.js";
1
+ import { N as ie, a as ae, b as ce, c as le, d as se, e as de, f as ue, g as he, h as me, i as fe, j as ve, k as ge, l as be, u as we, m as ye } from "./NiceWindow-SiCaREbq.js";
2
+ import { jsxs as Y, Fragment as W, jsx as a } from "react/jsx-runtime";
3
+ import { useRef as E, useState as L, useEffect as I, useCallback as g } from "react";
4
+ import { createPortal as C } from "react-dom";
5
+ import { c as K, t as X, d as O, e as z } from "./core-BpghV7Ls.js";
6
+ const F = ({
7
+ open: e,
8
+ onClose: o,
9
+ children: m,
10
+ title: r,
11
+ size: f = "md",
12
+ closeOnBackdropClick: s = !0,
13
+ closeOnEscape: d = !0,
14
+ disableFocusTrap: u = !1,
15
+ disableBodyScroll: k = !0,
16
+ zIndex: N = 1e3,
17
+ className: p,
18
+ style: M
19
+ }) => {
20
+ const b = E(null);
21
+ K(b, e && !u), I(() => {
22
+ if (!k && e) {
23
+ const n = document.body.style.overflow;
24
+ return document.body.style.overflow = "hidden", () => {
25
+ document.body.style.overflow = n;
26
+ };
27
+ }
28
+ }, [e, k]), I(() => {
29
+ if (!d || !e)
30
+ return;
31
+ const n = (l) => {
32
+ l.key === "Escape" && (l.preventDefault(), o());
33
+ };
34
+ return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
35
+ }, [d, e, o]);
36
+ const w = g(
37
+ (n) => {
38
+ s && n.target === n.currentTarget && o();
39
+ },
40
+ [s, o]
41
+ );
42
+ if (!e)
43
+ return null;
44
+ const i = {
45
+ sm: "nice-modal--sm",
46
+ md: "nice-modal--md",
47
+ lg: "nice-modal--lg",
48
+ xl: "nice-modal--xl",
49
+ full: "nice-modal--full"
50
+ }[f];
51
+ return C(
52
+ /* @__PURE__ */ a(
53
+ "div",
54
+ {
55
+ className: "nice-modal__overlay",
56
+ style: { zIndex: N },
57
+ onClick: w,
58
+ role: "presentation",
59
+ children: /* @__PURE__ */ a(
60
+ "div",
61
+ {
62
+ ref: b,
63
+ className: `nice-modal ${i} ${p || ""}`,
64
+ role: "dialog",
65
+ "aria-modal": "true",
66
+ "aria-label": r,
67
+ style: M,
68
+ tabIndex: -1,
69
+ children: m
70
+ }
71
+ )
72
+ }
73
+ ),
74
+ document.body
75
+ );
76
+ }, G = ({
77
+ children: e,
78
+ showClose: o = !0,
79
+ onClose: m,
80
+ className: r
81
+ }) => /* @__PURE__ */ Y("div", { className: `nice-modal__header ${r || ""}`, children: [
82
+ /* @__PURE__ */ a("div", { className: "nice-modal__title", children: e }),
83
+ o && m && /* @__PURE__ */ a("button", { type: "button", className: "nice-modal__close", onClick: m, "aria-label": "Close", children: /* @__PURE__ */ a(
84
+ "svg",
85
+ {
86
+ width: "20",
87
+ height: "20",
88
+ viewBox: "0 0 20 20",
89
+ fill: "none",
90
+ stroke: "currentColor",
91
+ strokeWidth: "2",
92
+ children: /* @__PURE__ */ a("path", { d: "M4 4l12 12M4 16L16 4" })
93
+ }
94
+ ) })
95
+ ] }), J = ({ children: e, className: o }) => /* @__PURE__ */ a("div", { className: `nice-modal__body ${o || ""}`, children: e }), Q = ({ children: e, className: o }) => /* @__PURE__ */ a("div", { className: `nice-modal__footer ${o || ""}`, children: e }), Z = ({
96
+ open: e,
97
+ onClose: o,
98
+ children: m,
99
+ position: r = "right",
100
+ size: f = 320,
101
+ title: s,
102
+ closeOnBackdropClick: d = !0,
103
+ closeOnEscape: u = !0,
104
+ swipeToClose: k = !0,
105
+ zIndex: N = 1e3,
106
+ className: p,
107
+ style: M
108
+ }) => {
109
+ const b = E(null), [w, i] = L(!1), [n, l] = L(0);
110
+ K(b, e), I(() => {
111
+ if (!u || !e)
112
+ return;
113
+ const t = (_) => {
114
+ _.key === "Escape" && (_.preventDefault(), o());
115
+ };
116
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
117
+ }, [u, e, o]);
118
+ const y = g(
119
+ (t) => {
120
+ let _ = 0;
121
+ switch (r) {
122
+ case "left":
123
+ _ = Math.min(0, t.deltaX);
124
+ break;
125
+ case "right":
126
+ _ = Math.max(0, t.deltaX);
127
+ break;
128
+ case "top":
129
+ _ = Math.min(0, t.deltaY);
130
+ break;
131
+ case "bottom":
132
+ _ = Math.max(0, t.deltaY);
133
+ break;
134
+ }
135
+ l(_);
136
+ },
137
+ [r]
138
+ ), T = g(
139
+ (t) => {
140
+ let D = !1;
141
+ switch (r) {
142
+ case "left":
143
+ D = t.deltaX < -100;
144
+ break;
145
+ case "right":
146
+ D = t.deltaX > 100;
147
+ break;
148
+ case "top":
149
+ D = t.deltaY < -100;
150
+ break;
151
+ case "bottom":
152
+ D = t.deltaY > 100;
153
+ break;
154
+ }
155
+ D && (X("light"), o()), l(0), i(!1);
156
+ },
157
+ [r, o]
158
+ ), { ref: H } = z({
159
+ enabled: k && e,
160
+ onPanStart: () => i(!0),
161
+ onPan: y,
162
+ onPanEnd: T
163
+ }), P = g(
164
+ (t) => {
165
+ d && t.target === t.currentTarget && o();
166
+ },
167
+ [d, o]
168
+ );
169
+ if (!e)
170
+ return null;
171
+ const R = r === "left" || r === "right", S = R ? { width: typeof f == "number" ? `${f}px` : f } : { height: typeof f == "number" ? `${f}px` : f }, c = () => {
172
+ if (w)
173
+ return R ? `translateX(${n}px)` : `translateY(${n}px)`;
174
+ };
175
+ return C(
176
+ /* @__PURE__ */ Y(W, { children: [
177
+ /* @__PURE__ */ a(
178
+ "div",
179
+ {
180
+ className: `nice-drawer__overlay ${e ? "nice-drawer__overlay--visible" : ""}`,
181
+ style: { zIndex: N },
182
+ onClick: P
183
+ }
184
+ ),
185
+ /* @__PURE__ */ a(
186
+ "div",
187
+ {
188
+ ref: (t) => {
189
+ b.current = t, H.current = t;
190
+ },
191
+ className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${p || ""}`,
192
+ style: {
193
+ ...S,
194
+ zIndex: N + 1,
195
+ transform: c(),
196
+ transition: w ? "none" : void 0,
197
+ ...M
198
+ },
199
+ role: "dialog",
200
+ "aria-modal": "true",
201
+ "aria-label": s,
202
+ tabIndex: -1,
203
+ children: m
204
+ }
205
+ )
206
+ ] }),
207
+ document.body
208
+ );
209
+ }, ee = ({
210
+ open: e,
211
+ onClose: o,
212
+ children: m,
213
+ title: r,
214
+ showHandle: f = !0,
215
+ snapPoints: s = [0.5, 0.9],
216
+ initialSnap: d = 0,
217
+ expandable: u = !0,
218
+ closeOnBackdropClick: k = !0,
219
+ closeOnEscape: N = !0,
220
+ hapticFeedback: p = !0,
221
+ zIndex: M = 1e3,
222
+ className: b,
223
+ style: w
224
+ }) => {
225
+ const i = E(null), n = E(null), [l, y] = L(d), [T, H] = L(!1), [P, R] = L(0), S = E(0);
226
+ I(() => {
227
+ e && (y(d), R(0));
228
+ }, [e, d]), K(i, e), I(() => {
229
+ if (!N || !e)
230
+ return;
231
+ const h = (v) => {
232
+ v.key === "Escape" && (v.preventDefault(), o());
233
+ };
234
+ return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
235
+ }, [N, e, o]), I(() => {
236
+ if (e) {
237
+ const h = document.body.style.overflow;
238
+ return document.body.style.overflow = "hidden", () => {
239
+ document.body.style.overflow = h;
240
+ };
241
+ }
242
+ }, [e]);
243
+ const c = g((h) => {
244
+ const v = h.target.closest(".nice-bottom-sheet__handle"), B = n.current, j = !B || B.scrollTop <= 0;
245
+ !v && !j || (H(!0), S.current = h.touches[0].clientY);
246
+ }, []), t = g(
247
+ (h) => {
248
+ if (!T)
249
+ return;
250
+ const v = h.touches[0].clientY - S.current;
251
+ (v > 0 || l < s.length - 1) && R(v);
252
+ },
253
+ [T, l, s.length]
254
+ ), _ = g(() => {
255
+ if (!T)
256
+ return;
257
+ const h = window.innerHeight;
258
+ s[l] * h;
259
+ const v = -P, B = h * 0.15;
260
+ v > B && u && l < s.length - 1 ? (y(l + 1), p && X("selection")) : v < -B && (l > 0 ? (y(l - 1), p && X("selection")) : (p && X("light"), o())), H(!1), R(0);
261
+ }, [T, P, l, s, u, p, o]), D = g(() => {
262
+ k && o();
263
+ }, [k, o]);
264
+ if (!e)
265
+ return null;
266
+ const x = s[l] * 100, $ = T ? P : 0;
267
+ return C(
268
+ /* @__PURE__ */ Y(W, { children: [
269
+ /* @__PURE__ */ a(
270
+ "div",
271
+ {
272
+ className: `nice-bottom-sheet__overlay ${e ? "nice-bottom-sheet__overlay--visible" : ""}`,
273
+ style: { zIndex: M },
274
+ onClick: D
275
+ }
276
+ ),
277
+ /* @__PURE__ */ Y(
278
+ "div",
279
+ {
280
+ ref: i,
281
+ className: `nice-bottom-sheet ${e ? "nice-bottom-sheet--open" : ""} ${b || ""}`,
282
+ style: {
283
+ zIndex: M + 1,
284
+ height: `${x}vh`,
285
+ transform: `translateY(${Math.max(0, $)}px)`,
286
+ transition: T ? "none" : "transform 0.3s ease-out, height 0.3s ease-out",
287
+ ...w
288
+ },
289
+ role: "dialog",
290
+ "aria-modal": "true",
291
+ "aria-label": r,
292
+ tabIndex: -1,
293
+ onTouchStart: c,
294
+ onTouchMove: t,
295
+ onTouchEnd: _,
296
+ children: [
297
+ f && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__handle", "aria-hidden": "true" }),
298
+ r && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__title", children: r }),
299
+ /* @__PURE__ */ a("div", { ref: n, className: "nice-bottom-sheet__content", children: m })
300
+ ]
301
+ }
302
+ )
303
+ ] }),
304
+ document.body
305
+ );
306
+ }, te = ({
307
+ trigger: e,
308
+ children: o,
309
+ placement: m = "bottom",
310
+ triggerMode: r = "click",
311
+ open: f,
312
+ onOpenChange: s,
313
+ hoverDelay: d = 200,
314
+ offset: u = 8,
315
+ className: k,
316
+ showArrow: N = !0
317
+ }) => {
318
+ const [p, M] = L(!1), b = E(null), w = E(null), i = E(null), n = f !== void 0, l = n ? f : p, y = g(
319
+ (c) => {
320
+ n || M(c), s?.(c);
321
+ },
322
+ [n, s]
323
+ );
324
+ O(w, () => {
325
+ r !== "manual" && l && y(!1);
326
+ });
327
+ const T = g(() => {
328
+ r === "click" && y(!l);
329
+ }, [r, l, y]), H = g(() => {
330
+ r === "hover" && (i.current && window.clearTimeout(i.current), i.current = window.setTimeout(() => y(!0), d));
331
+ }, [r, d, y]), P = g(() => {
332
+ r === "hover" && (i.current && window.clearTimeout(i.current), i.current = window.setTimeout(() => y(!1), d));
333
+ }, [r, d, y]), [R, S] = L({ top: 0, left: 0 });
334
+ return I(() => {
335
+ if (!l || !b.current || !w.current)
336
+ return;
337
+ const c = b.current.getBoundingClientRect(), t = w.current.getBoundingClientRect(), _ = window.innerWidth, D = window.innerHeight;
338
+ let x = 0, $ = 0;
339
+ const [h, v = "center"] = m.split("-");
340
+ switch (h) {
341
+ case "top":
342
+ x = c.top - t.height - u, $ = c.left + (c.width - t.width) / 2;
343
+ break;
344
+ case "bottom":
345
+ x = c.bottom + u, $ = c.left + (c.width - t.width) / 2;
346
+ break;
347
+ case "left":
348
+ x = c.top + (c.height - t.height) / 2, $ = c.left - t.width - u;
349
+ break;
350
+ case "right":
351
+ x = c.top + (c.height - t.height) / 2, $ = c.right + u;
352
+ break;
353
+ }
354
+ h === "top" || h === "bottom" ? (v === "start" && ($ = c.left), v === "end" && ($ = c.right - t.width)) : (v === "start" && (x = c.top), v === "end" && (x = c.bottom - t.height)), $ = Math.max(8, Math.min(_ - t.width - 8, $)), x = Math.max(8, Math.min(D - t.height - 8, x)), S({ top: x, left: $ });
355
+ }, [l, m, u]), /* @__PURE__ */ Y(W, { children: [
356
+ /* @__PURE__ */ a(
357
+ "div",
358
+ {
359
+ ref: b,
360
+ className: "nice-popover__trigger",
361
+ onClick: T,
362
+ onMouseEnter: H,
363
+ onMouseLeave: P,
364
+ style: { display: "inline-block" },
365
+ children: e
366
+ }
367
+ ),
368
+ l && C(
369
+ /* @__PURE__ */ Y(
370
+ "div",
371
+ {
372
+ ref: w,
373
+ className: `nice-popover nice-popover--${m} ${k || ""}`,
374
+ style: {
375
+ position: "fixed",
376
+ top: R.top,
377
+ left: R.left,
378
+ zIndex: 1100
379
+ },
380
+ onMouseEnter: H,
381
+ onMouseLeave: P,
382
+ role: "tooltip",
383
+ children: [
384
+ N && /* @__PURE__ */ a("div", { className: "nice-popover__arrow" }),
385
+ /* @__PURE__ */ a("div", { className: "nice-popover__content", children: o })
386
+ ]
387
+ }
388
+ ),
389
+ document.body
390
+ )
391
+ ] });
392
+ }, ne = ({
393
+ items: e,
394
+ children: o,
395
+ onOpen: m,
396
+ onClose: r,
397
+ className: f
398
+ }) => {
399
+ const [s, d] = L(!1), [u, k] = L({ x: 0, y: 0 }), N = E(null), p = E(null);
400
+ O(N, () => {
401
+ s && (d(!1), r?.());
402
+ });
403
+ const M = g(
404
+ (i) => {
405
+ i.preventDefault(), k({ x: i.clientX, y: i.clientY }), d(!0), m?.();
406
+ },
407
+ [m]
408
+ ), b = g(
409
+ (i) => {
410
+ !i.disabled && i.onClick && (i.onClick(), d(!1), r?.());
411
+ },
412
+ [r]
413
+ );
414
+ I(() => {
415
+ if (!s)
416
+ return;
417
+ const i = (n) => {
418
+ n.key === "Escape" && (d(!1), r?.());
419
+ };
420
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
421
+ }, [s, r]);
422
+ const w = (i) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: i.map((n) => n.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, n.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ Y(
423
+ "button",
424
+ {
425
+ type: "button",
426
+ className: `nice-context-menu__item ${n.disabled ? "nice-context-menu__item--disabled" : ""} ${n.danger ? "nice-context-menu__item--danger" : ""}`,
427
+ role: "menuitem",
428
+ disabled: n.disabled,
429
+ onClick: () => b(n),
430
+ children: [
431
+ n.icon && /* @__PURE__ */ a("span", { className: "nice-context-menu__icon", children: n.icon }),
432
+ /* @__PURE__ */ a("span", { className: "nice-context-menu__label", children: n.label })
433
+ ]
434
+ }
435
+ ) }, n.key)) });
436
+ return /* @__PURE__ */ Y(W, { children: [
437
+ /* @__PURE__ */ a("div", { ref: p, onContextMenu: M, style: { display: "contents" }, children: o }),
438
+ s && C(
439
+ /* @__PURE__ */ a(
440
+ "div",
441
+ {
442
+ ref: N,
443
+ className: `nice-context-menu ${f || ""}`,
444
+ style: {
445
+ position: "fixed",
446
+ left: u.x,
447
+ top: u.y,
448
+ zIndex: 1200
449
+ },
450
+ role: "menu",
451
+ children: w(e)
452
+ }
453
+ ),
454
+ document.body
455
+ )
456
+ ] });
457
+ };
2
458
  export {
3
- i as NiceActionSheet,
4
- o as NiceBlockUI,
5
- s as NiceBottomSheet,
6
- c as NiceBox,
7
- N as NiceCommandPaletteProvider,
8
- r as NiceContextMenu,
9
- t as NiceDrawer,
10
- d as NiceLoadPanel,
11
- l as NiceModal,
12
- n as NiceModalBody,
13
- m as NiceModalFooter,
14
- v as NiceModalHeader,
15
- P as NiceOverlayPopover,
16
- u as NicePopover,
17
- M as NiceResizable,
18
- p as NiceResponsiveBox,
19
- B as NiceScrollView,
20
- w as NiceTutorial,
21
- x as NiceTutorialProvider,
22
- C as NiceWindow,
23
- g as NiceWindowManager,
24
- h as useCommandPalette,
25
- R as useRegisterCommands
459
+ ie as NiceActionSheet,
460
+ ae as NiceBlockUI,
461
+ ee as NiceBottomSheet,
462
+ ce as NiceBox,
463
+ le as NiceCommandPaletteProvider,
464
+ ne as NiceContextMenu,
465
+ Z as NiceDrawer,
466
+ se as NiceLoadPanel,
467
+ F as NiceModal,
468
+ J as NiceModalBody,
469
+ Q as NiceModalFooter,
470
+ G as NiceModalHeader,
471
+ te as NiceOverlayPopover,
472
+ de as NicePopover,
473
+ ue as NiceResizable,
474
+ he as NiceResponsiveBox,
475
+ me as NiceScrollView,
476
+ fe as NiceTutorial,
477
+ ve as NiceTutorialProvider,
478
+ ge as NiceWindow,
479
+ be as NiceWindowManager,
480
+ we as useCommandPalette,
481
+ ye as useRegisterCommands
26
482
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/ui",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Nice2Dev UI — Universal, themeable, i18n-ready React component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -42,6 +42,26 @@
42
42
  "import": "./dist/overlays.mjs",
43
43
  "require": "./dist/overlays.cjs"
44
44
  },
45
+ "./lazy": {
46
+ "types": "./dist/lazy.d.ts",
47
+ "import": "./dist/lazy.mjs",
48
+ "require": "./dist/lazy.cjs"
49
+ },
50
+ "./devops": {
51
+ "types": "./dist/devops.d.ts",
52
+ "import": "./dist/devops.mjs",
53
+ "require": "./dist/devops.cjs"
54
+ },
55
+ "./no-code": {
56
+ "types": "./dist/no-code.d.ts",
57
+ "import": "./dist/no-code.mjs",
58
+ "require": "./dist/no-code.cjs"
59
+ },
60
+ "./data-branching": {
61
+ "types": "./dist/data-branching.d.ts",
62
+ "import": "./dist/data-branching.mjs",
63
+ "require": "./dist/data-branching.cjs"
64
+ },
45
65
  "./style.css": "./dist/style.css"
46
66
  },
47
67
  "files": [