mirror of
https://github.com/bitbaum/whenkit.git
synced 2026-12-03 22:27:21 +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>
25 lines
1016 B
TypeScript
25 lines
1016 B
TypeScript
/**
|
|
* A row of tappable choices that is a real radio group: arrow keys move
|
|
* between chips, one is selected, a screen reader hears "3 of 6". Every chip
|
|
* is a 44px target. Used for times, lengths and modes — anything that would
|
|
* otherwise be a select or a typed value.
|
|
*/
|
|
import { type ReactNode } from "react";
|
|
export interface ChipOption<V extends string | number> {
|
|
value: V;
|
|
label: ReactNode;
|
|
/** Extra words for assistive tech when the label is terse. */
|
|
ariaLabel?: string;
|
|
disabled?: boolean;
|
|
}
|
|
export interface ChipGroupProps<V extends string | number> {
|
|
label: string;
|
|
/** Visually hide the label (it is still announced). */
|
|
hideLabel?: boolean;
|
|
options: ChipOption<V>[];
|
|
value: V | null;
|
|
onChange: (value: V) => void;
|
|
className?: string;
|
|
}
|
|
export declare function ChipGroup<V extends string | number>({ label, hideLabel, options, value, onChange, className, }: ChipGroupProps<V>): import("react").JSX.Element;
|
|
//# sourceMappingURL=ChipGroup.d.ts.map
|