Files
agency/.pnpm-store/v3/files/f6/99b67a32caac18009b6125e49562df5d5595e3741868d6e886da1cc29072d0c634b7d44ab0c7ab1b55c45087de5cf704ae05220f5eba80974184e4125d4330
hanzo-agent 5af6960b87 run project
Run: sess_f37640604ae254cb4d11dc6217f7b721
2026-09-30 00:04:56 +00:00

32 lines
1.6 KiB
Plaintext

import React from 'react'
export function Sheet({ open, onOpenChange, side = 'right', width = 380, children }) {
React.useEffect(() => {
if (!open) return
const onKey = (e) => { if (e.key === 'Escape') onOpenChange && onOpenChange(false) }
document.addEventListener('keydown', onKey)
return () => document.removeEventListener('keydown', onKey)
}, [open, onOpenChange])
if (!open) return null
const pos = side === 'left'
? { left: 0, top: 0, bottom: 0, width, borderRight: '1px solid var(--border)' }
: { right: 0, top: 0, bottom: 0, width, borderLeft: '1px solid var(--border)' }
return (
<div onClick={() => onOpenChange && onOpenChange(false)} style={{position:'fixed',inset:0,zIndex:'var(--z-modal)',background:'var(--surface-scrim)'}}>
<div
onClick={(e) => e.stopPropagation()}
style={{position:'absolute',display:'flex',flexDirection:'column',background:'var(--popover)',boxShadow:'var(--shadow-floating)',animation:'hanzo-fade-up var(--duration-base) var(--ease-out)',...pos}}
>{children}</div>
</div>
)
}
export function SheetHeader({ style, children, ...rest }) {
return <div style={{padding:'20px 24px',borderBottom:'1px solid var(--border)',display:'flex',flexDirection:'column',gap:4,...style}} {...rest}>{children}</div>
}
export function SheetTitle({ style, children, ...rest }) {
return <h2 style={{fontSize:'var(--text-base)',fontWeight:'var(--weight-semibold)',color:'var(--text-primary)',...style}} {...rest}>{children}</h2>
}
export function SheetContent({ style, children, ...rest }) {
return <div style={{flex:1,overflowY:'auto',padding:24,...style}} {...rest}>{children}</div>
}