import type React from 'react'; import type { CloseDetail } from './types.js'; export interface DrawerRef extends HTMLElement { /** Opens the drawer panel with slide-in animation. */ open(): void; /** Closes the drawer panel with slide-out animation. */ close(): void; /** Toggles the drawer open/close state. */ toggle(): void; } /** * Content goes in named slots (`header`, `children`, `footer`). * Open and close imperatively — see the framework access note below — or with the `open` boolean prop. `onClose` fires when the user dismisses (backdrop click, Escape, close button). * * In React, reach the imperative methods through a ref: * `const api = useRef(null)`, pass `ref={api}`, then `api.current?.open()`. * Available: open(), close(), toggle(). * * @csspart base, body, footer, header */ export interface DrawerOwnProps { /** * Unique identifier for the element. * @example 'example-id' */ id?: string; /** * Title text. * @example 'Example title' */ title: string; /** * Secondary descriptive text rendered inside Shadow DOM. Not the same as React children — use the `description` prop for helper text. * @example 'Additional context' */ description?: string; /** * Which viewport edge the drawer slides from (left, right, top, bottom). Allowed values: `left`, `right`, `top`, `bottom`. * @example 'left' */ side?: 'left' | 'right' | 'top' | 'bottom'; /** * Component size. Allowed values: `sm`, `md`, `lg`, `xl`, `full`. * @example 'sm' */ size?: 'sm' | 'md' | 'lg' | 'xl' | 'full'; /** * Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. * @example 'sharp' */ shape?: 'sharp' | 'rounded' | 'pill'; /** * Whether to render a close button. * @example true */ closeButton?: boolean; /** * Whether the component is in an open/expanded state. * @defaultValue false * @example true */ open?: boolean; /** * Fires when the component closes. Detail: `CloseDetail`. * @example (event) => console.log(event.detail.reason) */ onClose?: (event: CustomEvent) => void; /** Default slot content. * @example Content */ children?: React.ReactNode; /** Content for the `footer` slot. * @example Content */ footer?: React.ReactNode; /** CSS class applied to the Custom Element host. * @example 'my-component' */ className?: string; /** Inline styles applied to the Custom Element host. * @example { marginTop: 8 } */ style?: React.CSSProperties; } /** * Props for ``: the component's own API plus every standard DOM * attribute and native React event handler, forwarded verbatim to the * `` host — `id`, `data-*`, `aria-*`, `title`, `tabIndex`, * `slot`, `onMouseEnter`, and the rest. Own props always win over a * same-named DOM attribute. */ export type DrawerProps = DrawerOwnProps & Omit, keyof DrawerOwnProps | 'children' | 'dangerouslySetInnerHTML'>; export declare const Drawer: React.ForwardRefExoticComponent, "dangerouslySetInnerHTML" | keyof DrawerOwnProps> & React.RefAttributes>;