import { JSX } from 'solid-js'; /** 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 Solid `onMount`. */ declare function setupSheet(element: HTMLElement, options?: Partial & { onPresentedChange?: (event: SheetPresentedChangeEvent) => void; onActiveDetentChange?: (event: SheetActiveDetentChangeEvent) => void; onTravel?: (event: SheetTravelEvent) => void; }): () => void; type CapElementAttributes = JSX.HTMLAttributes & { for?: string; action?: 'present' | 'dismiss' | 'toggle' | 'step'; detent?: number | string; direction?: 'up' | 'down'; axis?: 'x' | 'y'; role?: string; 'content-placement'?: 'top' | 'bottom' | 'left' | 'right' | 'center'; 'default-active-detent'?: number | string; detents?: string; disabled?: boolean | 'true' | 'false'; presented?: boolean | 'true' | 'false'; 'default-presented'?: boolean | 'true' | 'false'; 'active-detent'?: number | string; 'safe-area'?: boolean | 'true' | 'false' | 'auto' | 'none' | 'all' | string; detached?: boolean | 'true' | 'false'; 'top-inset'?: number | string; 'bottom-inset'?: number | string; 'left-inset'?: number | string; 'right-inset'?: number | string; tracks?: string; 'sheet-role'?: string; swipe?: boolean | 'true' | 'false'; 'swipe-dismissal'?: boolean | 'true' | 'false'; 'swipe-overshoot'?: boolean | 'true' | 'false'; 'swipe-trap'?: boolean | 'true' | 'false'; 'inert-outside'?: boolean | 'true' | 'false'; 'native-edge-swipe-prevention'?: boolean | 'true' | 'false'; 'native-focus-scroll-prevention'?: boolean | 'true' | 'false'; 'close-on-outside-click'?: boolean | 'true' | 'false'; 'close-on-escape'?: boolean | 'true' | 'false'; 'focus-trap'?: boolean | 'true' | 'false'; 'restore-focus'?: boolean | 'true' | 'false'; 'theme-color-dimming'?: 'auto' | 'false'; stack?: string; }; declare module 'solid-js' { namespace JSX { interface IntrinsicElements { 'cap-sheet': CapElementAttributes; 'cap-sheet-trigger': CapElementAttributes; 'cap-sheet-portal': CapElementAttributes; 'cap-sheet-view': CapElementAttributes; 'cap-sheet-backdrop': CapElementAttributes; 'cap-sheet-content': CapElementAttributes; 'cap-sheet-bleeding-background': CapElementAttributes; 'cap-sheet-handle': CapElementAttributes; 'cap-sheet-title': CapElementAttributes; 'cap-sheet-description': CapElementAttributes; 'cap-sheet-special-wrapper': CapElementAttributes; 'cap-sheet-special-wrapper-content': CapElementAttributes; 'cap-sheet-stack': CapElementAttributes; 'cap-sheet-outlet': CapElementAttributes; 'cap-scroll': CapElementAttributes; 'cap-scroll-content': CapElementAttributes; 'cap-fixed': CapElementAttributes; 'cap-island': CapElementAttributes; 'cap-external-overlay': CapElementAttributes; 'cap-visually-hidden': CapElementAttributes; 'cap-auto-focus-target': CapElementAttributes; } } } export { type SheetActiveDetentChangeEvent, type SheetContainerOffset, type SheetInsetValue, type SheetOptions, type SheetPresentedChangeEvent, type SheetSafeAreaEdge, type SheetSafeAreaMode, type SheetTravelEvent, setupSheet };