cyberui-2045 2.0.1 → 2.0.3
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/index.d.ts +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './components';
|
|
2
|
-
export declare const version = "2.0.
|
|
2
|
+
export declare const version = "2.0.3";
|
package/dist/index.es.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -65,5 +65,5 @@ React keys must be passed directly to JSX without using spread:
|
|
|
65
65
|
border-radius: ${j?"4px 0 0 4px":"4px"};
|
|
66
66
|
border: ${G.border};
|
|
67
67
|
box-shadow: ${G.boxShadow};
|
|
68
|
-
`;for(let B=0;B<T;B++)_.appendChild(J("arrow","up",B,h));for(let B=0;B<2;B++)_.appendChild(J("line",void 0,B,h));for(let B=0;B<T;B++)_.appendChild(J("arrow","down",B,h));document.body.appendChild(_),d.current=_;const z=j?void 0:()=>{const B=c.current;if(B){const se=B.getBoundingClientRect();_.style.top=`${se.top}px`,_.style.right=`${window.innerWidth-se.right}px`,_.style.height=`${se.height}px`}};return z&&(window.addEventListener("resize",z),window.addEventListener("scroll",z)),()=>{_.remove(),!j&&c.current&&c.current.classList.remove("cyber-scrollbar-container"),z&&(window.removeEventListener("resize",z),window.removeEventListener("scroll",z))}},[o,j,E,Z,Q,J,p,O,V,i,l]),U=m.useCallback((u,h)=>{const A=Math.max(1,Math.min(3,Math.ceil(u*.8))),T=Math.floor(h/oe.DISTANCE_THRESHOLD);return A+T},[]),q=m.useCallback((u,h,A)=>{const T=Array.from(u).filter(D=>D.classList.contains(`cyber-arrow-${h}`)),_=Math.min(A,T.length);return h==="up"?T.slice(-_):T.slice(0,_)},[]),Y=m.useCallback((u,h,A)=>{const T=Math.min(h*a,oe.MAX_ANIMATION_SPEED),_=window.innerWidth<oe.MOBILE_BREAKPOINT,D=Math.max(300/T,oe.MIN_GLOW_DURATION)*(_?1.5:1),W=Math.max(40,80/T)*(_?1.25:1),G=A==="up"?[...u].reverse():u;G.forEach(z=>{z.style.opacity="0.3"}),G.forEach((z,B)=>{const se=B*W,ue=setTimeout(()=>{z.style.opacity="1";const he=setTimeout(()=>{z.style.opacity="0.3"},D);f.current.push(he)},se);f.current.push(ue)})},[a]),X=m.useCallback(()=>{if(!d.current)return;const{isScrolling:u,direction:h,velocity:A,scrollDistance:T}=w,_=d.current.querySelectorAll(".cyber-arrow"),D=d.current.querySelectorAll(".cyber-line");if(u&&h){D.forEach(G=>{G.style.opacity="0"});const W=U(A,T);if(W!==C.current){f.current.forEach(z=>clearTimeout(z)),f.current=[],_.forEach(z=>{z.style.opacity="0"});const G=q(Array.from(_),h,W);Y(G,A,h),C.current=W}}else f.current.forEach(W=>clearTimeout(W)),f.current=[],C.current=0,_.forEach(W=>{W.style.opacity="0"}),k&&D.forEach(W=>{W.style.opacity="0.6"})},[w,k,Y,U,q]),H=m.useRef(null),ee=m.useCallback(()=>{if(o||!j&&!c.current)return;const u=Date.now(),h=j?{currentScrollTop:window.scrollY,scrollHeight:document.body.scrollHeight,clientHeight:window.innerHeight}:{currentScrollTop:c.current.scrollTop,scrollHeight:c.current.scrollHeight,clientHeight:c.current.clientHeight},A=u-v.current,T=h.currentScrollTop-b.current,D=Math.abs(T)/Math.max(A,1)*oe.VELOCITY_MULTIPLIER,W=T>0?"down":T<0?"up":null,G=h.currentScrollTop/(h.scrollHeight-h.clientHeight);k||L(!0);const z=window.innerWidth<oe.MOBILE_BREAKPOINT;z&&!E&&$(!0),y(B=>({isScrolling:!0,direction:W,velocity:D,position:G,scrollDistance:B.direction!==W?Math.abs(T):B.scrollDistance+Math.abs(T)})),x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current),x.current=setTimeout(()=>{f.current.forEach(B=>clearTimeout(B)),f.current=[],y(B=>({...B,isScrolling:!1,velocity:0,scrollDistance:0})),z&&(g.current=setTimeout(()=>{$(!1)},oe.MOBILE_HIDE_DELAY))},oe.STABLE_TIMEOUT),v.current=u,b.current=h.currentScrollTop},[o,j,k,E]),s=m.useCallback(()=>{H.current===null&&(H.current=requestAnimationFrame(()=>{H.current=null,ee()}))},[ee]);return m.useEffect(()=>{if(o||!j&&!c.current)return;const u=te(),h=j?window:c.current;return h.addEventListener("scroll",s,{passive:!0}),()=>{h.removeEventListener("scroll",s),x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current),f.current.forEach(A=>clearTimeout(A)),H.current!==null&&(cancelAnimationFrame(H.current),H.current=null),u?.()}},[te,s,o,j]),m.useEffect(()=>{X()},[X]),c},rt=m.createContext(void 0),kr=()=>{const e=m.useContext(rt);if(e===void 0)throw new Error("useCyberNotifications must be used within a CyberNotificationProvider");return e},jr=({children:e,position:r="top-right",defaultDuration:a=2500})=>{const[o,n]=m.useState([]),i=m.useCallback((b,x,f,g={})=>{const w=Date.now().toString(),{autoHide:y=!0,duration:k=a}=g;return n(L=>[...L,{id:w,type:b,title:x,message:f}]),y&&setTimeout(()=>{n(L=>L.map(E=>E.id===w?{...E,isClosing:!0}:E)),setTimeout(()=>{n(L=>L.filter(E=>E.id!==w))},500)},k),w},[a]),l=m.useCallback(b=>{n(x=>x.map(f=>f.id===b?{...f,isClosing:!0}:f)),setTimeout(()=>{n(x=>x.filter(f=>f.id!==b))},500)},[]),c=m.useCallback(()=>{n([])},[]),d=m.useCallback((b,x)=>{n(f=>f.map(g=>g.id===b?{...g,width:x}:g))},[]),v={notifications:o,showNotification:i,hideNotification:l,clearAllNotifications:c};return t.jsxs(rt.Provider,{value:v,children:[e,o.length>0&&t.jsx("div",{className:`fixed z-50 ${Nr(r)}`,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"true",children:o.map((b,x)=>t.jsx("div",{className:"absolute",style:{right:r.includes("right")?0:void 0,left:r.includes("left")?0:void 0,top:`${x*70}px`,width:b.width?`${b.width}px`:"auto"},children:t.jsx("div",{className:`transform transition-all duration-500 ease-out scale-75 opacity-90 w-full ${r.includes("right")?"flex justify-end":"flex justify-start"} ${b.isClosing?`${r.includes("right")?"translate-x-full":"-translate-x-full"} opacity-0`:"translate-x-0 opacity-90"}`,style:{whiteSpace:"nowrap",transformOrigin:r.includes("right")?"right center":"left center",transform:b.isClosing?`translateX(${r.includes("right")?"100%":"-100%"}) scale(0.75)`:`translateX(${b.width?"0px":r.includes("right")?"100%":"-100%"}) scale(0.75)`},ref:f=>{if(f&&!b.width){const g=f.scrollWidth;d(b.id,g)}},children:t.jsx(et,{type:b.type,title:b.title,message:b.message,onClose:()=>l(b.id),size:"sm"})})},b.id))})]})},Nr=e=>{const r={"top-right":"top-4 right-4","top-left":"top-4 left-4","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4"};return r[e]||r["top-right"]},Cr="2.0.
|
|
68
|
+
`;for(let B=0;B<T;B++)_.appendChild(J("arrow","up",B,h));for(let B=0;B<2;B++)_.appendChild(J("line",void 0,B,h));for(let B=0;B<T;B++)_.appendChild(J("arrow","down",B,h));document.body.appendChild(_),d.current=_;const z=j?void 0:()=>{const B=c.current;if(B){const se=B.getBoundingClientRect();_.style.top=`${se.top}px`,_.style.right=`${window.innerWidth-se.right}px`,_.style.height=`${se.height}px`}};return z&&(window.addEventListener("resize",z),window.addEventListener("scroll",z)),()=>{_.remove(),!j&&c.current&&c.current.classList.remove("cyber-scrollbar-container"),z&&(window.removeEventListener("resize",z),window.removeEventListener("scroll",z))}},[o,j,E,Z,Q,J,p,O,V,i,l]),U=m.useCallback((u,h)=>{const A=Math.max(1,Math.min(3,Math.ceil(u*.8))),T=Math.floor(h/oe.DISTANCE_THRESHOLD);return A+T},[]),q=m.useCallback((u,h,A)=>{const T=Array.from(u).filter(D=>D.classList.contains(`cyber-arrow-${h}`)),_=Math.min(A,T.length);return h==="up"?T.slice(-_):T.slice(0,_)},[]),Y=m.useCallback((u,h,A)=>{const T=Math.min(h*a,oe.MAX_ANIMATION_SPEED),_=window.innerWidth<oe.MOBILE_BREAKPOINT,D=Math.max(300/T,oe.MIN_GLOW_DURATION)*(_?1.5:1),W=Math.max(40,80/T)*(_?1.25:1),G=A==="up"?[...u].reverse():u;G.forEach(z=>{z.style.opacity="0.3"}),G.forEach((z,B)=>{const se=B*W,ue=setTimeout(()=>{z.style.opacity="1";const he=setTimeout(()=>{z.style.opacity="0.3"},D);f.current.push(he)},se);f.current.push(ue)})},[a]),X=m.useCallback(()=>{if(!d.current)return;const{isScrolling:u,direction:h,velocity:A,scrollDistance:T}=w,_=d.current.querySelectorAll(".cyber-arrow"),D=d.current.querySelectorAll(".cyber-line");if(u&&h){D.forEach(G=>{G.style.opacity="0"});const W=U(A,T);if(W!==C.current){f.current.forEach(z=>clearTimeout(z)),f.current=[],_.forEach(z=>{z.style.opacity="0"});const G=q(Array.from(_),h,W);Y(G,A,h),C.current=W}}else f.current.forEach(W=>clearTimeout(W)),f.current=[],C.current=0,_.forEach(W=>{W.style.opacity="0"}),k&&D.forEach(W=>{W.style.opacity="0.6"})},[w,k,Y,U,q]),H=m.useRef(null),ee=m.useCallback(()=>{if(o||!j&&!c.current)return;const u=Date.now(),h=j?{currentScrollTop:window.scrollY,scrollHeight:document.body.scrollHeight,clientHeight:window.innerHeight}:{currentScrollTop:c.current.scrollTop,scrollHeight:c.current.scrollHeight,clientHeight:c.current.clientHeight},A=u-v.current,T=h.currentScrollTop-b.current,D=Math.abs(T)/Math.max(A,1)*oe.VELOCITY_MULTIPLIER,W=T>0?"down":T<0?"up":null,G=h.currentScrollTop/(h.scrollHeight-h.clientHeight);k||L(!0);const z=window.innerWidth<oe.MOBILE_BREAKPOINT;z&&!E&&$(!0),y(B=>({isScrolling:!0,direction:W,velocity:D,position:G,scrollDistance:B.direction!==W?Math.abs(T):B.scrollDistance+Math.abs(T)})),x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current),x.current=setTimeout(()=>{f.current.forEach(B=>clearTimeout(B)),f.current=[],y(B=>({...B,isScrolling:!1,velocity:0,scrollDistance:0})),z&&(g.current=setTimeout(()=>{$(!1)},oe.MOBILE_HIDE_DELAY))},oe.STABLE_TIMEOUT),v.current=u,b.current=h.currentScrollTop},[o,j,k,E]),s=m.useCallback(()=>{H.current===null&&(H.current=requestAnimationFrame(()=>{H.current=null,ee()}))},[ee]);return m.useEffect(()=>{if(o||!j&&!c.current)return;const u=te(),h=j?window:c.current;return h.addEventListener("scroll",s,{passive:!0}),()=>{h.removeEventListener("scroll",s),x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current),f.current.forEach(A=>clearTimeout(A)),H.current!==null&&(cancelAnimationFrame(H.current),H.current=null),u?.()}},[te,s,o,j]),m.useEffect(()=>{X()},[X]),c},rt=m.createContext(void 0),kr=()=>{const e=m.useContext(rt);if(e===void 0)throw new Error("useCyberNotifications must be used within a CyberNotificationProvider");return e},jr=({children:e,position:r="top-right",defaultDuration:a=2500})=>{const[o,n]=m.useState([]),i=m.useCallback((b,x,f,g={})=>{const w=Date.now().toString(),{autoHide:y=!0,duration:k=a}=g;return n(L=>[...L,{id:w,type:b,title:x,message:f}]),y&&setTimeout(()=>{n(L=>L.map(E=>E.id===w?{...E,isClosing:!0}:E)),setTimeout(()=>{n(L=>L.filter(E=>E.id!==w))},500)},k),w},[a]),l=m.useCallback(b=>{n(x=>x.map(f=>f.id===b?{...f,isClosing:!0}:f)),setTimeout(()=>{n(x=>x.filter(f=>f.id!==b))},500)},[]),c=m.useCallback(()=>{n([])},[]),d=m.useCallback((b,x)=>{n(f=>f.map(g=>g.id===b?{...g,width:x}:g))},[]),v={notifications:o,showNotification:i,hideNotification:l,clearAllNotifications:c};return t.jsxs(rt.Provider,{value:v,children:[e,o.length>0&&t.jsx("div",{className:`fixed z-50 ${Nr(r)}`,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"true",children:o.map((b,x)=>t.jsx("div",{className:"absolute",style:{right:r.includes("right")?0:void 0,left:r.includes("left")?0:void 0,top:`${x*70}px`,width:b.width?`${b.width}px`:"auto"},children:t.jsx("div",{className:`transform transition-all duration-500 ease-out scale-75 opacity-90 w-full ${r.includes("right")?"flex justify-end":"flex justify-start"} ${b.isClosing?`${r.includes("right")?"translate-x-full":"-translate-x-full"} opacity-0`:"translate-x-0 opacity-90"}`,style:{whiteSpace:"nowrap",transformOrigin:r.includes("right")?"right center":"left center",transform:b.isClosing?`translateX(${r.includes("right")?"100%":"-100%"}) scale(0.75)`:`translateX(${b.width?"0px":r.includes("right")?"100%":"-100%"}) scale(0.75)`},ref:f=>{if(f&&!b.width){const g=f.scrollWidth;d(b.id,g)}},children:t.jsx(et,{type:b.type,title:b.title,message:b.message,onClose:()=>l(b.id),size:"sm"})})},b.id))})]})},Nr=e=>{const r={"top-right":"top-4 right-4","top-left":"top-4 left-4","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4"};return r[e]||r["top-right"]},Cr="2.0.3";R.Badge=nr,R.Button=Ee,R.Card=ar,R.Carousel=fr,R.Checkbox=yr,R.CircularProgress=er,R.CyberNotificationProvider=jr,R.Divider=vr,R.GradientText=pr,R.Image=pe,R.Input=or,R.LinearProgress=sr,R.Modal=tt,R.Notification=et,R.RESPONSIVE_SIZE_MAPS=re,R.SectionTitle=hr,R.SegmentedProgress=rr,R.Select=ir,R.Skeleton=cr,R.Steps=xr,R.TabNavigation=dt,R.Timeline=gr,R.Toggle=lr,R.cn=M,R.combineResponsiveClasses=nt,R.getResponsiveClasses=F,R.useCyberNotifications=kr,R.useCyberScrollbar=wr,R.version=Cr,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
|
69
69
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyberui-2045",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "A cyberpunk-themed React UI library with neon-styled components. Also known as CyberUI.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"module": "dist/index.es.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"bin": {
|
|
11
|
-
"cyberui-2045": "
|
|
11
|
+
"cyberui-2045": "bin/init.js"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist/assets",
|