import * as react_jsx_runtime from 'react/jsx-runtime';
import * as RadixDialog from '@radix-ui/react-dialog';
import * as React$1 from 'react';
import { MotionStyle, useMotionValue, useTransform } from 'motion/react';
import { b as ScrollAreaProps } from './scroll-area-CVS6HyLl.mjs';
/**
* Root `Dialog` props. Wraps Radix `Dialog.Root` supporting controlled and uncontrolled open state.
*
* @example
* ```tsx
* const [open, setOpen] = React.useState(false);
*
*
* ```
*/
interface DialogProps {
/** Whether the dialog is open (controlled). Omit for uncontrolled. */
open?: boolean;
/** Called when the open state should change. */
onOpenChange?: (open: boolean) => void;
/** Dialog trigger + content. */
children: React$1.ReactNode;
}
/**
* Props passed to standard container `DialogContent`.
*
* @see {@link DialogContent}
*/
interface DialogContentProps extends React$1.ComponentPropsWithoutRef {
/** Hides the top-right close (X) button. @default false */
hideCloseButton?: boolean;
className?: string;
}
/**
* Props for `DialogFullScreenContent` dedicated to Full-Screen dialog mode.
*
* @remarks
* Full-screen dialogs expand to cover the entire device screen and feature a Top App Bar
* with a title label, close button, and action confirmation button.
*
* @see {@link DialogFullScreenContent}
* @see https://m3.material.io/components/dialogs/guidelines#full-screen
*/
interface DialogFullScreenContentProps extends React$1.ComponentPropsWithoutRef {
/** Title label displayed in the Top App Bar. */
title?: string;
/** Label for the primary action button on the Top App Bar (e.g. "Save"). */
actionLabel?: string;
/** Handler invoked when pressing the primary action button. */
onAction?: () => void;
/** Renders a divider separating Top App Bar from scrollable body content. @default false */
showDivider?: boolean;
className?: string;
}
/**
* Dialog component Root — wraps Radix `Dialog.Root`.
*
* @remarks Supports controlled state via `open`/`onOpenChange`, or uncontrolled state using `DialogTrigger`.
*/
declare const Dialog: {
({ open, onOpenChange, children }: DialogProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
/** Trigger element that toggles the open state of the Dialog (supports `asChild`). */
declare const DialogTrigger: React$1.ForwardRefExoticComponent>;
declare const DialogPortal: {
({ open, children, }: {
open?: boolean;
children: React$1.ReactNode;
}): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const DialogOverlay: React$1.ForwardRefExoticComponent, "ref"> & React$1.RefAttributes>;
declare const DialogContent: React$1.ForwardRefExoticComponent>;
declare const DialogIcon: React$1.ForwardRefExoticComponent & React$1.RefAttributes>;
declare const DialogHeader: {
({ className, ...props }: React$1.HTMLAttributes): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const DialogTitle: React$1.ForwardRefExoticComponent, "ref"> & React$1.RefAttributes>;
declare const DialogDescription: React$1.ForwardRefExoticComponent, "ref"> & React$1.RefAttributes>;
declare const DialogBody: React$1.ForwardRefExoticComponent & React$1.RefAttributes>;
declare const DialogFooter: {
({ className, ...props }: React$1.HTMLAttributes): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const DialogClose: React$1.ForwardRefExoticComponent>;
declare const DialogFullScreenContent: React$1.ForwardRefExoticComponent>;
interface DrawerProps {
open?: boolean;
onOpenChange?: (open: boolean) => void;
children: React$1.ReactNode;
}
interface DrawerContentProps extends Omit, "asChild"> {
/** Max height (vh). Default 90vh */
maxHeight?: string;
/** Hide drag handle */
hideHandle?: boolean;
/** Hide close button */
hideCloseButton?: boolean;
className?: string;
}
declare const Drawer: {
({ open, onOpenChange, children }: DrawerProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const DrawerTrigger: React$1.ForwardRefExoticComponent>;
declare const DrawerClose: React$1.ForwardRefExoticComponent>;
declare const DrawerPortal: ({ open, children, }: {
open?: boolean;
children: React$1.ReactNode;
}) => react_jsx_runtime.JSX.Element;
declare const DrawerOverlay: React$1.ForwardRefExoticComponent, "ref"> & React$1.RefAttributes>;
declare const DrawerContent: React$1.ForwardRefExoticComponent>;
declare const DrawerHeader: {
({ className, ...props }: React$1.HTMLAttributes): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const DrawerFooter: {
({ className, ...props }: React$1.HTMLAttributes): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const DrawerTitle: React$1.ForwardRefExoticComponent, "ref"> & React$1.RefAttributes>;
declare const DrawerDescription: React$1.ForwardRefExoticComponent, "ref"> & React$1.RefAttributes>;
/**
* @file sheets/shared/types.ts
*
* Shared TypeScript type definitions for Bottom Sheet and Side Sheet components.
*
* @see https://m3.material.io/components/sheets-bottom/overview
* @see https://m3.material.io/components/side-sheets/overview
*/
/**
* Discrete states of a Bottom Sheet, mirroring Android's `SheetValue` enum.
*
* - `hidden` — Sheet is fully off-screen (below viewport).
* - `partiallyExpanded` — Sheet is visible at ≤ 50% of screen height.
* - `expanded` — Sheet is fully expanded (full screen height).
*/
type SheetValue = "hidden" | "partiallyExpanded" | "expanded";
/**
* Lifecycle state of a Sheet component.
*
* - `closed` — Fully hidden, not in the DOM.
* - `opening` — Animating into view.
* - `open` — Fully visible and interactive.
* - `dragging` — User is actively dragging (bottom sheet only).
* - `closing` — Animating out of view.
*/
type SheetState = "closed" | "opening" | "open" | "dragging" | "closing";
/**
* Screen edge a Side Sheet slides in from.
* Supports RTL layouts.
*
* - `start` — Logical start edge (left in LTR, right in RTL).
* - `end` — Logical end edge (right in LTR, left in RTL).
*/
type SheetEdge = "start" | "end";
/**
* Base props shared across all Sheet component variants.
*/
interface BaseSheetProps {
/** Controls whether the sheet is visible. */
isOpen: boolean;
/** Called when the sheet should close (drag-dismiss, Escape key, scrim click). */
onClose: () => void;
/** Content rendered inside the sheet. */
children: React$1.ReactNode;
/** Additional CSS classes applied to the sheet container. */
className?: string;
/** ID of the element labelling this sheet (`aria-labelledby`). */
"aria-labelledby"?: string;
/** Accessible label when no visible heading is present (`aria-label`). */
"aria-label"?: string;
/**
* Whether to render the sheet inside a React Portal (at `document.body`).
* Defaults to `true` for standard sheets. Modals always use portals.
*/
portal?: boolean;
/** Fixed header slot rendered above the scrollable content area. */
header?: React$1.ReactNode;
/** Fixed footer slot rendered below the scrollable content area. */
footer?: React$1.ReactNode;
/**
* Controls divider visibility between header/footer and the scroll area.
* - `true` (default) — Show divider when header/footer is present.
* - `false` — Hide all dividers.
* - `{ header?, footer? }` — Toggle each position independently.
*/
divider?: boolean | {
header?: boolean;
footer?: boolean;
};
/** Props forwarded to the inner `ScrollArea` component. */
scrollAreaProps?: Omit;
/**
* Snap points for the Bottom Sheet.
* @example `['fit', '70%', 'full']`
*/
snapPoints?: BottomSheetSnapPoint[];
/**
* Initial snap point when the Bottom Sheet opens.
* Defaults to the first entry in `snapPoints`.
*/
defaultSnapPoint?: BottomSheetSnapPoint;
/** Called when the Bottom Sheet moves to a new snap point. */
onSnapChange?: (snapPoint: BottomSheetSnapPoint) => void;
/**
* When `false`, skip the `partiallyExpanded` state and open directly to full height.
* Mirrors `skipPartiallyExpanded` in Android's `SheetState`.
* @default false
*/
skipPartiallyExpanded?: boolean;
/**
* Whether drag/swipe gestures are enabled on this sheet.
* When `false`, the sheet can only be dismissed programmatically.
* Mirrors `sheetGesturesEnabled` in Android's `ModalBottomSheet`.
* @default true
*/
gesturesEnabled?: boolean;
/**
* Override the background color of the sheet container.
* Accepts any CSS color value. Defaults to `surfaceContainerLow` token.
*/
containerColor?: string;
/**
* Max width of the sheet. On viewports wider than this value, the sheet
* is centered with equal margins on both sides.
* Accepts any CSS length. Defaults to `var(--m3-bottom-sheet-max-width, 640px)`.
*/
sheetMaxWidth?: string | number;
}
/** Valid snap point values for Bottom Sheet. */
type BottomSheetSnapPoint = "fit" | "max-content" | "full" | string | number;
/**
* Imperative handle exposed on the Bottom Sheet's DOM node.
* Allows programmatic snapping via `ref.current.snapTo(snapPoint)`.
*
* @example
* ```tsx
* const sheetRef = useRef(null);
* sheetRef.current?.snapTo('full');
* ```
*/
interface BottomSheetHandle {
/** Programmatically animate the sheet to a specific snap point. */
snapTo: (snapPoint: BottomSheetSnapPoint) => void;
}
/** Props for the `DragHandle` component used in Bottom Sheets. */
interface DragHandleProps {
/** Additional CSS classes. */
className?: string;
/**
* Called when the drag handle is activated via click, Space, or Enter.
* Should cycle the sheet through its available snap points / dismiss.
* When provided, the handle becomes keyboard-interactive with `role="button"`.
*/
onCycle?: () => void;
/** Accessible label for the drag handle button. */
"aria-label"?: string;
}
/** Props for the `Scrim` backdrop overlay component. */
interface ScrimProps {
/** Called when the scrim is clicked — typically closes the sheet. */
onClick: () => void;
/** Additional CSS classes. */
className?: string;
/** Motion style (supports MotionValue for animated opacity). */
style?: MotionStyle;
}
/**
* @file sheets/bottom-sheet/bottom-sheet.tsx
*
* Standard (non-modal) Bottom Sheet following MD3 specification.
*
* - Slide-up animation with DEFAULT_SPATIAL_SPRING
* - Drag-to-dismiss with seamless nested scroll handling
* - Visual Viewport API for mobile keyboard resize
* - WAI-ARIA: `role="dialog"`, `aria-modal="false"`
* - SSR-safe portal rendering
*
* @see https://m3.material.io/components/sheets-bottom/overview
*/
/**
* Props for the standard (non-modal) Bottom Sheet.
*/
interface BottomSheetProps extends BaseSheetProps {
/**
* Maximum height of the sheet.
* @default "90dvh"
*/
maxHeight?: string;
/**
* Hide the drag handle visual indicator.
* @default false
*/
hideHandle?: boolean;
}
/**
* Standard (non-modal) Bottom Sheet that slides up from the bottom edge.
*
* Does NOT trap focus or block background interaction. Use `BottomSheetModal`
* for blocking behaviour.
*
* @example
* ```tsx
* setIsOpen(false)}>
* Sheet content
*
* ```
*/
declare const BottomSheet: React$1.ForwardRefExoticComponent>;
/**
* @file sheets/bottom-sheet/bottom-sheet-modal.tsx
*
* Modal Bottom Sheet — blocks background interaction.
*
* Android Jetpack Compose parity:
* - Entry animation: slides up from y=100% (GAP 6 fix)
* - PartiallyExpanded default: opens at 50% screen (GAP 1 via isModal flag)
* - sheetMaxWidth: max-width 640px centered (GAP 2 fix)
* - Scrim opacity linked to drag position via MotionValue (GAP 8 fix)
* - DragHandle keyboard-accessible with cycle (GAP 3 fix)
* - gesturesEnabled prop to disable all drag (GAP 7 fix)
* - containerColor / contentColor props (GAP 9 fix)
* - IME / Visual Viewport handled by hook (GAP 11 fix)
*
* @see https://m3.material.io/components/sheets-bottom/guidelines#modal
*/
/**
* Props for the modal Bottom Sheet.
*/
interface BottomSheetModalProps extends BaseSheetProps {
/**
* Maximum height of the sheet.
* @default "90dvh"
*/
maxHeight?: string;
/**
* Hide the drag handle visual indicator.
* @default false
*/
hideHandle?: boolean;
}
/**
* Modal Bottom Sheet that slides up from the bottom edge.
*
* Renders into a portal, traps focus, locks body scroll, and blocks
* background interaction with an animated Scrim.
*
* Dismiss by: swiping down, clicking the Scrim, or pressing Escape.
*
* @example
* ```tsx
* setIsOpen(false)} aria-labelledby="sheet-title">
* Title
* Modal sheet content
*
* ```
*/
declare const BottomSheetModal: React$1.ForwardRefExoticComponent>;
/**
* @file sheets/bottom-sheet/use-bottom-sheet.ts
*
* Custom hook encapsulating drag-to-dismiss and snap point gesture logic
* for Bottom Sheet components, using manual touch/pointer events to allow
* seamless scroll-to-drag handoffs without locking native nested scrolling.
*/
interface UseBottomSheetOptions {
isOpen: boolean;
onClose: () => void;
snapPoints?: BottomSheetSnapPoint[];
defaultSnapPoint?: BottomSheetSnapPoint;
onSnapChange?: (snapPoint: BottomSheetSnapPoint) => void;
gesturesEnabled?: boolean;
isModal?: boolean;
maxHeight?: string;
}
interface UseBottomSheetReturn {
scope: React.RefCallback;
y: ReturnType>;
scrimOpacity: ReturnType>;
activeSnapPoint: BottomSheetSnapPoint;
isContentScrollable: boolean;
snapTo: (snapPoint: BottomSheetSnapPoint) => void;
cycleSnapPoint: () => void;
dragConstraints: {
top: number;
bottom: number;
};
}
declare function useBottomSheet({ isOpen, onClose, snapPoints, defaultSnapPoint, onSnapChange, gesturesEnabled, isModal, maxHeight, }: UseBottomSheetOptions): UseBottomSheetReturn;
/**
* @file sheets/shared/drag-handle.tsx
*
* Visual drag handle for Bottom Sheet components.
*
* MD3 spec:
* - Padding top/bottom: 22dp ("Drag handle padding top/bottom: 22dp")
* - Width: 32dp, Height: 4dp, corner-full radius
* - Color: on-surface-variant @ 40% opacity
* - Touch target: top 48dp of sheet is interactive (py-[22px])
* - When interactive: renders as `