import { CommonProps, Refable, type Styleable } from "@trackunit/react-components"; import { TimeRangeInput } from "../TimeRange/TimeRange"; export interface ScheduleItem { /** * The key for the schedule item. */ key?: string; /** * The label for the schedule item. */ label: string; /** * The time range input for the schedule item. */ range: TimeRangeInput; /** * Indicates whether the schedule item is active. */ isActive: boolean; /** * Indicates whether the all day schedule item is active. */ isAllDay?: boolean; /** * Checkbox text */ checkboxLabel?: string; } export interface ScheduleProps extends CommonProps, Refable, Styleable { /** * List of schedule rows. */ schedule: Array; /** * List of invalid keys. */ invalidKeys?: Array; /** * Called when time range or checkbox changes state. * * @param {ScheduleItem[]} schedules Updated schedule entries * @returns {void} */ onChange: (schedules: Array) => void; } /** * Schedule renders a weekly time-range editor where each row represents a day with an active toggle, * an optional all-day checkbox, and a start/end time range. It is used for defining recurring schedules * such as operating hours, service windows, or geofence active periods. * * ### When to use * Use Schedule when users need to configure per-day time ranges — for example, setting working hours for each day of the week. * * ### When not to use * Do not use Schedule for a single time range — use `TimeRangeField`. * Do not use it for date range selection — use `DayRangePicker`. * * @example Weekly operating hours schedule * ```tsx * import { Schedule, ScheduleItem } from "@trackunit/react-form-components"; * import { useState } from "react"; * * const OperatingHours = () => { * const [schedule, setSchedule] = useState>([ * { key: "mon", label: "Monday", isActive: true, range: { timeFrom: "08:00", timeTo: "17:00" } }, * { key: "tue", label: "Tuesday", isActive: true, range: { timeFrom: "08:00", timeTo: "17:00" } }, * { key: "wed", label: "Wednesday", isActive: false, range: { timeFrom: "", timeTo: "" } }, * ]); * return ; * }; * ``` * @param {ScheduleProps} props - The props for the Schedule component * @returns {ReactElement} Schedule component */ export declare const Schedule: ({ className, "data-testid": dataTestId, schedule, onChange, invalidKeys, style, ref, }: ScheduleProps) => import("react/jsx-runtime").JSX.Element;