import type { AppointmentDetailsAction, AppointmentDetailsActionEvent, AppointmentDetailsMode } from "./components/details/AppointmentDetailsModal"; import { type AgendaOptionInput } from "@zigoschedule/scheduler-engine"; import { type AgendaMessagesInput, type TimeZone } from "@zigoschedule/scheduler-core"; import type { Appointment, Block, BusinessHoursDefaults, BusinessHours, BreakWindow, Professional, WeekStart } from "@zigoschedule/scheduler-engine"; import { type AppointmentColor, type AppointmentColorMode } from "@zigoschedule/scheduler-core"; /** * The calendar, assembled. * * `AgendaGrid` underneath takes forty-odd props because it deliberately knows * nothing: it does not decide what a slot is, where a card lands, or what * "closed" means. That is the right shape for the grid and the wrong shape for * a public API, so this component owns the derivation and exposes the handful * of things a caller actually has an opinion about. * * It holds no data of its own. Appointments come in as a prop and changes go * out as callbacks - persistence belongs to the host application. */ export type AgendaProps = { /** Day being shown. In week mode this anchors the week. */ date: Date; /** Appointments to render. The component never mutates this array. */ appointments: Appointment[]; /** Time blocks (holidays, maintenance, personal time). */ blocks?: Block[]; /** Columns. One per professional, room or chair. */ professionals: Professional[]; /** Opening hours per weekday. Missing days fall back to `defaultHours`. */ businessHours?: BusinessHours | null; /** Fallback opening hours for days absent from `businessHours`. */ defaultHours?: BusinessHoursDefaults; /** Shared lunch break. A professional's own break overrides this. */ lunchBreak?: BreakWindow | null; /** IANA zone the business runs in, e.g. "America/Manaus". */ timeZone?: TimeZone; /** Built-in UI language, e.g. "en-US", "es-ES", "ja-JP", "ar-SA", "hi-IN". */ locale?: string; /** Optional overrides for built-in labels and aria text. */ messages?: AgendaMessagesInput; /** Rendering and lifecycle callbacks compatible with the scheduler option contract. */ calendarOptions?: Omit; /** Which view to render. */ view?: "day" | "week" | "month"; /** * Grid resolution of the day view, in minutes. One of 5, 10, 15, 20, 30. * Anything else falls back to 30. */ slotMinutes?: number; /** * Row spacing of the week view, in minutes: 30 or 60. * * The week is deliberately coarser than the day. A day column belongs to one * professional and benefits from fine steps; a week column has to fit seven * days side by side, and drawing a line every five minutes turns it into * noise. This is why the library keeps two separate scales. */ weekScaleMinutes?: number; /** * Week start: 0 = Sunday, 1 = Monday. Default follows the package default. */ weekStartsOn?: WeekStart; /** * "default" paints every card with `defaultColor`. "appointment" lets each * appointment carry its own color. Legacy values "padrao" and "por_cliente" * are still accepted. */ colorMode?: AppointmentColorMode; /** Card color used when the appointment does not carry one. Hex. */ defaultColor?: AppointmentColor; /** * Minimum width of a column, in pixels. Raise it when several professionals * share a day column and their cards end up too narrow to read. */ columnMinWidth?: number; /** * Minimum height of one slot row, in pixels. Default 32. Rows stretch to fill * the viewport when the day is short; raise this to keep the grid dense and * scrollable instead of stretched. */ rowHeight?: number; /** Set false to render read-only: no dragging, no resizing. */ editable?: boolean; /** Shows a non-interactive loading state while the host refreshes data. */ loading?: boolean; /** Receives errors thrown by calendar render callbacks or lifecycle hooks. */ onAgendaCallbackError?: (error: Error | null) => void; /** * By default past slots cannot be selected. Set false when that guard is not * wanted, such as in a demo where every day has to stay interactive. */ blockPastSlots?: boolean; /** Fired after a card is dragged to a new time or column. */ onMove?: (change: { appointmentId: string; startsAt: string; professionalId: string | null; }) => void | Promise; /** Fired after a card is resized. */ onResize?: (change: { appointmentId: string; durationMinutes: number; startsAt?: string; }) => void | Promise; /** Fired when an appointment is clicked. */ onSelectAppointment?: (appointment: Appointment, dayKey: string) => void; /** * Appointment click behavior. * * "auto" opens the built-in modal when no `onSelectAppointment` is supplied, * and preserves callback-only behavior when the host already handles clicks. * Use "modal" to always show the built-in modal, or "callback" to keep full * ownership in your app. */ detailsMode?: AppointmentDetailsMode; /** Actions shown in the built-in details modal. Default: all secondary actions plus charge. */ detailsActions?: readonly AppointmentDetailsAction[]; /** Fired when the built-in modal action buttons are clicked. Persistence still belongs to the host. */ onDetailsAction?: (event: AppointmentDetailsActionEvent) => void | Promise; /** * Fired when the grid refuses a selection: closed day, lunch break, slot * already taken. Without it the calendar looks broken when it is in fact * doing its job. */ onBlocked?: (message: string) => void; /** Fired when an empty range is selected: the "new appointment" gesture. */ onSelectRange?: (range: { dayKey: string; startMinute: number; endMinute: number; professionalId: string | null; }) => void; }; export declare const Agenda: import("react").NamedExoticComponent;