@scopetickets/checkout 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -3
- package/dist/index.cjs +3429 -5521
- package/dist/index.cjs.map +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1684 -1171
- package/dist/index.d.ts +1684 -1171
- package/dist/index.js +4335 -3134
- package/dist/index.js.map +1 -1
- package/dist/styles.css +477 -2803
- package/package.json +16 -21
- package/dist/chunk-VS7ACUTQ.js +0 -3556
- package/dist/chunk-VS7ACUTQ.js.map +0 -1
- package/dist/pickers.cjs +0 -1999
- package/dist/pickers.cjs.map +0 -1
- package/dist/pickers.css +0 -1151
- package/dist/pickers.css.map +0 -1
- package/dist/pickers.d.cts +0 -947
- package/dist/pickers.d.ts +0 -947
- package/dist/pickers.js +0 -117
- package/dist/pickers.js.map +0 -1
package/dist/pickers.d.cts
DELETED
|
@@ -1,947 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
/** `2055-11-28` shifted by whole days, staying a `YYYY-MM-DD` key. */
|
|
4
|
-
export declare function addDays(day: string, count: number): string;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* THE KEY THIS PRODUCT SPENDS FOR THAT TYPE, or `undefined` where it offers none — which
|
|
8
|
-
* is a real answer and not a failure: the head goes without a key, and an ABSENT key is
|
|
9
|
-
* the platform's own way of saying "no user type". A host that keyed its own composition
|
|
10
|
-
* by assignment gets that key back, so its composition keeps working.
|
|
11
|
-
*
|
|
12
|
-
* ABSENT AND NULL ARE NOT THE SAME ANSWER. `Ticket.UserTypes` is documented NULL — not
|
|
13
|
-
* empty — when the product names none, so null and `[]` are both the platform SAYING none
|
|
14
|
-
* and an unmatched key is dropped. A field that is not there at all is nobody having said
|
|
15
|
-
* anything, and guessing "none" from silence would strip a host's working key and charge
|
|
16
|
-
* every head full price.
|
|
17
|
-
*/
|
|
18
|
-
export declare function assignmentFor(product: Partial<Pick<Ticket, 'UserTypes'>>, key: string): string | undefined;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* THE RAMP AS THE WEB PAINTS IT — a `color-mix()` over the ramp's TOKENS rather than a
|
|
22
|
-
* computed hex, so the light appearance swaps underneath it. The ramp is a different
|
|
23
|
-
* three colours there, and a value resolved in JS would be the dark one on both.
|
|
24
|
-
*
|
|
25
|
-
* A flat token at each end rather than a colour mixed with itself: the two are the same
|
|
26
|
-
* paint, and the shorter string is the one a stylesheet test can read.
|
|
27
|
-
*/
|
|
28
|
-
export declare function availabilityColor(remaining: number | null): string;
|
|
29
|
-
|
|
30
|
-
/** How full a day is, as the three buckets the indicator draws. */
|
|
31
|
-
export declare type AvailabilityLevel = 'LOW' | 'MEDIUM' | 'HIGH';
|
|
32
|
-
|
|
33
|
-
/** The weeks of `month`, padded to whole rows.. */
|
|
34
|
-
export declare function buildMonthGrid(series: CalendarSeries, month: CalendarMonthKey, { today, selectedDay }: MonthGridOptions): readonly CalendarWeek[];
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* A ticket's slots, gathered under the part of the day they fall in — CHRONOLOGICALLY,
|
|
38
|
-
* from 00:00 onwards, within each part and across them.
|
|
39
|
-
*
|
|
40
|
-
* SORTED HERE RATHER THAN ASSUMED. The order used to be whatever the platform returned:
|
|
41
|
-
* groups appeared in the order their first slot happened to arrive in, and the slots
|
|
42
|
-
* inside them likewise, so a response that listed 20:00 before 09:00 drew Late Evening
|
|
43
|
-
* above Early Morning. Nothing upstream promises an order, and a buyer reading a column
|
|
44
|
-
* of times expects one.
|
|
45
|
-
*
|
|
46
|
-
* `HH:MM` SORTS AS A STRING, which is why this is a plain compare and not a parse: the
|
|
47
|
-
* fields are fixed width and zero-padded, so lexicographic IS chronological. Sorting the
|
|
48
|
-
* SLOTS is also all that is needed for the groups — walking them in order visits the
|
|
49
|
-
* parts in order too, since `partOfDay` cuts the day into contiguous ascending bands.
|
|
50
|
-
*/
|
|
51
|
-
export declare function buildTimeslotGroups(slots: readonly Timeslot[], options: TimeslotOptions): readonly TimeslotGroup[];
|
|
52
|
-
|
|
53
|
-
/** One week as SEVEN REAL DAYS, Monday first — never padded. */
|
|
54
|
-
export declare function buildWeekRow(series: CalendarSeries, weekStart: string, { today, selectedDay }: MonthGridOptions): CalendarWeek;
|
|
55
|
-
|
|
56
|
-
/** What a day cell is, as one value rather than a set of flags. */
|
|
57
|
-
export declare type CalendarCell =
|
|
58
|
-
/** Outside the month — renders as an empty container, keeping the columns. */
|
|
59
|
-
{
|
|
60
|
-
readonly kind: 'EMPTY';
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Outside the run entirely: before its first day, after its last, or gone without ever
|
|
64
|
-
* having been one of its days. No well at all — transparent fill AND transparent
|
|
65
|
-
* stroke.
|
|
66
|
-
*/
|
|
67
|
-
| {
|
|
68
|
-
readonly kind: 'OUT_OF_SERIES';
|
|
69
|
-
readonly day: string;
|
|
70
|
-
readonly dayOfMonth: number;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Already gone, but the series DID run it. Not selectable, and not the same as a day
|
|
74
|
-
* the run never touched: a buyer scanning the month should be able to see where the run
|
|
75
|
-
* has got to, not just where it has yet to reach. Keeps its events so the reason it is
|
|
76
|
-
* marked is not lost — nothing renders them today.
|
|
77
|
-
*/
|
|
78
|
-
| {
|
|
79
|
-
readonly kind: 'PAST_BUT_RELEVANT';
|
|
80
|
-
readonly day: string;
|
|
81
|
-
readonly dayOfMonth: number;
|
|
82
|
-
readonly events: readonly CalendarSeriesEvent[];
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* INSIDE the run's own span and still to come, but not a day it plays — a gap between
|
|
86
|
-
* days it does. Keeps the outline and loses the fill.
|
|
87
|
-
*/
|
|
88
|
-
| {
|
|
89
|
-
readonly kind: 'UNAVAILABLE';
|
|
90
|
-
readonly day: string;
|
|
91
|
-
readonly dayOfMonth: number;
|
|
92
|
-
}
|
|
93
|
-
/** In the month and sellable. `events` may hold more than one. */
|
|
94
|
-
| {
|
|
95
|
-
readonly kind: 'AVAILABLE';
|
|
96
|
-
readonly day: string;
|
|
97
|
-
readonly dayOfMonth: number;
|
|
98
|
-
readonly events: readonly CalendarSeriesEvent[];
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* The one day currently picked. Still shows its availability accessory — selecting a
|
|
102
|
-
* day does not hide how full it is.
|
|
103
|
-
*/
|
|
104
|
-
| {
|
|
105
|
-
readonly kind: 'SELECTED';
|
|
106
|
-
readonly day: string;
|
|
107
|
-
readonly dayOfMonth: number;
|
|
108
|
-
readonly events: readonly CalendarSeriesEvent[];
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/** Which period the pill names — and therefore which picker it opens. */
|
|
112
|
-
export declare type CalendarGrain = 'YEAR' | 'MONTH';
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* The period a picker sits inside, as the second pill in its header — the design,
|
|
116
|
-
* inside `IslandHeaderWrapper`'s leading group.
|
|
117
|
-
*/
|
|
118
|
-
export declare function CalendarGrainButton({ month, grain, onPress }: CalendarGrainButtonProps): react_jsx_runtime.JSX.Element;
|
|
119
|
-
|
|
120
|
-
export declare type CalendarGrainButtonProps = {
|
|
121
|
-
/**
|
|
122
|
-
* The month ON SCREEN, not the run's first — the pickers publish theirs as they page
|
|
123
|
-
* (`onVisibleMonthChange`), and a run that crosses New Year says 2026 over December and
|
|
124
|
-
* 2027 over January.
|
|
125
|
-
*/
|
|
126
|
-
readonly month: CalendarMonthKey;
|
|
127
|
-
/** Which half of that key to say. See `CalendarGrain`. */
|
|
128
|
-
readonly grain: CalendarGrain;
|
|
129
|
-
/** Where pressing it goes — the picker for the period it names. */
|
|
130
|
-
readonly onPress?: () => void;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/** Laying a run of days out as a month grid — the day picker's whole domain. */
|
|
134
|
-
/** `YYYY-MM`.. */
|
|
135
|
-
export declare type CalendarMonthKey = string;
|
|
136
|
-
|
|
137
|
-
/** Where a month begins, as a row of the run's week list. */
|
|
138
|
-
export declare type CalendarMonthRow = {
|
|
139
|
-
readonly month: CalendarMonthKey;
|
|
140
|
-
readonly row: number;
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
/** A run of linked events, as the calendar needs it. */
|
|
144
|
-
export declare type CalendarSeries = {
|
|
145
|
-
/** Ordered by day, then start. May hold several entries for one day. */
|
|
146
|
-
readonly events: readonly CalendarSeriesEvent[];
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
/** One event in the run, as the calendar needs it. */
|
|
150
|
-
export declare type CalendarSeriesEvent = {
|
|
151
|
-
readonly eventKey: string;
|
|
152
|
-
readonly name: string;
|
|
153
|
-
/**
|
|
154
|
-
* `YYYY-MM-DD`. The GROUPING day, not the start: an event can run past midnight, so
|
|
155
|
-
* this is what says which day it belongs to.
|
|
156
|
-
*/
|
|
157
|
-
readonly day: string;
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
/** Always seven cells, Monday first.. */
|
|
161
|
-
export declare type CalendarWeek = readonly CalendarCell[];
|
|
162
|
-
|
|
163
|
-
declare type CheckoutSchedule = {
|
|
164
|
-
/** The run being picked from. Every month it touches is drawn. */
|
|
165
|
-
readonly series: CalendarSeries;
|
|
166
|
-
/** `YYYY-MM-DD` on the venue's calendar. */
|
|
167
|
-
readonly today: string;
|
|
168
|
-
/** `HH:MM` on the venue's clock — see `timeOfDayInZone`. */
|
|
169
|
-
readonly nowTime: string;
|
|
170
|
-
/** One ticket's slots, by `YYYY-MM-DD`. A day with none simply offers none. */
|
|
171
|
-
readonly slotsByDay?: Readonly<Record<string, readonly Timeslot[]>>;
|
|
172
|
-
/** Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD`. */
|
|
173
|
-
readonly remaining?: Readonly<Record<string, number>>;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
export declare function ContentFlag({ tone, title }: ContentFlagProps): react_jsx_runtime.JSX.Element;
|
|
177
|
-
|
|
178
|
-
export declare type ContentFlagProps = {
|
|
179
|
-
readonly tone: ContentFlagTone;
|
|
180
|
-
/**
|
|
181
|
-
* An accessible name. Omitted, the mark is decorative and hidden — which is right
|
|
182
|
-
* wherever the field's own text already says what is wrong, and wrong where the mark is
|
|
183
|
-
* the only thing saying it.
|
|
184
|
-
*/
|
|
185
|
-
readonly title?: string;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* What a field says about its own contents — Figma's `ContentFlagIcon`, the 16px mark
|
|
190
|
-
* at the trailing end of an `InputTextShort`.
|
|
191
|
-
*/
|
|
192
|
-
export declare type ContentFlagTone = 'success' | 'warning' | 'error';
|
|
193
|
-
|
|
194
|
-
/** A progress ring — Figma's `StepCompletionProgressRing`. */
|
|
195
|
-
export declare function CounterRing({ progress, complete, size, title, color, trackColor, direction, track, }: CounterRingProps): react_jsx_runtime.JSX.Element;
|
|
196
|
-
|
|
197
|
-
export declare type CounterRingProps = {
|
|
198
|
-
/**
|
|
199
|
-
* How full the ring is, 0..1. Out-of-range values are clamped by the geometry, because
|
|
200
|
-
* a caller's `count / target` goes out of range in normal use — a confirm field can
|
|
201
|
-
* hold more than the password above it.
|
|
202
|
-
*
|
|
203
|
-
* IT MAY FALL AS READILY AS IT RISES. The arc is a function of this number and of
|
|
204
|
-
* nothing else — no last value is kept anywhere — so a ring counting TOWARDS a target
|
|
205
|
-
* and one counting what is LEFT are the same component handed different numbers.
|
|
206
|
-
*/
|
|
207
|
-
readonly progress: number;
|
|
208
|
-
/**
|
|
209
|
-
* What the ring BECOMES once it is full, or absent while it is still filling. Present,
|
|
210
|
-
* the ring gives way to this mark entirely.
|
|
211
|
-
*/
|
|
212
|
-
readonly complete?: ContentFlagTone;
|
|
213
|
-
/**
|
|
214
|
-
* The size of the 1:1 box. Any CSS length; a number is taken as px. Default `1em`, so
|
|
215
|
-
* it scales with the row it sits in — `CountdownTimer`'s contract.
|
|
216
|
-
*/
|
|
217
|
-
readonly size?: number | string;
|
|
218
|
-
readonly title?: string;
|
|
219
|
-
/**
|
|
220
|
-
* THE ARC'S COLOUR. Any CSS colour, including a `var()` or a `color-mix()` — the value
|
|
221
|
-
* is handed to `IconGlyph` as a fill and this component does not read it.
|
|
222
|
-
*
|
|
223
|
-
* Default is the counter's own token. A caller states one where the ring MEANS
|
|
224
|
-
* something the counter does not: the timeslot's ring runs a green-to-red ramp,
|
|
225
|
-
* because there a filling ring and a draining one are different news.
|
|
226
|
-
*/
|
|
227
|
-
readonly color?: string;
|
|
228
|
-
/** The groove's colour, on the same terms. Ignored when `track` is off. */
|
|
229
|
-
readonly trackColor?: string;
|
|
230
|
-
/**
|
|
231
|
-
* WHICH WAY ROUND THE ARC GROWS from 12 o'clock. Default `cw`, the clock's own sense
|
|
232
|
-
* and the design's.
|
|
233
|
-
*/
|
|
234
|
-
readonly direction?: RingDirection;
|
|
235
|
-
/**
|
|
236
|
-
* THE GROOVE BEHIND THE ARC. Default on.
|
|
237
|
-
*
|
|
238
|
-
* It is what makes 0% read as EMPTY rather than as absent: with no track, a ring with
|
|
239
|
-
* nothing in it is nothing at all, and a row of them is a row of gaps. Turn it off
|
|
240
|
-
* where something else already draws the whole — an arc on a ground that is itself the
|
|
241
|
-
* track — and never merely because it looks quieter.
|
|
242
|
-
*/
|
|
243
|
-
readonly track?: boolean;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
/** The variant BOTH pickers draw.. */
|
|
247
|
-
export declare const DATE_PICKER_ACCESSORY: DatePickerCellAccessory;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* What a date-picker cell shows BENEATH its own label — a day beneath its number, a
|
|
251
|
-
* timeslot beneath its time..
|
|
252
|
-
*/
|
|
253
|
-
export declare type DatePickerCellAccessory = 'NONE' | 'LINE';
|
|
254
|
-
|
|
255
|
-
/** What a pickable date cell is, for ANY grain of date picker. */
|
|
256
|
-
export declare type DatePickerCellState = 'AVAILABLE' | 'SELECTED' | 'UNAVAILABLE' | 'PAST_BUT_RELEVANT' | 'OUT_OF_SERIES';
|
|
257
|
-
|
|
258
|
-
/** The span a calendar opens on, or null when there is nothing to show. */
|
|
259
|
-
export declare function dateRange(series: CalendarSeries): {
|
|
260
|
-
first: string;
|
|
261
|
-
last: string;
|
|
262
|
-
} | null;
|
|
263
|
-
|
|
264
|
-
/** What a day's `Remaining` says — BOTH readings, from one call. */
|
|
265
|
-
export declare type DayAvailability = {
|
|
266
|
-
/** How far the track fills. */
|
|
267
|
-
readonly level: AvailabilityLevel;
|
|
268
|
-
/** What the day says, for the reader who cannot see the track. */
|
|
269
|
-
readonly announcement: string;
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
/** Select Day — the day picker's content. */
|
|
273
|
-
export declare function DayPicker({ series, offered, today, selectedDay, onSelectDay, remaining, accessory, onVisibleMonthChange, }: DayPickerProps): react_jsx_runtime.JSX.Element | null;
|
|
274
|
-
|
|
275
|
-
export declare type DayPickerProps = {
|
|
276
|
-
/** The run being picked from. Every month it touches is drawn. */
|
|
277
|
-
readonly series: CalendarSeries;
|
|
278
|
-
/**
|
|
279
|
-
* THE DAYS STILL ON OFFER, where the inventory filter has hidden some — absent is all of
|
|
280
|
-
* `series`. The weeks stay the whole run's, so ticking a box greys days where they stand
|
|
281
|
-
* rather than moving the month the buyer is reading; see `offeredSeries`.
|
|
282
|
-
*/
|
|
283
|
-
readonly offered?: CalendarSeries;
|
|
284
|
-
/**
|
|
285
|
-
* `YYYY-MM-DD` in the VENUE's local day, never the device's. Passed in rather than read
|
|
286
|
-
* from a clock — see `MonthGridOptions`.
|
|
287
|
-
*/
|
|
288
|
-
readonly today: string;
|
|
289
|
-
readonly selectedDay: string | null;
|
|
290
|
-
readonly onSelectDay: (day: string) => void;
|
|
291
|
-
/** Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD`. */
|
|
292
|
-
readonly remaining?: Readonly<Record<string, number>>;
|
|
293
|
-
/**
|
|
294
|
-
* Defaults to the variant both pickers draw. A prop only so a host can turn the line
|
|
295
|
-
* off; there is no per-cell answer.
|
|
296
|
-
*/
|
|
297
|
-
readonly accessory?: DatePickerCellAccessory;
|
|
298
|
-
/**
|
|
299
|
-
* The month CURRENTLY IN VIEW, reported as it changes — including once on mount,
|
|
300
|
-
* because the picker opens on a month the host did not choose (see
|
|
301
|
-
* `soonestRelevantDay`).
|
|
302
|
-
*/
|
|
303
|
-
readonly onVisibleMonthChange?: (month: CalendarMonthKey) => void;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* WHICH EVENT A DAY OF A RUN IS. A series sells one event per day and a cart is opened
|
|
308
|
-
* against that event, so a day the buyer picked has to become a key — and the run is what
|
|
309
|
-
* names it. The data layer works the same map out from its own fetch; see the call site
|
|
310
|
-
* for why a schedule that already says it is asked first.
|
|
311
|
-
*/
|
|
312
|
-
export declare function eventKeyForDay(series: CalendarSeries | undefined, day: string): string | undefined;
|
|
313
|
-
|
|
314
|
-
/** Every event on a day. The one place that match is expressed. */
|
|
315
|
-
export declare function eventsOn(series: CalendarSeries, day: string): readonly CalendarSeriesEvent[];
|
|
316
|
-
|
|
317
|
-
/** @internal */
|
|
318
|
-
declare interface EventTimeslot {
|
|
319
|
-
LocalStartTime: string;
|
|
320
|
-
LocalEndTime: string;
|
|
321
|
-
Total: number;
|
|
322
|
-
Remaining: number;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/** A day key as its date — `2055-12-01` -> `1 December 2055`. */
|
|
326
|
-
export declare function formatDayDate(day: string): string;
|
|
327
|
-
|
|
328
|
-
/** A day key as its weekday — `2055-12-01` -> `Wednesday`. */
|
|
329
|
-
export declare function formatDayWeekday(day: string): string;
|
|
330
|
-
|
|
331
|
-
/** A month key as its name — `2056-06` -> `June`.. */
|
|
332
|
-
export declare function formatMonthName(month: CalendarMonthKey): string;
|
|
333
|
-
|
|
334
|
-
/** A month key as its SHORT name — `2056-06` -> `June`, `2056-12` -> `Dec.` */
|
|
335
|
-
export declare function formatMonthNameShort(month: CalendarMonthKey): string;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* A month key's YEAR — `2056-06` -> `2028`., whose name says `MonthYear` and whose body
|
|
339
|
-
* returns the year alone. Kept under the source's name so the mapping back is
|
|
340
|
-
* greppable.
|
|
341
|
-
*/
|
|
342
|
-
export declare function formatMonthYear(month: CalendarMonthKey): string;
|
|
343
|
-
|
|
344
|
-
export declare function formatSlotDuration(startTime: string, endTime: string | null): string | null;
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* How long a slot runs, as the words the design sets beside the range — `15m`, `1h`,
|
|
348
|
-
* `1h 30m`.
|
|
349
|
-
*/
|
|
350
|
-
/**
|
|
351
|
-
* A SESSION AS ITS TWO ENDS — `12:00 - 12:45`, the design's own separator and spacing. A
|
|
352
|
-
* slot with no stated end is just its start: an open-ended session is not a range.
|
|
353
|
-
*/
|
|
354
|
-
export declare function formatSlotRange(startTime: string, endTime: string | null): string;
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* A day as the cart writes it — `Saturday, 12 December`, and NO YEAR: the design's own
|
|
358
|
-
* line, on a card about an order whose year nobody is in doubt about.
|
|
359
|
-
*/
|
|
360
|
-
export declare function formatWeekdayAndDate(day: string): string;
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* THE DISTINCT TYPES, in the order the platform first names each — the organiser's own,
|
|
364
|
-
* and re-sorting on every fetch would move the rows under the pointer.
|
|
365
|
-
*/
|
|
366
|
-
export declare function groupUserTypes(rows: readonly UserType[]): readonly PartyUserTypeOption[];
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Whether a state can be tapped — exactly the states carrying BOTH a fill and a stroke,
|
|
370
|
-
* i.e. a date the run touches that has not gone..
|
|
371
|
-
*/
|
|
372
|
-
export declare function isDatePickerCellSelectable(state: DatePickerCellState): state is 'AVAILABLE' | 'SELECTED';
|
|
373
|
-
|
|
374
|
-
/** The day grain's adapter onto that answer, narrowing as it answers. */
|
|
375
|
-
export declare function isSelectableCalendarCell(cell: CalendarCell): cell is Extract<CalendarCell, {
|
|
376
|
-
kind: 'AVAILABLE' | 'SELECTED';
|
|
377
|
-
}>;
|
|
378
|
-
|
|
379
|
-
/** Find a day in the month stack the day picker draws.. */
|
|
380
|
-
export declare function locateDayInMonthStack(series: CalendarSeries, day: string, { today }: {
|
|
381
|
-
today: string;
|
|
382
|
-
}): MonthStackPosition | null;
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Which month is being shown when `topRow` is at the top of the viewport: the LAST one
|
|
386
|
-
* to have begun at or above it.
|
|
387
|
-
*/
|
|
388
|
-
export declare function monthAtRow(starts: readonly CalendarMonthRow[], topRow: number): CalendarMonthKey | null;
|
|
389
|
-
|
|
390
|
-
export declare type MonthGridOptions = {
|
|
391
|
-
/**
|
|
392
|
-
* `YYYY-MM-DD`, in the same basis as an event's `day` — the VENUE's local day, not the
|
|
393
|
-
* device's. Required, not defaulted from a clock: "what is today" is the caller's to
|
|
394
|
-
* decide, and a module that read it itself could not be tested without freezing time.
|
|
395
|
-
*/
|
|
396
|
-
readonly today: string;
|
|
397
|
-
/**
|
|
398
|
-
* `YYYY-MM-DD`, or null when nothing is picked yet. A day outside this month, or one
|
|
399
|
-
* the series does not run, simply never matches.
|
|
400
|
-
*/
|
|
401
|
-
readonly selectedDay?: string | null;
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* `2055-11-28` -> `2055-11`.. Named rather than sliced at each call site so the two key
|
|
406
|
-
* formats stay one vocabulary.
|
|
407
|
-
*/
|
|
408
|
-
export declare function monthOfDay(day: string): CalendarMonthKey;
|
|
409
|
-
|
|
410
|
-
/** The month a week belongs to, where it straddles two.. */
|
|
411
|
-
export declare function monthOfWeek(weekStart: string): CalendarMonthKey;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* WHERE THE PICKER OPENS — the first row of the MONTH holding `day`, so a buyer meets that
|
|
415
|
-
* month as a month rather than as a week pinned to the top of the window.
|
|
416
|
-
*
|
|
417
|
-
* IT COSTS NOTHING TO SEE: `CALENDAR_VIEWPORT_ROWS` is 6, and 6 is the most rows a month
|
|
418
|
-
* can touch with Monday-first weeks, so resting on a month's first row always holds the
|
|
419
|
-
* whole of it — `day` included.
|
|
420
|
-
*
|
|
421
|
-
* IT REVERSES AN EARLIER READING, deliberately. This opened on the row holding the day,
|
|
422
|
-
* to avoid a run starting on the 28th opening with three weeks of November nobody can
|
|
423
|
-
* buy; those weeks are drawn either way, and what that bought instead was November's last
|
|
424
|
-
* week at the top of a screen named December. It also matches what the picker already
|
|
425
|
-
* does elsewhere: tapping a day in another month pages to that month's FIRST row.
|
|
426
|
-
*/
|
|
427
|
-
export declare function monthOpeningRow(weeks: readonly string[], starts: readonly CalendarMonthRow[], day: string | null): number;
|
|
428
|
-
|
|
429
|
-
/** Every month the series touches, in order — the whole of what the stack draws. */
|
|
430
|
-
export declare function monthsInSeries(series: CalendarSeries): readonly CalendarMonthKey[];
|
|
431
|
-
|
|
432
|
-
/** Where in the month STACK a day sits.. */
|
|
433
|
-
export declare type MonthStackPosition = {
|
|
434
|
-
readonly monthIndex: number;
|
|
435
|
-
readonly weekIndex: number;
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
/** The row each month BEGINS in — the one holding its 1st. */
|
|
439
|
-
export declare function monthStartRows(weeks: readonly string[]): readonly CalendarMonthRow[];
|
|
440
|
-
|
|
441
|
-
/** The month a picker should open on — whichever one holds `soonestRelevantDay`. */
|
|
442
|
-
export declare function openingMonth(series: CalendarSeries, today: string): CalendarMonthKey | null;
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* `16:00:00` -> `16:00`. Null for anything that is not a readable clock time, including
|
|
446
|
-
* an hour or minute out of range..
|
|
447
|
-
*/
|
|
448
|
-
export declare function parseWallClockTime(value: string | null | undefined): string | null;
|
|
449
|
-
|
|
450
|
-
/** Which part of the day a time falls in — the headings slots are gathered under.. */
|
|
451
|
-
export declare type PartOfDay = 'OVERNIGHT' | 'PRE_DAWN' | 'EARLY_MORNING' | 'LATE_MORNING' | 'EARLY_AFTERNOON' | 'LATE_AFTERNOON' | 'EARLY_EVENING' | 'LATE_EVENING';
|
|
452
|
-
|
|
453
|
-
/** `11:00` -> LATE MORNING.. */
|
|
454
|
-
export declare function partOfDay(time: string): PartOfDay;
|
|
455
|
-
|
|
456
|
-
export declare function partOfDayLabel(part: PartOfDay): string;
|
|
457
|
-
|
|
458
|
-
/** The party step's controls, holding their own counts. */
|
|
459
|
-
/** The step itself: rows when the event names its types, one line when it does not. */
|
|
460
|
-
export declare function PartyStepper({ userTypes, counts, onChange, max, soloName, onRefuse, refused, }: PartyStepperProps): react_jsx_runtime.JSX.Element;
|
|
461
|
-
|
|
462
|
-
export declare type PartyStepperProps = {
|
|
463
|
-
/** What the event offers. EMPTY draws the single unnamed line instead of rows. */
|
|
464
|
-
readonly userTypes: readonly PartyUserTypeOption[];
|
|
465
|
-
/** How many of each, by user-type key. */
|
|
466
|
-
readonly counts: Readonly<Record<string, number>>;
|
|
467
|
-
readonly onChange: (key: string, count: number) => void;
|
|
468
|
-
/** The ticket's ceiling, across every row together. */
|
|
469
|
-
readonly max: number;
|
|
470
|
-
/** What the single line is called when there are no user types. */
|
|
471
|
-
readonly soloName?: string;
|
|
472
|
-
/**
|
|
473
|
-
* A NUMBER OVER THE CEILING WAS ASKED FOR, or `null` once one within it is. The step is
|
|
474
|
-
* not answered while this stands: a card showing a refusal and a live Continue would be
|
|
475
|
-
* telling a buyer both that they cannot have it and that they may proceed.
|
|
476
|
-
*/
|
|
477
|
-
readonly onRefuse?: (asked: number | null) => void;
|
|
478
|
-
/**
|
|
479
|
-
* WHAT WAS ASKED FOR, HELD BY THE WIDGET. Controlled rather than kept here, because the
|
|
480
|
-
* step's answered-ness depends on it and that lives up there — two copies of one fact is
|
|
481
|
-
* how the note ends up on screen while Continue is live, or the other way round.
|
|
482
|
-
*/
|
|
483
|
-
readonly refused?: number | null;
|
|
484
|
-
};
|
|
485
|
-
|
|
486
|
-
/** A user type the event offers, as the row needs it. */
|
|
487
|
-
export declare type PartyUserTypeOption = {
|
|
488
|
-
/**
|
|
489
|
-
* WHAT THE COMPOSITION COUNTS UNDER. The platform's types are keyed by NAME, because an
|
|
490
|
-
* assignment key belongs to a product no one has chosen yet — see this module's header.
|
|
491
|
-
* A host supplying its own may key them however it likes.
|
|
492
|
-
*/
|
|
493
|
-
readonly key: string;
|
|
494
|
-
/** Always present: an event with no discount types still offers a default. */
|
|
495
|
-
readonly name: string;
|
|
496
|
-
/** The organiser's own condition on choosing it, or null. */
|
|
497
|
-
readonly note: string | null;
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
/** @internal */
|
|
501
|
-
declare interface QuestionnaireQuestion {
|
|
502
|
-
Question: string;
|
|
503
|
-
QuestionId: number;
|
|
504
|
-
Type: 'text' | 'date' | 'checkbox' | string;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* IT READS THE DECIMAL, NOT THE LEVEL. A second, differently-grouped set of words —
|
|
509
|
-
* "unavailable / under half / available" — would let the colours and the announcement
|
|
510
|
-
* classify the same day differently. Reading the decimal also survives the interval
|
|
511
|
-
* changing: the platform quantises `Remaining` to quarters today and does not promise
|
|
512
|
-
* to keep doing so, where a bucketed phrase would have to be re-decided.
|
|
513
|
-
*/
|
|
514
|
-
export declare function readAvailability(remaining: number | null): DayAvailability | null;
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* WHICH WAY ROUND AN ARC GROWS FROM 12 O'CLOCK.
|
|
518
|
-
*
|
|
519
|
-
* `cw` is a clock's own sense and the default everywhere — the countdown's hand, the
|
|
520
|
-
* character counter, the design's `StepCompletionProgressRing`. `ccw` is its mirror, and
|
|
521
|
-
* it earns a place because a ring that DEPLETES reads differently unwinding than it does
|
|
522
|
-
* filling backwards: the timeslot's remaining ring runs down, not up.
|
|
523
|
-
*/
|
|
524
|
-
export declare type RingDirection = 'cw' | 'ccw';
|
|
525
|
-
|
|
526
|
-
/** Whether two lists of slots say the same thing. */
|
|
527
|
-
export declare function sameTimeslots(a: readonly Timeslot[], b: readonly Timeslot[]): boolean;
|
|
528
|
-
|
|
529
|
-
/** One way into a session: a band by the name a party is counted under, and its unit price. */
|
|
530
|
-
declare type SlotBand = {
|
|
531
|
-
readonly name: string;
|
|
532
|
-
readonly minorUnits: number;
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* WHAT A SESSION COSTS.
|
|
537
|
-
*
|
|
538
|
-
* `minorUnits` IS THE FLOOR — the cheapest single admission, which is what a row can say
|
|
539
|
-
* before anybody has said who is coming.
|
|
540
|
-
*
|
|
541
|
-
* `options` IS HOW IT BECOMES A TOTAL. One list of bands per product that sells the session,
|
|
542
|
-
* because the price of a party is not a property of the session alone: two Adults and a
|
|
543
|
-
* Child is a different number from three Adults, and the difference is only knowable once
|
|
544
|
-
* the party is. `priceComposition` spends this; nothing else needs to.
|
|
545
|
-
*
|
|
546
|
-
* ONE LIST PER PRODUCT AND NOT ONE MERGED LIST, because a composition has to be priced
|
|
547
|
-
* against a product that can serve ALL of it. Merging two tickets' bands would let a total
|
|
548
|
-
* be built out of an Adult from one and a Child from the other, at a price no single cart
|
|
549
|
-
* line could be filled at.
|
|
550
|
-
*/
|
|
551
|
-
declare type SlotPrice = {
|
|
552
|
-
readonly minorUnits: number;
|
|
553
|
-
readonly currency: string;
|
|
554
|
-
readonly options?: readonly (readonly SlotBand[])[];
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
/** The key the single line counts under when the event names no types. */
|
|
558
|
-
export declare const SOLO_KEY = "default";
|
|
559
|
-
|
|
560
|
-
/** The day a picker should open on: the SOONEST day the run still has. */
|
|
561
|
-
export declare function soonestRelevantDay(series: CalendarSeries, today: string): string | null;
|
|
562
|
-
|
|
563
|
-
/** The MONDAY of the week a day falls in.. */
|
|
564
|
-
export declare function startOfWeek(day: string): string;
|
|
565
|
-
|
|
566
|
-
/** The next or previous month the series RUNS IN, or null at the end. */
|
|
567
|
-
export declare function stepMonth(series: CalendarSeries, month: CalendarMonthKey, step: 1 | -1): CalendarMonthKey | null;
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* STui's `Switch` (`11376:2089`) — an on/off control, for a host composing its own rows.
|
|
571
|
-
*
|
|
572
|
-
* CONTROLLED, AND ONLY CONTROLLED. A switch that kept its own state would flip under a
|
|
573
|
-
* finger and then disagree with the host the moment the host refused the change — an
|
|
574
|
-
* opt-in the session could not save, say. So it draws `checked` and asks for the other,
|
|
575
|
-
* and nothing moves until the host says so.
|
|
576
|
-
*
|
|
577
|
-
* A `button` WITH `role="switch"` rather than a hidden checkbox, which is how every other
|
|
578
|
-
* pressable thing in this package is built — the stars are buttons with `role="radio"`.
|
|
579
|
-
* It takes the ELEMENT press: turning something on does not change what the island is.
|
|
580
|
-
*/
|
|
581
|
-
export declare function Switch({ checked, onChange, label, size, disabled }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
582
|
-
|
|
583
|
-
export declare type SwitchProps = {
|
|
584
|
-
/** Whether it is on. The switch keeps no state of its own — see below. */
|
|
585
|
-
readonly checked: boolean;
|
|
586
|
-
/** Called with the state asked for, which is always the opposite of `checked`. */
|
|
587
|
-
readonly onChange: (checked: boolean) => void;
|
|
588
|
-
/**
|
|
589
|
-
* The accessible name. The design draws the switch bare — its label is whatever row it
|
|
590
|
-
* sits in — so without this a screen reader announces an unnamed switch. Pass the row's
|
|
591
|
-
* own text.
|
|
592
|
-
*/
|
|
593
|
-
readonly label: string;
|
|
594
|
-
/** Default `wide`. */
|
|
595
|
-
readonly size?: SwitchSize;
|
|
596
|
-
readonly disabled?: boolean;
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
/** STui `Switch`'s two sizes: `wide` is `$12` across with a long thumb, `thin` `$8` with a short upright one. */
|
|
600
|
-
export declare type SwitchSize = 'wide' | 'thin';
|
|
601
|
-
|
|
602
|
-
declare interface Ticket {
|
|
603
|
-
/** @deprecated Legacy numeric ID — populated from v1 for cart compat, remove when v2 cart ships */
|
|
604
|
-
ID?: number;
|
|
605
|
-
Key: string;
|
|
606
|
-
Name: string;
|
|
607
|
-
Note: string | null;
|
|
608
|
-
BasePrice: number;
|
|
609
|
-
SalePrice: number;
|
|
610
|
-
Fees: number;
|
|
611
|
-
Total: number;
|
|
612
|
-
/**
|
|
613
|
-
* The product's own currency, where it states one — the most specific of the three
|
|
614
|
-
* places this is set, above its event's and the run's. Optional because it is not on
|
|
615
|
-
* every response, and a caller that finds it absent falls up rather than guessing.
|
|
616
|
-
*/
|
|
617
|
-
Currency?: string | null;
|
|
618
|
-
Remaining: number;
|
|
619
|
-
Available: boolean;
|
|
620
|
-
Status: string | null;
|
|
621
|
-
Starts: string | null;
|
|
622
|
-
Ends: string | null;
|
|
623
|
-
LocalStartTime: string | null;
|
|
624
|
-
LocalEndTime: string | null;
|
|
625
|
-
MinPerTransaction: number;
|
|
626
|
-
MaxPerTransaction: number;
|
|
627
|
-
PaymentsEnabled: boolean;
|
|
628
|
-
AttendeeDetailsRequired: boolean;
|
|
629
|
-
HasTimeslot: boolean;
|
|
630
|
-
Questions: QuestionnaireQuestion[] | null;
|
|
631
|
-
Timeslots: EventTimeslot[] | null;
|
|
632
|
-
UrgencyTags: string[];
|
|
633
|
-
/** Nullable for the same reason as the run's — see `EventInfoResponse`. */
|
|
634
|
-
UserTypes: UserType[] | null;
|
|
635
|
-
/**
|
|
636
|
-
* The events this product sells for. Only `TicketInformation` sends it, which is how a
|
|
637
|
-
* response spanning a whole series is split back into days.
|
|
638
|
-
*/
|
|
639
|
-
EventKeys?: string[] | null;
|
|
640
|
-
/**
|
|
641
|
-
* The inventories this product is sold from — the event's own `(Main)` one and any named
|
|
642
|
-
* ones that silo an allocation across events. Sent by `TicketInformation`.
|
|
643
|
-
*/
|
|
644
|
-
InventoryKeys?: string[] | null;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
/** The time it is right now on a given zone's clock, as `HH:MM`. */
|
|
648
|
-
export declare function timeOfDayInZone(now: Date, timeZone: string | null): string;
|
|
649
|
-
|
|
650
|
-
/** Select Time — the timeslot picker's content. */
|
|
651
|
-
export declare function TimePicker({ series, today, nowTime, selection, onSelectDay, slots, onSelectTime, remaining, accessory, onVisibleMonthChange, grouping, }: TimePickerProps): react_jsx_runtime.JSX.Element;
|
|
652
|
-
|
|
653
|
-
export declare type TimePickerProps = {
|
|
654
|
-
/**
|
|
655
|
-
* The run the chosen day belongs to. The week strip scrolls through all of it,
|
|
656
|
-
* including weeks the run skips.
|
|
657
|
-
*/
|
|
658
|
-
readonly series: CalendarSeries;
|
|
659
|
-
/** `YYYY-MM-DD` in the VENUE's local day, never the device's. */
|
|
660
|
-
readonly today: string;
|
|
661
|
-
/** `HH:MM` in the VENUE's local time (`timeOfDayInZone`). */
|
|
662
|
-
readonly nowTime: string;
|
|
663
|
-
/** THE WHOLE ANSWER THIS CARD IS COLLECTING: the day, and the time on it. */
|
|
664
|
-
readonly selection: TimeSelection;
|
|
665
|
-
/**
|
|
666
|
-
* Picking a day in the strip REPLACES the chosen one; it never clears it — and it drops
|
|
667
|
-
* any time chosen on the day before it. See `withSelectedDay`.
|
|
668
|
-
*/
|
|
669
|
-
readonly onSelectDay: (day: string) => void;
|
|
670
|
-
/** ONE ticket's slots for `selection.day`, in the order the wire gave them. */
|
|
671
|
-
readonly slots: readonly Timeslot[];
|
|
672
|
-
readonly onSelectTime: (startTime: string) => void;
|
|
673
|
-
/**
|
|
674
|
-
* Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD` — the RAW signal, exactly as
|
|
675
|
-
* `DayPicker` takes it, for the strip's own seven cells. A slot's own
|
|
676
|
-
* availability rides on the slot and never comes from here.
|
|
677
|
-
*/
|
|
678
|
-
readonly remaining?: Readonly<Record<string, number>>;
|
|
679
|
-
/**
|
|
680
|
-
* Defaults to the variant both pickers draw. A prop only so a host can turn the line
|
|
681
|
-
* off; there is no per-cell answer.
|
|
682
|
-
*/
|
|
683
|
-
readonly accessory?: DatePickerCellAccessory;
|
|
684
|
-
/**
|
|
685
|
-
* The month the WEEK STRIP is showing, reported as it pages — the same fact
|
|
686
|
-
* `DayPicker` publishes, for the same header pill. The timeslots below never move
|
|
687
|
-
* it: they all belong to one day.
|
|
688
|
-
*/
|
|
689
|
-
readonly onVisibleMonthChange?: (month: CalendarMonthKey) => void;
|
|
690
|
-
/** How the day's slots are cut up — see `TimeslotGrouping`. Absent is the eight bands. */
|
|
691
|
-
readonly grouping?: TimeslotGrouping | undefined;
|
|
692
|
-
};
|
|
693
|
-
|
|
694
|
-
/**
|
|
695
|
-
* THE DAY AND THE TIME ON IT, AS ONE VALUE — because they are one answer, and holding
|
|
696
|
-
* them apart is what let a time outlive the day it was chosen on.
|
|
697
|
-
*/
|
|
698
|
-
export declare type TimeSelection = {
|
|
699
|
-
/**
|
|
700
|
-
* `YYYY-MM-DD` — the day being bought, on the VENUE's own local calendar. Not nullable:
|
|
701
|
-
* there is no version of Select Time with no day, because the slots on it belong to
|
|
702
|
-
* one.
|
|
703
|
-
*/
|
|
704
|
-
readonly day: string;
|
|
705
|
-
/**
|
|
706
|
-
* The picked slot's `startTime`, which is the only identity a slot has, or null for a
|
|
707
|
-
* day whose time has not been chosen yet.
|
|
708
|
-
*/
|
|
709
|
-
readonly startTime: string | null;
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
/** One slot a ticket is sold for. */
|
|
713
|
-
export declare type Timeslot = {
|
|
714
|
-
/**
|
|
715
|
-
* `HH:MM` on the VENUE's clock — never the viewer's. Also the slot's IDENTITY: the wire
|
|
716
|
-
* gives no key, so the start time is what a selection points at.
|
|
717
|
-
*/
|
|
718
|
-
readonly startTime: string;
|
|
719
|
-
/** `HH:MM` on the VENUE's clock, or null where the slot does not say. */
|
|
720
|
-
readonly endTime: string | null;
|
|
721
|
-
/**
|
|
722
|
-
* How full this slot is, 0..1 — the platform's own `Remaining`, exactly as a day
|
|
723
|
-
* reports it. Null where the slot does not say.
|
|
724
|
-
*/
|
|
725
|
-
readonly remaining: number | null;
|
|
726
|
-
/**
|
|
727
|
-
* THE CHEAPEST WAY INTO THIS SESSION, where the host knows one. Absent draws no price,
|
|
728
|
-
* which is the default and what every existing caller gets.
|
|
729
|
-
*
|
|
730
|
-
* COMPUTED, NEVER READ. A slot carries no money on the wire — `EventTimeslot` is two
|
|
731
|
-
* times, a total and a remaining — so a price is reached through the TICKET that owns
|
|
732
|
-
* the slot, and the discount bands hang off that ticket too. `slot-price.ts` is the
|
|
733
|
-
* package's answer to all of that, and `runView` spends it for the schedule the widget
|
|
734
|
-
* builds itself; a host composing its own rows reaches the same functions.
|
|
735
|
-
*
|
|
736
|
-
* SO THIS IS A FIGURE AND NOT A RULE. The picker writes the word in front of it and
|
|
737
|
-
* formats the money — that is copy and presentation, which stay here — and takes no view
|
|
738
|
-
* on how the number was arrived at.
|
|
739
|
-
*/
|
|
740
|
-
readonly fromPrice?: SlotPrice | null;
|
|
741
|
-
/**
|
|
742
|
-
* THE NAME OF THE PRODUCT THAT SELLS THIS SLOT — `Ticket.Name`, "Peak" or "Off-Peak" —
|
|
743
|
-
* where the slot was read off one. What `PRODUCT` grouping heads each group with. Absent
|
|
744
|
-
* is a slot a host built without saying, and it is grouped with the others that say
|
|
745
|
-
* nothing, under no heading.
|
|
746
|
-
*/
|
|
747
|
-
readonly product?: string;
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
/** One slot, resolved: what it is, when it is, and what it can do. */
|
|
751
|
-
export declare type TimeslotCell = {
|
|
752
|
-
readonly slot: Timeslot;
|
|
753
|
-
readonly part: PartOfDay;
|
|
754
|
-
readonly state: TimeslotState;
|
|
755
|
-
/**
|
|
756
|
-
* How long the slot runs, in the words the row draws — or null where it cannot say.
|
|
757
|
-
* `formatSlotDuration` of the slot's own two times.
|
|
758
|
-
*/
|
|
759
|
-
readonly duration: string | null;
|
|
760
|
-
};
|
|
761
|
-
|
|
762
|
-
export declare type TimeslotGroup = {
|
|
763
|
-
/**
|
|
764
|
-
* Unique among a list's groups, and stable while its slots are — what a renderer keys
|
|
765
|
-
* the group by. The part of the day, the product, or `ALL` for the one ungrouped list.
|
|
766
|
-
*/
|
|
767
|
-
readonly key: string;
|
|
768
|
-
/** The part of the day these fall in, or null when the list was not cut by time. */
|
|
769
|
-
readonly part: PartOfDay | null;
|
|
770
|
-
/** The heading to draw above them, or null when there is none. */
|
|
771
|
-
readonly label: string | null;
|
|
772
|
-
readonly cells: readonly TimeslotCell[];
|
|
773
|
-
};
|
|
774
|
-
|
|
775
|
-
/**
|
|
776
|
-
* HOW A TICKET'S SLOTS ARE CUT UP.
|
|
777
|
-
*
|
|
778
|
-
* `PART_OF_DAY` is the island's own: eight contiguous bands, each headed by its name.
|
|
779
|
-
* `NONE` is one chronological list with no heading at all — which is what an
|
|
780
|
-
* implementation wants when the list is ALREADY grouped by something the platform
|
|
781
|
-
* carries and this file does not know about. Slots hang off a TICKET, so "Peak" and
|
|
782
|
-
* "Off-Peak" are a grouping the host has and cutting it again by time of day gives a
|
|
783
|
-
* buyer two headings for one list.
|
|
784
|
-
*
|
|
785
|
-
* `PRODUCT` IS THAT GROUPING, DRAWN: one group per product the day's slots are sold by,
|
|
786
|
-
* headed by its name — see `Timeslot.product`. For a run whose products ARE the sessions'
|
|
787
|
-
* kind, which is what a buyer is choosing between, and the time of day is not.
|
|
788
|
-
*/
|
|
789
|
-
export declare type TimeslotGrouping = 'PART_OF_DAY' | 'PRODUCT' | 'NONE';
|
|
790
|
-
|
|
791
|
-
export declare type TimeslotOptions = {
|
|
792
|
-
/**
|
|
793
|
-
* The day these slots are sold for, and the time picked ON it. One value — see
|
|
794
|
-
* `TimeSelection`, which is where the reason lives.
|
|
795
|
-
*/
|
|
796
|
-
readonly selection: TimeSelection;
|
|
797
|
-
/** `YYYY-MM-DD` in the VENUE's zone. */
|
|
798
|
-
readonly today: string;
|
|
799
|
-
/**
|
|
800
|
-
* `HH:MM` in the VENUE's zone (`timeOfDayInZone`). Only consulted when the slots are
|
|
801
|
-
* being sold for today.
|
|
802
|
-
*/
|
|
803
|
-
readonly nowTime: string;
|
|
804
|
-
/** Defaults to `PART_OF_DAY`, which is what the island draws. */
|
|
805
|
-
readonly grouping?: TimeslotGrouping;
|
|
806
|
-
};
|
|
807
|
-
|
|
808
|
-
/** Pick a TIMESLOT — one of the times a ticket is sold for on a given day. */
|
|
809
|
-
export declare function TimeslotPicker({ slots, selection, today, nowTime, onSelect, accessory, grouping, }: TimeslotPickerProps): react_jsx_runtime.JSX.Element;
|
|
810
|
-
|
|
811
|
-
export declare type TimeslotPickerProps = {
|
|
812
|
-
/**
|
|
813
|
-
* ONE ticket's slots, in the order the backend gave them. One ticket's, not the day's:
|
|
814
|
-
* slots hang off a ticket, and two tickets on the same day can offer different sets of
|
|
815
|
-
* them.
|
|
816
|
-
*/
|
|
817
|
-
readonly slots: readonly Timeslot[];
|
|
818
|
-
/**
|
|
819
|
-
* The day these slots are sold for AND the time picked on it, as one value. See
|
|
820
|
-
* `TimeSelection` — a start time that arrived without its day is how a selection came
|
|
821
|
-
* to outlive the day it was made on.
|
|
822
|
-
*/
|
|
823
|
-
readonly selection: TimeSelection;
|
|
824
|
-
/**
|
|
825
|
-
* `YYYY-MM-DD` and `HH:MM` on the VENUE's clock (`timeOfDayInZone`). Passed in rather
|
|
826
|
-
* than read from a clock here, so the picker stays a pure function of its props and an
|
|
827
|
-
* elapsed slot can be tested without freezing time.
|
|
828
|
-
*/
|
|
829
|
-
readonly today: string;
|
|
830
|
-
readonly nowTime: string;
|
|
831
|
-
readonly onSelect: (startTime: string) => void;
|
|
832
|
-
/**
|
|
833
|
-
* What every pill shows beneath its time. A property of the PICKER, not of a slot:
|
|
834
|
-
* every pill takes the same variant, so the times stay one size whether or not a given
|
|
835
|
-
* slot has a line to show.
|
|
836
|
-
*/
|
|
837
|
-
readonly accessory: DatePickerCellAccessory;
|
|
838
|
-
/**
|
|
839
|
-
* Defaults to the island's own eight bands. `PRODUCT` heads each product's slots with its
|
|
840
|
-
* name. `NONE` draws one chronological list with no heading — for a host whose list is
|
|
841
|
-
* already grouped by something this component cannot see. See `TimeslotGrouping`.
|
|
842
|
-
*/
|
|
843
|
-
readonly grouping?: TimeslotGrouping | undefined;
|
|
844
|
-
};
|
|
845
|
-
|
|
846
|
-
/**
|
|
847
|
-
* The session an item is bought for. BOTH ENDS ARE TIMES OF DAY — `18:00:00`, which is
|
|
848
|
-
* what the platform deserialises them into (`System.TimeSpan`) and the shape a ticket's
|
|
849
|
-
* own `Timeslots` come back in. A full local timestamp is refused: `The JSON value could
|
|
850
|
-
* not be converted to System.TimeSpan`. The date is not missing from this — it is the
|
|
851
|
-
* event the cart was opened on.
|
|
852
|
-
*/
|
|
853
|
-
declare interface TimeslotRequest {
|
|
854
|
-
LocalStartTime: string;
|
|
855
|
-
LocalEndTime: string;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* THE SESSION AS THE CART WANTS IT — A TIME OF DAY, NOT A TIMESTAMP.
|
|
860
|
-
*
|
|
861
|
-
* This sent `2054-12-12T18:00:00`, on the reading that `TimeslotRequest.LocalStartTime`
|
|
862
|
-
* is a local timestamp and the day the buyer chose is half the answer. It is not. The
|
|
863
|
-
* bulk add deserialises both ends into a .NET `System.TimeSpan` and refused every order
|
|
864
|
-
* that carried one: `The JSON value could not be converted to System.TimeSpan. Path: $`,
|
|
865
|
-
* which surfaced as ORDER_NOT_OPENED over a flow whose every step had gone right.
|
|
866
|
-
*
|
|
867
|
-
* THE DAY IS ALREADY SAID, WHICH IS WHY THE FIELD DOES NOT WANT IT: a cart is opened on
|
|
868
|
-
* ONE event and an event is one night, so the item has only to say which session of that
|
|
869
|
-
* night — see `createCart`. The read side knew this and the write side did not: a
|
|
870
|
-
* ticket's own slots come back as bare `15:00:00`, which `parseWallClockTime` has always
|
|
871
|
-
* handled, and the platform is simply asking for its own shape back.
|
|
872
|
-
*
|
|
873
|
-
* NO END INVENTED. A session with no stated end is sent as starting and finishing at the
|
|
874
|
-
* same time rather than given a duration nobody claimed — a guess about when somebody's
|
|
875
|
-
* show finishes is worse than a slot that does not say.
|
|
876
|
-
*/
|
|
877
|
-
export declare function timeslotRequest(day: string | undefined, startTime: string | undefined, schedule: Pick<CheckoutSchedule, 'slotsByDay'> | undefined): TimeslotRequest | undefined;
|
|
878
|
-
|
|
879
|
-
/** What a slot is, for colour and for tapping.. */
|
|
880
|
-
export declare type TimeslotState = Extract<DatePickerCellState, 'AVAILABLE' | 'SELECTED' | 'UNAVAILABLE' | 'PAST_BUT_RELEVANT'>;
|
|
881
|
-
|
|
882
|
-
/**
|
|
883
|
-
* `remaining` is 0..1. Returns null at or below 0 — sold out is not a level. Values
|
|
884
|
-
* above 1 are treated as full rather than rejected; the field is approximate and has
|
|
885
|
-
* been seen out of range.
|
|
886
|
-
*/
|
|
887
|
-
export declare function toAvailabilityLevel(remaining: number): AvailabilityLevel | null;
|
|
888
|
-
|
|
889
|
-
/**
|
|
890
|
-
* The selection after a day is pressed: the day, or NOTHING if it was already the
|
|
891
|
-
* chosen one.
|
|
892
|
-
*/
|
|
893
|
-
export declare function toggleSelectedDay(selected: string | null, day: string): string | null;
|
|
894
|
-
|
|
895
|
-
/**
|
|
896
|
-
* WHO A TICKET IS FOR — "Child", "Student".
|
|
897
|
-
*
|
|
898
|
-
* `AssignmentKey` IDENTIFIES THE ASSIGNMENT, NOT THE TYPE. One entry is this type
|
|
899
|
-
* assigned to one product on one event, so the same "Child" appears once per product per
|
|
900
|
-
* night, each with its own key, its own discount and its own conditions. `Name` is the
|
|
901
|
-
* only field that identifies what a buyer is choosing — see `groupUserTypes`, which is
|
|
902
|
-
* the only thing that should be building rows out of these.
|
|
903
|
-
*
|
|
904
|
-
* @internal
|
|
905
|
-
*/
|
|
906
|
-
declare interface UserType {
|
|
907
|
-
AssignmentKey: string;
|
|
908
|
-
Name: string;
|
|
909
|
-
DiscountNominal: number;
|
|
910
|
-
DiscountRate: number;
|
|
911
|
-
/**
|
|
912
|
-
* How many people one of this type admits — 4 for a "Family of 4", 1 for an Adult. One
|
|
913
|
-
* unit of the type is one ticket however many it seats. Absent from older platform
|
|
914
|
-
* builds, which is 1.
|
|
915
|
-
*/
|
|
916
|
-
NumberOfPeople?: number;
|
|
917
|
-
/** The organiser's own condition on choosing it, drawn under the name at `PARTY`. */
|
|
918
|
-
Note?: string | null;
|
|
919
|
-
/** Whether the buyer must show ID. Varies BY PRODUCT under one name — see `agreed`. */
|
|
920
|
-
IdRequired?: boolean;
|
|
921
|
-
AgeMinimum?: number | null;
|
|
922
|
-
AgeMaximum?: number | null;
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
/**
|
|
926
|
-
* EVERY ASSIGNMENT KEY TO THE WORD IT STANDS FOR. `attributeCartItems` reads the key back
|
|
927
|
-
* off the REQUEST, where it is the resolved assignment rather than the name the
|
|
928
|
-
* composition held — so this covers every assignment in the run, not the rows drawn.
|
|
929
|
-
*/
|
|
930
|
-
export declare function userTypeNames(rows: readonly UserType[]): Record<string, string>;
|
|
931
|
-
|
|
932
|
-
/** The week of a stack that holds a given day, or null.. */
|
|
933
|
-
export declare function weekContainingDay(weeks: readonly CalendarWeek[], day: string): CalendarWeek | null;
|
|
934
|
-
|
|
935
|
-
/** The weeks the CALENDAR draws — every month the run touches, in full. */
|
|
936
|
-
export declare function weeksInCalendar(series: CalendarSeries): readonly string[];
|
|
937
|
-
|
|
938
|
-
/** Every week the run touches, Monday keys, in order.. */
|
|
939
|
-
export declare function weeksInSeries(series: CalendarSeries): readonly string[];
|
|
940
|
-
|
|
941
|
-
/** The selection after a day is picked: the new day, and NO time. */
|
|
942
|
-
export declare function withSelectedDay(selection: TimeSelection, day: string): TimeSelection;
|
|
943
|
-
|
|
944
|
-
/** The selection after a time is picked, on the day already chosen. */
|
|
945
|
-
export declare function withSelectedTime(selection: TimeSelection, startTime: string): TimeSelection;
|
|
946
|
-
|
|
947
|
-
export { }
|