import "./calendar_view.css"; import type * as React from "react"; import { type ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "../style_props"; import type { CalendarEvent, CalendarViewLabels, CalendarViewMode, Weekday } from "./types"; export interface CalendarViewProps extends StyleProps { events: CalendarEvent[]; /** Controlled anchor date. Omit and pass `defaultDate` for the drop-in form. */ date?: Date; defaultDate?: Date; onDateChange?: (date: Date) => void; /** Controlled view. Omit and pass `defaultView` for the drop-in form. */ view?: CalendarViewMode; defaultView?: CalendarViewMode; onViewChange?: (view: CalendarViewMode) => void; /** Which modes the built-in toolbar offers. Default: all four. */ views?: CalendarViewMode[]; weekStartsOn?: Weekday; /** BCP-47 tag for the weekday / month / time names. Defaults to the active * `LoticsLocaleProvider` pack's `bcp47`; pass one only to override it. */ locale?: string; /** Per-instance overrides; the rest resolve from `LoticsLocale.calendarView`. */ labels?: Partial; /** Default visible hours of a day in the time grid. A viewport, not a filter — * an event outside it still widens the grid rather than disappearing. */ dayStartHour?: number; dayEndHour?: number; /** Width below which month/week fall back to the agenda. */ compactBelow?: number; /** * What counts as "now" — the today badge, the now line, the hour a time grid * opens at. Defaults to the browser's clock. * * **Not a timezone conversion, and the calendar deliberately has no `timeZone` * prop.** Lotics stores a datetime as a naive WALL CLOCK, so there is nothing to * convert; what genuinely depends on where the reader sits is "what day is it", * so that is the only thing taken as a prop. */ now?: Date; onEventPress?: (event: CalendarEvent) => void; /** An empty day cell or hour slot was pressed. The calendar never writes — * this hands you a range so your own form or drawer can. */ onSlotPress?: (start: Date, end: Date) => void; /** Replace the contents of an event chip; the press target, the lane and the * geometry stay the calendar's. Called for banners and timed chips alike — * branch on the exported `isBanner(event)`. */ renderEvent?: (event: CalendarEvent) => ReactNode; /** * Draw the calendar's own period and view controls (default on). Off for a * screen that already carries a header band, and `view` is then the screen's to * set. */ toolbar?: boolean; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * A calendar of events — month grid, week/day time grid, or agenda. * * **Drop-in.** `` renders the toolbar and the current * view; `toolbar={false}` drops the band for a screen that already carries one. * * **Controlled or not.** `date`/`view` with their `on*Change` callbacks let the * surrounding screen drive; omit them and the calendar owns its state. * * **It never writes.** Press an event or an empty slot and you get a callback. * * For rows that are RESOURCES rather than days, reach for `GanttView` instead. * Both pack bars with the same layout core. */ export declare function CalendarView(props: CalendarViewProps): React.ReactElement>; export interface CalendarBodyProps extends StyleProps { testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** The current view's grid, without the toolbar — for composing your own chrome * over the calendar's own view state. */ export declare function CalendarBody({ testID, render, ref, ...styleProps }: CalendarBodyProps): React.ReactElement>;