import * as React from 'react'; /** * One footer action. Structurally compatible with `ActionItem` (ui `ActionBar`) * and with `ModalFooterAction` (`@asteby/metacore-sdk`, `ModalProps.footerExtra`). */ export interface ResponsiveDialogAction { key?: string; /** Visible text. A string is preferred (it is reused in the confirmation copy). */ label: React.ReactNode; icon?: React.ReactNode; /** Optional when `type: 'submit'` (the form's onSubmit does the work). */ run?: () => void | Promise; disabled?: boolean; /** Implies `disabled`; shown as text in the «⋯» menu and as `title` on buttons. */ disabledReason?: string; /** External busy flag; a pending `run` promise also shows the spinner. */ loading?: boolean; type?: 'button' | 'submit'; /** Form id for `type: 'submit'` buttons rendered outside the `
`. */ form?: string; /** * Confirmation before `run`. `destructive` actions confirm by default with a * generic copy; `false` skips it when the host already confirms. */ confirm?: { title?: string; description?: string; confirmLabel?: string; cancelLabel?: string; } | false; } export interface ResponsiveDialogFooter { /** The single call to action of the step. Full width on phones, rightmost on desktop. */ primary?: ResponsiveDialogAction & { /** Paint the primary as destructive (e.g. «Eliminar» as the dialog's only purpose). */ destructive?: boolean; }; /** Phones: the first one sits next to «⋯», the rest go inside it. */ secondary?: ResponsiveDialogAction[]; /** Red, away from the primary (desktop: far left; phones: last in «⋯»), always confirmed. */ destructive?: ResponsiveDialogAction[]; /** Host-provided actions (e.g. «Ver historial» from a deep link). Desktop: before secondaries; phones: in «⋯». */ extra?: ResponsiveDialogAction[]; /** Free content at the start of the footer (hint, checkbox). */ start?: React.ReactNode; } export type ResponsiveDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'; export interface ResponsiveDialogProps { open: boolean; onOpenChange: (open: boolean) => void; /** Dialog title (wraps, never truncated). Omit only for chromeless dialogs. */ title?: React.ReactNode; description?: React.ReactNode; /** Icon next to the title. */ icon?: React.ReactNode; /** Fixed content under the title (stepper, tabs); does not scroll with the body. */ header?: React.ReactNode; /** Declarative footer with a fixed hierarchy. */ footer?: ResponsiveDialogFooter; /** Custom footer content, rendered in the same sticky footer (legacy `Modal.footer`). */ footerContent?: React.ReactNode; /** Desktop width. Default `md`. */ size?: ResponsiveDialogSize; /** Below 768px (`MOBILE_BREAKPOINT`): `sheet` (default), `fullscreen` or a centered `dialog`. */ mobile?: 'sheet' | 'fullscreen' | 'dialog'; /** When false, Esc, overlay click and swipe-down do not close. Default true. */ dismissable?: boolean; /** Show the close (X) button. Default true (hidden when not dismissable). */ showCloseButton?: boolean; /** Called when an action's `run` throws or rejects. Without it the error is rethrown. */ onActionError?: (error: unknown, action: ResponsiveDialogAction) => void; className?: string; bodyClassName?: string; children?: React.ReactNode; } /** * ResponsiveDialog — a centered dialog from 768px up and a bottom sheet below * (drag handle, swipe down to close, `max-h-[92dvh]`, scrolling body, sticky * footer with safe-area and on-screen-keyboard insets). * * The footer has a fixed hierarchy instead of hand-placed buttons: * desktop `[destructive] ··· [start] [extra] [secondary] [PRIMARY]`; phones * stacked: PRIMARY full width, then the first secondary + «⋯» (other * secondaries, extra and — last, red — destructive). There is no «Cerrar» * button: the X, Esc, swipe and back close it. * * @example * } * footer={{ * primary: { label: 'Confirmar picking', run: confirmPicking }, * secondary: [{ label: 'Imprimir surtido', icon: , run: print }], * destructive: [{ label: 'Liberar apartado', run: release, confirm: { title: '¿Liberar el apartado?' } }], * extra: footerExtra, * }}> * {body} * */ export declare function ResponsiveDialog({ open, onOpenChange, title, description, icon, header, footer, footerContent, size, mobile, dismissable, showCloseButton, onActionError, className, bodyClassName, children, }: ResponsiveDialogProps): React.JSX.Element; //# sourceMappingURL=responsive-dialog.d.ts.map