@radix-ui/react-scroll-area
Advanced tools
Comparing version 0.1.4 to 0.1.5-rc.1
@@ -1,2 +0,2 @@ | ||
var e,r,t,o=require("@radix-ui/primitive").composeEventHandlers,n=require("@radix-ui/number").clamp,l=require("@radix-ui/react-use-layout-effect").useLayoutEffect,i=require("@radix-ui/react-use-direction").useDirection,a=require("@radix-ui/react-use-callback-ref").useCallbackRef,c=require("@radix-ui/react-compose-refs").useComposedRefs,s=require("@radix-ui/react-context").createContextScope,u=require("@radix-ui/react-presence").Presence,d=require("@radix-ui/react-primitive").Primitive,p=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e),f=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const[h,b]=s("ScrollArea");exports.createScrollAreaScope=b;const[w,v]=h("ScrollArea"),m=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,type:o="hover",scrollHideDelay:n=600,...l}=e,[a,s]=p.useState(null),[u,h]=p.useState(null),[b,v]=p.useState(null),[m,S]=p.useState(null),[g,E]=p.useState(null),[C,T]=p.useState(0),[y,R]=p.useState(0),[x,A]=p.useState(!1),[P,_]=p.useState(!1),L=c(r,(e=>s(e))),D=i(a,l.dir);/*#__PURE__*/return p.createElement(w,{scope:t,type:o,dir:D,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:h,content:b,onContentChange:v,scrollbarX:m,onScrollbarXChange:S,scrollbarXEnabled:x,onScrollbarXEnabledChange:A,scrollbarY:g,onScrollbarYChange:E,scrollbarYEnabled:P,onScrollbarYEnabledChange:_,onCornerWidthChange:T,onCornerHeightChange:R},/*#__PURE__*/p.createElement(d.div,f({},l,{ref:L,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})))}));exports.ScrollArea=m;const S=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,children:o,...n}=e,l=v("ScrollAreaViewport",t),i=p.useRef(null),a=c(r,i,l.onViewportChange);/*#__PURE__*/return p.createElement(p.Fragment,null,/*#__PURE__*/p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),/*#__PURE__*/p.createElement(d.div,f({"data-radix-scroll-area-viewport":""},n,{ref:a,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style}}),/*#__PURE__*/p.createElement("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"}},o)))}));exports.ScrollAreaViewport=S;const g=/*#__PURE__*/p.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=v("ScrollAreaScrollbar",e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:i}=n,a="horizontal"===e.orientation;return p.useEffect((()=>(a?l(!0):i(!0),()=>{a?l(!1):i(!1)})),[a,l,i]),"hover"===n.type?/*#__PURE__*/p.createElement(E,f({},o,{ref:r,forceMount:t})):"scroll"===n.type?/*#__PURE__*/p.createElement(C,f({},o,{ref:r,forceMount:t})):"auto"===n.type?/*#__PURE__*/p.createElement(T,f({},o,{ref:r,forceMount:t})):"always"===n.type?/*#__PURE__*/p.createElement(y,f({},o,{ref:r})):null}));exports.ScrollAreaScrollbar=g;const E=/*#__PURE__*/p.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=v("ScrollAreaScrollbar",e.__scopeScrollArea),[l,i]=p.useState(!1);return p.useEffect((()=>{const e=n.scrollArea;let r=0;if(e){const t=()=>{window.clearTimeout(r),i(!0)},o=()=>{r=window.setTimeout((()=>i(!1)),n.scrollHideDelay)};return e.addEventListener("pointerenter",t),e.addEventListener("pointerleave",o),()=>{e.removeEventListener("pointerenter",t),e.removeEventListener("pointerleave",o)}}}),[n.scrollArea,n.scrollHideDelay]),/*#__PURE__*/p.createElement(u,{present:t||l},/*#__PURE__*/p.createElement(T,f({"data-state":l?"visible":"hidden"},o,{ref:r})))})),C=/*#__PURE__*/p.forwardRef(((e,r)=>{const{forceMount:t,...n}=e,l=v("ScrollAreaScrollbar",e.__scopeScrollArea),i="horizontal"===e.orientation,a=N((()=>s("SCROLL_END")),100),[c,s]=(d="hidden",h={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},p.useReducer(((e,r)=>{const t=h[e][r];return null!=t?t:e}),d));var d,h;return p.useEffect((()=>{if("idle"===c){const e=window.setTimeout((()=>s("HIDE")),l.scrollHideDelay);return()=>window.clearTimeout(e)}}),[c,l.scrollHideDelay,s]),p.useEffect((()=>{const e=l.viewport,r=i?"scrollLeft":"scrollTop";if(e){let t=e[r];const o=()=>{const o=e[r];t!==o&&(s("SCROLL"),a()),t=o};return e.addEventListener("scroll",o),()=>e.removeEventListener("scroll",o)}}),[l.viewport,i,s,a]),/*#__PURE__*/p.createElement(u,{present:t||"hidden"!==c},/*#__PURE__*/p.createElement(y,f({"data-state":"hidden"===c?"hidden":"visible"},n,{ref:r,onPointerEnter:o(e.onPointerEnter,(()=>s("POINTER_ENTER"))),onPointerLeave:o(e.onPointerLeave,(()=>s("POINTER_LEAVE")))})))})),T=/*#__PURE__*/p.forwardRef(((e,r)=>{const t=v("ScrollAreaScrollbar",e.__scopeScrollArea),{forceMount:o,...n}=e,[l,i]=p.useState(!1),a="horizontal"===e.orientation,c=N((()=>{if(t.viewport){const e=t.viewport.offsetWidth<t.viewport.scrollWidth,r=t.viewport.offsetHeight<t.viewport.scrollHeight;i(a?e:r)}}),10);return I(t.viewport,c),I(t.content,c),/*#__PURE__*/p.createElement(u,{present:o||l},/*#__PURE__*/p.createElement(y,f({"data-state":l?"visible":"hidden"},n,{ref:r})))})),y=/*#__PURE__*/p.forwardRef(((e,r)=>{const{orientation:t="vertical",...o}=e,n=v("ScrollAreaScrollbar",e.__scopeScrollArea),l=p.useRef(null),i=p.useRef(0),[a,c]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),s=W(a.viewport,a.content),u={...o,sizes:a,onSizesChange:c,hasThumb:Boolean(s>0&&s<1),onThumbChange:e=>l.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function d(e,r){return function(e,r,t,o="ltr"){const n=O(t),l=n/2,i=r||l,a=n-i,c=t.scrollbar.paddingStart+i,s=t.scrollbar.size-t.scrollbar.paddingEnd-a,u=t.content-t.viewport;return Y([c,s],"ltr"===o?[0,u]:[-1*u,0])(e)}(e,i.current,a,r)}return"horizontal"===t?/*#__PURE__*/p.createElement(R,f({},u,{ref:r,onThumbPositionChange:()=>{if(n.viewport&&l.current){const e=X(n.viewport.scrollLeft,a,n.dir);l.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{n.viewport&&(n.viewport.scrollLeft=e)},onDragScroll:e=>{n.viewport&&(n.viewport.scrollLeft=d(e,n.dir))}})):"vertical"===t?/*#__PURE__*/p.createElement(x,f({},u,{ref:r,onThumbPositionChange:()=>{if(n.viewport&&l.current){const e=X(n.viewport.scrollTop,a);l.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{n.viewport&&(n.viewport.scrollTop=e)},onDragScroll:e=>{n.viewport&&(n.viewport.scrollTop=d(e))}})):null})),R=/*#__PURE__*/p.forwardRef(((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,l=v("ScrollAreaScrollbar",e.__scopeScrollArea),[i,a]=p.useState(),s=p.useRef(null),u=c(r,s,l.onScrollbarXChange);return p.useEffect((()=>{s.current&&a(getComputedStyle(s.current))}),[s]),/*#__PURE__*/p.createElement(_,f({"data-orientation":"horizontal"},n,{ref:u,sizes:t,style:{bottom:0,left:"rtl"===l.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===l.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":O(t)+"px",...e.style},onThumbPointerDown:r=>e.onThumbPointerDown(r.x),onDragScroll:r=>e.onDragScroll(r.x),onWheelScroll:(r,t)=>{if(l.viewport){const o=l.viewport.scrollLeft+r.deltaX;e.onWheelScroll(o),q(o,t)&&r.preventDefault()}},onResize:()=>{s.current&&l.viewport&&i&&o({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:s.current.clientWidth,paddingStart:H(i.paddingLeft),paddingEnd:H(i.paddingRight)}})}}))})),x=/*#__PURE__*/p.forwardRef(((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,l=v("ScrollAreaScrollbar",e.__scopeScrollArea),[i,a]=p.useState(),s=p.useRef(null),u=c(r,s,l.onScrollbarYChange);return p.useEffect((()=>{s.current&&a(getComputedStyle(s.current))}),[s]),/*#__PURE__*/p.createElement(_,f({"data-orientation":"vertical"},n,{ref:u,sizes:t,style:{top:0,right:"ltr"===l.dir?0:void 0,left:"rtl"===l.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":O(t)+"px",...e.style},onThumbPointerDown:r=>e.onThumbPointerDown(r.y),onDragScroll:r=>e.onDragScroll(r.y),onWheelScroll:(r,t)=>{if(l.viewport){const o=l.viewport.scrollTop+r.deltaY;e.onWheelScroll(o),q(o,t)&&r.preventDefault()}},onResize:()=>{s.current&&l.viewport&&i&&o({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:s.current.clientHeight,paddingStart:H(i.paddingTop),paddingEnd:H(i.paddingBottom)}})}}))})),[A,P]=h("ScrollAreaScrollbar"),_=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,sizes:n,hasThumb:l,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:h,onDragScroll:b,onWheelScroll:w,onResize:m,...S}=e,g=v("ScrollAreaScrollbar",t),[E,C]=p.useState(null),T=c(r,(e=>C(e))),y=p.useRef(null),R=p.useRef(""),x=g.viewport,P=n.content-n.viewport,_=a(w),L=a(h),D=N(m,10);function z(e){if(y.current){const r=e.clientX-y.current.left,t=e.clientY-y.current.top;b({x:r,y:t})}}return p.useEffect((()=>{const e=e=>{const r=e.target;(null==E?void 0:E.contains(r))&&_(e,P)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[x,E,P,_]),p.useEffect(L,[n,L]),I(E,D),I(g.content,D),/*#__PURE__*/p.createElement(A,{scope:t,scrollbar:E,hasThumb:l,onThumbChange:a(i),onThumbPointerUp:a(s),onThumbPositionChange:L,onThumbPointerDown:a(u)},/*#__PURE__*/p.createElement(d.div,f({},S,{ref:T,style:{position:"absolute",...S.style},onPointerDown:o(e.onPointerDown,(e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=E.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",z(e)}})),onPointerMove:o(e.onPointerMove,z),onPointerUp:o(e.onPointerUp,(e=>{e.target.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=R.current,y.current=null}))})))})),L=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,style:n,...l}=e,i=v("ScrollbarThumb",t),a=P("ScrollbarThumb",t),{onThumbPositionChange:s}=a,u=c(r,(e=>a.onThumbChange(e))),h=p.useRef(),b=N((()=>{h.current&&(h.current(),h.current=void 0)}),100);return p.useEffect((()=>{const e=i.viewport;if(e){const r=()=>{if(b(),!h.current){const r=M(e,s);h.current=r,s()}};return s(),e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[i.viewport,b,s]),a.hasThumb?/*#__PURE__*/p.createElement(d.div,f({},l,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:o(e.onPointerDownCapture,(e=>{const r=e.target.getBoundingClientRect(),t=e.clientX-r.left,o=e.clientY-r.top;a.onThumbPointerDown({x:t,y:o})})),onPointerUp:o(e.onPointerUp,a.onThumbPointerUp)})):null}));exports.ScrollAreaThumb=L;const D=/*#__PURE__*/p.forwardRef(((e,r)=>{const t=v("ScrollAreaCorner",e.__scopeScrollArea),o=Boolean(t.scrollbarX&&t.scrollbarY);return"scroll"!==t.type&&o?/*#__PURE__*/p.createElement(z,f({},e,{ref:r})):null}));exports.ScrollAreaCorner=D;const z=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,...o}=e,n=v("ScrollAreaCorner",t),[l,i]=p.useState(0),[a,c]=p.useState(0),s=Boolean(l&&a);return I(n.scrollbarX,(()=>{var e;const r=(null===(e=n.scrollbarX)||void 0===e?void 0:e.offsetHeight)||0;n.onCornerHeightChange(r),c(r)})),I(n.scrollbarY,(()=>{var e;const r=(null===(e=n.scrollbarY)||void 0===e?void 0:e.offsetWidth)||0;n.onCornerWidthChange(r),i(r)})),s?/*#__PURE__*/p.createElement(d.div,f({},o,{ref:r,style:{width:l,height:a,position:"absolute",right:"ltr"===n.dir?0:void 0,left:"rtl"===n.dir?0:void 0,bottom:0,...e.style}})):null}));function H(e){return e?parseInt(e,10):0}function W(e,r){const t=e/r;return isNaN(t)?0:t}function O(e){const r=W(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-t)*r;return Math.max(o,18)}function X(e,r,t="ltr"){const o=O(r),l=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,i=r.scrollbar.size-l,a=r.content-r.viewport,c=i-o,s=n(e,"ltr"===t?[0,a]:[-1*a,0]);return Y([0,a],[0,c])(s)}function Y(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const o=(r[1]-r[0])/(e[1]-e[0]);return r[0]+o*(t-e[0])}}function q(e,r){return e>0&&e<r}const M=(e,r=(()=>{}))=>{let t={left:e.scrollLeft,top:e.scrollTop},o=0;return function n(){const l={left:e.scrollLeft,top:e.scrollTop},i=t.left!==l.left,a=t.top!==l.top;(i||a)&&r(),t=l,o=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(o)};function N(e,r){const t=a(e),o=p.useRef(0);return p.useEffect((()=>()=>window.clearTimeout(o.current)),[]),p.useCallback((()=>{window.clearTimeout(o.current),o.current=window.setTimeout(t,r)}),[t,r])}function I(e,r){const t=a(r);l((()=>{let r=0;if(e){const o=new ResizeObserver((()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)}));return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}}),[e,t])}const U=m;exports.Root=U;const k=S;exports.Viewport=k;const V=g;exports.Scrollbar=V;const B=L;exports.Thumb=B;const F=D;exports.Corner=F; | ||
var e,r,t,o=require("@radix-ui/primitive").composeEventHandlers,n=require("@radix-ui/number").clamp,l=require("@radix-ui/react-use-layout-effect").useLayoutEffect,i=require("@radix-ui/react-direction").useDirection,a=require("@radix-ui/react-use-callback-ref").useCallbackRef,c=require("@radix-ui/react-compose-refs").useComposedRefs,s=require("@radix-ui/react-context").createContextScope,u=require("@radix-ui/react-presence").Presence,d=require("@radix-ui/react-primitive").Primitive,p=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e),f=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const[h,b]=s("ScrollArea");exports.createScrollAreaScope=b;const[w,v]=h("ScrollArea"),m=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,type:o="hover",dir:n,scrollHideDelay:l=600,...a}=e,[s,u]=p.useState(null),[h,b]=p.useState(null),[v,m]=p.useState(null),[S,g]=p.useState(null),[E,C]=p.useState(null),[T,y]=p.useState(0),[R,x]=p.useState(0),[A,P]=p.useState(!1),[_,L]=p.useState(!1),D=c(r,(e=>u(e))),z=i(n);/*#__PURE__*/return p.createElement(w,{scope:t,type:o,dir:z,scrollHideDelay:l,scrollArea:s,viewport:h,onViewportChange:b,content:v,onContentChange:m,scrollbarX:S,onScrollbarXChange:g,scrollbarXEnabled:A,onScrollbarXEnabledChange:P,scrollbarY:E,onScrollbarYChange:C,scrollbarYEnabled:_,onScrollbarYEnabledChange:L,onCornerWidthChange:y,onCornerHeightChange:x},/*#__PURE__*/p.createElement(d.div,f({dir:z},a,{ref:D,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})))}));exports.ScrollArea=m;const S=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,children:o,...n}=e,l=v("ScrollAreaViewport",t),i=p.useRef(null),a=c(r,i,l.onViewportChange);/*#__PURE__*/return p.createElement(p.Fragment,null,/*#__PURE__*/p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),/*#__PURE__*/p.createElement(d.div,f({"data-radix-scroll-area-viewport":""},n,{ref:a,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style}}),/*#__PURE__*/p.createElement("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"}},o)))}));exports.ScrollAreaViewport=S;const g=/*#__PURE__*/p.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=v("ScrollAreaScrollbar",e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:i}=n,a="horizontal"===e.orientation;return p.useEffect((()=>(a?l(!0):i(!0),()=>{a?l(!1):i(!1)})),[a,l,i]),"hover"===n.type?/*#__PURE__*/p.createElement(E,f({},o,{ref:r,forceMount:t})):"scroll"===n.type?/*#__PURE__*/p.createElement(C,f({},o,{ref:r,forceMount:t})):"auto"===n.type?/*#__PURE__*/p.createElement(T,f({},o,{ref:r,forceMount:t})):"always"===n.type?/*#__PURE__*/p.createElement(y,f({},o,{ref:r})):null}));exports.ScrollAreaScrollbar=g;const E=/*#__PURE__*/p.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=v("ScrollAreaScrollbar",e.__scopeScrollArea),[l,i]=p.useState(!1);return p.useEffect((()=>{const e=n.scrollArea;let r=0;if(e){const t=()=>{window.clearTimeout(r),i(!0)},o=()=>{r=window.setTimeout((()=>i(!1)),n.scrollHideDelay)};return e.addEventListener("pointerenter",t),e.addEventListener("pointerleave",o),()=>{e.removeEventListener("pointerenter",t),e.removeEventListener("pointerleave",o)}}}),[n.scrollArea,n.scrollHideDelay]),/*#__PURE__*/p.createElement(u,{present:t||l},/*#__PURE__*/p.createElement(T,f({"data-state":l?"visible":"hidden"},o,{ref:r})))})),C=/*#__PURE__*/p.forwardRef(((e,r)=>{const{forceMount:t,...n}=e,l=v("ScrollAreaScrollbar",e.__scopeScrollArea),i="horizontal"===e.orientation,a=N((()=>s("SCROLL_END")),100),[c,s]=(d="hidden",h={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},p.useReducer(((e,r)=>{const t=h[e][r];return null!=t?t:e}),d));var d,h;return p.useEffect((()=>{if("idle"===c){const e=window.setTimeout((()=>s("HIDE")),l.scrollHideDelay);return()=>window.clearTimeout(e)}}),[c,l.scrollHideDelay,s]),p.useEffect((()=>{const e=l.viewport,r=i?"scrollLeft":"scrollTop";if(e){let t=e[r];const o=()=>{const o=e[r];t!==o&&(s("SCROLL"),a()),t=o};return e.addEventListener("scroll",o),()=>e.removeEventListener("scroll",o)}}),[l.viewport,i,s,a]),/*#__PURE__*/p.createElement(u,{present:t||"hidden"!==c},/*#__PURE__*/p.createElement(y,f({"data-state":"hidden"===c?"hidden":"visible"},n,{ref:r,onPointerEnter:o(e.onPointerEnter,(()=>s("POINTER_ENTER"))),onPointerLeave:o(e.onPointerLeave,(()=>s("POINTER_LEAVE")))})))})),T=/*#__PURE__*/p.forwardRef(((e,r)=>{const t=v("ScrollAreaScrollbar",e.__scopeScrollArea),{forceMount:o,...n}=e,[l,i]=p.useState(!1),a="horizontal"===e.orientation,c=N((()=>{if(t.viewport){const e=t.viewport.offsetWidth<t.viewport.scrollWidth,r=t.viewport.offsetHeight<t.viewport.scrollHeight;i(a?e:r)}}),10);return I(t.viewport,c),I(t.content,c),/*#__PURE__*/p.createElement(u,{present:o||l},/*#__PURE__*/p.createElement(y,f({"data-state":l?"visible":"hidden"},n,{ref:r})))})),y=/*#__PURE__*/p.forwardRef(((e,r)=>{const{orientation:t="vertical",...o}=e,n=v("ScrollAreaScrollbar",e.__scopeScrollArea),l=p.useRef(null),i=p.useRef(0),[a,c]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),s=W(a.viewport,a.content),u={...o,sizes:a,onSizesChange:c,hasThumb:Boolean(s>0&&s<1),onThumbChange:e=>l.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function d(e,r){return function(e,r,t,o="ltr"){const n=O(t),l=n/2,i=r||l,a=n-i,c=t.scrollbar.paddingStart+i,s=t.scrollbar.size-t.scrollbar.paddingEnd-a,u=t.content-t.viewport;return Y([c,s],"ltr"===o?[0,u]:[-1*u,0])(e)}(e,i.current,a,r)}return"horizontal"===t?/*#__PURE__*/p.createElement(R,f({},u,{ref:r,onThumbPositionChange:()=>{if(n.viewport&&l.current){const e=X(n.viewport.scrollLeft,a,n.dir);l.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{n.viewport&&(n.viewport.scrollLeft=e)},onDragScroll:e=>{n.viewport&&(n.viewport.scrollLeft=d(e,n.dir))}})):"vertical"===t?/*#__PURE__*/p.createElement(x,f({},u,{ref:r,onThumbPositionChange:()=>{if(n.viewport&&l.current){const e=X(n.viewport.scrollTop,a);l.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{n.viewport&&(n.viewport.scrollTop=e)},onDragScroll:e=>{n.viewport&&(n.viewport.scrollTop=d(e))}})):null})),R=/*#__PURE__*/p.forwardRef(((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,l=v("ScrollAreaScrollbar",e.__scopeScrollArea),[i,a]=p.useState(),s=p.useRef(null),u=c(r,s,l.onScrollbarXChange);return p.useEffect((()=>{s.current&&a(getComputedStyle(s.current))}),[s]),/*#__PURE__*/p.createElement(_,f({"data-orientation":"horizontal"},n,{ref:u,sizes:t,style:{bottom:0,left:"rtl"===l.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===l.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":O(t)+"px",...e.style},onThumbPointerDown:r=>e.onThumbPointerDown(r.x),onDragScroll:r=>e.onDragScroll(r.x),onWheelScroll:(r,t)=>{if(l.viewport){const o=l.viewport.scrollLeft+r.deltaX;e.onWheelScroll(o),q(o,t)&&r.preventDefault()}},onResize:()=>{s.current&&l.viewport&&i&&o({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:s.current.clientWidth,paddingStart:H(i.paddingLeft),paddingEnd:H(i.paddingRight)}})}}))})),x=/*#__PURE__*/p.forwardRef(((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,l=v("ScrollAreaScrollbar",e.__scopeScrollArea),[i,a]=p.useState(),s=p.useRef(null),u=c(r,s,l.onScrollbarYChange);return p.useEffect((()=>{s.current&&a(getComputedStyle(s.current))}),[s]),/*#__PURE__*/p.createElement(_,f({"data-orientation":"vertical"},n,{ref:u,sizes:t,style:{top:0,right:"ltr"===l.dir?0:void 0,left:"rtl"===l.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":O(t)+"px",...e.style},onThumbPointerDown:r=>e.onThumbPointerDown(r.y),onDragScroll:r=>e.onDragScroll(r.y),onWheelScroll:(r,t)=>{if(l.viewport){const o=l.viewport.scrollTop+r.deltaY;e.onWheelScroll(o),q(o,t)&&r.preventDefault()}},onResize:()=>{s.current&&l.viewport&&i&&o({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:s.current.clientHeight,paddingStart:H(i.paddingTop),paddingEnd:H(i.paddingBottom)}})}}))})),[A,P]=h("ScrollAreaScrollbar"),_=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,sizes:n,hasThumb:l,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:h,onDragScroll:b,onWheelScroll:w,onResize:m,...S}=e,g=v("ScrollAreaScrollbar",t),[E,C]=p.useState(null),T=c(r,(e=>C(e))),y=p.useRef(null),R=p.useRef(""),x=g.viewport,P=n.content-n.viewport,_=a(w),L=a(h),D=N(m,10);function z(e){if(y.current){const r=e.clientX-y.current.left,t=e.clientY-y.current.top;b({x:r,y:t})}}return p.useEffect((()=>{const e=e=>{const r=e.target;(null==E?void 0:E.contains(r))&&_(e,P)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[x,E,P,_]),p.useEffect(L,[n,L]),I(E,D),I(g.content,D),/*#__PURE__*/p.createElement(A,{scope:t,scrollbar:E,hasThumb:l,onThumbChange:a(i),onThumbPointerUp:a(s),onThumbPositionChange:L,onThumbPointerDown:a(u)},/*#__PURE__*/p.createElement(d.div,f({},S,{ref:T,style:{position:"absolute",...S.style},onPointerDown:o(e.onPointerDown,(e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=E.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",z(e)}})),onPointerMove:o(e.onPointerMove,z),onPointerUp:o(e.onPointerUp,(e=>{e.target.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=R.current,y.current=null}))})))})),L=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,style:n,...l}=e,i=v("ScrollbarThumb",t),a=P("ScrollbarThumb",t),{onThumbPositionChange:s}=a,u=c(r,(e=>a.onThumbChange(e))),h=p.useRef(),b=N((()=>{h.current&&(h.current(),h.current=void 0)}),100);return p.useEffect((()=>{const e=i.viewport;if(e){const r=()=>{if(b(),!h.current){const r=M(e,s);h.current=r,s()}};return s(),e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[i.viewport,b,s]),a.hasThumb?/*#__PURE__*/p.createElement(d.div,f({},l,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:o(e.onPointerDownCapture,(e=>{const r=e.target.getBoundingClientRect(),t=e.clientX-r.left,o=e.clientY-r.top;a.onThumbPointerDown({x:t,y:o})})),onPointerUp:o(e.onPointerUp,a.onThumbPointerUp)})):null}));exports.ScrollAreaThumb=L;const D=/*#__PURE__*/p.forwardRef(((e,r)=>{const t=v("ScrollAreaCorner",e.__scopeScrollArea),o=Boolean(t.scrollbarX&&t.scrollbarY);return"scroll"!==t.type&&o?/*#__PURE__*/p.createElement(z,f({},e,{ref:r})):null}));exports.ScrollAreaCorner=D;const z=/*#__PURE__*/p.forwardRef(((e,r)=>{const{__scopeScrollArea:t,...o}=e,n=v("ScrollAreaCorner",t),[l,i]=p.useState(0),[a,c]=p.useState(0),s=Boolean(l&&a);return I(n.scrollbarX,(()=>{var e;const r=(null===(e=n.scrollbarX)||void 0===e?void 0:e.offsetHeight)||0;n.onCornerHeightChange(r),c(r)})),I(n.scrollbarY,(()=>{var e;const r=(null===(e=n.scrollbarY)||void 0===e?void 0:e.offsetWidth)||0;n.onCornerWidthChange(r),i(r)})),s?/*#__PURE__*/p.createElement(d.div,f({},o,{ref:r,style:{width:l,height:a,position:"absolute",right:"ltr"===n.dir?0:void 0,left:"rtl"===n.dir?0:void 0,bottom:0,...e.style}})):null}));function H(e){return e?parseInt(e,10):0}function W(e,r){const t=e/r;return isNaN(t)?0:t}function O(e){const r=W(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-t)*r;return Math.max(o,18)}function X(e,r,t="ltr"){const o=O(r),l=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,i=r.scrollbar.size-l,a=r.content-r.viewport,c=i-o,s=n(e,"ltr"===t?[0,a]:[-1*a,0]);return Y([0,a],[0,c])(s)}function Y(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const o=(r[1]-r[0])/(e[1]-e[0]);return r[0]+o*(t-e[0])}}function q(e,r){return e>0&&e<r}const M=(e,r=(()=>{}))=>{let t={left:e.scrollLeft,top:e.scrollTop},o=0;return function n(){const l={left:e.scrollLeft,top:e.scrollTop},i=t.left!==l.left,a=t.top!==l.top;(i||a)&&r(),t=l,o=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(o)};function N(e,r){const t=a(e),o=p.useRef(0);return p.useEffect((()=>()=>window.clearTimeout(o.current)),[]),p.useCallback((()=>{window.clearTimeout(o.current),o.current=window.setTimeout(t,r)}),[t,r])}function I(e,r){const t=a(r);l((()=>{let r=0;if(e){const o=new ResizeObserver((()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)}));return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}}),[e,t])}const U=m;exports.Root=U;const k=S;exports.Viewport=k;const V=g;exports.Scrollbar=V;const B=L;exports.Thumb=B;const F=D;exports.Corner=F; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{composeEventHandlers as e}from"@radix-ui/primitive";import{clamp as r}from"@radix-ui/number";import{useLayoutEffect as t}from"@radix-ui/react-use-layout-effect";import{useDirection as o}from"@radix-ui/react-use-direction";import{useCallbackRef as n}from"@radix-ui/react-use-callback-ref";import{useComposedRefs as l}from"@radix-ui/react-compose-refs";import{createContextScope as i}from"@radix-ui/react-context";import{Presence as a}from"@radix-ui/react-presence";import{Primitive as c}from"@radix-ui/react-primitive";import*as s from"react";import u from"@babel/runtime/helpers/esm/extends";const[d,p]=i("ScrollArea");export{p as createScrollAreaScope};const[f,h]=d("ScrollArea");export const ScrollArea=/*#__PURE__*/s.forwardRef(((e,r)=>{const{__scopeScrollArea:t,type:n="hover",scrollHideDelay:i=600,...a}=e,[d,p]=s.useState(null),[h,m]=s.useState(null),[w,b]=s.useState(null),[v,S]=s.useState(null),[g,E]=s.useState(null),[C,T]=s.useState(0),[y,A]=s.useState(0),[x,R]=s.useState(!1),[P,L]=s.useState(!1),_=l(r,(e=>p(e))),D=o(d,a.dir);/*#__PURE__*/return s.createElement(f,{scope:t,type:n,dir:D,scrollHideDelay:i,scrollArea:d,viewport:h,onViewportChange:m,content:w,onContentChange:b,scrollbarX:v,onScrollbarXChange:S,scrollbarXEnabled:x,onScrollbarXEnabledChange:R,scrollbarY:g,onScrollbarYChange:E,scrollbarYEnabled:P,onScrollbarYEnabledChange:L,onCornerWidthChange:T,onCornerHeightChange:A},/*#__PURE__*/s.createElement(c.div,u({},a,{ref:_,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})))}));/*#__PURE__*/export const ScrollAreaViewport=/*#__PURE__*/s.forwardRef(((e,r)=>{const{__scopeScrollArea:t,children:o,...n}=e,i=h("ScrollAreaViewport",t),a=s.useRef(null),d=l(r,a,i.onViewportChange);/*#__PURE__*/return s.createElement(s.Fragment,null,/*#__PURE__*/s.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),/*#__PURE__*/s.createElement(c.div,u({"data-radix-scroll-area-viewport":""},n,{ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),/*#__PURE__*/s.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},o)))}));/*#__PURE__*/export const ScrollAreaScrollbar=/*#__PURE__*/s.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=h("ScrollAreaScrollbar",e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:i}=n,a="horizontal"===e.orientation;return s.useEffect((()=>(a?l(!0):i(!0),()=>{a?l(!1):i(!1)})),[a,l,i]),"hover"===n.type?/*#__PURE__*/s.createElement(m,u({},o,{ref:r,forceMount:t})):"scroll"===n.type?/*#__PURE__*/s.createElement(w,u({},o,{ref:r,forceMount:t})):"auto"===n.type?/*#__PURE__*/s.createElement(b,u({},o,{ref:r,forceMount:t})):"always"===n.type?/*#__PURE__*/s.createElement(v,u({},o,{ref:r})):null}));/*#__PURE__*/const m=/*#__PURE__*/s.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=h("ScrollAreaScrollbar",e.__scopeScrollArea),[l,i]=s.useState(!1);return s.useEffect((()=>{const e=n.scrollArea;let r=0;if(e){const t=()=>{window.clearTimeout(r),i(!0)},o=()=>{r=window.setTimeout((()=>i(!1)),n.scrollHideDelay)};return e.addEventListener("pointerenter",t),e.addEventListener("pointerleave",o),()=>{e.removeEventListener("pointerenter",t),e.removeEventListener("pointerleave",o)}}}),[n.scrollArea,n.scrollHideDelay]),/*#__PURE__*/s.createElement(a,{present:t||l},/*#__PURE__*/s.createElement(b,u({"data-state":l?"visible":"hidden"},o,{ref:r})))})),w=/*#__PURE__*/s.forwardRef(((r,t)=>{const{forceMount:o,...n}=r,l=h("ScrollAreaScrollbar",r.__scopeScrollArea),i="horizontal"===r.orientation,c=z((()=>p("SCROLL_END")),100),[d,p]=(f="hidden",m={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},s.useReducer(((e,r)=>{const t=m[e][r];return null!=t?t:e}),f));var f,m;return s.useEffect((()=>{if("idle"===d){const e=window.setTimeout((()=>p("HIDE")),l.scrollHideDelay);return()=>window.clearTimeout(e)}}),[d,l.scrollHideDelay,p]),s.useEffect((()=>{const e=l.viewport,r=i?"scrollLeft":"scrollTop";if(e){let t=e[r];const o=()=>{const o=e[r];t!==o&&(p("SCROLL"),c()),t=o};return e.addEventListener("scroll",o),()=>e.removeEventListener("scroll",o)}}),[l.viewport,i,p,c]),/*#__PURE__*/s.createElement(a,{present:o||"hidden"!==d},/*#__PURE__*/s.createElement(v,u({"data-state":"hidden"===d?"hidden":"visible"},n,{ref:t,onPointerEnter:e(r.onPointerEnter,(()=>p("POINTER_ENTER"))),onPointerLeave:e(r.onPointerLeave,(()=>p("POINTER_LEAVE")))})))})),b=/*#__PURE__*/s.forwardRef(((e,r)=>{const t=h("ScrollAreaScrollbar",e.__scopeScrollArea),{forceMount:o,...n}=e,[l,i]=s.useState(!1),c="horizontal"===e.orientation,d=z((()=>{if(t.viewport){const e=t.viewport.offsetWidth<t.viewport.scrollWidth,r=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?e:r)}}),10);return H(t.viewport,d),H(t.content,d),/*#__PURE__*/s.createElement(a,{present:o||l},/*#__PURE__*/s.createElement(v,u({"data-state":l?"visible":"hidden"},n,{ref:r})))})),v=/*#__PURE__*/s.forwardRef(((e,r)=>{const{orientation:t="vertical",...o}=e,n=h("ScrollAreaScrollbar",e.__scopeScrollArea),l=s.useRef(null),i=s.useRef(0),[a,c]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=x(a.viewport,a.content),p={...o,sizes:a,onSizesChange:c,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>l.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function f(e,r){return function(e,r,t,o="ltr"){const n=R(t),l=n/2,i=r||l,a=n-i,c=t.scrollbar.paddingStart+i,s=t.scrollbar.size-t.scrollbar.paddingEnd-a,u=t.content-t.viewport;return L([c,s],"ltr"===o?[0,u]:[-1*u,0])(e)}(e,i.current,a,r)}return"horizontal"===t?/*#__PURE__*/s.createElement(S,u({},p,{ref:r,onThumbPositionChange:()=>{if(n.viewport&&l.current){const e=P(n.viewport.scrollLeft,a,n.dir);l.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{n.viewport&&(n.viewport.scrollLeft=e)},onDragScroll:e=>{n.viewport&&(n.viewport.scrollLeft=f(e,n.dir))}})):"vertical"===t?/*#__PURE__*/s.createElement(g,u({},p,{ref:r,onThumbPositionChange:()=>{if(n.viewport&&l.current){const e=P(n.viewport.scrollTop,a);l.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{n.viewport&&(n.viewport.scrollTop=e)},onDragScroll:e=>{n.viewport&&(n.viewport.scrollTop=f(e))}})):null})),S=/*#__PURE__*/s.forwardRef(((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,i=h("ScrollAreaScrollbar",e.__scopeScrollArea),[a,c]=s.useState(),d=s.useRef(null),p=l(r,d,i.onScrollbarXChange);return s.useEffect((()=>{d.current&&c(getComputedStyle(d.current))}),[d]),/*#__PURE__*/s.createElement(T,u({"data-orientation":"horizontal"},n,{ref:p,sizes:t,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":R(t)+"px",...e.style},onThumbPointerDown:r=>e.onThumbPointerDown(r.x),onDragScroll:r=>e.onDragScroll(r.x),onWheelScroll:(r,t)=>{if(i.viewport){const o=i.viewport.scrollLeft+r.deltaX;e.onWheelScroll(o),_(o,t)&&r.preventDefault()}},onResize:()=>{d.current&&i.viewport&&a&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:A(a.paddingLeft),paddingEnd:A(a.paddingRight)}})}}))})),g=/*#__PURE__*/s.forwardRef(((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,i=h("ScrollAreaScrollbar",e.__scopeScrollArea),[a,c]=s.useState(),d=s.useRef(null),p=l(r,d,i.onScrollbarYChange);return s.useEffect((()=>{d.current&&c(getComputedStyle(d.current))}),[d]),/*#__PURE__*/s.createElement(T,u({"data-orientation":"vertical"},n,{ref:p,sizes:t,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":R(t)+"px",...e.style},onThumbPointerDown:r=>e.onThumbPointerDown(r.y),onDragScroll:r=>e.onDragScroll(r.y),onWheelScroll:(r,t)=>{if(i.viewport){const o=i.viewport.scrollTop+r.deltaY;e.onWheelScroll(o),_(o,t)&&r.preventDefault()}},onResize:()=>{d.current&&i.viewport&&a&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:A(a.paddingTop),paddingEnd:A(a.paddingBottom)}})}}))})),[E,C]=d("ScrollAreaScrollbar"),T=/*#__PURE__*/s.forwardRef(((r,t)=>{const{__scopeScrollArea:o,sizes:i,hasThumb:a,onThumbChange:d,onThumbPointerUp:p,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:w,onWheelScroll:b,onResize:v,...S}=r,g=h("ScrollAreaScrollbar",o),[C,T]=s.useState(null),y=l(t,(e=>T(e))),A=s.useRef(null),x=s.useRef(""),R=g.viewport,P=i.content-i.viewport,L=n(b),_=n(m),D=z(v,10);function W(e){if(A.current){const r=e.clientX-A.current.left,t=e.clientY-A.current.top;w({x:r,y:t})}}return s.useEffect((()=>{const e=e=>{const r=e.target;(null==C?void 0:C.contains(r))&&L(e,P)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[R,C,P,L]),s.useEffect(_,[i,_]),H(C,D),H(g.content,D),/*#__PURE__*/s.createElement(E,{scope:o,scrollbar:C,hasThumb:a,onThumbChange:n(d),onThumbPointerUp:n(p),onThumbPositionChange:_,onThumbPointerDown:n(f)},/*#__PURE__*/s.createElement(c.div,u({},S,{ref:y,style:{position:"absolute",...S.style},onPointerDown:e(r.onPointerDown,(e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),A.current=C.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",W(e)}})),onPointerMove:e(r.onPointerMove,W),onPointerUp:e(r.onPointerUp,(e=>{e.target.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,A.current=null}))})))}));export const ScrollAreaThumb=/*#__PURE__*/s.forwardRef(((r,t)=>{const{__scopeScrollArea:o,style:n,...i}=r,a=h("ScrollbarThumb",o),d=C("ScrollbarThumb",o),{onThumbPositionChange:p}=d,f=l(t,(e=>d.onThumbChange(e))),m=s.useRef(),w=z((()=>{m.current&&(m.current(),m.current=void 0)}),100);return s.useEffect((()=>{const e=a.viewport;if(e){const r=()=>{if(w(),!m.current){const r=D(e,p);m.current=r,p()}};return p(),e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[a.viewport,w,p]),d.hasThumb?/*#__PURE__*/s.createElement(c.div,u({},i,{ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:e(r.onPointerDownCapture,(e=>{const r=e.target.getBoundingClientRect(),t=e.clientX-r.left,o=e.clientY-r.top;d.onThumbPointerDown({x:t,y:o})})),onPointerUp:e(r.onPointerUp,d.onThumbPointerUp)})):null}));/*#__PURE__*/export const ScrollAreaCorner=/*#__PURE__*/s.forwardRef(((e,r)=>{const t=h("ScrollAreaCorner",e.__scopeScrollArea),o=Boolean(t.scrollbarX&&t.scrollbarY);return"scroll"!==t.type&&o?/*#__PURE__*/s.createElement(y,u({},e,{ref:r})):null}));/*#__PURE__*/const y=/*#__PURE__*/s.forwardRef(((e,r)=>{const{__scopeScrollArea:t,...o}=e,n=h("ScrollAreaCorner",t),[l,i]=s.useState(0),[a,d]=s.useState(0),p=Boolean(l&&a);return H(n.scrollbarX,(()=>{var e;const r=(null===(e=n.scrollbarX)||void 0===e?void 0:e.offsetHeight)||0;n.onCornerHeightChange(r),d(r)})),H(n.scrollbarY,(()=>{var e;const r=(null===(e=n.scrollbarY)||void 0===e?void 0:e.offsetWidth)||0;n.onCornerWidthChange(r),i(r)})),p?/*#__PURE__*/s.createElement(c.div,u({},o,{ref:r,style:{width:l,height:a,position:"absolute",right:"ltr"===n.dir?0:void 0,left:"rtl"===n.dir?0:void 0,bottom:0,...e.style}})):null}));function A(e){return e?parseInt(e,10):0}function x(e,r){const t=e/r;return isNaN(t)?0:t}function R(e){const r=x(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-t)*r;return Math.max(o,18)}function P(e,t,o="ltr"){const n=R(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-l,a=t.content-t.viewport,c=i-n,s=r(e,"ltr"===o?[0,a]:[-1*a,0]);return L([0,a],[0,c])(s)}function L(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const o=(r[1]-r[0])/(e[1]-e[0]);return r[0]+o*(t-e[0])}}function _(e,r){return e>0&&e<r}const D=(e,r=(()=>{}))=>{let t={left:e.scrollLeft,top:e.scrollTop},o=0;return function n(){const l={left:e.scrollLeft,top:e.scrollTop},i=t.left!==l.left,a=t.top!==l.top;(i||a)&&r(),t=l,o=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(o)};function z(e,r){const t=n(e),o=s.useRef(0);return s.useEffect((()=>()=>window.clearTimeout(o.current)),[]),s.useCallback((()=>{window.clearTimeout(o.current),o.current=window.setTimeout(t,r)}),[t,r])}function H(e,r){const o=n(r);t((()=>{let r=0;if(e){const t=new ResizeObserver((()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(o)}));return t.observe(e),()=>{window.cancelAnimationFrame(r),t.unobserve(e)}}}),[e,o])}export const Root=ScrollArea;export const Viewport=ScrollAreaViewport;export const Scrollbar=ScrollAreaScrollbar;export const Thumb=ScrollAreaThumb;export const Corner=ScrollAreaCorner; | ||
import{composeEventHandlers as e}from"@radix-ui/primitive";import{clamp as r}from"@radix-ui/number";import{useLayoutEffect as t}from"@radix-ui/react-use-layout-effect";import{useDirection as o}from"@radix-ui/react-direction";import{useCallbackRef as n}from"@radix-ui/react-use-callback-ref";import{useComposedRefs as l}from"@radix-ui/react-compose-refs";import{createContextScope as i}from"@radix-ui/react-context";import{Presence as a}from"@radix-ui/react-presence";import{Primitive as c}from"@radix-ui/react-primitive";import*as s from"react";import u from"@babel/runtime/helpers/esm/extends";const[d,p]=i("ScrollArea");export{p as createScrollAreaScope};const[f,h]=d("ScrollArea");export const ScrollArea=/*#__PURE__*/s.forwardRef(((e,r)=>{const{__scopeScrollArea:t,type:n="hover",dir:i,scrollHideDelay:a=600,...d}=e,[p,h]=s.useState(null),[m,w]=s.useState(null),[b,v]=s.useState(null),[S,g]=s.useState(null),[E,C]=s.useState(null),[T,y]=s.useState(0),[A,x]=s.useState(0),[R,P]=s.useState(!1),[L,_]=s.useState(!1),D=l(r,(e=>h(e))),z=o(i);/*#__PURE__*/return s.createElement(f,{scope:t,type:n,dir:z,scrollHideDelay:a,scrollArea:p,viewport:m,onViewportChange:w,content:b,onContentChange:v,scrollbarX:S,onScrollbarXChange:g,scrollbarXEnabled:R,onScrollbarXEnabledChange:P,scrollbarY:E,onScrollbarYChange:C,scrollbarYEnabled:L,onScrollbarYEnabledChange:_,onCornerWidthChange:y,onCornerHeightChange:x},/*#__PURE__*/s.createElement(c.div,u({dir:z},d,{ref:D,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})))}));/*#__PURE__*/export const ScrollAreaViewport=/*#__PURE__*/s.forwardRef(((e,r)=>{const{__scopeScrollArea:t,children:o,...n}=e,i=h("ScrollAreaViewport",t),a=s.useRef(null),d=l(r,a,i.onViewportChange);/*#__PURE__*/return s.createElement(s.Fragment,null,/*#__PURE__*/s.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),/*#__PURE__*/s.createElement(c.div,u({"data-radix-scroll-area-viewport":""},n,{ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),/*#__PURE__*/s.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},o)))}));/*#__PURE__*/export const ScrollAreaScrollbar=/*#__PURE__*/s.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=h("ScrollAreaScrollbar",e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:i}=n,a="horizontal"===e.orientation;return s.useEffect((()=>(a?l(!0):i(!0),()=>{a?l(!1):i(!1)})),[a,l,i]),"hover"===n.type?/*#__PURE__*/s.createElement(m,u({},o,{ref:r,forceMount:t})):"scroll"===n.type?/*#__PURE__*/s.createElement(w,u({},o,{ref:r,forceMount:t})):"auto"===n.type?/*#__PURE__*/s.createElement(b,u({},o,{ref:r,forceMount:t})):"always"===n.type?/*#__PURE__*/s.createElement(v,u({},o,{ref:r})):null}));/*#__PURE__*/const m=/*#__PURE__*/s.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=h("ScrollAreaScrollbar",e.__scopeScrollArea),[l,i]=s.useState(!1);return s.useEffect((()=>{const e=n.scrollArea;let r=0;if(e){const t=()=>{window.clearTimeout(r),i(!0)},o=()=>{r=window.setTimeout((()=>i(!1)),n.scrollHideDelay)};return e.addEventListener("pointerenter",t),e.addEventListener("pointerleave",o),()=>{e.removeEventListener("pointerenter",t),e.removeEventListener("pointerleave",o)}}}),[n.scrollArea,n.scrollHideDelay]),/*#__PURE__*/s.createElement(a,{present:t||l},/*#__PURE__*/s.createElement(b,u({"data-state":l?"visible":"hidden"},o,{ref:r})))})),w=/*#__PURE__*/s.forwardRef(((r,t)=>{const{forceMount:o,...n}=r,l=h("ScrollAreaScrollbar",r.__scopeScrollArea),i="horizontal"===r.orientation,c=z((()=>p("SCROLL_END")),100),[d,p]=(f="hidden",m={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},s.useReducer(((e,r)=>{const t=m[e][r];return null!=t?t:e}),f));var f,m;return s.useEffect((()=>{if("idle"===d){const e=window.setTimeout((()=>p("HIDE")),l.scrollHideDelay);return()=>window.clearTimeout(e)}}),[d,l.scrollHideDelay,p]),s.useEffect((()=>{const e=l.viewport,r=i?"scrollLeft":"scrollTop";if(e){let t=e[r];const o=()=>{const o=e[r];t!==o&&(p("SCROLL"),c()),t=o};return e.addEventListener("scroll",o),()=>e.removeEventListener("scroll",o)}}),[l.viewport,i,p,c]),/*#__PURE__*/s.createElement(a,{present:o||"hidden"!==d},/*#__PURE__*/s.createElement(v,u({"data-state":"hidden"===d?"hidden":"visible"},n,{ref:t,onPointerEnter:e(r.onPointerEnter,(()=>p("POINTER_ENTER"))),onPointerLeave:e(r.onPointerLeave,(()=>p("POINTER_LEAVE")))})))})),b=/*#__PURE__*/s.forwardRef(((e,r)=>{const t=h("ScrollAreaScrollbar",e.__scopeScrollArea),{forceMount:o,...n}=e,[l,i]=s.useState(!1),c="horizontal"===e.orientation,d=z((()=>{if(t.viewport){const e=t.viewport.offsetWidth<t.viewport.scrollWidth,r=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?e:r)}}),10);return H(t.viewport,d),H(t.content,d),/*#__PURE__*/s.createElement(a,{present:o||l},/*#__PURE__*/s.createElement(v,u({"data-state":l?"visible":"hidden"},n,{ref:r})))})),v=/*#__PURE__*/s.forwardRef(((e,r)=>{const{orientation:t="vertical",...o}=e,n=h("ScrollAreaScrollbar",e.__scopeScrollArea),l=s.useRef(null),i=s.useRef(0),[a,c]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=x(a.viewport,a.content),p={...o,sizes:a,onSizesChange:c,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>l.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function f(e,r){return function(e,r,t,o="ltr"){const n=R(t),l=n/2,i=r||l,a=n-i,c=t.scrollbar.paddingStart+i,s=t.scrollbar.size-t.scrollbar.paddingEnd-a,u=t.content-t.viewport;return L([c,s],"ltr"===o?[0,u]:[-1*u,0])(e)}(e,i.current,a,r)}return"horizontal"===t?/*#__PURE__*/s.createElement(S,u({},p,{ref:r,onThumbPositionChange:()=>{if(n.viewport&&l.current){const e=P(n.viewport.scrollLeft,a,n.dir);l.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{n.viewport&&(n.viewport.scrollLeft=e)},onDragScroll:e=>{n.viewport&&(n.viewport.scrollLeft=f(e,n.dir))}})):"vertical"===t?/*#__PURE__*/s.createElement(g,u({},p,{ref:r,onThumbPositionChange:()=>{if(n.viewport&&l.current){const e=P(n.viewport.scrollTop,a);l.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{n.viewport&&(n.viewport.scrollTop=e)},onDragScroll:e=>{n.viewport&&(n.viewport.scrollTop=f(e))}})):null})),S=/*#__PURE__*/s.forwardRef(((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,i=h("ScrollAreaScrollbar",e.__scopeScrollArea),[a,c]=s.useState(),d=s.useRef(null),p=l(r,d,i.onScrollbarXChange);return s.useEffect((()=>{d.current&&c(getComputedStyle(d.current))}),[d]),/*#__PURE__*/s.createElement(T,u({"data-orientation":"horizontal"},n,{ref:p,sizes:t,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":R(t)+"px",...e.style},onThumbPointerDown:r=>e.onThumbPointerDown(r.x),onDragScroll:r=>e.onDragScroll(r.x),onWheelScroll:(r,t)=>{if(i.viewport){const o=i.viewport.scrollLeft+r.deltaX;e.onWheelScroll(o),_(o,t)&&r.preventDefault()}},onResize:()=>{d.current&&i.viewport&&a&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:A(a.paddingLeft),paddingEnd:A(a.paddingRight)}})}}))})),g=/*#__PURE__*/s.forwardRef(((e,r)=>{const{sizes:t,onSizesChange:o,...n}=e,i=h("ScrollAreaScrollbar",e.__scopeScrollArea),[a,c]=s.useState(),d=s.useRef(null),p=l(r,d,i.onScrollbarYChange);return s.useEffect((()=>{d.current&&c(getComputedStyle(d.current))}),[d]),/*#__PURE__*/s.createElement(T,u({"data-orientation":"vertical"},n,{ref:p,sizes:t,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":R(t)+"px",...e.style},onThumbPointerDown:r=>e.onThumbPointerDown(r.y),onDragScroll:r=>e.onDragScroll(r.y),onWheelScroll:(r,t)=>{if(i.viewport){const o=i.viewport.scrollTop+r.deltaY;e.onWheelScroll(o),_(o,t)&&r.preventDefault()}},onResize:()=>{d.current&&i.viewport&&a&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:A(a.paddingTop),paddingEnd:A(a.paddingBottom)}})}}))})),[E,C]=d("ScrollAreaScrollbar"),T=/*#__PURE__*/s.forwardRef(((r,t)=>{const{__scopeScrollArea:o,sizes:i,hasThumb:a,onThumbChange:d,onThumbPointerUp:p,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:w,onWheelScroll:b,onResize:v,...S}=r,g=h("ScrollAreaScrollbar",o),[C,T]=s.useState(null),y=l(t,(e=>T(e))),A=s.useRef(null),x=s.useRef(""),R=g.viewport,P=i.content-i.viewport,L=n(b),_=n(m),D=z(v,10);function W(e){if(A.current){const r=e.clientX-A.current.left,t=e.clientY-A.current.top;w({x:r,y:t})}}return s.useEffect((()=>{const e=e=>{const r=e.target;(null==C?void 0:C.contains(r))&&L(e,P)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[R,C,P,L]),s.useEffect(_,[i,_]),H(C,D),H(g.content,D),/*#__PURE__*/s.createElement(E,{scope:o,scrollbar:C,hasThumb:a,onThumbChange:n(d),onThumbPointerUp:n(p),onThumbPositionChange:_,onThumbPointerDown:n(f)},/*#__PURE__*/s.createElement(c.div,u({},S,{ref:y,style:{position:"absolute",...S.style},onPointerDown:e(r.onPointerDown,(e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),A.current=C.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",W(e)}})),onPointerMove:e(r.onPointerMove,W),onPointerUp:e(r.onPointerUp,(e=>{e.target.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,A.current=null}))})))}));export const ScrollAreaThumb=/*#__PURE__*/s.forwardRef(((r,t)=>{const{__scopeScrollArea:o,style:n,...i}=r,a=h("ScrollbarThumb",o),d=C("ScrollbarThumb",o),{onThumbPositionChange:p}=d,f=l(t,(e=>d.onThumbChange(e))),m=s.useRef(),w=z((()=>{m.current&&(m.current(),m.current=void 0)}),100);return s.useEffect((()=>{const e=a.viewport;if(e){const r=()=>{if(w(),!m.current){const r=D(e,p);m.current=r,p()}};return p(),e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[a.viewport,w,p]),d.hasThumb?/*#__PURE__*/s.createElement(c.div,u({},i,{ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:e(r.onPointerDownCapture,(e=>{const r=e.target.getBoundingClientRect(),t=e.clientX-r.left,o=e.clientY-r.top;d.onThumbPointerDown({x:t,y:o})})),onPointerUp:e(r.onPointerUp,d.onThumbPointerUp)})):null}));/*#__PURE__*/export const ScrollAreaCorner=/*#__PURE__*/s.forwardRef(((e,r)=>{const t=h("ScrollAreaCorner",e.__scopeScrollArea),o=Boolean(t.scrollbarX&&t.scrollbarY);return"scroll"!==t.type&&o?/*#__PURE__*/s.createElement(y,u({},e,{ref:r})):null}));/*#__PURE__*/const y=/*#__PURE__*/s.forwardRef(((e,r)=>{const{__scopeScrollArea:t,...o}=e,n=h("ScrollAreaCorner",t),[l,i]=s.useState(0),[a,d]=s.useState(0),p=Boolean(l&&a);return H(n.scrollbarX,(()=>{var e;const r=(null===(e=n.scrollbarX)||void 0===e?void 0:e.offsetHeight)||0;n.onCornerHeightChange(r),d(r)})),H(n.scrollbarY,(()=>{var e;const r=(null===(e=n.scrollbarY)||void 0===e?void 0:e.offsetWidth)||0;n.onCornerWidthChange(r),i(r)})),p?/*#__PURE__*/s.createElement(c.div,u({},o,{ref:r,style:{width:l,height:a,position:"absolute",right:"ltr"===n.dir?0:void 0,left:"rtl"===n.dir?0:void 0,bottom:0,...e.style}})):null}));function A(e){return e?parseInt(e,10):0}function x(e,r){const t=e/r;return isNaN(t)?0:t}function R(e){const r=x(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-t)*r;return Math.max(o,18)}function P(e,t,o="ltr"){const n=R(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-l,a=t.content-t.viewport,c=i-n,s=r(e,"ltr"===o?[0,a]:[-1*a,0]);return L([0,a],[0,c])(s)}function L(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const o=(r[1]-r[0])/(e[1]-e[0]);return r[0]+o*(t-e[0])}}function _(e,r){return e>0&&e<r}const D=(e,r=(()=>{}))=>{let t={left:e.scrollLeft,top:e.scrollTop},o=0;return function n(){const l={left:e.scrollLeft,top:e.scrollTop},i=t.left!==l.left,a=t.top!==l.top;(i||a)&&r(),t=l,o=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(o)};function z(e,r){const t=n(e),o=s.useRef(0);return s.useEffect((()=>()=>window.clearTimeout(o.current)),[]),s.useCallback((()=>{window.clearTimeout(o.current),o.current=window.setTimeout(t,r)}),[t,r])}function H(e,r){const o=n(r);t((()=>{let r=0;if(e){const t=new ResizeObserver((()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(o)}));return t.observe(e),()=>{window.cancelAnimationFrame(r),t.unobserve(e)}}}),[e,o])}export const Root=ScrollArea;export const Viewport=ScrollAreaViewport;export const Scrollbar=ScrollAreaScrollbar;export const Thumb=ScrollAreaThumb;export const Corner=ScrollAreaCorner; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-scroll-area", | ||
"version": "0.1.4", | ||
"version": "0.1.5-rc.1", | ||
"license": "MIT", | ||
@@ -24,6 +24,6 @@ "source": "src/index.ts", | ||
"@radix-ui/react-context": "0.1.1", | ||
"@radix-ui/react-direction": "0.1.0-rc.1", | ||
"@radix-ui/react-presence": "0.1.2", | ||
"@radix-ui/react-primitive": "0.1.4", | ||
"@radix-ui/react-use-callback-ref": "0.1.0", | ||
"@radix-ui/react-use-direction": "0.1.0", | ||
"@radix-ui/react-use-layout-effect": "0.1.0" | ||
@@ -44,3 +44,4 @@ }, | ||
"url": "https://github.com/radix-ui/primitives/issues" | ||
} | ||
}, | ||
"stableVersion": "0.1.4" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158280
+ Added@radix-ui/react-direction@0.1.0-rc.1(transitive)
- Removed@radix-ui/react-use-direction@0.1.0
- Removed@radix-ui/react-use-direction@0.1.0(transitive)