import 'rollup-plugin-inject-process-env'; import { FC } from "react"; import { ClockTime, FormDateTimeInput } from "stentor-models"; import { FormFieldProps } from "../FormDisplay"; /** * What the field reports through `onFieldChange`, and what it accepts back to resume. * * Everything a lead consumer needs is resolved here rather than at submit time, because * this is where the schedule - and so the timezone the times are expressed in - is known. */ export interface FormDateTimeValue { /** * The chosen day as the business sees it, "YYYY-MM-DD". Never shifted into UTC. */ date: string; /** * What the chosen time reads as, and what is submitted for the field itself. */ label: string; /** * When the appointment starts, "HH:MM". */ start: ClockTime; /** * When it ends, "HH:MM". Absent for a discrete start time. */ end?: ClockTime; /** * Date and time together as ISO 8601 carrying the schedule's offset on that date, * e.g. "2026-08-24T09:30:00-04:00", so the value survives a DST transition. */ datetime: string; } export declare const NO_DATE_MESSAGE = "Select a date to see the available times."; export declare const NO_TIMES_MESSAGE = "No times are available on this date."; export declare const TIMES_LABEL = "Appointment times"; export declare const TIMEZONE_NOTICE_PREFIX = "Times shown in"; export interface FormDateTimeProps extends FormFieldProps { readonly field: FormDateTimeInput; /** * A previously chosen date and time, so stepping back into the form resumes it. */ readonly value?: FormDateTimeValue; /** * The current moment. Injectable so tests and Storybook get a fixed calendar rather * than whatever day they happen to run on. */ readonly now?: Date; /** * The days the tenant's CRM has declared full, comma delimited - "YYYY-MM-DD,YYYY-MM-DD". * * Arrives on a channel action response and so is absent on the first render; until it * turns up the calendar shows the schedule's own availability. Busy days narrow that * availability, they never widen it. */ readonly busyDays?: string; /** * Open on the soonest date that actually has times, instead of on the prompt. * * For a preview that lands straight on this step: a calendar with an empty * column beside it reads as a form with nothing to offer, when the schedule * is in fact full of slots one click away. * * Off by default, and deliberately not derived from `demoMode`. On a real * booking page a preselected date is a date the customer never chose, and * nothing stops them carrying it through to submit -- an appointment request * for a day picked by the software. Only the date is chosen; the time is * still theirs. */ readonly preselectFirstAvailable?: boolean; } /** * Calendar beside a scrollable column of appointment times, in the manner of Calendly. * * The column is generated from `field.schedule` on the client, so picking a date repaints * it immediately - there is no availability lookup and no round trip to wait on. Changing * the date clears the chosen time, because a time that exists on one day frequently does * not exist on the next. */ export declare const FormFieldDateTime: FC; export default FormFieldDateTime;