UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

2 lines (1 loc) 2.5 kB
"use strict";const s=require("react/jsx-runtime"),a=require("./index-DwV9MiDB.js"),m=require("./utils/tailwind.cjs"),x=require("./x-C9x1HOMQ.js"),o=require("./index-Gv5S_MDL.js"),f=o.Root,p=o.Trigger,l=o.Portal,u=o.Close,r=({className:e,...t})=>s.jsxs(o.Close,{"data-slot":"sheet-close",className:a.cn("focus-ring absolute top-4 right-4 opacity-70 transition hover:opacity-100 disabled:pointer-events-none",e),...t,children:[s.jsx(x.default,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}),i=({className:e,...t})=>s.jsx(o.Overlay,{className:a.cn("animate-entrance-fade fixed inset-0 z-50 bg-black/20",e),"data-slot":"sheet-overlay",...t}),S=["top","right","bottom","left"],c=({side:e="right",className:t,size:n="sm",children:d,...h})=>s.jsx(o.Content,{className:a.cn("bg-surface data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 overflow-y-auto p-4 shadow-lg transition duration-300 [--screenGap:2rem] lg:[--screenGap:3rem]",e==="right"||e==="left"?["inset-y-0 h-full w-[calc(100vw-var(--screenGap))]",n&&m.sizeToMaxWidthRecord[n]]:"inset-x-0 h-auto max-h-[calc(100vh-var(--screenGap))]",e==="right"?"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right right-0 border-l":e==="left"?"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left left-0 border-r":e==="top"?"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top top-0 border-b":"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom bottom-0 border-t",t),"data-slot":"sheet-content",...h,children:d}),g=({children:e,...t})=>s.jsxs(l,{children:[s.jsx(i,{}),s.jsxs(c,{...t,children:[e,s.jsx(r,{})]})]}),b=({className:e,...t})=>s.jsx("div",{className:a.cn("flex flex-col gap-1.5",e),"data-slot":"sheet-header",...t}),j=({className:e,...t})=>s.jsx("div",{className:a.cn("flex justify-end gap-2",e),"data-slot":"sheet-footer",...t}),v=({className:e,...t})=>s.jsx(o.Title,{className:a.cn("text-foreground font-semibold",e),"data-slot":"sheet-title",...t}),C=({className:e,...t})=>s.jsx(o.Description,{className:a.cn("text-muted-foreground text-sm",e),"data-slot":"sheet-description",...t});exports.Sheet=f;exports.SheetClose=u;exports.SheetCloseX=r;exports.SheetContent=g;exports.SheetContentElement=c;exports.SheetDescription=C;exports.SheetFooter=j;exports.SheetHeader=b;exports.SheetOverlay=i;exports.SheetPortal=l;exports.SheetTitle=v;exports.SheetTrigger=p;exports.sheetSides=S;