import { type ButtonProps } from "@salt-ds/core"; import { type ComponentPropsWithoutRef, type Ref, type SyntheticEvent } from "react"; import type { DateRangeSelection, SingleDateSelection } from "../calendar"; import "./DatePickerActions.css"; import type { DateFrameworkType } from "@salt-ds/date-adapters"; /** * Base props for DatePicker actions component. */ export interface DatePickerActionsBaseProps extends ComponentPropsWithoutRef<"div"> { /** * Callback fired when the cancel action is triggered. * @param _event - The synthetic event. */ onCancel?: (_event: SyntheticEvent) => void; /** * Ref to apply button */ applyButtonRef?: Ref; /** * Props for the apply button. */ ApplyButtonProps?: ButtonProps; /** * Props for the cancel button. */ CancelButtonProps?: ButtonProps; /** * Ref to cancel button */ cancelButtonRef?: Ref; } /** * Props for the DatePicker actions component. * @template SelectionVariant - The selection variant, either "single" or "range". */ export type DatePickerActionsProps = SelectionVariant extends "single" ? DatePickerActionsBaseProps & { /** * The selection variant, set to "single". */ selectionVariant: "single"; /** * Callback fired when the apply action is triggered. * @param _event - The synthetic event. * @param date - The selected single date or null. */ onApply?: (_event: SyntheticEvent, date: SingleDateSelection | null) => void; } : DatePickerActionsBaseProps & { /** * The selection variant, set to "range". */ selectionVariant: "range"; /** * Callback fired when the apply action is triggered. * @param _event - The synthetic event. * @param date - The selected date range or null. */ onApply?: (_event: SyntheticEvent, date: DateRangeSelection | null) => void; }; export declare const DatePickerActions: import("react").ForwardRefExoticComponent<((DatePickerActionsBaseProps & { /** * The selection variant, set to "range". */ selectionVariant: "range"; /** * Callback fired when the apply action is triggered. * @param _event - The synthetic event. * @param date - The selected date range or null. */ onApply?: ((_event: SyntheticEvent, date: DateRangeSelection | null) => void) | undefined; }) | (DatePickerActionsBaseProps & { /** * The selection variant, set to "single". */ selectionVariant: "single"; /** * Callback fired when the apply action is triggered. * @param _event - The synthetic event. * @param date - The selected single date or null. */ onApply?: ((_event: SyntheticEvent, date: unknown) => void) | undefined; })) & import("react").RefAttributes>;