mirror of
https://github.com/bitbaum/whenkit.git
synced 2026-12-04 05:57:06 +01:00
Day chips, time chips, length chips, a readable date field over the native
picker, and a booking request that resolves to {startsAt, endsAt} in the
provider's zone.
- Core (no React): wall-clock YYYY-MM-DD / HH:MM strings, one zonedToUtc
(DST gaps resolve forward), todayIn(zone), slots inside opening hours,
lengths that fit, resolveRequest / describeRequest for three choices:
slot, days, flexible.
- React: BookingRequestPicker, DayStrip, ChipGroup (real radio groups),
DateField (native input transparent over a readable display).
- styles.css: --wk-* variables defaulting to @bitbaum/design-tokens; 44px
targets, 16px input, strip scrolls inside itself.
- Tests: 15 core + 8 server-render, and a Chromium check at 1280/390,
light/dark that taps bookings end to end. dist/ committed for github: installs.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import { type BookingChoice, type RequestWords } from "../request.js";
|
|
import { type DailyHours } from "../slots.js";
|
|
export interface BookingPickerWords extends RequestWords {
|
|
day: string;
|
|
days: string;
|
|
time: string;
|
|
length: string;
|
|
mode: string;
|
|
modeExact: string;
|
|
modeDays: string;
|
|
modeFlexible: string;
|
|
preferredDay: string;
|
|
flexibleHint: string;
|
|
noTimes: string;
|
|
otherDate: string;
|
|
}
|
|
export declare const DEFAULT_PICKER_WORDS: BookingPickerWords;
|
|
export interface BookingRequestPickerProps {
|
|
unit: "hour" | "day";
|
|
/** IANA zone of the thing being booked, e.g. "Europe/Zurich". */
|
|
zone: string;
|
|
locale?: string;
|
|
value: BookingChoice | null;
|
|
onChange: (choice: BookingChoice) => void;
|
|
/** Opening hours for hourly bookings. */
|
|
hours?: DailyHours;
|
|
/** Weekdays open, 0 = Sunday … 6 = Saturday. Omit for every day. */
|
|
openWeekdays?: number[];
|
|
/** Spacing of start times, minutes. */
|
|
stepMinutes?: number;
|
|
/** Days shown as chips. */
|
|
daysAhead?: number;
|
|
allowFlexible?: boolean;
|
|
words?: Partial<BookingPickerWords>;
|
|
/** For tests and demos; defaults to now. */
|
|
now?: Date;
|
|
}
|
|
export declare function BookingRequestPicker({ unit, zone, locale, value, onChange, hours, openWeekdays, stepMinutes, daysAhead, allowFlexible, words: wordOverrides, now, }: BookingRequestPickerProps): import("react").JSX.Element;
|
|
//# sourceMappingURL=BookingRequestPicker.d.ts.map
|