@nice2dev/ui 1.0.8 → 1.0.10
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.
- package/dist/NiceErrorBoundary-B5nF-OVn.cjs +1 -0
- package/dist/NiceErrorBoundary-D75yr_WE.js +762 -0
- package/dist/NiceForm-CKoJA6NG.js +5131 -0
- package/dist/NiceForm-D7xnpnRJ.cjs +382 -0
- package/dist/NiceForm.css +1 -0
- package/dist/NiceModal-1QX7NhyH.js +95 -0
- package/dist/NiceModal-CAwsKVQ2.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-C9xMSjOF.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5249 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -0
- package/dist/NicePagination-DbE-uOkl.js +171 -0
- package/dist/NicePagination-DlealakT.cjs +1 -0
- package/dist/NicePinCodeInput-B8cI8zu8.js +11830 -0
- package/dist/NicePinCodeInput-SGQaHvpE.cjs +419 -0
- package/dist/NicePinCodeInput.css +1 -1
- package/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6449 -0
- package/dist/NiceSavedQueryPanel-Ce2s060j.cjs +596 -0
- package/dist/NiceTabs-DvOmxKyQ.cjs +1 -0
- package/dist/NiceTabs-DzLHzwuA.js +1636 -0
- package/dist/NiceWindow-CVgkxcCz.cjs +1 -0
- package/dist/NiceWindow-DeC83yfE.js +1409 -0
- package/dist/charts-BAS21jkC.js +4621 -0
- package/dist/charts-DShUbWrP.cjs +759 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +42 -45
- package/dist/charts.mjs +1 -1
- package/dist/core-C2ZmWe_u.cjs +96 -0
- package/dist/core-Da43q-pO.js +22094 -0
- package/dist/data-branching-CJlrg8qf.cjs +1 -0
- package/dist/data-branching-DCUwI53s.js +6121 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.d.ts +1 -38
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +206 -192
- package/dist/data.mjs +1 -1
- package/dist/devops-CXynFG3X.cjs +17 -0
- package/dist/devops-D0TfzV5B.js +7660 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +1 -38
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +311 -393
- package/dist/editors.mjs +61 -64
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +3 -44
- package/dist/feedback.mjs +11 -10
- package/dist/index-B8wxZ8Ps.cjs +5192 -0
- package/dist/index-pAuGTbuB.js +57319 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2248 -11140
- package/dist/index.mjs +880 -1018
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +7 -39
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +151 -216
- package/dist/navigation.mjs +46 -40
- package/dist/no-code-B5bzduNP.cjs +332 -0
- package/dist/no-code-D8RJ7lx0.js +7064 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +1 -38
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +13 -45
- package/dist/overlays.mjs +260 -250
- package/package.json +4 -2
package/dist/no-code.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-B5bzduNP.cjs");exports.NiceAPIFlow=e.NiceAPIFlow;exports.NiceCodePreview=e.NiceCodePreview;exports.NiceCodeTemplate=e.NiceCodeTemplate;exports.NiceComponentDesigner=e.NiceComponentDesigner;exports.NiceDataMapper=e.NiceDataMapper;exports.NiceEventOrchestrator=e.NiceEventOrchestrator;exports.NiceLowCodeStudio=e.NiceLowCodeStudio;exports.NicePageBuilder=e.NicePageBuilder;exports.NiceStateDesigner=e.NiceStateDesigner;exports.NiceTestBuilder=e.NiceTestBuilder;
|
package/dist/no-code.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
|
+
import { NiceBaseProps } from '@nice2dev/ui-core';
|
|
2
3
|
|
|
3
4
|
declare interface ActionParam {
|
|
4
5
|
id: string;
|
|
@@ -354,15 +355,6 @@ declare interface MockResponse {
|
|
|
354
355
|
|
|
355
356
|
declare type MockType = 'function' | 'module' | 'api' | 'timer' | 'storage';
|
|
356
357
|
|
|
357
|
-
/**
|
|
358
|
-
* Per-component visibility & interaction level used by the access control system.
|
|
359
|
-
* - `'full'` — fully interactive (default)
|
|
360
|
-
* - `'readOnly'` — renders but cannot be edited
|
|
361
|
-
* - `'disabled'` — renders greyed-out
|
|
362
|
-
* - `'hidden'` — not rendered at all
|
|
363
|
-
*/
|
|
364
|
-
declare type NiceAccessMode = 'full' | 'readOnly' | 'disabled' | 'hidden';
|
|
365
|
-
|
|
366
358
|
export declare const NiceAPIFlow: default_2.FC<NiceAPIFlowProps>;
|
|
367
359
|
|
|
368
360
|
export declare interface NiceAPIFlowProps extends NiceBaseProps {
|
|
@@ -376,28 +368,6 @@ export declare interface NiceAPIFlowProps extends NiceBaseProps {
|
|
|
376
368
|
onSave?: (flow: APIFlowDefinition) => void;
|
|
377
369
|
}
|
|
378
370
|
|
|
379
|
-
/** Base props inherited by every NiceToDev component. */
|
|
380
|
-
declare interface NiceBaseProps {
|
|
381
|
-
/** Additional CSS class name(s). */
|
|
382
|
-
className?: string;
|
|
383
|
-
/** Inline style object. */
|
|
384
|
-
style?: React.CSSProperties;
|
|
385
|
-
/** HTML `id` attribute. When omitted a stable auto-generated id is used. */
|
|
386
|
-
id?: string;
|
|
387
|
-
/** Tooltip text shown on hover. */
|
|
388
|
-
title?: string;
|
|
389
|
-
/** Test identifier for integration / e2e test selectors. */
|
|
390
|
-
'data-testid'?: string;
|
|
391
|
-
/** Controls component visibility and interaction — see {@link NiceAccessMode}. */
|
|
392
|
-
accessMode?: NiceAccessMode;
|
|
393
|
-
/**
|
|
394
|
-
* Visual presentation style override.
|
|
395
|
-
* When set, overrides the global `displayStyle` from `NiceThemeProvider`.
|
|
396
|
-
* @see NiceDisplayStyle
|
|
397
|
-
*/
|
|
398
|
-
displayStyle?: NiceDisplayStyle;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
371
|
/**
|
|
402
372
|
* NiceCodePreview - Live code preview with syntax highlighting and diff
|
|
403
373
|
*
|
|
@@ -494,13 +464,6 @@ export declare interface NiceDataMapperProps extends NiceBaseProps {
|
|
|
494
464
|
onSave?: (mapping: MappingDefinition) => void;
|
|
495
465
|
}
|
|
496
466
|
|
|
497
|
-
/**
|
|
498
|
-
* Cross-component visual presentation style.
|
|
499
|
-
* Each style maps 1:1 to a ThemeVariantConfig preset controlling
|
|
500
|
-
* buttons, inputs, cards, badges, tabs, toggles, tooltips, tables, etc.
|
|
501
|
-
*/
|
|
502
|
-
declare type NiceDisplayStyle = 'default' | 'minimal' | 'rounded' | 'sharp' | 'glass' | 'neumorphic' | 'playful' | 'enterprise' | 'modern3d' | 'brutalist' | 'luxe' | 'pill' | 'flat' | 'editorial' | 'dashboard' | 'softCloud' | 'cosmic' | 'corporate' | 'bank' | 'government' | 'military' | 'legal' | 'medical' | 'swiss' | 'scandinavian' | 'bauhaus' | 'notebook' | 'origami' | 'watercolor' | 'monochrome' | 'paper' | 'zen' | 'terminal' | 'hacker' | 'retro8bit' | 'synthwave' | 'cyberpunk' | 'steampunk' | 'vapor' | 'neon' | 'windows95' | 'material' | 'fluent' | 'cupertino' | 'ant' | 'bootstrap' | 'chakra' | 'notion' | 'linear' | 'vercel' | 'candy' | 'bubblegum' | 'cartoon' | 'kawaii' | 'circus' | 'gaming' | 'kiddo' | 'disco' | 'clown';
|
|
503
|
-
|
|
504
467
|
export declare const NiceEventOrchestrator: default_2.FC<NiceEventOrchestratorProps>;
|
|
505
468
|
|
|
506
469
|
export declare interface NiceEventOrchestratorProps extends NiceBaseProps {
|
package/dist/no-code.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-D8RJ7lx0.js";
|
|
2
2
|
export {
|
|
3
3
|
i as NiceAPIFlow,
|
|
4
4
|
s as NiceCodePreview,
|
package/dist/overlays.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;
|
package/dist/overlays.d.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
2
|
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { NiceBaseProps } from '@nice2dev/ui-core';
|
|
4
|
+
import { NiceSize } from '@nice2dev/ui-core';
|
|
3
5
|
import { ReactNode } from 'react';
|
|
4
6
|
import { RefAttributes } from 'react';
|
|
5
7
|
|
|
6
|
-
/**
|
|
7
|
-
* Per-component visibility & interaction level used by the access control system.
|
|
8
|
-
* - `'full'` — fully interactive (default)
|
|
9
|
-
* - `'readOnly'` — renders but cannot be edited
|
|
10
|
-
* - `'disabled'` — renders greyed-out
|
|
11
|
-
* - `'hidden'` — not rendered at all
|
|
12
|
-
*/
|
|
13
|
-
declare type NiceAccessMode = 'full' | 'readOnly' | 'disabled' | 'hidden';
|
|
14
|
-
|
|
15
8
|
export declare const NiceActionSheet: default_2.FC<NiceActionSheetProps>;
|
|
16
9
|
|
|
17
10
|
/** An action item in the {@link NiceActionSheet}. */
|
|
@@ -44,28 +37,6 @@ export declare interface NiceActionSheetProps extends NiceBaseProps {
|
|
|
44
37
|
cancelText?: string;
|
|
45
38
|
}
|
|
46
39
|
|
|
47
|
-
/** Base props inherited by every NiceToDev component. */
|
|
48
|
-
declare interface NiceBaseProps {
|
|
49
|
-
/** Additional CSS class name(s). */
|
|
50
|
-
className?: string;
|
|
51
|
-
/** Inline style object. */
|
|
52
|
-
style?: React.CSSProperties;
|
|
53
|
-
/** HTML `id` attribute. When omitted a stable auto-generated id is used. */
|
|
54
|
-
id?: string;
|
|
55
|
-
/** Tooltip text shown on hover. */
|
|
56
|
-
title?: string;
|
|
57
|
-
/** Test identifier for integration / e2e test selectors. */
|
|
58
|
-
'data-testid'?: string;
|
|
59
|
-
/** Controls component visibility and interaction — see {@link NiceAccessMode}. */
|
|
60
|
-
accessMode?: NiceAccessMode;
|
|
61
|
-
/**
|
|
62
|
-
* Visual presentation style override.
|
|
63
|
-
* When set, overrides the global `displayStyle` from `NiceThemeProvider`.
|
|
64
|
-
* @see NiceDisplayStyle
|
|
65
|
-
*/
|
|
66
|
-
displayStyle?: NiceDisplayStyle;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
40
|
export declare const NiceBlockUI: default_2.ForwardRefExoticComponent<NiceBlockUIProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
70
41
|
|
|
71
42
|
/** Props for the {@link NiceBlockUI} component — an overlay that blocks user interaction on its children. */
|
|
@@ -201,13 +172,6 @@ declare interface NiceContextMenuProps {
|
|
|
201
172
|
className?: string;
|
|
202
173
|
}
|
|
203
174
|
|
|
204
|
-
/**
|
|
205
|
-
* Cross-component visual presentation style.
|
|
206
|
-
* Each style maps 1:1 to a ThemeVariantConfig preset controlling
|
|
207
|
-
* buttons, inputs, cards, badges, tabs, toggles, tooltips, tables, etc.
|
|
208
|
-
*/
|
|
209
|
-
declare type NiceDisplayStyle = 'default' | 'minimal' | 'rounded' | 'sharp' | 'glass' | 'neumorphic' | 'playful' | 'enterprise' | 'modern3d' | 'brutalist' | 'luxe' | 'pill' | 'flat' | 'editorial' | 'dashboard' | 'softCloud' | 'cosmic' | 'corporate' | 'bank' | 'government' | 'military' | 'legal' | 'medical' | 'swiss' | 'scandinavian' | 'bauhaus' | 'notebook' | 'origami' | 'watercolor' | 'monochrome' | 'paper' | 'zen' | 'terminal' | 'hacker' | 'retro8bit' | 'synthwave' | 'cyberpunk' | 'steampunk' | 'vapor' | 'neon' | 'windows95' | 'material' | 'fluent' | 'cupertino' | 'ant' | 'bootstrap' | 'chakra' | 'notion' | 'linear' | 'vercel' | 'candy' | 'bubblegum' | 'cartoon' | 'kawaii' | 'circus' | 'gaming' | 'kiddo' | 'disco' | 'clown';
|
|
210
|
-
|
|
211
175
|
/**
|
|
212
176
|
* Drawer component that slides in from screen edges.
|
|
213
177
|
* Supports swipe-to-close on touch devices.
|
|
@@ -428,9 +392,6 @@ export declare interface NiceScrollViewProps extends NiceBaseProps {
|
|
|
428
392
|
children?: default_2.ReactNode;
|
|
429
393
|
}
|
|
430
394
|
|
|
431
|
-
/** T-shirt sizing used across all components for consistent visual density. */
|
|
432
|
-
declare type NiceSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
433
|
-
|
|
434
395
|
export declare const NiceTutorial: default_2.FC<NiceTutorialProps>;
|
|
435
396
|
|
|
436
397
|
/** Props for the {@link NiceTutorial} component — a guided walkthrough overlay with step-by-step highlighting. */
|
|
@@ -513,8 +474,10 @@ export declare const NiceWindowManager: ForwardRefExoticComponent<NiceWindowMana
|
|
|
513
474
|
|
|
514
475
|
/** Props for the {@link NiceWindowManager} component — a multi-window manager with taskbar and z-index stacking. */
|
|
515
476
|
export declare interface NiceWindowManagerProps extends NiceBaseProps {
|
|
516
|
-
/** Managed window entries. */
|
|
517
|
-
windows
|
|
477
|
+
/** Managed window entries. Optional when children (NiceWindow elements) are provided. */
|
|
478
|
+
windows?: NiceWindowState_2[];
|
|
479
|
+
/** Window children (NiceWindow elements). Used when `windows` is not provided. */
|
|
480
|
+
children?: React.ReactNode;
|
|
518
481
|
/** Called when the window list changes (drag, resize, minimize, etc.). */
|
|
519
482
|
onChange?: (windows: NiceWindowState_2[]) => void;
|
|
520
483
|
/** Called when a window is closed. */
|
|
@@ -537,8 +500,8 @@ export declare interface NiceWindowPosition {
|
|
|
537
500
|
|
|
538
501
|
/** Props for the {@link NiceWindow} component — a draggable, resizable, snappable desktop window with title bar controls. */
|
|
539
502
|
export declare interface NiceWindowProps extends NiceBaseProps {
|
|
540
|
-
/** Unique window identifier. */
|
|
541
|
-
windowKey
|
|
503
|
+
/** Unique window identifier. Auto-generated if not provided. */
|
|
504
|
+
windowKey?: string;
|
|
542
505
|
/** Window title. */
|
|
543
506
|
title: string;
|
|
544
507
|
/** Icon displayed in title bar */
|
|
@@ -551,6 +514,11 @@ export declare interface NiceWindowProps extends NiceBaseProps {
|
|
|
551
514
|
x?: number;
|
|
552
515
|
/** Initial or controlled y position */
|
|
553
516
|
y?: number;
|
|
517
|
+
/** Convenience initial position object — alternative to passing `x` and `y` separately. */
|
|
518
|
+
defaultPosition?: {
|
|
519
|
+
x: number;
|
|
520
|
+
y: number;
|
|
521
|
+
};
|
|
554
522
|
/** Initial or controlled width */
|
|
555
523
|
width?: number;
|
|
556
524
|
/** Initial or controlled height */
|