import { ReactNode, RefObject } from 'react'; import { UiCoreLocale } from '../../../helpers/uiCoreLocale'; import { PopoverSlot } from '../popover/PopoverSheet'; export type BottomSheetCloseReason = 'closeButton' | 'scrim' | 'escape' | 'drag' | 'viewResults' | 'action'; /** @figmaNode rIndtQfMCi8wQ46CQ2oqsb#7-10991 (DS_draft · "_bottom sheet", approved) */ export interface StyledBottomSheetProps { /** @figmaProp none — test hook */ dataTest: string; /** @figmaProp none — a11y: lets a trigger point `aria-controls` at the sheet */ id?: string; /** @figmaProp none — behavioral: controlled */ open: boolean; /** @figmaProp none — behavioral: every dismiss route lands here; none of them commits anything */ onClose: (reason: BottomSheetCloseReason) => void; /** * Name the object, not just the action — "Handlinger — søknad 4417". A sheet detaches from its * trigger, so the header is what tells the user which row they opened. * @figmaProp Title = ReactNode→true | undefined→false */ title?: ReactNode; /** @figmaProp none — a11y: the dialog's name when there is no `title` */ ariaLabel?: string; /** @figmaProp Icon = ReactNode→true | undefined→false — the 20px icon before the title */ titleIcon?: ReactNode; /** * Shows the header's back control, e.g. to return from a sub-step to the previous sheet content. * @figmaProp Back = function→true | undefined→false */ onBack?: () => void; /** @figmaProp none — a11y: accessible name of the back control; defaults to "Back" in `locale` */ backLabel?: string; /** @figmaProp Slot — the scrollable body */ children: PopoverSlot; /** * Left of the footer. Omit it and pass `resultCount` to get the standard "Vis resultater (N)". * @figmaProp Footer = ReactNode→true | undefined→false — left slot ("View results (3)") */ viewResultsAction?: PopoverSlot; /** @figmaProp Footer = ReactNode→true | undefined→false — right slot ("Reset filter") */ resetAction?: PopoverSlot; /** @figmaProp none — the popover's Actions row, kept so nothing is lost when it becomes a sheet */ footerActions?: PopoverSlot; /** * Result total for the built-in "Vis resultater (N)" control and its in-sheet live region. `null` * means the total is unavailable. Keep passing the last count while a request is in flight — the * label never blanks, never disables and never shows a spinner. * @figmaProp none — behavioral */ resultCount?: number | null; /** @figmaProp none — a11y: accessible name of the close control; defaults to "Close" in `locale` */ closeLabel?: string; /** Language of the default result and close labels; defaults to English. */ locale?: UiCoreLocale; /** @figmaProp none — style escape hatch, applied to the sheet container */ className?: string; /** Set `false` when a wrapper already owns the Back-close registration. */ registerBackClose?: boolean; /** Logical owner supplied by a wrapper that must keep one identity across responsive variants. */ ownerRef?: RefObject; /** * The control that opened the sheet; focus returns to it on close. Without it the sheet returns * focus to whatever was focused on open — in Safari a tap never focuses a button, so that is the * nearest focusable ancestor (a dialog's scrollable content), which then shows a focus ring. */ triggerRef?: RefObject; } /** * ASMA Design System **Bottom Sheet** (ASMA-8184) — the mobile (0–743px) form of the Action popover: * a modal sheet with a dimmed scrim, top-rounded container, drag handle, header (optional back, * close, optional icon + title), a body that scrolls internally and an optional sticky footer. * * Height fits the content, with no minimum, up to half the screen. A sheet whose content needs more * can be expanded to 90vh — by dragging the handle up, or by activating it (Tab lands on it, Space / * Enter toggle between the two heights) — and scrolls internally from there. Below 480px of viewport * height (a phone in landscape) it becomes a full-screen dialog instead. Five equivalent dismiss * routes — close button, "Vis resultater", scrim, Escape, dragging down past 30% or flinging down — and * none of them commits or discards anything: filters apply as the user goes and actions commit on * activation. * * Motion follows Material 3: the sheet tracks the finger (on the handle, or on the body while it is * scrolled to the top or can still expand), the scrim fades with a downward drag, a release settles on * emphasized-decelerate, and closing slides the sheet out on emphasized-accelerate before the dialog * closes. `prefers-reduced-motion` keeps all of it instant. * * Interaction model is the popover's: `role="dialog"`, `Tab` only, no `role="menu"`, no arrow keys. * Focus moves to the sheet on open (so the title is announced first) and back to the trigger on * close. `PopoverSheet` with `variant='action'` renders this automatically below 744px. */ export declare const StyledBottomSheet: ({ dataTest, id, open, onClose, title, ariaLabel, titleIcon, onBack, backLabel, children, viewResultsAction, resetAction, footerActions, resultCount, locale, closeLabel, className, registerBackClose, ownerRef, triggerRef, }: StyledBottomSheetProps) => JSX.Element | null;