/** Placement of the sheet content inside the viewport. */ type SheetPlacement = 'top' | 'bottom' | 'left' | 'right' | 'center'; /** Swipe track used when the content can be dismissed from an edge. */ type SheetTrack = Exclude; /** Viewport edges protected by safe-area insets. */ type SheetSafeAreaEdge = 'top' | 'bottom' | 'left' | 'right'; /** Safe-area behavior for Capacitor WebViews and mobile browsers. */ type SheetSafeAreaMode = boolean | 'auto' | 'all' | 'none' | SheetSafeAreaEdge[]; /** CSS length or pixel number used for sheet container insets. */ type SheetInsetValue = string | number; /** Extra container offsets applied around the sheet viewport. */ type SheetContainerOffset = Partial>; /** Runtime travel state emitted by sheet lifecycle events. */ type SheetTravelStatus = 'idle' | 'entering' | 'exiting' | 'dragging' | 'settling'; /** Built-in animation presets tuned for mobile WebViews. */ type SheetAnimationPreset = 'gentle' | 'smooth' | 'snappy'; /** Easing string accepted by the Web Animations API. */ type SheetEasing = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | string; /** Animation options for programmatic present, dismiss, and detent steps. */ interface SheetAnimationSettings { /** Named preset. Defaults to `smooth`. */ preset?: SheetAnimationPreset; /** Duration in milliseconds. Ignored when `skip` is true. */ duration?: number; /** CSS easing used by WAAPI. */ easing?: SheetEasing; /** Skip the animation and snap to the final state. */ skip?: boolean | 'auto'; /** For dual-track sheets, select the track used by this programmatic movement. */ track?: SheetTrack; /** Keep content fixed while related outlets/backdrops animate. */ contentMove?: boolean; } /** Options accepted by the `` custom element and setup helpers. */ interface SheetOptions { /** Unique component id used by `for` attributes. */ componentId?: string; /** Sheet stack id. Use the closest `` when omitted. */ stack?: string; /** Initial uncontrolled presentation state. */ defaultPresented?: boolean; /** Controlled presentation state. */ presented?: boolean; /** Initial detent index for uncontrolled sheets. */ defaultActiveDetent?: number; /** Controlled detent index. */ activeDetent?: number; /** Intermediate detents between dismissed `0` and fully presented `n`. */ detents?: string | string[]; /** WAI-ARIA role applied to ``. */ sheetRole?: 'dialog' | 'alertdialog' | 'status' | string; /** Where content sits when fully presented. */ contentPlacement?: SheetPlacement; /** Safe-area edges protected by the sheet viewport. Defaults to `auto`. */ safeArea?: SheetSafeAreaMode; /** Render as a floating sheet with detached edge rounding. */ detached?: boolean; /** Extra top inset added to the sheet viewport, equivalent to Gorhom `topInset`. */ topInset?: SheetInsetValue; /** Extra bottom inset added to the sheet viewport, equivalent to Gorhom `bottomInset`. */ bottomInset?: SheetInsetValue; /** Extra left inset added to the sheet viewport. */ leftInset?: SheetInsetValue; /** Extra right inset added to the sheet viewport. */ rightInset?: SheetInsetValue; /** Extra per-edge container offsets, equivalent to Gorhom `containerOffset`. */ containerOffset?: SheetContainerOffset; /** Edge tracks that can dismiss the sheet. */ tracks?: SheetTrack | SheetTrack[]; /** Enables pointer, touch, trackpad, and wheel travel gestures. */ swipe?: boolean; /** Allows swiping to detent `0` and dismissing. */ swipeDismissal?: boolean; /** Allows a soft overshoot past the end detents. */ swipeOvershoot?: boolean; /** Prevents gestures from escaping to page scroll while the sheet can travel. */ swipeTrap?: boolean; /** Prevents interaction outside the sheet view while presented. */ inertOutside?: boolean; /** Blocks OS edge navigation conflicts near the travel edge when possible. */ nativeEdgeSwipePrevention?: boolean; /** Keeps focused inputs visible while the visual viewport changes. */ nativeFocusScrollPrevention?: boolean; /** Dismiss when clicking outside the sheet content. */ closeOnOutsideClick?: boolean; /** Dismiss when pressing Escape. */ closeOnEscape?: boolean; /** Keep keyboard focus inside the sheet view while modal. */ focusTrap?: boolean; /** Restore focus to the trigger when dismissed. */ restoreFocus?: boolean; /** Blend the page theme color with the backdrop color. */ themeColorDimming?: false | 'auto'; /** Animation settings used when presenting. */ enteringAnimationSettings?: SheetAnimationSettings; /** Animation settings used when dismissing. */ exitingAnimationSettings?: SheetAnimationSettings; /** Animation settings used when stepping between detents. */ steppingAnimationSettings?: SheetAnimationSettings; } /** Detail emitted by presentation state changes. */ interface SheetPresentedChangeEvent { presented: boolean; source: 'programmatic' | 'trigger' | 'gesture' | 'escape' | 'outside'; } /** Detail emitted by detent state changes. */ interface SheetActiveDetentChangeEvent { activeDetent: number; previousActiveDetent: number; } /** Detail emitted continuously while the sheet travels. */ interface SheetTravelEvent { /** Current normalized travel progress from dismissed `0` to fully presented `1`. */ progress: number; /** Active detent index nearest to the current travel position. */ activeDetent: number; /** Current offset from the presented position, in em. */ offset: number; /** Current travel status. */ status: SheetTravelStatus; } /** Configure a `` element from React effects. */ declare function setupSheet(element: HTMLElement, options?: Partial & { onPresentedChange?: (event: SheetPresentedChangeEvent) => void; onActiveDetentChange?: (event: SheetActiveDetentChangeEvent) => void; onTravel?: (event: SheetTravelEvent) => void; }): () => void; /** Present a sheet by id from React event handlers. */ declare function presentSheet(id: string): Promise | undefined; /** Dismiss a sheet by id from React event handlers. */ declare function dismissSheet(id: string): Promise | undefined; type CapElementAttributes = { key?: unknown; ref?: unknown; children?: unknown; id?: string; class?: string; className?: string; style?: unknown; slot?: string; role?: string; part?: string; title?: string; tabIndex?: number; hidden?: boolean; [attribute: `data-${string}`]: unknown; [attribute: `aria-${string}`]: unknown; [eventHandler: `on${string}`]: unknown; }; type Booleanish = boolean | 'true' | 'false'; type Placement = 'top' | 'bottom' | 'left' | 'right' | 'center'; type Track = 'top' | 'bottom' | 'left' | 'right'; type SafeArea = Booleanish | 'auto' | 'none' | 'all' | string; interface CapSheetsIntrinsicElements { 'cap-sheet': CapElementAttributes & { presented?: Booleanish; 'default-presented'?: Booleanish; 'active-detent'?: number | string; 'default-active-detent'?: number | string; detents?: string; 'content-placement'?: Placement; 'safe-area'?: SafeArea; detached?: Booleanish; 'top-inset'?: number | string; 'bottom-inset'?: number | string; 'left-inset'?: number | string; 'right-inset'?: number | string; tracks?: string; 'sheet-role'?: string; swipe?: Booleanish; 'swipe-dismissal'?: Booleanish; 'swipe-overshoot'?: Booleanish; 'swipe-trap'?: Booleanish; 'inert-outside'?: Booleanish; 'native-edge-swipe-prevention'?: Booleanish; 'native-focus-scroll-prevention'?: Booleanish; 'close-on-outside-click'?: Booleanish; 'close-on-escape'?: Booleanish; 'focus-trap'?: Booleanish; 'restore-focus'?: Booleanish; 'theme-color-dimming'?: 'auto' | 'false'; stack?: string; }; 'cap-sheet-trigger': CapElementAttributes & { for?: string; action?: 'present' | 'dismiss' | 'toggle' | 'step'; detent?: number | string; direction?: 'up' | 'down'; }; 'cap-sheet-portal': CapElementAttributes & { disabled?: Booleanish; }; 'cap-sheet-view': CapElementAttributes & { for?: string; 'content-placement'?: Placement; }; 'cap-sheet-backdrop': CapElementAttributes & { for?: string; }; 'cap-sheet-content': CapElementAttributes & { for?: string; }; 'cap-sheet-bleeding-background': CapElementAttributes; 'cap-sheet-handle': CapElementAttributes & { for?: string; action?: 'step' | 'dismiss'; detent?: number | string; direction?: 'up' | 'down'; }; 'cap-sheet-title': CapElementAttributes & { for?: string; }; 'cap-sheet-description': CapElementAttributes & { for?: string; }; 'cap-sheet-special-wrapper': CapElementAttributes; 'cap-sheet-special-wrapper-content': CapElementAttributes; 'cap-sheet-stack': CapElementAttributes; 'cap-sheet-outlet': CapElementAttributes & { for?: string; }; 'cap-scroll': CapElementAttributes & { axis?: 'x' | 'y'; }; 'cap-scroll-content': CapElementAttributes; 'cap-fixed': CapElementAttributes; 'cap-island': CapElementAttributes & { for?: string; }; 'cap-external-overlay': CapElementAttributes & { for?: string; 'content-getter'?: string; 'self-managed-inert-outside'?: Booleanish; }; 'cap-visually-hidden': CapElementAttributes; 'cap-auto-focus-target': CapElementAttributes & { for?: string; 'hidden-target'?: Booleanish; }; } declare global { namespace JSX { interface IntrinsicElements extends CapSheetsIntrinsicElements { } } } declare module 'react' { namespace JSX { interface IntrinsicElements extends CapSheetsIntrinsicElements { } } } declare module 'react/jsx-runtime' { namespace JSX { interface IntrinsicElements extends CapSheetsIntrinsicElements { } } } export { type Placement, type SheetActiveDetentChangeEvent, type SheetContainerOffset, type SheetInsetValue, type SheetOptions, type SheetPresentedChangeEvent, type SheetSafeAreaEdge, type SheetSafeAreaMode, type SheetTravelEvent, type Track, dismissSheet, presentSheet, setupSheet };