UNPKG

@snowball-tech/fractal

Version:

Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS

3 lines 1.79 kB
'use client'; import{a}from"./chunk-4LUJ3YLA.js";import{b as o}from"./chunk-CMFNILWJ.js";import{a as c,b as m}from"./chunk-XYM7TA65.js";import*as l from"@radix-ui/react-scroll-area";import h from"lodash/fp/omit";import{jsx as e,jsxs as n}from"react/jsx-runtime";var x=({children:u,orientation:r="vertical",scrollHideDelay:S=600,type:i="hover",viewport:s,...t})=>{let f="flex touch-none select-none bg-grey-90 p-quarter transition-background-color duration-300 ease-out hover:bg-grey-70",b="relative flex-1 rounded-sm bg-grey-30 before:absolute before:content-empty";return n(l.Root,{className:m(`${o}-${a}`,"overflow-hidden",r==="vertical"||r==="both"?"h-full max-h-full min-h-0":"",r==="horizontal"||r==="both"?"w-full min-w-0 max-w-full":"",t.className),scrollHideDelay:S,type:i,...h(["className"],t),children:[e(l.Viewport,{className:m("relative size-full max-h-full max-w-full",s?.rootClassName),...h(["className"],s),children:e("div",{className:s?.className,children:u})}),(r==="both"||r==="vertical")&&e(l.Scrollbar,{className:c(`${o}-${a}__scrollbar--y`,f,"w-1"),orientation:"vertical",children:e(l.Thumb,{className:c(`${o}-${a}__scrollbar--y__thumb`,b,"!w-half before:top-1/2 before:h-full before:min-h-[44px] before:w-full before:min-w-[44px] before:-translate-x-1/2 before:-translate-y-1/2")})}),(r==="both"||r==="horizontal")&&e(l.Scrollbar,{className:c(`${o}-${a}__scrollbar--x`,f,"h-1 flex-col"),orientation:"horizontal",children:e(l.Thumb,{className:c(`${o}-${a}__scrollbar--x__thumb`,b,"!h-half before:top-1/2 before:h-full before:min-h-[44px] before:w-full before:min-w-[44px] before:-translate-x-1/2 before:-translate-y-1/2")})}),e(l.Corner,{className:"bg-grey-50"})]})};x.displayName="LegacyScrollArea";var R=x;export{x as a,R as b}; //# sourceMappingURL=chunk-M5QTYEXA.js.map