@scopetickets/checkout 0.1.0 → 0.1.2
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 +18 -1
- package/dist/chunk-4BOPQURW.js +1989 -0
- package/dist/chunk-4BOPQURW.js.map +1 -0
- package/dist/index.cjs +13852 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +3813 -0
- package/dist/index.d.ts +3813 -0
- package/dist/index.js +12004 -0
- package/dist/index.js.map +1 -0
- package/dist/pickers.cjs +1908 -0
- package/dist/pickers.cjs.map +1 -0
- package/dist/pickers.css +1054 -0
- package/dist/pickers.css.map +1 -0
- package/dist/pickers.d.cts +911 -0
- package/dist/pickers.d.ts +911 -0
- package/dist/pickers.js +117 -0
- package/dist/pickers.js.map +1 -0
- package/dist/styles.css +2948 -0
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3813 @@
|
|
|
1
|
+
import { AvatarAssets } from '@scopetickets/avatar';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { IconAppearance } from '@scopetickets/icons';
|
|
4
|
+
import { PointerEvent as PointerEvent_2 } from 'react';
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
+
import { ReactNode } from 'react';
|
|
8
|
+
import { Ref } from 'react';
|
|
9
|
+
import { RefObject } from 'react';
|
|
10
|
+
|
|
11
|
+
/** One url, made absolute and put on the configured CDN. */
|
|
12
|
+
export declare function absoluteArtworkUrl(url: string | null | undefined, origin?: string): string | undefined;
|
|
13
|
+
|
|
14
|
+
/** WHO IS BUYING, WHERE THE FLOW ASKS, AND WHAT THE ANSWER COSTS IT. */
|
|
15
|
+
/** What a Scope Tickets account carries that this flow spends. */
|
|
16
|
+
declare type Account = {
|
|
17
|
+
/**
|
|
18
|
+
* The stored avatar VALUE, exactly as the profile carries it — a URI, or one of
|
|
19
|
+
* `@scopetickets/avatar`'s prefixed forms. `null` is a real account that has never set
|
|
20
|
+
* one, which is a fact about the ACCOUNT and not a treatment: what gets drawn for it is
|
|
21
|
+
* `buyerAvatarValue`'s decision, and that is the placeholder.
|
|
22
|
+
*/
|
|
23
|
+
readonly avatar: string | null;
|
|
24
|
+
readonly name: string | null;
|
|
25
|
+
readonly email: string | null;
|
|
26
|
+
readonly phone: string | null;
|
|
27
|
+
/** The type this account holder IS, or `null`. Not a composition key — see `user-types`. */
|
|
28
|
+
readonly userTypeKey: string | null;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** How a step tells its card whether its question is answered. */
|
|
32
|
+
export declare type AnswerReporting = {
|
|
33
|
+
readonly onAnsweredChange?: (answered: boolean) => void;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* THE CDN A HOST SHOULD RESOLVE AGAINST — the same one this widget uses.
|
|
38
|
+
*
|
|
39
|
+
* PUBLISHED BECAUSE A HOST THAT SUPPLIES `cartLines` OWNS THE PICTURE, and cannot
|
|
40
|
+
* resolve it correctly without this: the url on the wire keeps the host of whichever
|
|
41
|
+
* environment uploaded the file, so the stored one answers 403 from anywhere else.
|
|
42
|
+
* Measured on TwinkleTown's staging series, 2026-09-10 — the same path is 403 on
|
|
43
|
+
* `cdn-dev.scopetickets.com` and 200 on `cdn.scopetickets.com`.
|
|
44
|
+
*
|
|
45
|
+
* A HOST CANNOT READ `ENVIRONMENT_URLS` ITSELF. `@scopetickets/api` is this package's
|
|
46
|
+
* dependency and not the host's, so without this the only way to a working `<img>` is a
|
|
47
|
+
* hostname typed into somebody's integration — which is the fact this module exists to
|
|
48
|
+
* keep in one place.
|
|
49
|
+
*/
|
|
50
|
+
export declare function artworkOrigin(environment?: Environment): string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* THE RUN'S OWN PICTURE, resolved to something an `<img>` on somebody else's page can load.
|
|
54
|
+
*
|
|
55
|
+
* TWO FACTS ABOUT THE WIRE, AND EACH ONE LOOKS LIKE SUCCESS WHEN IT IS WRONG.
|
|
56
|
+
* `@scopetickets/avatar` draws `<img src>` unconditionally, so a bad url and a missing one
|
|
57
|
+
* both render as its own fill — which is roughly what a ticket looks like anyway.
|
|
58
|
+
*
|
|
59
|
+
* THE PICTURE IS `Backgrounds`, NOT `Cover`. `Cover` is the link preview: a different asset,
|
|
60
|
+
* and on its own host.
|
|
61
|
+
*
|
|
62
|
+
* THE HOST IS NOT THE PLATFORM'S TO CHOOSE. Artwork urls are stored absolute, keeping the
|
|
63
|
+
* host of whichever environment UPLOADED the file — so a run authored against dev answers
|
|
64
|
+
* `cdn-dev` from production forever. The path is the platform's; the host is this
|
|
65
|
+
* integration's, and `ENVIRONMENT_URLS[env].artworkUrl` states it.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/** The artwork half of the wire's `Theme`, and nothing else it carries. */
|
|
69
|
+
export declare type ArtworkTheme = {
|
|
70
|
+
readonly Backgrounds?: readonly string[] | null;
|
|
71
|
+
readonly Cover?: string | null;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* THE KEY THIS PRODUCT SPENDS FOR THAT TYPE, or `undefined` where it offers none — which
|
|
76
|
+
* is a real answer and not a failure: the head goes without a key, and an ABSENT key is
|
|
77
|
+
* the platform's own way of saying "no user type". A host that keyed its own composition
|
|
78
|
+
* by assignment gets that key back, so its composition keeps working.
|
|
79
|
+
*
|
|
80
|
+
* ABSENT AND NULL ARE NOT THE SAME ANSWER. `Ticket.UserTypes` is documented NULL — not
|
|
81
|
+
* empty — when the product names none, so null and `[]` are both the platform SAYING none
|
|
82
|
+
* and an unmatched key is dropped. A field that is not there at all is nobody having said
|
|
83
|
+
* anything, and guessing "none" from silence would strip a host's working key and charge
|
|
84
|
+
* every head full price.
|
|
85
|
+
*/
|
|
86
|
+
export declare function assignmentFor(product: Partial<Pick<Ticket, 'UserTypes'>>, key: string): string | undefined;
|
|
87
|
+
|
|
88
|
+
declare interface AttendeeTicket {
|
|
89
|
+
ID: number;
|
|
90
|
+
AttendeeTicketKey: string;
|
|
91
|
+
AttendeeID: number;
|
|
92
|
+
TicketID: number | null;
|
|
93
|
+
TransactionID: number;
|
|
94
|
+
Status: string;
|
|
95
|
+
TotalAmount: number;
|
|
96
|
+
Currency: string;
|
|
97
|
+
TimeBooked: string;
|
|
98
|
+
OrganisationAmount: number;
|
|
99
|
+
ScopeAmount: number;
|
|
100
|
+
BrokerAmount: number;
|
|
101
|
+
DiscountAmount: number;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* WHAT WE ASKED FOR, ZIPPED WITH WHAT CAME BACK — the user type per created item.
|
|
106
|
+
*
|
|
107
|
+
* A BULK ADD ANSWERS IN REQUEST ORDER, which is the one assumption here and is why this
|
|
108
|
+
* is a function with a guard rather than a line inside the hook: if the platform returns
|
|
109
|
+
* a different NUMBER of items than were asked for, the correspondence is broken and
|
|
110
|
+
* nothing about it can be trusted, so the answer is `null` — no split — rather than a
|
|
111
|
+
* plausible mislabelling of somebody's money.
|
|
112
|
+
*
|
|
113
|
+
* `names` MAPS KEYS TO WORDS, because the wire deals in assignment keys and a cart line
|
|
114
|
+
* says "Adult". An unrecognised key is left unnamed rather than printed raw.
|
|
115
|
+
*/
|
|
116
|
+
export declare function attributeCartItems(requested: readonly RequestedItem[], items: readonly CartItem[], names: Readonly<Record<string, string>>): readonly AttributedCartItem[];
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A cart item with the user type it was BOUGHT FOR attached — see `attributeCartItems`,
|
|
120
|
+
* which is the only thing that can attach it.
|
|
121
|
+
*/
|
|
122
|
+
export declare type AttributedCartItem = CartItem & {
|
|
123
|
+
readonly userType?: string;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export declare const AUTH_CARDS: Record<AuthCardId, AuthCard>;
|
|
127
|
+
|
|
128
|
+
/** THE FIVE AUTH CARDS — every card the three checkpoints draw between them. */
|
|
129
|
+
export declare type AuthCard = {
|
|
130
|
+
readonly copy: {
|
|
131
|
+
readonly title: string;
|
|
132
|
+
readonly subtitle: string;
|
|
133
|
+
};
|
|
134
|
+
readonly actions: readonly CardAction[];
|
|
135
|
+
/**
|
|
136
|
+
* The badge on the hero, and the hole it sits in — or absent where the design hides it.
|
|
137
|
+
* See `DevAvatar.accessory` for why the shape travels with the node.
|
|
138
|
+
*/
|
|
139
|
+
readonly accessory?: {
|
|
140
|
+
readonly shape: 'square' | 'circle';
|
|
141
|
+
readonly content: ReactNode;
|
|
142
|
+
/**
|
|
143
|
+
* Names this badge for the avatar's own transition — see `STEP_ACCESSORY`, and
|
|
144
|
+
* `AvatarAccessory.id` in the package.
|
|
145
|
+
*/
|
|
146
|
+
readonly id: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The five cards the three checkpoints draw between them, named by what each SAYS
|
|
152
|
+
* rather than by where it appears — `SIGN_IN_RECOGNISED` is one node at two
|
|
153
|
+
* checkpoints, and naming it twice is how two copies of one card fall out of step.
|
|
154
|
+
*/
|
|
155
|
+
declare type AuthCardId =
|
|
156
|
+
/**
|
|
157
|
+
* the design `Login-Idle-Unrecognised`. "Already Have An Account?" over the guest
|
|
158
|
+
* placeholder, with Sign in with ▮ and Create Account.
|
|
159
|
+
*/
|
|
160
|
+
'SIGN_IN_UNRECOGNISED'
|
|
161
|
+
/**
|
|
162
|
+
* the design. The same card with `CONTINUE_AS_GUEST` added beneath — the
|
|
163
|
+
* `ORDER_CREATED` reading, where there IS an order and guest checkout is therefore a
|
|
164
|
+
* real route.
|
|
165
|
+
*/
|
|
166
|
+
| 'SIGN_IN_UNRECOGNISED_GUEST'
|
|
167
|
+
/**
|
|
168
|
+
* the design `Login-Idle-Recognised`. The buyer's own face under a keyhole badge,
|
|
169
|
+
* "Welcome Back!", and the two ways back in — passkey first.
|
|
170
|
+
*/
|
|
171
|
+
| 'SIGN_IN_RECOGNISED'
|
|
172
|
+
/**
|
|
173
|
+
* the design `Login-Idle-SignedIn`. "Welcome Back! / You're ready to go." and a single
|
|
174
|
+
* `SIGN_OUT`.
|
|
175
|
+
*/
|
|
176
|
+
| 'ACCOUNT_READY'
|
|
177
|
+
/**
|
|
178
|
+
* the design `SignupPrompt`. "Add to Account / Enjoy faster checkout and access to
|
|
179
|
+
* discounts." — Create Account, Sign In, Skip.
|
|
180
|
+
*/
|
|
181
|
+
| 'ADD_TO_ACCOUNT';
|
|
182
|
+
|
|
183
|
+
/** The session, as the flow sees it — everything a checkpoint decides from. */
|
|
184
|
+
declare type AuthSession = {
|
|
185
|
+
readonly auth: AuthState;
|
|
186
|
+
readonly guest: GuestChoice;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/** The three ways a buyer arrives, as ONE value. */
|
|
190
|
+
declare type AuthState =
|
|
191
|
+
/**
|
|
192
|
+
* Nobody. No account stored, no session — the first visit from this browser, or a buyer
|
|
193
|
+
* who signed out. Carries no account, because there is none to carry: that absence is
|
|
194
|
+
* the union's whole point.
|
|
195
|
+
*/
|
|
196
|
+
{
|
|
197
|
+
readonly status: 'UNRECOGNISED';
|
|
198
|
+
}
|
|
199
|
+
/** An account we hold, without a live session. */
|
|
200
|
+
| {
|
|
201
|
+
readonly status: 'RECOGNISED';
|
|
202
|
+
readonly avatar: string | null;
|
|
203
|
+
}
|
|
204
|
+
/** Authenticated. Nothing further is asked; the account is spendable. */
|
|
205
|
+
| {
|
|
206
|
+
readonly status: 'AUTHENTICATED';
|
|
207
|
+
readonly account: Account;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* WHERE BACK GOES — the whole navigation, as one function.
|
|
212
|
+
*
|
|
213
|
+
* IT IS A TREE AND NOT A HISTORY, which is the decision this encodes. Show QRs is reachable
|
|
214
|
+
* from the root AND from a ticket, and a history would send a buyer back to whichever they
|
|
215
|
+
* came from; this sends them to the root either way. That is the right answer because the
|
|
216
|
+
* carousel is the whole booking's codes rather than one ticket's — going "back" from all of
|
|
217
|
+
* them to one of them is not a step backwards.
|
|
218
|
+
*
|
|
219
|
+
* `BOOKING` HAS NO BACK, and `null` is how it says so: the root's header draws a Close, and
|
|
220
|
+
* closing the island is not navigation.
|
|
221
|
+
*
|
|
222
|
+
* ── AND THE FORM BACKS OUT PAST A CARD THAT IS STILL GATED ──────────────────
|
|
223
|
+
*
|
|
224
|
+
* The form is reached two ways and they are not the same journey. From a NAMED ticket's
|
|
225
|
+
* quick action it is a detour off that ticket's card, and Back returns to it. From an
|
|
226
|
+
* unnamed row it is what the row opened INSTEAD of that card, and backing onto the card
|
|
227
|
+
* anyway would hand the buyer the "Your Ticket" screen the gate exists to keep shut — so
|
|
228
|
+
* Back goes to the list, which is where they pressed.
|
|
229
|
+
*
|
|
230
|
+
* The booking is optional because three of the four answers do not need it, and without one
|
|
231
|
+
* nothing is gated — `ticketGate` says why — so the form backs out to its ticket exactly as
|
|
232
|
+
* it did before there was a gate. `BookingIsland` always has one to pass.
|
|
233
|
+
*/
|
|
234
|
+
export declare function backFrom(screen: BookingScreen, booking?: Booking | null): BookingScreen | null;
|
|
235
|
+
|
|
236
|
+
/** One ticket, as the platform holds it. */
|
|
237
|
+
export declare type BookedTicket = {
|
|
238
|
+
/**
|
|
239
|
+
* The platform's `AttendeeTicketKey`, and the QR code's own content. Stable for the life
|
|
240
|
+
* of the ticket, which is why the carousel and the ticket card are keyed on it — and it
|
|
241
|
+
* is one of the two keys a save is ADDRESSED BY, which is why nothing else about the
|
|
242
|
+
* ticket has to be known before a holder can be named.
|
|
243
|
+
*/
|
|
244
|
+
readonly key: string;
|
|
245
|
+
/**
|
|
246
|
+
* THE SAME ROW'S NUMERIC ID — `AttendeeTicket.ID`, which the platform's own
|
|
247
|
+
* send-a-copy call is addressed by. The save is not: it takes the key above.
|
|
248
|
+
*
|
|
249
|
+
* `0` where the attendee-ticket list did not answer, which is the one case a ticket
|
|
250
|
+
* cannot be SENT — see the gateway's `sendTicket`.
|
|
251
|
+
*/
|
|
252
|
+
readonly attendeeTicketId: number;
|
|
253
|
+
readonly holder: Ticketholder;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/** A booking as the cards draw it — the record, dressed. */
|
|
257
|
+
export declare type Booking = {
|
|
258
|
+
readonly transactionKey: string;
|
|
259
|
+
readonly occasion: BookingOccasion;
|
|
260
|
+
readonly tickets: readonly BookingTicket[];
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* MY BOOKING'S OWN WORDS — the four cards after the money moved.
|
|
265
|
+
*
|
|
266
|
+
* DATA, LIKE `step-cards`. A host defers these screens because it does not want to draw
|
|
267
|
+
* them, so it cannot then be asked what they should say. Nothing here holds state and
|
|
268
|
+
* nothing here presses anything: `BookingIsland` composes the props, and this file is the
|
|
269
|
+
* copy, the badges and the two facts about the header.
|
|
270
|
+
*/
|
|
271
|
+
export declare const BOOKING_COPY: {
|
|
272
|
+
/** The root. A statement of what was bought, which is why the title is a subject. */
|
|
273
|
+
readonly title: "Booking Details";
|
|
274
|
+
readonly myBooking: "My Booking";
|
|
275
|
+
/**
|
|
276
|
+
* WHEN THE PLATFORM NAMES NOBODY — which is every booking this widget makes today, since
|
|
277
|
+
* no attendee is created for a ticket bought through it.
|
|
278
|
+
*
|
|
279
|
+
* "AWAITING DETAILS" AND NOT "TICKETHOLDER". It says what is true of the ticket rather
|
|
280
|
+
* than what kind of thing the line is: nobody has been named yet, and somebody can be.
|
|
281
|
+
* The design sets it a step quieter than the user type beneath it for the same reason.
|
|
282
|
+
*/
|
|
283
|
+
readonly awaiting: "Awaiting Details";
|
|
284
|
+
/** What is offered on a row nobody is named on, where a name can actually be added. */
|
|
285
|
+
readonly add: "Add";
|
|
286
|
+
/** The way to every code at once. Plural even for one — see `codes`, which is not. */
|
|
287
|
+
readonly showCodes: "Show QRs";
|
|
288
|
+
/** The codes screen, and the run inside it. */
|
|
289
|
+
readonly codes: "Show QR";
|
|
290
|
+
readonly codesRegion: "Your tickets";
|
|
291
|
+
/** "1". Counted from one, because it is being read rather than indexed. */
|
|
292
|
+
readonly position: (at: number) => string;
|
|
293
|
+
readonly previous: "Previous ticket";
|
|
294
|
+
readonly next: "Next ticket";
|
|
295
|
+
/**
|
|
296
|
+
* "1 of 3", IN TWO WEIGHTS OF INK — the design sets the position full strength and the
|
|
297
|
+
* run it is out of at Text60, so the number a buyer is looking for reads first.
|
|
298
|
+
*
|
|
299
|
+
* SPLIT HERE RATHER THAN IN THE COMPONENT, because it is a sentence with a part
|
|
300
|
+
* emphasised and that is a fact about the copy. The space belongs to the second half.
|
|
301
|
+
*/
|
|
302
|
+
readonly positionOf: (count: number) => string;
|
|
303
|
+
/** What a code IS, for anyone who cannot see it. */
|
|
304
|
+
readonly codeLabel: (name: string) => string;
|
|
305
|
+
/**
|
|
306
|
+
* AND WHAT STANDS IN ITS PLACE when it did not come back. It says the ticket is fine,
|
|
307
|
+
* because that is the buyer's real question: a blank square where a code should be reads
|
|
308
|
+
* as a ticket that has been cancelled.
|
|
309
|
+
*/
|
|
310
|
+
readonly codeMissing: "Code unavailable. Your ticket is still valid.";
|
|
311
|
+
/** One ticket. Its title is the holder's — see `ticketTitle`. */
|
|
312
|
+
readonly ticketFallbackTitle: "Your Ticket";
|
|
313
|
+
readonly editHolder: "Edit Ticketholder";
|
|
314
|
+
/** The quick actions' two lines each — see `QuickAction.lines`. */
|
|
315
|
+
readonly showCodeLines: readonly ["Show", "QR"];
|
|
316
|
+
readonly editHolderLines: readonly ["Edit", "Ticketholder"];
|
|
317
|
+
/** The edit form. */
|
|
318
|
+
readonly firstName: "First Name";
|
|
319
|
+
readonly lastName: "Last Name";
|
|
320
|
+
readonly email: "Email";
|
|
321
|
+
readonly save: "Save";
|
|
322
|
+
readonly saving: "Saving…";
|
|
323
|
+
/**
|
|
324
|
+
* SENDING A COPY OF A TICKET, which this widget CAN do now — `SendSingleEmail` is the
|
|
325
|
+
* platform's, and the quick action on a ticket's own card is the way to it.
|
|
326
|
+
*
|
|
327
|
+
* The wallet badge still has no entry here, and that is the point: it is Apple's mark and
|
|
328
|
+
* the host supplies the whole node. See `BookingIslandProps.walletBadge`.
|
|
329
|
+
*/
|
|
330
|
+
readonly sendTicketLines: readonly ["Send", "Ticket"];
|
|
331
|
+
readonly sendTicket: "Send Ticket";
|
|
332
|
+
readonly sendPrompt: "Enter recipient email address below.";
|
|
333
|
+
readonly send: "Send";
|
|
334
|
+
readonly sending: "Sending…";
|
|
335
|
+
/** Where it went, said back — the card's only proof that anything happened. */
|
|
336
|
+
readonly sentTo: (email: string) => string;
|
|
337
|
+
readonly sendFailed: "The ticket could not be sent. Please try again.";
|
|
338
|
+
/** The root card's way out, and every other card's way back. */
|
|
339
|
+
readonly close: "Close";
|
|
340
|
+
readonly back: "Back";
|
|
341
|
+
/** While the booking is being read. */
|
|
342
|
+
readonly loadingTitle: "Opening Your Booking";
|
|
343
|
+
readonly loadingSubtitle: "One moment.";
|
|
344
|
+
/**
|
|
345
|
+
* A CART THE PLATFORM HOLDS NO TICKETS AGAINST — and it is NOT a terminal card.
|
|
346
|
+
*
|
|
347
|
+
* THE READ CAN BE EARLY. A booking is opened the instant a purchase finishes, which is
|
|
348
|
+
* within a second of the transaction being finalized; a platform that has not finished
|
|
349
|
+
* indexing it answers with nothing, and that answer stops being true a moment later. So
|
|
350
|
+
* this leads with asking again rather than with the confirmation email — a buyer who has
|
|
351
|
+
* just paid and is looking at "no tickets" needs a button, not a consolation.
|
|
352
|
+
*
|
|
353
|
+
* IT IS ALSO WHAT A STALE CART KEY LOOKS LIKE on a page mounted cold, where asking again
|
|
354
|
+
* costs one request and answers the same way. One card serves both because the buyer's
|
|
355
|
+
* next move is identical.
|
|
356
|
+
*/
|
|
357
|
+
readonly noneTitle: "No Tickets Here Yet";
|
|
358
|
+
readonly noneSubtitle: "We could not find any tickets on this booking. Try again, or check your email for your confirmation.";
|
|
359
|
+
readonly retry: "Try Again";
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* THE SEAM. Everything this island asks of the platform, and nothing about WHEN — that is
|
|
364
|
+
* the hook's, exactly as it is for `SignInGateway`.
|
|
365
|
+
*
|
|
366
|
+
* THREE CALLS AND NOT FOUR. Reading a booking is one request: `Transactions/ByKey` carries
|
|
367
|
+
* the transaction's own key alongside the items, so nothing has to be looked up before a
|
|
368
|
+
* save can be addressed.
|
|
369
|
+
*/
|
|
370
|
+
export declare type BookingGateway = {
|
|
371
|
+
/** The booking behind a cart, or `null` where the cart has not become one. */
|
|
372
|
+
readonly read: (cartKey: string) => Promise<BookingRecord | null>;
|
|
373
|
+
/**
|
|
374
|
+
* Name a person on one ticket — creating the attendee where there is none, which is the
|
|
375
|
+
* ordinary case. `false` is the platform declining; anything worse keeps travelling and
|
|
376
|
+
* becomes a notice.
|
|
377
|
+
*
|
|
378
|
+
* ADDRESSED BY THE TWO KEYS AND NOTHING ELSE: the transaction's and the ticket's, which
|
|
379
|
+
* is why every ticket a read can draw is a ticket this can name — there is no row number
|
|
380
|
+
* to be missing. The platform binds the attendee itself, so there is no id to hand back
|
|
381
|
+
* and none to keep for the next edit: re-addressing the same item is how a holder is
|
|
382
|
+
* changed.
|
|
383
|
+
*/
|
|
384
|
+
readonly saveHolder: (transactionKey: string, ticketKey: string, holder: Ticketholder) => Promise<boolean>;
|
|
385
|
+
/** One ticket's code, as an SVG document, or `null` where nothing usable came back. */
|
|
386
|
+
readonly code: (key: string) => Promise<string | null>;
|
|
387
|
+
/**
|
|
388
|
+
* Send a copy of one ticket to an address. `false` is "it did not go" and nothing more:
|
|
389
|
+
* the endpoint says nothing about why, so neither does this.
|
|
390
|
+
*
|
|
391
|
+
* BY THE NUMERIC ID — `BookedTicket.attendeeTicketId`, which is what the platform's own
|
|
392
|
+
* call takes and is `0` where the list did not answer for the ticket.
|
|
393
|
+
*/
|
|
394
|
+
readonly sendTicket: (attendeeTicketId: number, email: string) => Promise<boolean>;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* MY BOOKING — the last face of the widget, and the only one that is not a purchase.
|
|
399
|
+
*
|
|
400
|
+
* ── FOUR CARDS AND ONE MOUNT ─────────────────────────────────────────────────
|
|
401
|
+
*
|
|
402
|
+
* The booking, every code, one ticket, and who that ticket is for. They are one component
|
|
403
|
+
* for the reason `RestingIsland`'s two faces are: the island's planes cross-fade and its
|
|
404
|
+
* surface morphs because the `contentKey` changed underneath ONE host. Four components would
|
|
405
|
+
* make every move between them a remount, and a remount has nothing to transition from.
|
|
406
|
+
*
|
|
407
|
+
* ── IT IS NOT A WALK ─────────────────────────────────────────────────────────
|
|
408
|
+
*
|
|
409
|
+
* Nothing here is a step. There is no order to complete, nothing is excused, and no card
|
|
410
|
+
* gates the one after it — so there is no `PurchaseStep`, no preflight and no `at` index.
|
|
411
|
+
* What there is instead is a TREE, and `backFrom` is the whole of it.
|
|
412
|
+
*
|
|
413
|
+
* ── AND IT IS REACHABLE TWICE ────────────────────────────────────────────────
|
|
414
|
+
*
|
|
415
|
+
* `ScopeTicketsCheckout` hands over to it when a purchase finishes, and a host can mount it
|
|
416
|
+
* on its own page with a cart key. Both are the same component with the same props, which is
|
|
417
|
+
* why the occasion arrives as data rather than being read out of a flow that may not exist.
|
|
418
|
+
*/
|
|
419
|
+
export declare function BookingIsland({ appKey, source, cartKey, occasion, attribution, buyerAvatar, buyerAvatarAssets, seed, walletBadge, initialPresentation, mode, align, placement, }: BookingIslandProps): react_jsx_runtime.JSX.Element;
|
|
420
|
+
|
|
421
|
+
export declare type BookingIslandProps = {
|
|
422
|
+
/** WHICH IMPLEMENTATION IS ASKING — the Bearer token, as everywhere else here. */
|
|
423
|
+
readonly appKey: string;
|
|
424
|
+
readonly source?: CheckoutSource;
|
|
425
|
+
/**
|
|
426
|
+
* THE CART THE BOOKING WAS MADE FROM, and not the transaction's key.
|
|
427
|
+
*
|
|
428
|
+
* `Transactions/ByKey/{cartKey}` is the one endpoint that answers with a holder per
|
|
429
|
+
* ticket, and it takes this. The transaction's own key comes back inside the response and
|
|
430
|
+
* is what a save is addressed to — see `bookingGateway`.
|
|
431
|
+
*/
|
|
432
|
+
readonly cartKey: string;
|
|
433
|
+
/**
|
|
434
|
+
* WHAT WAS BOUGHT INTO. The caller's, because the platform does not answer for it — see
|
|
435
|
+
* `BookingOccasion`, where that is argued.
|
|
436
|
+
*/
|
|
437
|
+
readonly occasion: BookingOccasion;
|
|
438
|
+
/** The product and the user type per ticket, where the caller knows them. */
|
|
439
|
+
readonly attribution?: TicketAttribution;
|
|
440
|
+
/**
|
|
441
|
+
* THE BUYER'S OWN FACE, for the pill and for nothing else — see the root card, where the
|
|
442
|
+
* collapsed island shows WHOSE booking this is and the opened one shows WHAT it is.
|
|
443
|
+
*
|
|
444
|
+
* Absent draws the guest placeholder, which is what a booking opened on its own page by
|
|
445
|
+
* a host that has no session gets: `buyerAvatarValue` never answers null, so this is
|
|
446
|
+
* only ever unset by a caller that does not know.
|
|
447
|
+
*/
|
|
448
|
+
readonly buyerAvatar?: string;
|
|
449
|
+
/** Where a `default:<id>` gets its pixels — see `avatarAssetsFor`. */
|
|
450
|
+
readonly buyerAvatarAssets?: AvatarAssets;
|
|
451
|
+
/**
|
|
452
|
+
* THE TICKETS, WHERE THE CALLER HAS ALREADY READ THEM — see `useBooking`'s own note. A
|
|
453
|
+
* host mounting this on a cold page has not, and leaves it out.
|
|
454
|
+
*/
|
|
455
|
+
readonly seed?: BookingRecord;
|
|
456
|
+
/**
|
|
457
|
+
* THE WALLET BADGE, AS THE HOST'S OWN NODE — not a press this widget paints a button for.
|
|
458
|
+
*
|
|
459
|
+
* ── WHY THIS ONE IS A `ReactNode` WHERE EVERY OTHER CONTROL HERE IS A CALLBACK ──
|
|
460
|
+
*
|
|
461
|
+
* "Add to Apple Wallet" is APPLE'S MARK, and its size, corner, ground, lock-up and
|
|
462
|
+
* wording are theirs to specify and ours to reproduce exactly or not at all. Painting an
|
|
463
|
+
* approximation of it in this design system's tokens — which is what a callback would
|
|
464
|
+
* oblige — produces a black pill with the right words and none of the right anything
|
|
465
|
+
* else, sitting on a card where every other control is ours.
|
|
466
|
+
*
|
|
467
|
+
* There is no `.pkpass` endpoint on the platform either, so the press has nothing here to
|
|
468
|
+
* do. Both halves are the host's, so the whole control is: it is given the slot the design
|
|
469
|
+
* draws it in, centred above the rule, and this file neither paints it nor presses it.
|
|
470
|
+
*
|
|
471
|
+
* ABSENT DRAWS NOTHING, which is what the platform can honour today.
|
|
472
|
+
*/
|
|
473
|
+
readonly walletBadge?: (ticketKey: string) => ReactNode;
|
|
474
|
+
readonly initialPresentation?: 'pill' | 'card';
|
|
475
|
+
readonly mode?: IslandMode;
|
|
476
|
+
readonly align?: IslandAlignment;
|
|
477
|
+
readonly placement?: IslandPlacement;
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* WHAT WAS BOUGHT INTO. The caller's, for the reason at the top of this file.
|
|
482
|
+
*
|
|
483
|
+
* `day` is `YYYY-MM-DD` and the two times are `HH:MM`, which is the shape the rest of this
|
|
484
|
+
* package already speaks — see `island-timeslots`, whose `parseWallClockTime` is what turns
|
|
485
|
+
* a wire value into one.
|
|
486
|
+
*/
|
|
487
|
+
export declare type BookingOccasion = {
|
|
488
|
+
/** "Ice Skating". */
|
|
489
|
+
readonly name: string;
|
|
490
|
+
/** `YYYY-MM-DD` in the VENUE's local day, never the device's. */
|
|
491
|
+
readonly day: string;
|
|
492
|
+
/** The run's picture, for the hero. */
|
|
493
|
+
readonly artwork: string | null;
|
|
494
|
+
/** `HH:MM`, or absent where the event sells no sessions. */
|
|
495
|
+
readonly startTime: string | null;
|
|
496
|
+
readonly endTime: string | null;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
/** What the platform holds: the transaction, and who each of its tickets is for. */
|
|
500
|
+
export declare type BookingRecord = {
|
|
501
|
+
/** What a save is addressed to. Read off the response; a cart key will not do. */
|
|
502
|
+
readonly transactionKey: string;
|
|
503
|
+
readonly tickets: readonly BookedTicket[];
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* WHICH OF THE FOUR CARDS IS SHOWING.
|
|
508
|
+
*
|
|
509
|
+
* ONE VALUE, AND EACH ARM CARRIES WHAT ONLY IT NEEDS. The alternative — a screen name
|
|
510
|
+
* beside an optional ticket key beside a carousel index — can say "the edit card, for no
|
|
511
|
+
* ticket", which is a card with three empty fields and a Save that addresses nobody.
|
|
512
|
+
*
|
|
513
|
+
* THE INDEX LIVES ON `CODES` FOR THE SAME REASON. It is where the run is scrolled to, which
|
|
514
|
+
* is a fact about that card and about nothing else: kept beside the screen, a buyer who
|
|
515
|
+
* leaves and comes back opens on the first ticket, which is right — they arrived by pressing
|
|
516
|
+
* Show QRs, not by resuming.
|
|
517
|
+
*/
|
|
518
|
+
export declare type BookingScreen =
|
|
519
|
+
/** The root: what was bought, and who each ticket is for. Its way out is out of the island. */
|
|
520
|
+
{
|
|
521
|
+
readonly kind: 'BOOKING';
|
|
522
|
+
}
|
|
523
|
+
/** Every code, one at a time. `at` counts from zero. */
|
|
524
|
+
| {
|
|
525
|
+
readonly kind: 'CODES';
|
|
526
|
+
readonly at: number;
|
|
527
|
+
}
|
|
528
|
+
/** One ticket, and the two things that can be done with it. */
|
|
529
|
+
| {
|
|
530
|
+
readonly kind: 'TICKET';
|
|
531
|
+
readonly ticketKey: string;
|
|
532
|
+
}
|
|
533
|
+
/** Who that ticket is for, as a form. */
|
|
534
|
+
| {
|
|
535
|
+
readonly kind: 'EDIT';
|
|
536
|
+
readonly ticketKey: string;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* WHERE A COPY OF IT GOES — an address, and nothing else. Not the holder's form: this
|
|
540
|
+
* sends the ticket to WHOEVER the buyer names, which is the whole point of it, and
|
|
541
|
+
* changing who the ticket BELONGS to is the other card.
|
|
542
|
+
*/
|
|
543
|
+
| {
|
|
544
|
+
readonly kind: 'SEND';
|
|
545
|
+
readonly ticketKey: string;
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* WHAT IS KNOWN ABOUT THE BOOKING — one value, never a record beside a pair of flags.
|
|
550
|
+
*
|
|
551
|
+
* `NONE` IS NOT `ERROR` AND IT IS NOT `LOADING`. A cart that never became a transaction is
|
|
552
|
+
* a complete, successful answer — there is nothing to show — and it needs a card that says
|
|
553
|
+
* so rather than a spinner that never stops or a failure nobody caused.
|
|
554
|
+
*/
|
|
555
|
+
export declare type BookingState = {
|
|
556
|
+
readonly status: 'LOADING';
|
|
557
|
+
} | {
|
|
558
|
+
readonly status: 'LOADED';
|
|
559
|
+
readonly record: BookingRecord;
|
|
560
|
+
} | {
|
|
561
|
+
readonly status: 'NONE';
|
|
562
|
+
} | {
|
|
563
|
+
readonly status: 'ERROR';
|
|
564
|
+
readonly error: Error;
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
/** One ticket as the cards draw it. */
|
|
568
|
+
export declare type BookingTicket = BookedTicket & {
|
|
569
|
+
/** "Peak" — the product, where the caller knows it. */
|
|
570
|
+
readonly product: string | null;
|
|
571
|
+
/** "Adult" — the user type, where the caller knows it. */
|
|
572
|
+
readonly userType: string | null;
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
/** Which period the pill names — and therefore which picker it opens. */
|
|
576
|
+
export declare type CalendarGrain = 'YEAR' | 'MONTH';
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* The period a picker sits inside, as the second pill in its header — the design,
|
|
580
|
+
* inside `IslandHeaderWrapper`'s leading group.
|
|
581
|
+
*/
|
|
582
|
+
export declare function CalendarGrainButton({ month, grain, onPress }: CalendarGrainButtonProps): react_jsx_runtime.JSX.Element;
|
|
583
|
+
|
|
584
|
+
export declare type CalendarGrainButtonProps = {
|
|
585
|
+
/**
|
|
586
|
+
* The month ON SCREEN, not the run's first — the pickers publish theirs as they page
|
|
587
|
+
* (`onVisibleMonthChange`), and a run that crosses New Year says 2026 over December and
|
|
588
|
+
* 2027 over January.
|
|
589
|
+
*/
|
|
590
|
+
readonly month: CalendarMonthKey;
|
|
591
|
+
/** Which half of that key to say. See `CalendarGrain`. */
|
|
592
|
+
readonly grain: CalendarGrain;
|
|
593
|
+
/** Where pressing it goes — the picker for the period it names. */
|
|
594
|
+
readonly onPress?: () => void;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
/** Laying a run of days out as a month grid — the day picker's whole domain. */
|
|
598
|
+
/** `YYYY-MM`.. */
|
|
599
|
+
export declare type CalendarMonthKey = string;
|
|
600
|
+
|
|
601
|
+
/** A run of linked events, as the calendar needs it. */
|
|
602
|
+
export declare type CalendarSeries = {
|
|
603
|
+
/** Ordered by day, then start. May hold several entries for one day. */
|
|
604
|
+
readonly events: readonly CalendarSeriesEvent[];
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
/** One event in the run, as the calendar needs it. */
|
|
608
|
+
export declare type CalendarSeriesEvent = {
|
|
609
|
+
readonly eventKey: string;
|
|
610
|
+
readonly name: string;
|
|
611
|
+
/**
|
|
612
|
+
* `YYYY-MM-DD`. The GROUPING day, not the start: an event can run past midnight, so
|
|
613
|
+
* this is what says which day it belongs to.
|
|
614
|
+
*/
|
|
615
|
+
readonly day: string;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* A card's button as this file describes one — the role and the words, plus whatever
|
|
620
|
+
* mark the design puts beside them. `onPress` is the gallery's, since a fixture has
|
|
621
|
+
* nowhere to send anybody.
|
|
622
|
+
*/
|
|
623
|
+
export declare type CardAction = Pick<IslandAction, 'role' | 'mark'> & {
|
|
624
|
+
/**
|
|
625
|
+
* A `ReactNode` because the pay button composes a brand mark into its own words — "Pay
|
|
626
|
+
* with [mark] • 1123", as the design draws it.
|
|
627
|
+
*/
|
|
628
|
+
readonly label: ReactNode;
|
|
629
|
+
/** What the button DOES, for the few that do anything. */
|
|
630
|
+
readonly onPress?: () => void;
|
|
631
|
+
/**
|
|
632
|
+
* THE DETOUR THIS BUTTON OPENS — the other half of `PurchaseStep.detourFrom`, which
|
|
633
|
+
* says which card a step hangs off but not what opens it.
|
|
634
|
+
*
|
|
635
|
+
* Declared rather than handled, because this file is data and has no state to set. A
|
|
636
|
+
* button without it falls through to advancing the flow, and on the last card that
|
|
637
|
+
* means committing: "Select Payment Method" was placing the order.
|
|
638
|
+
*/
|
|
639
|
+
readonly opens?: PurchaseStepId;
|
|
640
|
+
/**
|
|
641
|
+
* THIS BUTTON ATTEMPTS THE PAYMENT AGAIN. Declared rather than handled, like `opens` —
|
|
642
|
+
* what a retry DOES depends on who reported the failure, and this file knows neither.
|
|
643
|
+
*/
|
|
644
|
+
readonly retries?: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* SHUT, whatever the step's own answer says. The primary is gated on the step being
|
|
647
|
+
* answered; this is for a button that is unavailable for a reason of its own — Re-send
|
|
648
|
+
* serving its cooldown, and nothing else so far.
|
|
649
|
+
*/
|
|
650
|
+
readonly disabled?: boolean;
|
|
651
|
+
/**
|
|
652
|
+
* THIS BUTTON CHOOSES THE ACCOUNT ROUTE — the offer's Create Account, and the only
|
|
653
|
+
* thing that opens the sub-flow behind it.
|
|
654
|
+
*
|
|
655
|
+
* Declared rather than handled, like `opens` and `retries`: what it costs is the walk's
|
|
656
|
+
* question, and this file is data with no state to set. Without it the widget walks
|
|
657
|
+
* `GUEST` at every checkpoint, `makingAccount` never becomes true, and the five steps
|
|
658
|
+
* after the offer are skipped — which is what happens today.
|
|
659
|
+
*/
|
|
660
|
+
readonly takesAccount?: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* THIS BUTTON CHARGES. Declared rather than handled, like `opens` and `retries`: what
|
|
663
|
+
* paying DOES depends on whether there is a platform behind the widget, and this file
|
|
664
|
+
* knows neither that nor who the buyer is.
|
|
665
|
+
*/
|
|
666
|
+
readonly pays?: boolean;
|
|
667
|
+
/**
|
|
668
|
+
* THIS BUTTON CHOOSES A PAYMENT METHOD — Review's method buttons. Declared rather
|
|
669
|
+
* than handled, like `opens`: which frame the choice mounts, and what the buyer
|
|
670
|
+
* save has to do with it, is the widget's to decide, and this file is data with no
|
|
671
|
+
* state to set.
|
|
672
|
+
*
|
|
673
|
+
* `'wallet'` IS THE DEVICE'S ONE WALLET, not a method of its own: this file cannot
|
|
674
|
+
* know whether that is Apple Pay or Google Pay — the widget's device sniff decides
|
|
675
|
+
* at runtime, and relabels the button to match. See `detect-digital-wallet`.
|
|
676
|
+
*/
|
|
677
|
+
readonly picks?: 'card' | 'revolut_pay' | 'wallet';
|
|
678
|
+
/**
|
|
679
|
+
* THIS BUTTON OPENS THE DEVICE'S FILE DIALOG — the photo step's Upload. Declared rather
|
|
680
|
+
* than handled for the reason the rest are: the input it opens belongs to the grid on
|
|
681
|
+
* the card, and this file draws no controls.
|
|
682
|
+
*/
|
|
683
|
+
readonly uploads?: boolean;
|
|
684
|
+
/**
|
|
685
|
+
* THIS BUTTON SENDS THE RATING — the feedback card's Continue, and the only thing that
|
|
686
|
+
* does. Declared rather than handled, like `pays`: the number is on the card and the
|
|
687
|
+
* call is the data layer's, and this file has neither.
|
|
688
|
+
*
|
|
689
|
+
* WITHOUT IT THE PRESS WOULD STILL ADVANCE, which is exactly the fall-through
|
|
690
|
+
* `pressFor` exists to stop — a Continue that moves the buyer on and quietly drops what
|
|
691
|
+
* they just said. The Skip beside it has no flag for that reason: dropping the rating
|
|
692
|
+
* IS what Skip does.
|
|
693
|
+
*/
|
|
694
|
+
readonly rates?: boolean;
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
/** Marks content that should survive a step change rather than fade through itself. */
|
|
698
|
+
export declare function CarrySlot({ name, carryWhen, children }: CarrySlotProps): react_jsx_runtime.JSX.Element;
|
|
699
|
+
|
|
700
|
+
export declare type CarrySlotProps = {
|
|
701
|
+
/**
|
|
702
|
+
* Stable identity of the thing being carried, shared by both steps. The total is
|
|
703
|
+
* `"total"` in the compact step and `"total"` in the expanded one — that shared name is
|
|
704
|
+
* the entire mechanism.
|
|
705
|
+
*/
|
|
706
|
+
name: string;
|
|
707
|
+
/**
|
|
708
|
+
* When the overlay takes this element over — see `CarryTrigger`. Defaults to every
|
|
709
|
+
* move, which is right for a subject and wrong for chrome.
|
|
710
|
+
*/
|
|
711
|
+
carryWhen?: CarryTrigger;
|
|
712
|
+
children: ReactNode;
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
/** WHEN the overlay takes an element over, rather than leaving it to the planes. */
|
|
716
|
+
declare type CarryTrigger = 'always' | 'resized';
|
|
717
|
+
|
|
718
|
+
export declare const CART_VIEW: {
|
|
719
|
+
readonly title: "My Cart";
|
|
720
|
+
readonly total: "Total";
|
|
721
|
+
readonly back: "Back";
|
|
722
|
+
/**
|
|
723
|
+
* The cart target's own name. It is a GLYPH now — the total that used to sit beside it
|
|
724
|
+
* is the Pay card's title — so this is the only thing that says what pressing it opens.
|
|
725
|
+
*/
|
|
726
|
+
readonly label: (total: string) => string;
|
|
727
|
+
/**
|
|
728
|
+
* WHAT THE TOTAL ABOVE IT INCLUDES — one sentence, true whether or not a clock is
|
|
729
|
+
* running, which is why neither cart screen chooses between two lines any more.
|
|
730
|
+
*
|
|
731
|
+
* IT REPLACED THE COUNTDOWN, which moved to the card the buyer pays from: the cart
|
|
732
|
+
* screen is where somebody checks what they are buying, and the clock belongs where
|
|
733
|
+
* they decide to pay for it. This is the only place that argument is made.
|
|
734
|
+
*/
|
|
735
|
+
readonly subtitle: "Includes all taxes and service fees.";
|
|
736
|
+
/**
|
|
737
|
+
* THE HOLD, IN WORDS — `3793:8723`. Drawn on the PAY card, over the hero's own ring:
|
|
738
|
+
* the card says the clock twice, and both are readings of one `EscrowHold`.
|
|
739
|
+
*
|
|
740
|
+
* See `CART_VIEW.subtitle` for why it is no longer said here.
|
|
741
|
+
*/
|
|
742
|
+
readonly remaining: (clock: string) => string;
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
declare interface CartItem {
|
|
746
|
+
Key: string;
|
|
747
|
+
Type: string;
|
|
748
|
+
Name?: string;
|
|
749
|
+
ItemId: number;
|
|
750
|
+
TotalAmount: number;
|
|
751
|
+
OrganisationAmount: number;
|
|
752
|
+
ScopeAmount: number;
|
|
753
|
+
BrokerAmount: number;
|
|
754
|
+
DiscountAmount: number;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* WHAT IS IN THE CART, as the cart screen draws it.
|
|
759
|
+
*
|
|
760
|
+
* ONE LINE PER PRODUCT, and the platform's own money on each. A cart holds one ITEM PER
|
|
761
|
+
* HEAD — `itemsFor` sends one per person and the platform answers with one per person —
|
|
762
|
+
* so three adult tickets are three items with a third of the money each. Nobody wants to
|
|
763
|
+
* read that; a line is what a buyer recognises as a thing they chose, and the count on
|
|
764
|
+
* its badge is how many of it they took.
|
|
765
|
+
*
|
|
766
|
+
* "Peak" IS THE PRODUCT AND "(Child)" IS THE USER TYPE, where one applies — so three Peak
|
|
767
|
+
* tickets bought for one adult and two children are TWO lines, not one. The wire does not
|
|
768
|
+
* say which is which: `CartItem` echoes a name and an amount and nothing about who the
|
|
769
|
+
* ticket is for, though the widget sent a `UserTypeAssignmentKey` on every one of them.
|
|
770
|
+
*
|
|
771
|
+
* SO IT IS READ BACK OFF THE REQUEST, where there was one — see `attributeCartItems`. A
|
|
772
|
+
* cart the widget did not open (a host's own, adopted) has no request to read, and its
|
|
773
|
+
* lines group by product alone until the host or the platform says more.
|
|
774
|
+
*/
|
|
775
|
+
|
|
776
|
+
/** One line of the cart. Everything a row draws, and nothing about how. */
|
|
777
|
+
export declare type CartLine = {
|
|
778
|
+
/** Stable across a re-price, so React keeps the row rather than replacing it. */
|
|
779
|
+
readonly key: string;
|
|
780
|
+
/** The product, as the platform names it — "Peak". */
|
|
781
|
+
readonly name: string;
|
|
782
|
+
/** Who the ticket is for — "Adult". Absent until the platform says. */
|
|
783
|
+
readonly userType?: string;
|
|
784
|
+
/** How many, drawn on the thumbnail's own badge. */
|
|
785
|
+
readonly count: number;
|
|
786
|
+
/** What the LINE comes to — every head of it, in minor units. */
|
|
787
|
+
readonly minorUnits: number;
|
|
788
|
+
/**
|
|
789
|
+
* THE EVENT'S OWN ARTWORK, under the ticket silhouette — the design's
|
|
790
|
+
* `AvatarImage-Event`. Absent, the avatar package draws its own fill rather than a gap,
|
|
791
|
+
* which is what a cart adopted from a host that names none gets.
|
|
792
|
+
*/
|
|
793
|
+
readonly artwork?: string;
|
|
794
|
+
/** The run these tickets are for — "Ice Rink". */
|
|
795
|
+
readonly subject?: string;
|
|
796
|
+
/** The session, already joined: `12:00 - 12:45`. */
|
|
797
|
+
readonly timeslot?: string;
|
|
798
|
+
/** The day, written out: "Saturday, 12 December". */
|
|
799
|
+
readonly day?: string;
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* What every line of a cart shares — the order it belongs to, said once.
|
|
804
|
+
*
|
|
805
|
+
* THE ARTWORK IS IN HERE and not on the item because a cart holds ONE event: every line
|
|
806
|
+
* of it is a ticket to the same thing, so the picture is the order's rather than the
|
|
807
|
+
* product's. A host that stocks per-product artwork says so by supplying `cartLines`
|
|
808
|
+
* itself, where each line carries its own.
|
|
809
|
+
*/
|
|
810
|
+
export declare type CartLineContext = {
|
|
811
|
+
readonly artwork?: string;
|
|
812
|
+
/**
|
|
813
|
+
* WHAT THE CART WAS FILLED WITH, as the PRODUCT names itself — "Peak".
|
|
814
|
+
*
|
|
815
|
+
* The cart's own items do not reliably echo it — `Name` is optional on the wire and `Type`
|
|
816
|
+
* is a category, not a product. Taken off the product for the same reason the currency is:
|
|
817
|
+
* it is a reading of what was bought, not of the receipt.
|
|
818
|
+
*/
|
|
819
|
+
readonly productName?: string;
|
|
820
|
+
readonly subject?: string;
|
|
821
|
+
readonly timeslot?: string;
|
|
822
|
+
readonly day?: string;
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* WHAT IS IN THE CART — the design's `ItemsInCart`, and the total under it.
|
|
827
|
+
*
|
|
828
|
+
* THE LINE AMOUNTS SHARE ONE COLUMN, as wide as the widest of them, so the symbols stack
|
|
829
|
+
* down the card instead of drifting with the digits. It is published as a COUNT of
|
|
830
|
+
* characters — see `widestAmount` — and spent as `ch` on the mono face, where a character
|
|
831
|
+
* is one advance: no element is measured, and adding a line that is a digit longer moves
|
|
832
|
+
* the whole column by exactly one.
|
|
833
|
+
*
|
|
834
|
+
* THE TOTAL IS IN NEITHER. `3795:8748` sets the whole of `€ 18.00` in `text/bold/lg` —
|
|
835
|
+
* Basier Square Medium 20/24 — where a line's own figure is `text/mono/md`. Drawn as one
|
|
836
|
+
* more row of the column it took a face the design never gives it, and sized that column to
|
|
837
|
+
* a figure sitting nowhere near it.
|
|
838
|
+
*/
|
|
839
|
+
export declare function CartLines({ lines, totalMinorUnits, currency, totalLabel }: CartLinesProps): react_jsx_runtime.JSX.Element;
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* The cart's items as lines: grouped by what they are AND who they are for, counted, and
|
|
843
|
+
* summed.
|
|
844
|
+
*
|
|
845
|
+
* THE USER TYPE IS PART OF THE GROUPING KEY, which is the whole of the design's reading:
|
|
846
|
+
* one adult and two children on the same product are two lines with a 1 and a 2 on them,
|
|
847
|
+
* and the money on each is what those heads came to.
|
|
848
|
+
*
|
|
849
|
+
* `Name`, THEN THE PRODUCT, THEN `Type` — most specific first. `Type` is a category
|
|
850
|
+
* ("Ticket") and is the last resort rather than the answer. Each only if it is not blank; see
|
|
851
|
+
* `firstNamed`.
|
|
852
|
+
*/
|
|
853
|
+
export declare function cartLines(items: readonly AttributedCartItem[], context?: CartLineContext): readonly CartLine[];
|
|
854
|
+
|
|
855
|
+
export declare type CartLinesProps = {
|
|
856
|
+
readonly lines: readonly CartLine[];
|
|
857
|
+
/** What the whole cart comes to, in minor units — the platform's own figure. */
|
|
858
|
+
readonly totalMinorUnits: number;
|
|
859
|
+
readonly currency: string;
|
|
860
|
+
/** The total row's label. This package's copy lives in `step-cards`. */
|
|
861
|
+
readonly totalLabel: string;
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* The cart screen as the PROPS that turn a card into it — the hero and its badge are the
|
|
866
|
+
* caller's, because the avatar is the buyer's and this file draws none.
|
|
867
|
+
*/
|
|
868
|
+
export declare function cartViewProps(input: ReactNode, hold: EscrowHold, onBack: () => void): {
|
|
869
|
+
variant: "cart";
|
|
870
|
+
expanded: boolean;
|
|
871
|
+
onToggle: () => void;
|
|
872
|
+
title: "My Cart";
|
|
873
|
+
subtitle: "Includes all taxes and service fees.";
|
|
874
|
+
actionLabel: string;
|
|
875
|
+
input: ReactNode;
|
|
876
|
+
actions: {
|
|
877
|
+
key: string;
|
|
878
|
+
role: "secondary";
|
|
879
|
+
label: "Back";
|
|
880
|
+
onPress: () => void;
|
|
881
|
+
}[];
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
/** The island, as the design draws it: a pill that becomes a card. */
|
|
885
|
+
export declare function CheckoutIsland({ expanded, contentKey, onToggle, avatar, title, subtitle, pillCopy, input, bay, bayVisible, bayRows, variant, sealed, closable, actionLabel, actions, footer, bayActions, dismiss, dismissIcon, dismissLabel, headerLead, headerTrail, mode, align, placement, journeyFullscreen, }: CheckoutIslandProps): react_jsx_runtime.JSX.Element;
|
|
886
|
+
|
|
887
|
+
export declare type CheckoutIslandProps = {
|
|
888
|
+
/** Collapsed is the pill; expanded is the card. */
|
|
889
|
+
readonly expanded: boolean;
|
|
890
|
+
/** WHICH CARD is showing, when "the card" is not specific enough. */
|
|
891
|
+
readonly contentKey?: string;
|
|
892
|
+
/** The pill's action opens it; the card's header button closes it. */
|
|
893
|
+
readonly onToggle: () => void;
|
|
894
|
+
/**
|
|
895
|
+
* The hero. This component supplies the SIZE the current state calls for — `$10` in the
|
|
896
|
+
* pill, 100 in the card — and the carry identity that moves it between them. It does
|
|
897
|
+
* NOT supply a shape.
|
|
898
|
+
*/
|
|
899
|
+
readonly avatar?: ReactNode;
|
|
900
|
+
/** `heading/lg` in the pill, `heading/xl` and centred in the card. */
|
|
901
|
+
/**
|
|
902
|
+
* The card's own title. A PICKER passes none: the entry step has already said at full
|
|
903
|
+
* size what is being asked for, so the card opens on the run. The pill's line is
|
|
904
|
+
* `IslandPillProps.title`, which is always drawn.
|
|
905
|
+
*/
|
|
906
|
+
readonly title?: ReactNode;
|
|
907
|
+
/** Above the title in the pill, below it in the card. */
|
|
908
|
+
readonly subtitle?: ReactNode;
|
|
909
|
+
/**
|
|
910
|
+
* THE PILL'S OWN TWO LINES, which are NOT the card's.
|
|
911
|
+
*
|
|
912
|
+
* They were, and it read as nonsense: a card's copy is written for a card, and the pill
|
|
913
|
+
* is one row that truncates — "Already Have An Account?" over "You may qualify for
|
|
914
|
+
* better pricing." came out as "Already Hav…" over "You may qual…", which says nothing
|
|
915
|
+
* and looks broken. The pill's job is to state the price and the way in, not to
|
|
916
|
+
* summarise the card behind it.
|
|
917
|
+
*
|
|
918
|
+
* ONE OBJECT, AND ITS PRESENCE IS THE DECISION. Supplying it means "the pill's copy is
|
|
919
|
+
* mine", and EMPTY FIELDS INSIDE IT MEAN THE PILL SAYS NOTHING — which is a real answer
|
|
920
|
+
* and the whole reason this is not two optional props. Two would have fallen back
|
|
921
|
+
* field-by-field, so a caller with no price would have been handed the card's title
|
|
922
|
+
* again, which is the thing being fixed.
|
|
923
|
+
*
|
|
924
|
+
* Omitting it entirely keeps the card's copy for both, so `CheckoutIsland` stays usable
|
|
925
|
+
* on its own by a caller with one thing to say.
|
|
926
|
+
*/
|
|
927
|
+
readonly pillCopy?: {
|
|
928
|
+
readonly title?: ReactNode;
|
|
929
|
+
readonly subtitle?: ReactNode;
|
|
930
|
+
};
|
|
931
|
+
/**
|
|
932
|
+
* The card's own controls, between the hero and the buttons. The pill has no
|
|
933
|
+
* counterpart — it is one row, and a collapsed island asking a question would be a
|
|
934
|
+
* card.
|
|
935
|
+
*/
|
|
936
|
+
readonly input?: ReactNode;
|
|
937
|
+
/** Persistent content outside the replaceable step planes. */
|
|
938
|
+
readonly bay?: ReactNode;
|
|
939
|
+
readonly bayVisible?: boolean;
|
|
940
|
+
/** How many entries the bay holds room for — see `IslandHostProps.bayRows`. */
|
|
941
|
+
readonly bayRows?: number;
|
|
942
|
+
/** Which card the expanded island is showing — see `IslandCardProps.variant`. */
|
|
943
|
+
readonly variant?: 'default' | 'hold' | 'cart';
|
|
944
|
+
/**
|
|
945
|
+
* NOTHING MAY BE PRESSED, HERE OR ANYWHERE ELSE ON THE PAGE — one state, two
|
|
946
|
+
* consequences, and they are the same sentence twice.
|
|
947
|
+
*
|
|
948
|
+
* The card loses its header, because the header IS the way out: a cross that cannot
|
|
949
|
+
* close and a trailing pill that opens a view the buyer must not leave for. And the page gets
|
|
950
|
+
* `IslandShield` over it, which answers a press with the island's own pop instead of
|
|
951
|
+
* ignoring it.
|
|
952
|
+
*
|
|
953
|
+
* `PurchaseStep.collapsed` is where this comes from — a step declaring `NONE` says
|
|
954
|
+
* "input is blocked entirely; there is no way out and nothing to collapse to".
|
|
955
|
+
*/
|
|
956
|
+
readonly sealed?: boolean;
|
|
957
|
+
/**
|
|
958
|
+
* WHETHER THE HEADER DRAWS A WAY OUT. Defaults to true.
|
|
959
|
+
*
|
|
960
|
+
* SEPARATE FROM `sealed`, and it has to be. `sealed` is "no header at all, and the
|
|
961
|
+
* host's page is held" — right while money moves, and wrong everywhere else, because the
|
|
962
|
+
* header is not only the cross: it carries the compose funnel before there is a cart and
|
|
963
|
+
* the cart-and-promo pill after, and a card that cannot be left still has both.
|
|
964
|
+
*/
|
|
965
|
+
readonly closable?: boolean;
|
|
966
|
+
/** The pill's action. */
|
|
967
|
+
readonly actionLabel: ReactNode;
|
|
968
|
+
/**
|
|
969
|
+
* THE BUTTONS, SPLIT BY THE BAY. `actions` is what the card plane draws; when the
|
|
970
|
+
* payment form is visible its card rides the form in the bay, and the card that acts
|
|
971
|
+
* on the field — Confirm, Try Again — belongs BENEATH it, not above it. `bayActions`
|
|
972
|
+
* draws there (same `CardAction`, same press); `actions` keeps only what stays
|
|
973
|
+
* upstairs, which with the form showing is nothing.
|
|
974
|
+
*/
|
|
975
|
+
readonly actions: readonly IslandAction[];
|
|
976
|
+
/** A control of the card's own shape where the buttons go — see `IslandCardProps.footer`. */
|
|
977
|
+
readonly footer?: ReactNode;
|
|
978
|
+
readonly bayActions?: readonly IslandAction[];
|
|
979
|
+
/**
|
|
980
|
+
* Whether the card's header button steps BACK or closes the island. Drives the glyph,
|
|
981
|
+
* which is the only thing telling a buyer which it is.
|
|
982
|
+
*/
|
|
983
|
+
readonly dismiss?: 'back' | 'close';
|
|
984
|
+
readonly dismissIcon?: ReactNode;
|
|
985
|
+
readonly dismissLabel?: string;
|
|
986
|
+
/** A second pill beside the card's way out — see `IslandCardProps.headerLead`. */
|
|
987
|
+
readonly headerLead?: ReactNode;
|
|
988
|
+
/** A pill at the OTHER end — the compose funnel, or the commit pill. See `IslandHeaderProps`. */
|
|
989
|
+
readonly headerTrail?: ReactNode;
|
|
990
|
+
/** Which appearance to render. Defaults to following the viewer's OS. */
|
|
991
|
+
readonly mode?: IslandMode;
|
|
992
|
+
/**
|
|
993
|
+
* Where the island sits. The vertical half is which way it grows — away from its edge,
|
|
994
|
+
* or both ways at once from the middle — and the horizontal half is which side of a
|
|
995
|
+
* reservation wider than the card it docks to. Defaults to `bottom`.
|
|
996
|
+
*/
|
|
997
|
+
readonly align?: IslandAlignment;
|
|
998
|
+
/** Where the reservation is held — see `IslandPlacement`. Defaults to `page`. */
|
|
999
|
+
readonly placement?: IslandPlacement;
|
|
1000
|
+
/**
|
|
1001
|
+
* THE PROVIDER'S FULLSCREEN JOURNEY IS OVER EVERYTHING, and stamping the root lets
|
|
1002
|
+
* the CSS both lift the journey over the host page and lift the centred island's
|
|
1003
|
+
* own transform out of the way of it. See `IslandSurfaceProps.journeyFullscreen`.
|
|
1004
|
+
*/
|
|
1005
|
+
readonly journeyFullscreen?: boolean;
|
|
1006
|
+
};
|
|
1007
|
+
|
|
1008
|
+
export declare type CheckoutProps = {
|
|
1009
|
+
/**
|
|
1010
|
+
* WHICH IMPLEMENTATION IS ASKING. Held rather than read here: the data layer
|
|
1011
|
+
* authenticates with it, and a widget that drew a card without one would be drawing
|
|
1012
|
+
* somebody's checkout with no idea whose.
|
|
1013
|
+
*/
|
|
1014
|
+
readonly appKey: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* WHICH PLATFORM, and nothing else — the app key above is what authenticates. Optional
|
|
1017
|
+
* in every field: absent means production.
|
|
1018
|
+
*
|
|
1019
|
+
* THIS IS WHAT `appKey` WAS ALWAYS FOR. The prop above has said since the first commit
|
|
1020
|
+
* that the data layer authenticates with it, and there was no data layer — every fact
|
|
1021
|
+
* arrived as a prop, which is right for a host already holding them and wrong for the
|
|
1022
|
+
* case this widget exists to serve: an implementation that will not engage with the SDK,
|
|
1023
|
+
* drops the island onto a page and expects it to work.
|
|
1024
|
+
*
|
|
1025
|
+
* WHAT A HOST PASSES STILL WINS. `schedule` and `userTypes` are checked first, so a host
|
|
1026
|
+
* with its own calendar keeps it and nothing is fetched twice.
|
|
1027
|
+
*/
|
|
1028
|
+
readonly source?: CheckoutSource;
|
|
1029
|
+
/**
|
|
1030
|
+
* WHAT THE HOST ALREADY KNOWS ABOUT THE ORDER. Partial is the normal case.
|
|
1031
|
+
*
|
|
1032
|
+
* ABSENT IS A MOUNT WITH NO ORDER AT ALL, which is a different thing from a partial one
|
|
1033
|
+
* — and it is why the absence is modelled HERE rather than by making `OrderSubject`
|
|
1034
|
+
* optional a level down. An intent with no subject is not an order half-composed; it is
|
|
1035
|
+
* nothing to sell, which is what that field's own note says and which stays true.
|
|
1036
|
+
*
|
|
1037
|
+
* The island then draws the `IDLE` checkpoint and nothing else: no walk, no steps, no
|
|
1038
|
+
* cart and nothing fetched. That is what a host mounts on a page which is not selling
|
|
1039
|
+
* anything — a header, a landing page, an account corner — and it hands in an intent the
|
|
1040
|
+
* moment there is something to buy.
|
|
1041
|
+
*/
|
|
1042
|
+
readonly intent?: OrderIntent;
|
|
1043
|
+
/**
|
|
1044
|
+
* The user types the event offers, for the party step. Empty draws the single
|
|
1045
|
+
* unnamed line, which is what an event with no discount types wants.
|
|
1046
|
+
*/
|
|
1047
|
+
readonly userTypes?: readonly PartyUserTypeOption[];
|
|
1048
|
+
/** The ticket's ceiling, across the whole party. */
|
|
1049
|
+
readonly maxParty?: number;
|
|
1050
|
+
/**
|
|
1051
|
+
* A CART THE HOST ALREADY OPENED — adopted, never duplicated.
|
|
1052
|
+
*
|
|
1053
|
+
* A host that composes the order itself holds a cart before this widget mounts: it made
|
|
1054
|
+
* one to price the order and to hold the stock. Without this the widget opened a SECOND
|
|
1055
|
+
* for the same purchase, so the items went in twice, the payment settled against the
|
|
1056
|
+
* widget's, and the host's went on holding stock nobody would ever buy.
|
|
1057
|
+
*
|
|
1058
|
+
* Given a key the cart is READ and never created or filled — what is in it is the
|
|
1059
|
+
* host's statement, not this widget's guess.
|
|
1060
|
+
*/
|
|
1061
|
+
readonly cart?: {
|
|
1062
|
+
readonly key: string;
|
|
1063
|
+
};
|
|
1064
|
+
/**
|
|
1065
|
+
* WHAT IS ON SALE AND WHEN — everything the day and time pickers draw from.
|
|
1066
|
+
*
|
|
1067
|
+
* REQUIRED BY A HOST THAT DEFERS THOSE STEPS, and there is no way around it: the widget
|
|
1068
|
+
* owns the calendar's LAYOUT and none of its CONTENT. Which days a run touches, which
|
|
1069
|
+
* slots a day holds and what the venue's clock says are all the platform's, and the
|
|
1070
|
+
* widget has no data layer to ask.
|
|
1071
|
+
*
|
|
1072
|
+
* Absent, the pickers cannot be drawn — and the steps then GATE rather than pass. See
|
|
1073
|
+
* `stepAnswered`: a card that cannot collect its answer must not let a buyer past it,
|
|
1074
|
+
* or the order goes out without the day it was supposed to carry.
|
|
1075
|
+
*/
|
|
1076
|
+
readonly schedule?: CheckoutSchedule;
|
|
1077
|
+
/**
|
|
1078
|
+
* THE STOCK PHOTOS THE PROFILE PHOTO STEP OFFERS, in the order the grid draws them.
|
|
1079
|
+
*
|
|
1080
|
+
* AN OVERRIDE, NOT A REQUIREMENT — `defaultProfilePhotos` is the platform's own set and
|
|
1081
|
+
* is what this falls back to. It was required once, on the reading that the faces are
|
|
1082
|
+
* content the widget has nowhere to fetch; but the ids are not the host's to choose
|
|
1083
|
+
* (see `ProfilePhoto`), so every integration was being asked to copy the same constant
|
|
1084
|
+
* and none of them did. The step was dark everywhere, and so was a returning buyer's
|
|
1085
|
+
* stored face, which resolves through the same set — see `avatarAssetsFor`.
|
|
1086
|
+
*
|
|
1087
|
+
* PASSED EMPTY, THE STEP IS STILL EXCUSED. A host that genuinely has no faces to offer
|
|
1088
|
+
* says so with `[]`, and an account can be made without a photo: a card asking for one
|
|
1089
|
+
* it cannot offer is worse than no card at all.
|
|
1090
|
+
*/
|
|
1091
|
+
readonly profilePhotos?: readonly ProfilePhoto[];
|
|
1092
|
+
/**
|
|
1093
|
+
* WHAT IS IN THE CART, for the screen the header's summary opens.
|
|
1094
|
+
*
|
|
1095
|
+
* Derived from the cart itself where the widget opened one — see `cartLines`, which
|
|
1096
|
+
* groups the platform's own items and money into rows a buyer recognises. A host that
|
|
1097
|
+
* knows better says so here: it may hold the user-type split, or artwork, or a line the
|
|
1098
|
+
* cart cannot describe.
|
|
1099
|
+
*/
|
|
1100
|
+
readonly cartLines?: readonly CartLine[];
|
|
1101
|
+
/**
|
|
1102
|
+
* WHO THE BUYER IS WHEN THE WIDGET MOUNTS, and nothing after that.
|
|
1103
|
+
*
|
|
1104
|
+
* A SEED AND NOT A CONTROL. It is read once, into the widget's own store, because the
|
|
1105
|
+
* widget is the only thing that knows whether a passkey ceremony finished or a call was
|
|
1106
|
+
* refused — a prop that could overwrite that would be a second authority over the one
|
|
1107
|
+
* thing that must have exactly one. See `useAuthSession`.
|
|
1108
|
+
*/
|
|
1109
|
+
readonly session?: AuthSession;
|
|
1110
|
+
/** What is owed, as the pill and the commitment button say it. */
|
|
1111
|
+
readonly quote?: Quote;
|
|
1112
|
+
/** The reservation, once there is an order to hold. */
|
|
1113
|
+
readonly hold?: EscrowHold;
|
|
1114
|
+
/**
|
|
1115
|
+
* WHAT THE PAYMENT DID, once it has been attempted. Absent until it has.
|
|
1116
|
+
*
|
|
1117
|
+
* A HOST SAYS SO because nothing here can know. There is no payment integration, and
|
|
1118
|
+
* the widget must not invent one — so both cards are built and the event that reaches
|
|
1119
|
+
* them comes from outside, exactly as `hold` and `quote` do. When payments are wired
|
|
1120
|
+
* this becomes something the widget observes rather than is told.
|
|
1121
|
+
*
|
|
1122
|
+
* ONE PROP FOR BOTH OUTCOMES, and that is the point of it. Processing draws no buttons
|
|
1123
|
+
* — there is nothing for a buyer to press while money moves — so NEITHER outcome is
|
|
1124
|
+
* reachable from inside the flow, and a host told to report only failures would have
|
|
1125
|
+
* had no way to say a payment worked.
|
|
1126
|
+
*/
|
|
1127
|
+
readonly payment?: PaymentOutcome;
|
|
1128
|
+
/**
|
|
1129
|
+
* RUN THE ACCOUNT SUB-FLOW AGAINST A DOUBLE, and nothing else. This once stood in for
|
|
1130
|
+
* the payment too; payments are real now, and an outcome a caller wants to state is
|
|
1131
|
+
* `payment` above. What is left is the account: eight calls the platform does not
|
|
1132
|
+
* answer yet, so without this the sub-flow has nothing to run against. See
|
|
1133
|
+
* `simulatedAccountGateway`.
|
|
1134
|
+
*/
|
|
1135
|
+
readonly simulate?: boolean;
|
|
1136
|
+
/** Called with the completed intent when the last step is answered. */
|
|
1137
|
+
readonly onCommit?: (intent: OrderIntent) => void;
|
|
1138
|
+
/**
|
|
1139
|
+
* WHICH STATE THE HOST'S PAGE LOADS ON — the pill, or the card already open.
|
|
1140
|
+
*
|
|
1141
|
+
* The state, not the only state: the island collapses and expands either way, and a
|
|
1142
|
+
* buyer who closes the card gets the pill back whichever this says. It names the
|
|
1143
|
+
* OPENING position, which is a page-layout decision and therefore the host's — a
|
|
1144
|
+
* dedicated checkout route wants the card standing open, a product page under a
|
|
1145
|
+
* "Get Tickets" button wants the pill until it is asked for.
|
|
1146
|
+
*/
|
|
1147
|
+
/**
|
|
1148
|
+
* WHICH FACE THE ISLAND RESTS ON — the purchase, or the cart the host is still filling.
|
|
1149
|
+
*
|
|
1150
|
+
* `flow` is the default and is what every host has had: the widget opens on the first
|
|
1151
|
+
* step the intent has not answered, and a host that preloaded the whole order opens on
|
|
1152
|
+
* Order Review.
|
|
1153
|
+
*
|
|
1154
|
+
* `cart` is for a host that is STILL COMPOSING — the SDK has put a product in a cart and
|
|
1155
|
+
* the buyer may add more. The island draws the cart instead of a step, follows it as it
|
|
1156
|
+
* changes, and hands over to the flow when Check Out is pressed. It is a prop rather
|
|
1157
|
+
* than something derived from `cart` being present, because a host resuming a purchase
|
|
1158
|
+
* across pages passes a cart on every page and means the opposite by it — see the
|
|
1159
|
+
* multi-page guide.
|
|
1160
|
+
*
|
|
1161
|
+
* A SIBLING OF `initialPresentation` AND NOT A REPLACEMENT: that one says pill or card,
|
|
1162
|
+
* this one says which card. Both are page-layout decisions and therefore the host's.
|
|
1163
|
+
*/
|
|
1164
|
+
readonly opensOn?: 'flow' | 'cart';
|
|
1165
|
+
readonly initialPresentation?: 'pill' | 'card';
|
|
1166
|
+
/**
|
|
1167
|
+
* WHAT THE OPENING PILL SAYS, where the host's page has its own word for it — "Book Santo
|
|
1168
|
+
* Panto" on a page selling one show. Absent, or blank, is `OPENING_LABEL`.
|
|
1169
|
+
*
|
|
1170
|
+
* THE ONE PIECE OF COPY A HOST MAY SUPPLY, and only this one: it names what is on sale,
|
|
1171
|
+
* which the page knows and the widget does not. Every later pill names the step behind
|
|
1172
|
+
* it, and those stay the widget's own.
|
|
1173
|
+
*/
|
|
1174
|
+
readonly openingLabel?: string;
|
|
1175
|
+
readonly mode?: IslandMode;
|
|
1176
|
+
/**
|
|
1177
|
+
* Where in its reservation the island sits — a corner, the middle of an edge, or the
|
|
1178
|
+
* middle. Defaults to `bottom`.
|
|
1179
|
+
*
|
|
1180
|
+
* THE RESERVATION IS THE SAME EVERY WAY: the host's page has the island's COLLAPSED
|
|
1181
|
+
* footprint held open for it, and an opened card grows out of that — upward from any
|
|
1182
|
+
* `bottom` alignment, downward from any `top` one, and both ways at once from `left`,
|
|
1183
|
+
* `center` and `right`, which therefore need room above AND below.
|
|
1184
|
+
*
|
|
1185
|
+
* LEFT AND RIGHT ONLY SHOW IN A RESERVATION WIDER THAN THE CARD, whose measure is capped
|
|
1186
|
+
* at `$100`. In a narrower one the island fills it, and every horizontal choice draws
|
|
1187
|
+
* the same. See `island.css`'s alignment blocks.
|
|
1188
|
+
*/
|
|
1189
|
+
readonly align?: IslandAlignment;
|
|
1190
|
+
/**
|
|
1191
|
+
* WHERE THE RESERVATION ITSELF IS HELD. Defaults to `page`.
|
|
1192
|
+
*
|
|
1193
|
+
* `page` holds it in the host's flow, wherever the widget was mounted, and `align` places
|
|
1194
|
+
* the island inside that box. `screen` pins the box to the viewport, so `align` names a
|
|
1195
|
+
* corner of the SCREEN — a floating widget, with no fixed-position wrapper of the host's
|
|
1196
|
+
* own to keep in step with it.
|
|
1197
|
+
*
|
|
1198
|
+
* A TRANSFORMED ANCESTOR STILL WINS: a `transform`, `filter` or `contain` anywhere above
|
|
1199
|
+
* the widget makes that ancestor the containing block of anything fixed, and a pinned
|
|
1200
|
+
* island then sits in it instead of on the screen. Mount a pinned widget at the end of
|
|
1201
|
+
* `<body>`, out of reach of the page's own wrappers.
|
|
1202
|
+
*/
|
|
1203
|
+
readonly placement?: IslandPlacement;
|
|
1204
|
+
};
|
|
1205
|
+
|
|
1206
|
+
export declare type CheckoutSchedule = {
|
|
1207
|
+
/** The run being picked from. Every month it touches is drawn. */
|
|
1208
|
+
readonly series: CalendarSeries;
|
|
1209
|
+
/** `YYYY-MM-DD` on the venue's calendar. */
|
|
1210
|
+
readonly today: string;
|
|
1211
|
+
/** `HH:MM` on the venue's clock — see `timeOfDayInZone`. */
|
|
1212
|
+
readonly nowTime: string;
|
|
1213
|
+
/** One ticket's slots, by `YYYY-MM-DD`. A day with none simply offers none. */
|
|
1214
|
+
readonly slotsByDay?: Readonly<Record<string, readonly Timeslot[]>>;
|
|
1215
|
+
/** Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD`. */
|
|
1216
|
+
readonly remaining?: Readonly<Record<string, number>>;
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* THE WIDGET'S OWN DATA LAYER — what `appKey` is for.
|
|
1221
|
+
*
|
|
1222
|
+
* `CheckoutProps.appKey` has said since the first commit that "the data layer
|
|
1223
|
+
* authenticates with it", and the body read `void appKey`. Everything the widget needed
|
|
1224
|
+
* arrived as a prop instead, which is fine for a host already holding it and wrong for
|
|
1225
|
+
* the case this widget exists to serve: an implementation that cannot or will not engage
|
|
1226
|
+
* with the SDK, drops the island onto a page and expects it to work.
|
|
1227
|
+
*
|
|
1228
|
+
* ── WHAT IT REPLACES ─────────────────────────────────────────────────────────
|
|
1229
|
+
*
|
|
1230
|
+
* `schedule` and `userTypes` were props a host had to fetch and shape. They still are:
|
|
1231
|
+
* a host that already holds them passes them and this never runs. Absent, the widget
|
|
1232
|
+
* fetches them itself.
|
|
1233
|
+
*
|
|
1234
|
+
* ONE CALL ANSWERS BOTH. `getSeriesInfo` returns the run's events AND its user types, so
|
|
1235
|
+
* the calendar and the party stepper come from the same request — which is also why they
|
|
1236
|
+
* are fetched together here rather than by two hooks that would each have to know the key.
|
|
1237
|
+
*
|
|
1238
|
+
* ── WHY A HOOK AND NOT A PROVIDER ────────────────────────────────────────────
|
|
1239
|
+
*
|
|
1240
|
+
* The SDK reaches its client through `ScopeProvider`, and a widget that required one
|
|
1241
|
+
* would be asking for exactly the engagement it is meant to avoid. So the client is built
|
|
1242
|
+
* from the props the widget already takes, and a host that HAS a provider is unaffected —
|
|
1243
|
+
* it passes the data and this stays asleep.
|
|
1244
|
+
*/
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* WHERE TO REACH THE PLATFORM. Every field optional, because `appKey` is the only thing
|
|
1248
|
+
* actually required — it is the Bearer token, and it is what `CheckoutProps.appKey` has
|
|
1249
|
+
* always said it was.
|
|
1250
|
+
*
|
|
1251
|
+
* IT USED TO DEMAND AN `orgKey` AND THAT WAS THE BUG. Nothing the widget calls uses one:
|
|
1252
|
+
* it appears in exactly one endpoint on the whole client, the deprecated v1
|
|
1253
|
+
* `getEvents`. Requiring it meant a host passing only its app key got no client, so
|
|
1254
|
+
* nothing was fetched — no user types, no sessions, and no error either, because a
|
|
1255
|
+
* request that is never made cannot fail.
|
|
1256
|
+
*/
|
|
1257
|
+
declare type CheckoutSource = {
|
|
1258
|
+
/** Which platform to talk to. Defaults to `production`. */
|
|
1259
|
+
readonly environment?: Environment;
|
|
1260
|
+
/** Only the deprecated v1 event list needs one; nothing this widget calls does. */
|
|
1261
|
+
readonly orgKey?: string;
|
|
1262
|
+
};
|
|
1263
|
+
|
|
1264
|
+
export declare function ContentFlag({ tone, title }: ContentFlagProps): react_jsx_runtime.JSX.Element;
|
|
1265
|
+
|
|
1266
|
+
export declare type ContentFlagProps = {
|
|
1267
|
+
readonly tone: ContentFlagTone;
|
|
1268
|
+
/**
|
|
1269
|
+
* An accessible name. Omitted, the mark is decorative and hidden — which is right
|
|
1270
|
+
* wherever the field's own text already says what is wrong, and wrong where the mark is
|
|
1271
|
+
* the only thing saying it.
|
|
1272
|
+
*/
|
|
1273
|
+
readonly title?: string;
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* What a field says about its own contents — Figma's `ContentFlagIcon`, the 16px mark
|
|
1278
|
+
* at the trailing end of an `InputTextShort`.
|
|
1279
|
+
*/
|
|
1280
|
+
export declare type ContentFlagTone = 'success' | 'warning' | 'error';
|
|
1281
|
+
|
|
1282
|
+
export declare function CountdownTimer({ remaining, size, appearance, track, color, title, className, style, }: CountdownTimerProps): react_jsx_runtime.JSX.Element;
|
|
1283
|
+
|
|
1284
|
+
/** A countdown, as a ring that drains and a hand that sweeps. */
|
|
1285
|
+
export declare type CountdownTimerProps = {
|
|
1286
|
+
/**
|
|
1287
|
+
* How much of the clock is left, 0..1 — a FRACTION, never seconds. The indicator has no
|
|
1288
|
+
* idea how long the timer is and does not need one: 100% is the hand at 12 whether that
|
|
1289
|
+
* is ten minutes or ten seconds.
|
|
1290
|
+
*/
|
|
1291
|
+
readonly remaining: number;
|
|
1292
|
+
/** The size of the 1:1 box. Any CSS length; a number is taken as px. */
|
|
1293
|
+
readonly size?: number | string;
|
|
1294
|
+
/**
|
|
1295
|
+
* `solid` — the glyph fill, and what every timer in the island draws today. `metal` —
|
|
1296
|
+
* the set's own treatment. Both are the package's; neither is described here.
|
|
1297
|
+
*/
|
|
1298
|
+
readonly appearance?: IconAppearance;
|
|
1299
|
+
/** Draw the groove the ring runs in. Default `true`. */
|
|
1300
|
+
readonly track?: boolean;
|
|
1301
|
+
/**
|
|
1302
|
+
* Override the fill. Omit and it takes `--scopetickets-icon-solid-fill` like every
|
|
1303
|
+
* glyph, which is what almost every caller wants — the ring and the hand then match the
|
|
1304
|
+
* icons beside them rather than the text.
|
|
1305
|
+
*/
|
|
1306
|
+
readonly color?: string;
|
|
1307
|
+
/**
|
|
1308
|
+
* An accessible name. Omit — as most callers should — and this is hidden from assistive
|
|
1309
|
+
* technology rather than announced as an unlabelled graphic.
|
|
1310
|
+
*/
|
|
1311
|
+
readonly title?: string;
|
|
1312
|
+
readonly className?: string;
|
|
1313
|
+
readonly style?: CSSProperties;
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
/** A progress ring — Figma's `StepCompletionProgressRing`. */
|
|
1317
|
+
export declare function CounterRing({ progress, complete, size, title, color, trackColor, direction, track, }: CounterRingProps): react_jsx_runtime.JSX.Element;
|
|
1318
|
+
|
|
1319
|
+
export declare type CounterRingProps = {
|
|
1320
|
+
/**
|
|
1321
|
+
* How full the ring is, 0..1. Out-of-range values are clamped by the geometry, because
|
|
1322
|
+
* a caller's `count / target` goes out of range in normal use — a confirm field can
|
|
1323
|
+
* hold more than the password above it.
|
|
1324
|
+
*
|
|
1325
|
+
* IT MAY FALL AS READILY AS IT RISES. The arc is a function of this number and of
|
|
1326
|
+
* nothing else — no last value is kept anywhere — so a ring counting TOWARDS a target
|
|
1327
|
+
* and one counting what is LEFT are the same component handed different numbers.
|
|
1328
|
+
*/
|
|
1329
|
+
readonly progress: number;
|
|
1330
|
+
/**
|
|
1331
|
+
* What the ring BECOMES once it is full, or absent while it is still filling. Present,
|
|
1332
|
+
* the ring gives way to this mark entirely.
|
|
1333
|
+
*/
|
|
1334
|
+
readonly complete?: ContentFlagTone;
|
|
1335
|
+
/**
|
|
1336
|
+
* The size of the 1:1 box. Any CSS length; a number is taken as px. Default `1em`, so
|
|
1337
|
+
* it scales with the row it sits in — `CountdownTimer`'s contract.
|
|
1338
|
+
*/
|
|
1339
|
+
readonly size?: number | string;
|
|
1340
|
+
readonly title?: string;
|
|
1341
|
+
/**
|
|
1342
|
+
* THE ARC'S COLOUR. Any CSS colour, including a `var()` or a `color-mix()` — the value
|
|
1343
|
+
* is handed to `IconGlyph` as a fill and this component does not read it.
|
|
1344
|
+
*
|
|
1345
|
+
* Default is the counter's own token. A caller states one where the ring MEANS
|
|
1346
|
+
* something the counter does not: the timeslot's ring runs a green-to-red ramp,
|
|
1347
|
+
* because there a filling ring and a draining one are different news.
|
|
1348
|
+
*/
|
|
1349
|
+
readonly color?: string;
|
|
1350
|
+
/** The groove's colour, on the same terms. Ignored when `track` is off. */
|
|
1351
|
+
readonly trackColor?: string;
|
|
1352
|
+
/**
|
|
1353
|
+
* WHICH WAY ROUND THE ARC GROWS from 12 o'clock. Default `cw`, the clock's own sense
|
|
1354
|
+
* and the design's.
|
|
1355
|
+
*/
|
|
1356
|
+
readonly direction?: RingDirection;
|
|
1357
|
+
/**
|
|
1358
|
+
* THE GROOVE BEHIND THE ARC. Default on.
|
|
1359
|
+
*
|
|
1360
|
+
* It is what makes 0% read as EMPTY rather than as absent: with no track, a ring with
|
|
1361
|
+
* nothing in it is nothing at all, and a row of them is a row of gaps. Turn it off
|
|
1362
|
+
* where something else already draws the whole — an arc on a ground that is itself the
|
|
1363
|
+
* track — and never merely because it looks quieter.
|
|
1364
|
+
*/
|
|
1365
|
+
readonly track?: boolean;
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* What a date-picker cell shows BENEATH its own label — a day beneath its number, a
|
|
1370
|
+
* timeslot beneath its time..
|
|
1371
|
+
*/
|
|
1372
|
+
export declare type DatePickerCellAccessory = 'NONE' | 'LINE';
|
|
1373
|
+
|
|
1374
|
+
/** Select Day — the day picker's content. */
|
|
1375
|
+
export declare function DayPicker({ series, today, selectedDay, onSelectDay, remaining, accessory, onVisibleMonthChange, }: DayPickerProps): react_jsx_runtime.JSX.Element | null;
|
|
1376
|
+
|
|
1377
|
+
export declare type DayPickerProps = {
|
|
1378
|
+
/** The run being picked from. Every month it touches is drawn. */
|
|
1379
|
+
readonly series: CalendarSeries;
|
|
1380
|
+
/**
|
|
1381
|
+
* `YYYY-MM-DD` in the VENUE's local day, never the device's. Passed in rather than read
|
|
1382
|
+
* from a clock — see `MonthGridOptions`.
|
|
1383
|
+
*/
|
|
1384
|
+
readonly today: string;
|
|
1385
|
+
readonly selectedDay: string | null;
|
|
1386
|
+
readonly onSelectDay: (day: string) => void;
|
|
1387
|
+
/** Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD`. */
|
|
1388
|
+
readonly remaining?: Readonly<Record<string, number>>;
|
|
1389
|
+
/**
|
|
1390
|
+
* Defaults to the variant both pickers draw. A prop only so a host can turn the line
|
|
1391
|
+
* off; there is no per-cell answer.
|
|
1392
|
+
*/
|
|
1393
|
+
readonly accessory?: DatePickerCellAccessory;
|
|
1394
|
+
/**
|
|
1395
|
+
* The month CURRENTLY IN VIEW, reported as it changes — including once on mount,
|
|
1396
|
+
* because the picker opens on a month the host did not choose (see
|
|
1397
|
+
* `soonestRelevantDay`).
|
|
1398
|
+
*/
|
|
1399
|
+
readonly onVisibleMonthChange?: (month: CalendarMonthKey) => void;
|
|
1400
|
+
};
|
|
1401
|
+
|
|
1402
|
+
/** The stock set as the picker and the hero both need it, for the configured platform. */
|
|
1403
|
+
export declare function defaultProfilePhotos(environment?: Environment, size?: ProfilePhotoSize): ProfilePhoto[];
|
|
1404
|
+
|
|
1405
|
+
/** The record with the caller's own facts folded in — see the top of this file. */
|
|
1406
|
+
export declare function dressBooking(record: BookingRecord, occasion: BookingOccasion, attribution?: TicketAttribution): Booking;
|
|
1407
|
+
|
|
1408
|
+
/** "Email Address" — the design. CONTROLLED the same way Name is; see there. */
|
|
1409
|
+
export declare function EmailStep({ value, onChange, onAnsweredChange, }: AnswerReporting & {
|
|
1410
|
+
readonly value?: string;
|
|
1411
|
+
readonly onChange?: (email: string) => void;
|
|
1412
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1413
|
+
|
|
1414
|
+
/** @internal */
|
|
1415
|
+
declare type Environment = 'sandbox' | 'production' | 'internal';
|
|
1416
|
+
|
|
1417
|
+
export declare type EscrowHold = {
|
|
1418
|
+
/**
|
|
1419
|
+
* Seconds left on the hold. May be negative — a countdown past its deadline is the
|
|
1420
|
+
* ordinary case, not an error, and both readings below floor at zero.
|
|
1421
|
+
*/
|
|
1422
|
+
readonly secondsLeft: number;
|
|
1423
|
+
/** The whole window, in seconds, which is what makes the ring a FRACTION. */
|
|
1424
|
+
readonly durationSeconds: number;
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1427
|
+
/** @internal */
|
|
1428
|
+
declare interface EventTimeslot {
|
|
1429
|
+
LocalStartTime: string;
|
|
1430
|
+
LocalEndTime: string;
|
|
1431
|
+
Total: number;
|
|
1432
|
+
Remaining: number;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
/**
|
|
1436
|
+
* WHICH STEPS THE HOST HAS ALREADY ANSWERED, which is the whole bridge between an intent
|
|
1437
|
+
* and a flow: `FlowSituation.excused` takes exactly this, and the walk does the rest.
|
|
1438
|
+
*
|
|
1439
|
+
* A step is excused when the intent HOLDS its answer, never when the answer merely could
|
|
1440
|
+
* be derived. The difference matters at DATE: an event subject settles the day by being
|
|
1441
|
+
* an event, and a series with a day in hand settles it by having been asked already.
|
|
1442
|
+
*
|
|
1443
|
+
* NOT INCLUDED, DELIBERATELY: `SIGN_IN`, `REVIEW`, `PROCESSING`, `CREATE_ACCOUNT`,
|
|
1444
|
+
* `PASSWORD` and `FOLLOW`. A host cannot answer those on the buyer's behalf — they are
|
|
1445
|
+
* the buyer's own, or the platform's, and an intent that claimed them would be claiming
|
|
1446
|
+
* something it cannot know.
|
|
1447
|
+
*/
|
|
1448
|
+
export declare function excusedByIntent(intent: OrderIntent): readonly PurchaseStepId[];
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* FIVE STARS, AND THE RANGE IS THE DESIGN'S RATHER THAN THE PLATFORM'S.
|
|
1452
|
+
*
|
|
1453
|
+
* `POST /api/Feedback` types `Rating` as a bare `int32` and states no range at all, so
|
|
1454
|
+
* the wire would take 7 or -1 as readily as 4. The only authority on what a rating MEANS
|
|
1455
|
+
* is the card, which draws five stars — so the range is stated here, once, and
|
|
1456
|
+
* `isFeedbackRating` is what stops anything else reaching the wire.
|
|
1457
|
+
*/
|
|
1458
|
+
export declare const FEEDBACK_STARS = 5;
|
|
1459
|
+
|
|
1460
|
+
/** One through five, as the card's stars are counted. */
|
|
1461
|
+
export declare type FeedbackRating = 1 | 2 | 3 | 4 | 5;
|
|
1462
|
+
|
|
1463
|
+
/**
|
|
1464
|
+
* THE WHOLE RULE.
|
|
1465
|
+
*
|
|
1466
|
+
* `available` is the room the parent offers ACROSS. `header` is what stands above the code
|
|
1467
|
+
* inside the centre, measured — the ticketholder's row and the booking's, with the seam
|
|
1468
|
+
* between them. Everything else follows.
|
|
1469
|
+
*
|
|
1470
|
+
* Reading the offered width as the RUN's budget rather than the FRAME's is the tempting
|
|
1471
|
+
* mistake, and it happens to agree at the size the design was drawn at — which is exactly
|
|
1472
|
+
* why it would survive a review against the design, and why the tests sweep scales and
|
|
1473
|
+
* widths instead of pinning the one.
|
|
1474
|
+
*/
|
|
1475
|
+
export declare function fitTicketEdge(available: number, header: number, tokens: TicketEdgeTokens): TicketEdgeFit;
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* Somebody behind the event, offered for subscription, reduced to what the row draws.
|
|
1479
|
+
*/
|
|
1480
|
+
export declare type FollowEntity = {
|
|
1481
|
+
readonly key: string;
|
|
1482
|
+
readonly name: string;
|
|
1483
|
+
/** What kind of entity this is, in words. Drawn under the name. */
|
|
1484
|
+
readonly kind: string;
|
|
1485
|
+
/** The entity's own artwork, or absent. */
|
|
1486
|
+
readonly artwork?: ReactNode;
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1489
|
+
/** The Follow Prompt's list — the design. */
|
|
1490
|
+
export declare function FollowList({ entities, selectedKeys, onToggle }: FollowListProps): react_jsx_runtime.JSX.Element;
|
|
1491
|
+
|
|
1492
|
+
export declare type FollowListProps = {
|
|
1493
|
+
readonly entities: readonly FollowEntity[];
|
|
1494
|
+
readonly selectedKeys: readonly string[];
|
|
1495
|
+
readonly onToggle: (key: string) => void;
|
|
1496
|
+
};
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* WHO THE TICKETS ARE FOR — the party step's rows, and the keys they are spent as.
|
|
1500
|
+
*
|
|
1501
|
+
* `AssignmentKey` IS NOT A USER TYPE. It identifies one ASSIGNMENT of a type to a product
|
|
1502
|
+
* on an event. Measured on sandbox 2026-09-10, TwinkleTown — 38 events × 2 products × 3
|
|
1503
|
+
* types — `EventInformation` answers with 228 entries and 228 distinct keys, 76 of them
|
|
1504
|
+
* named "Child". So de-duplicating on the key cannot help: every one is already distinct.
|
|
1505
|
+
* `Name` is the only field that identifies what a buyer is choosing.
|
|
1506
|
+
*
|
|
1507
|
+
* THE SAME NAME IS NOT THE SAME OFFER, which is why the assignments are not collapsed
|
|
1508
|
+
* away: Child is 550 off Peak and 450 off Off-Peak, and needs ID on one and not the other.
|
|
1509
|
+
* The type is what the buyer picks; the assignment is what it costs, and that is not
|
|
1510
|
+
* settled until a product is.
|
|
1511
|
+
*
|
|
1512
|
+
* WHICH IS WHY THE KEY IS RESOLVED LATE. `PARTY` runs before `DATE` and `TIME`, so when
|
|
1513
|
+
* the buyer picks "Child" there is no product for an assignment to belong to — the product
|
|
1514
|
+
* is `productForSession`, decided by the timeslot. Committing to a key there means sending
|
|
1515
|
+
* Peak's against an Off-Peak product, and a bulk add that refuses an unknown key leaves no
|
|
1516
|
+
* cart at all. So the composition is keyed by NAME and `assignmentFor` converts it once
|
|
1517
|
+
* `useCheckoutOrder` holds the product.
|
|
1518
|
+
*/
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* THE DISTINCT TYPES, in the order the platform first names each — the organiser's own,
|
|
1522
|
+
* and re-sorting on every fetch would move the rows under the pointer.
|
|
1523
|
+
*/
|
|
1524
|
+
export declare function groupUserTypes(rows: readonly UserType[]): readonly PartyUserTypeOption[];
|
|
1525
|
+
|
|
1526
|
+
/** Whether the buyer has taken the guest route for this order. */
|
|
1527
|
+
declare type GuestChoice = 'NOT_TAKEN' | 'TAKEN';
|
|
1528
|
+
|
|
1529
|
+
/**
|
|
1530
|
+
* WHAT A STOPPED CLOCK SAYS — see `timedOutViewProps` for the card it draws.
|
|
1531
|
+
*
|
|
1532
|
+
* The words stand where the countdown would: a card whose title is `00:00` says the number
|
|
1533
|
+
* and not what it means. "They may still be available" is the design's own hedge and is
|
|
1534
|
+
* the honest one — the tickets went back to the pool, and whether anybody has taken them
|
|
1535
|
+
* since is not something this widget knows.
|
|
1536
|
+
*/
|
|
1537
|
+
export declare const HOLD_VIEW: {
|
|
1538
|
+
readonly title: "Your Order Timed Out";
|
|
1539
|
+
readonly subtitle: "Your tickets have been released. They may still be available.";
|
|
1540
|
+
readonly tryAgain: "Try Again";
|
|
1541
|
+
readonly close: "Close";
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1544
|
+
/**
|
|
1545
|
+
* WHETHER THE EDIT CARD'S SAVE MAY GO.
|
|
1546
|
+
*
|
|
1547
|
+
* ── WHAT IS REQUIRED, AND WHAT IS DELIBERATELY NOT ──────────────────────────
|
|
1548
|
+
*
|
|
1549
|
+
* A NAME AND AN ADDRESS. The address because it is where the ticket goes and a malformed
|
|
1550
|
+
* one is refused by the platform anyway — asked here so the buyer is told by the field they
|
|
1551
|
+
* are standing in rather than by a notice two presses later. A first name because a ticket
|
|
1552
|
+
* belonging to nobody is what this card exists to fix, and saving one straight back would
|
|
1553
|
+
* make the button look broken.
|
|
1554
|
+
*
|
|
1555
|
+
* A LAST NAME IS NOT REQUIRED. Plenty of people have one name, and a widget that refuses to
|
|
1556
|
+
* save a ticket until a stranger supplies a surname they do not have is a widget that has
|
|
1557
|
+
* decided what names are.
|
|
1558
|
+
*
|
|
1559
|
+
* A PREDICATE BECAUSE IT IS THE KIND OF RULE THAT GETS RE-TYPED. The Save button reads it
|
|
1560
|
+
* and so does the press behind it — two copies of `email.includes('@')` is how the two come
|
|
1561
|
+
* to disagree.
|
|
1562
|
+
*/
|
|
1563
|
+
export declare function holderComplete(holder: Ticketholder): boolean;
|
|
1564
|
+
|
|
1565
|
+
/**
|
|
1566
|
+
* "AW" — the programmatic avatar's value, for a holder with no photo. Tickets carry no
|
|
1567
|
+
* `Photo` on this endpoint, so this is what every row and every code draws.
|
|
1568
|
+
*
|
|
1569
|
+
* ONE LETTER IS A COMPLETE ANSWER: a holder with only a first name gets "A", and padding it
|
|
1570
|
+
* to two with something invented would be worse than short.
|
|
1571
|
+
*/
|
|
1572
|
+
export declare function holderInitials(holder: Ticketholder): string;
|
|
1573
|
+
|
|
1574
|
+
/** "Alex Whelan", or `null` where the platform holds neither half. */
|
|
1575
|
+
export declare function holderName(holder: Ticketholder): string | null;
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* WHAT THE EDIT CARD'S SAVE IS DOING. `REFUSED` is the platform declining the details;
|
|
1579
|
+
* `FAILED` is never having reached it. Two outcomes because they read differently to a
|
|
1580
|
+
* buyer — one is "that address will not do" and the other is "try again in a moment" — and
|
|
1581
|
+
* because only the second is a fault worth reporting. See `raiseForBooking`.
|
|
1582
|
+
*/
|
|
1583
|
+
export declare type HolderSave = {
|
|
1584
|
+
readonly status: 'IDLE';
|
|
1585
|
+
} | {
|
|
1586
|
+
readonly status: 'SAVING';
|
|
1587
|
+
} | {
|
|
1588
|
+
readonly status: 'REFUSED';
|
|
1589
|
+
} | {
|
|
1590
|
+
readonly status: 'FAILED';
|
|
1591
|
+
readonly error: Error;
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* WHETHER THE HOLD HAS RUN OUT — the tickets are released and there is nothing left for
|
|
1596
|
+
* the flow to be about.
|
|
1597
|
+
*
|
|
1598
|
+
* A PREDICATE RATHER THAN A COMPARISON AT EACH SITE: `holdRemaining` and `formatHold`
|
|
1599
|
+
* both floor rather than going negative, so this is the only place a hold at `-4` can be
|
|
1600
|
+
* told from one at `0` — and three readings have to agree about it.
|
|
1601
|
+
*/
|
|
1602
|
+
export declare function holdExpired(hold: EscrowHold): boolean;
|
|
1603
|
+
|
|
1604
|
+
/** What the platform needs about the person paying. */
|
|
1605
|
+
export declare type IntentBuyer = {
|
|
1606
|
+
readonly firstName?: string;
|
|
1607
|
+
readonly lastName?: string;
|
|
1608
|
+
readonly email?: string;
|
|
1609
|
+
/** E.164, or absent. */
|
|
1610
|
+
readonly phone?: string;
|
|
1611
|
+
};
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* How many of each user type, BY NAME — see `groupUserTypes`. NOT by assignment key: one
|
|
1615
|
+
* assignment is a type on one product, so a name is the only key that survives the walk
|
|
1616
|
+
* from `PARTY` to the product `TIME` picks.
|
|
1617
|
+
*/
|
|
1618
|
+
export declare type IntentComposition = Readonly<Record<string, number>>;
|
|
1619
|
+
|
|
1620
|
+
/** Whether a composition names anybody at all. */
|
|
1621
|
+
export declare function intentHasParty(composition: IntentComposition | undefined): boolean;
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* WHETHER A NUMBER IS ONE OF THE FIVE. The guard the wire is behind: `FeedbackRating`
|
|
1625
|
+
* narrows what this package passes around, and this is the only thing that can make one
|
|
1626
|
+
* out of a number that was not already.
|
|
1627
|
+
*/
|
|
1628
|
+
export declare function isFeedbackRating(value: number): value is FeedbackRating;
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* Re-exported for callers. Declared in `island-motion`, where it is DERIVED from the
|
|
1632
|
+
* springs rather than typed — so the CSS the surface receives and the moment this
|
|
1633
|
+
* component tears the transition down cannot diverge.
|
|
1634
|
+
*/
|
|
1635
|
+
export declare const ISLAND_TRANSITION_MS: number;
|
|
1636
|
+
|
|
1637
|
+
export declare type IslandAction = {
|
|
1638
|
+
/** Stable across renders. Labels repeat — two states both end in "Close". */
|
|
1639
|
+
readonly key: string;
|
|
1640
|
+
readonly role: IslandActionRole;
|
|
1641
|
+
readonly label: ReactNode;
|
|
1642
|
+
/** A mark beside the label — the provider's logo, the passkey glyph. */
|
|
1643
|
+
/** The button is drawn, and it does not act. */
|
|
1644
|
+
readonly disabled?: boolean;
|
|
1645
|
+
readonly mark?: {
|
|
1646
|
+
readonly side: 'leading' | 'trailing';
|
|
1647
|
+
readonly node: ReactNode;
|
|
1648
|
+
/** Default `separate`. See above. */
|
|
1649
|
+
readonly spacing?: 'joined' | 'separate';
|
|
1650
|
+
};
|
|
1651
|
+
readonly onPress: () => void;
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
/** What a card's button IS, rather than what it looks like. */
|
|
1655
|
+
export declare type IslandActionRole = 'action' | 'primary' | 'secondary';
|
|
1656
|
+
|
|
1657
|
+
/**
|
|
1658
|
+
* Where in its reservation the island sits: a corner, the middle of an edge, or the middle.
|
|
1659
|
+
*
|
|
1660
|
+
* TWO AXES SPELLED AS ONE WORD, the way a host thinks of a position. Nothing downstream
|
|
1661
|
+
* reads the word — see `alignmentAxes`, which is the only thing that does.
|
|
1662
|
+
*/
|
|
1663
|
+
export declare type IslandAlignment = 'top-left' | 'top' | 'top-right' | 'left' | 'center' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right';
|
|
1664
|
+
|
|
1665
|
+
export declare function IslandCard({ avatar, title, subtitle, variant, sealed, input, actions, footer, }: IslandCardProps): react_jsx_runtime.JSX.Element;
|
|
1666
|
+
|
|
1667
|
+
export declare type IslandCardProps = {
|
|
1668
|
+
/** WHICH CARD THIS IS — Figma's own variant on `CtaCard`. */
|
|
1669
|
+
/**
|
|
1670
|
+
* NEITHER OF THE TWO BESIDE THE FLOW DRAWS A HEADER — the way out of both is the Back
|
|
1671
|
+
* button in the stack. `cart` is that card with the cart screen's own title size;
|
|
1672
|
+
* `hold` is the timed-out card, which takes the ordinary one.
|
|
1673
|
+
*/
|
|
1674
|
+
readonly variant?: 'default' | 'hold' | 'cart';
|
|
1675
|
+
/**
|
|
1676
|
+
* The hero — a `.scopetickets-island-avatar` element, and the same node the collapsed
|
|
1677
|
+
* pill shows, which is what lets it be carried between the two.
|
|
1678
|
+
*
|
|
1679
|
+
* THE HOLD'S CARDS TAKE ONE TOO, and that is the design `3803:7329`: the buyer's own
|
|
1680
|
+
* avatar wearing the clock as its ELEMENT, where they used to draw a bare `$25` ring.
|
|
1681
|
+
* The clock is the caller's to compose for the same reason every other hero is — the
|
|
1682
|
+
* face is the buyer's and this file draws none.
|
|
1683
|
+
*/
|
|
1684
|
+
readonly avatar?: ReactNode;
|
|
1685
|
+
/** `heading/xl`, centred — `heading/3xl` on the `cart` variant. */
|
|
1686
|
+
readonly title?: ReactNode;
|
|
1687
|
+
/** `text/regular/md`, centred, and free to run to several lines. */
|
|
1688
|
+
readonly subtitle?: ReactNode;
|
|
1689
|
+
/**
|
|
1690
|
+
* NO HERO, which is what a picker is: the entry step has already said at full size what
|
|
1691
|
+
* the buyer is being asked for, so the card opens on the run itself. `avatar`, `title`
|
|
1692
|
+
* and `subtitle` are simply left undrawn — the card is the run, and the chrome is not
|
|
1693
|
+
* its to draw.
|
|
1694
|
+
*/
|
|
1695
|
+
/**
|
|
1696
|
+
* NO HEADER IS BEING DRAWN OVER THIS CARD, so it pays no reserve for one — see
|
|
1697
|
+
* `CheckoutIslandProps.sealed`, which is where the decision is made.
|
|
1698
|
+
*
|
|
1699
|
+
* PER CARD AND NOT PER ISLAND, which is the whole reason it is a prop rather than a
|
|
1700
|
+
* rule hung off the frame's `data-sealed`. Both planes live in that frame while they
|
|
1701
|
+
* cross, so a rule there would pull the reserve out from under the card on its way OUT
|
|
1702
|
+
* as well — the header would fade while the step beneath it jumped upward to meet it.
|
|
1703
|
+
* Held here, the leaving card keeps the room it was laid out with and only the arriving
|
|
1704
|
+
* one is short, so the surface morphs between two heights instead of snapping.
|
|
1705
|
+
*/
|
|
1706
|
+
readonly sealed?: boolean;
|
|
1707
|
+
/**
|
|
1708
|
+
* The step's own controls — `Input` in the design, between the hero and the buttons.
|
|
1709
|
+
*/
|
|
1710
|
+
readonly input?: ReactNode;
|
|
1711
|
+
/** The buttons, in reading order. Stacked full-width at `$2` apart. */
|
|
1712
|
+
readonly actions: readonly IslandAction[];
|
|
1713
|
+
/**
|
|
1714
|
+
* A CONTROL OF ITS OWN SHAPE WHERE THE BUTTONS GO — the booking's ticket pager, which is
|
|
1715
|
+
* one label between two presses and therefore cannot be an `IslandAction`.
|
|
1716
|
+
*
|
|
1717
|
+
* IT IS NOT A THIRD KIND OF BUTTON. It stands in the same wrapper, which is what it is
|
|
1718
|
+
* for: that wrapper is positioned against the card's bottom edge and its height is what
|
|
1719
|
+
* the content reserves room for, so a control drawn anywhere else sits in the scroll and
|
|
1720
|
+
* takes the card's gutter twice. Counted with the actions below for exactly that reason.
|
|
1721
|
+
*/
|
|
1722
|
+
readonly footer?: ReactNode;
|
|
1723
|
+
};
|
|
1724
|
+
|
|
1725
|
+
export declare function IslandCommitPill({ onOpenCart, cartLabel, onOpenPromo, promoLabel, }: IslandCommitPillProps): react_jsx_runtime.JSX.Element;
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* THE HEADER'S TRAILING PILL ONCE THERE IS AN ORDER — the design's
|
|
1729
|
+
* `HeaderButton-CartSummary` on the Pay cards: what is being bought, and the one thing
|
|
1730
|
+
* that can still change what it costs.
|
|
1731
|
+
*
|
|
1732
|
+
* ── TWO TARGETS AGAIN, AND THE RULE IS BACK BETWEEN THEM ─────────────────────
|
|
1733
|
+
*
|
|
1734
|
+
* This pill held an order glyph and a hold ring once, lost the ring when the two screens
|
|
1735
|
+
* behind them became one, and is two controls again for a different reason: the second one
|
|
1736
|
+
* is no longer another way to the same screen, it is the promo code.
|
|
1737
|
+
*
|
|
1738
|
+
* THE CLOCK IS NOT HERE AND DOES NOT NEED TO BE. The Pay cards count the hold down in
|
|
1739
|
+
* their own subtitle and wear the same ring on their hero — see the `REVIEW`/`PAYMENT`
|
|
1740
|
+
* branch of `subtitle`, which is where that moved. A third reading of one countdown in the
|
|
1741
|
+
* header would be the pill saying what the card already says twice.
|
|
1742
|
+
*
|
|
1743
|
+
* NEITHER IS THE TOTAL, for the same reason: the card's title IS the money on every step
|
|
1744
|
+
* that draws this — `Pay €12.34`, off the quote.
|
|
1745
|
+
*/
|
|
1746
|
+
export declare type IslandCommitPillProps = {
|
|
1747
|
+
/** Opens the cart screen. */
|
|
1748
|
+
readonly onOpenCart: () => void;
|
|
1749
|
+
/** Names the cart target for assistive technology. This package holds no copy. */
|
|
1750
|
+
readonly cartLabel: string;
|
|
1751
|
+
/** Opens the promo code step. */
|
|
1752
|
+
readonly onOpenPromo: () => void;
|
|
1753
|
+
/** The promo target's own words — it is the one half of this pill that is drawn as text. */
|
|
1754
|
+
readonly promoLabel: string;
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1757
|
+
/** WHAT LED A MOVE, which decides what the SURFACE does about it. */
|
|
1758
|
+
declare type IslandGesture = 'island' | 'element' | 'none';
|
|
1759
|
+
|
|
1760
|
+
export declare function IslandHeader({ dismiss, onDismiss, dismissIcon, dismissLabel, headerLead, headerTrail, closable, }: IslandHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* `IslandHeaderWrapper` — the way out at the leading edge, the cart summary at the
|
|
1764
|
+
* trailing one, and nothing between them.
|
|
1765
|
+
*/
|
|
1766
|
+
export declare type IslandHeaderProps = {
|
|
1767
|
+
/** What the header button DOES, which decides what it draws. */
|
|
1768
|
+
readonly dismiss?: 'back' | 'close';
|
|
1769
|
+
readonly onDismiss: () => void;
|
|
1770
|
+
/**
|
|
1771
|
+
* Overrides the glyph. Defaults to `@scopetickets/icons`, which is STui's own set
|
|
1772
|
+
* generated from the file rather than copied by hand. A slot, because a host with its
|
|
1773
|
+
* own icon set should not be made to take a second one.
|
|
1774
|
+
*/
|
|
1775
|
+
readonly dismissIcon?: ReactNode;
|
|
1776
|
+
/** Names the control for assistive technology. Defaults to the `dismiss`. */
|
|
1777
|
+
readonly dismissLabel?: string;
|
|
1778
|
+
/**
|
|
1779
|
+
* A second pill BESIDE the way out — the leading group the design, `$2` off the cross.
|
|
1780
|
+
*/
|
|
1781
|
+
readonly headerLead?: ReactNode;
|
|
1782
|
+
/**
|
|
1783
|
+
* A PILL AT THE TRAILING END, and ONE SLOT for whichever of them the step wants.
|
|
1784
|
+
*
|
|
1785
|
+
* There were two props here and a rule about which won — `summary` outranking
|
|
1786
|
+
* `headerTrail`, on the reading that a counting hold outranks a way back. The two could
|
|
1787
|
+
* never have collided: the funnel is the half of the purchase before a cart exists and
|
|
1788
|
+
* the commit pill is the half after. A precedence rule between two things that cannot
|
|
1789
|
+
* meet is a rule nobody can be sure of, so the caller picks and this draws what it is
|
|
1790
|
+
* handed.
|
|
1791
|
+
*/
|
|
1792
|
+
readonly headerTrail?: ReactNode;
|
|
1793
|
+
/**
|
|
1794
|
+
* WHETHER THE WAY OUT IS OFFERED. Defaults to true.
|
|
1795
|
+
*
|
|
1796
|
+
* DRAWN AND HIDDEN RATHER THAN REMOVED, which is the design's own answer — the abandon
|
|
1797
|
+
* card sets the whole row to zero opacity rather than dropping it. The cross has to be
|
|
1798
|
+
* in the same place on every card, because carried elements are measured against a
|
|
1799
|
+
* header that rides every change in the card's height; taking the button out of the tree
|
|
1800
|
+
* would move the row and every element travelling through it.
|
|
1801
|
+
*/
|
|
1802
|
+
readonly closable?: boolean;
|
|
1803
|
+
};
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* The persistent surface, the two content planes inside it, and the carry layer above
|
|
1807
|
+
* them.
|
|
1808
|
+
*/
|
|
1809
|
+
export declare function IslandHost({ presentation, contentKey, continuity, label, mode, align, placement, journeyFullscreen, chrome, bay, bayLabel, bayVisible, bayRows, bayActions, sealed, children, }: IslandHostProps): react_jsx_runtime.JSX.Element;
|
|
1810
|
+
|
|
1811
|
+
export declare type IslandHostProps = {
|
|
1812
|
+
/** What shape the island should be. Drives the frame, not the content. */
|
|
1813
|
+
presentation: IslandPresentation;
|
|
1814
|
+
/**
|
|
1815
|
+
* Identity of what is being shown. A CHANGE here starts a transition; the same key
|
|
1816
|
+
* re-rendered with different children updates in place. Use the step name, not a value
|
|
1817
|
+
* that changes as the buyer types.
|
|
1818
|
+
*/
|
|
1819
|
+
contentKey: string;
|
|
1820
|
+
/**
|
|
1821
|
+
* WHICH ISLAND THIS HOST IS, ACROSS THE COMPONENT THAT MOUNTS IT.
|
|
1822
|
+
*
|
|
1823
|
+
* Named, and a host that leaves hands the next one under the same name what it was
|
|
1824
|
+
* showing — so a widget whose faces are separate components still MORPHS between them
|
|
1825
|
+
* instead of cutting. See `island-continuity`, which is the whole mechanism and the
|
|
1826
|
+
* argument for it. Absent means "only itself", which is every other mount.
|
|
1827
|
+
*/
|
|
1828
|
+
continuity?: string;
|
|
1829
|
+
/** Names the region for assistive technology. */
|
|
1830
|
+
label: string;
|
|
1831
|
+
/**
|
|
1832
|
+
* THE CHROME, WHICH IS NOT CONTENT — a bar drawn over both planes and rebuilt by
|
|
1833
|
+
* neither.
|
|
1834
|
+
*/
|
|
1835
|
+
chrome?: ReactNode;
|
|
1836
|
+
/**
|
|
1837
|
+
* SEALED — nothing anywhere on the page may be pressed. Draws `IslandShield`, and it is
|
|
1838
|
+
* taken as a flag rather than a node so the host owns where that sheet sits: it has to
|
|
1839
|
+
* hang off the anchor, outside every transform and filter between here and there.
|
|
1840
|
+
*/
|
|
1841
|
+
sealed?: boolean;
|
|
1842
|
+
/** Which appearance to render. Defaults to following the viewer's OS. */
|
|
1843
|
+
mode?: IslandMode;
|
|
1844
|
+
/**
|
|
1845
|
+
* Where in its reservation the island sits — see `IslandAlignment`. Defaults to `bottom`,
|
|
1846
|
+
* which is where the design docks it.
|
|
1847
|
+
*/
|
|
1848
|
+
align?: IslandAlignment;
|
|
1849
|
+
/** Where the reservation is held — see `IslandPlacement`. Defaults to `page`. */
|
|
1850
|
+
placement?: IslandPlacement;
|
|
1851
|
+
/**
|
|
1852
|
+
* THE PROVIDER'S JOURNEY, TAKING THE SCREEN — stamped on the root so the CSS can lift
|
|
1853
|
+
* the fullscreen overlay over the host page and the centred island's transform out of
|
|
1854
|
+
* the overlay's way. Pass-through to `IslandSurfaceProps.journeyFullscreen`.
|
|
1855
|
+
*/
|
|
1856
|
+
journeyFullscreen?: boolean;
|
|
1857
|
+
bay?: ReactNode;
|
|
1858
|
+
/**
|
|
1859
|
+
* NOT A CONTENT CHANGE. A bay that appears, disappears or changes height must not
|
|
1860
|
+
* start a step transition or carry anything: the planes do not move, and the payment
|
|
1861
|
+
* frame inside the bay must not be re-laid-out by anything but its own resize.
|
|
1862
|
+
*/
|
|
1863
|
+
bayLabel?: string;
|
|
1864
|
+
bayVisible?: boolean;
|
|
1865
|
+
/**
|
|
1866
|
+
* HOW MANY ENTRIES THE BAY HOLDS ROOM FOR, whether or not it has them yet.
|
|
1867
|
+
*
|
|
1868
|
+
* A bay measures what is in it, which is right for a region whose contents are the
|
|
1869
|
+
* caller's — and wrong for two screens that are meant to BE the same card. Review and
|
|
1870
|
+
* the card screen hold the same kind of stack in the same place; a buyer crossing
|
|
1871
|
+
* between them should see the contents change, not the card resize under their hand,
|
|
1872
|
+
* and every entry in that stack is an async arrival (a provider reporting its height,
|
|
1873
|
+
* a platform answering whether it can pay) that would otherwise resize it again.
|
|
1874
|
+
*
|
|
1875
|
+
* So the CALLER says how many rows the pair reserves and both screens ask for the same
|
|
1876
|
+
* number. The reserve is a FLOOR, not a height: a bay with more to show than it
|
|
1877
|
+
* reserved still grows — see the rule in `island.css`.
|
|
1878
|
+
*/
|
|
1879
|
+
bayRows?: number;
|
|
1880
|
+
/**
|
|
1881
|
+
* THE BAY'S OWN BUTTONS, drawn beneath the bay's content (form first, CTA last —
|
|
1882
|
+
* the SDK selector's own order). Same `CardAction` markup the card plane uses, so
|
|
1883
|
+
* the press, the compression and the disabled read match everywhere.
|
|
1884
|
+
*/
|
|
1885
|
+
bayActions?: readonly IslandAction[];
|
|
1886
|
+
children: ReactNode;
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
/** How the island is told which appearance to render. */
|
|
1890
|
+
/**
|
|
1891
|
+
* Three states, not two — matching the SDK's own `ThemeSelectionMode`, so a consumer
|
|
1892
|
+
* that already holds one can pass it straight through.
|
|
1893
|
+
*/
|
|
1894
|
+
export declare type IslandMode = 'light' | 'dark' | 'system';
|
|
1895
|
+
|
|
1896
|
+
/** The collapsed island — Figma `CtaCollapsedGetTicket`. */
|
|
1897
|
+
export declare function IslandPill({ avatar, subtitle, title, actionLabel, onAction }: IslandPillProps): react_jsx_runtime.JSX.Element;
|
|
1898
|
+
|
|
1899
|
+
export declare type IslandPillProps = {
|
|
1900
|
+
/**
|
|
1901
|
+
* The round preview at the leading edge — a
|
|
1902
|
+
* `.scopetickets-island-avatar.scopetickets-island-avatar--sm` element, `$10` across.
|
|
1903
|
+
*/
|
|
1904
|
+
readonly avatar?: ReactNode;
|
|
1905
|
+
/**
|
|
1906
|
+
* The quiet line above the title. Optional — the design ships it hidden, which is what
|
|
1907
|
+
* makes it optional rather than empty.
|
|
1908
|
+
*/
|
|
1909
|
+
readonly subtitle?: ReactNode;
|
|
1910
|
+
/** The line that carries the number. `heading/lg`. */
|
|
1911
|
+
readonly title?: ReactNode;
|
|
1912
|
+
/** The label on the action. `text/bold/md`, e.g. Figma's "Get Ticket". */
|
|
1913
|
+
readonly actionLabel: ReactNode;
|
|
1914
|
+
readonly onAction: () => void;
|
|
1915
|
+
};
|
|
1916
|
+
|
|
1917
|
+
/**
|
|
1918
|
+
* Where the reservation itself is held: in the host page's flow, or pinned to the screen.
|
|
1919
|
+
*
|
|
1920
|
+
* `page` is the default and every host before this: the anchor is `position: relative`
|
|
1921
|
+
* wherever the host mounted it, so `align` places the island inside a box the page lays
|
|
1922
|
+
* out. `screen` pins that box to the viewport, so the same `align` names a corner of the
|
|
1923
|
+
* SCREEN — which a host wanting a floating widget could otherwise only get by wrapping it
|
|
1924
|
+
* in fixed-position CSS of its own and keeping that in step with `align` by hand.
|
|
1925
|
+
*/
|
|
1926
|
+
export declare type IslandPlacement = 'page' | 'screen';
|
|
1927
|
+
|
|
1928
|
+
/** The island's shape, as pure data. */
|
|
1929
|
+
declare type IslandPresentation = 'compact' | 'card' | 'full';
|
|
1930
|
+
|
|
1931
|
+
/** The island's own box — fill, stroke, radius, and the frame it animates. */
|
|
1932
|
+
export declare const IslandSurface: react.ForwardRefExoticComponent<IslandSurfaceProps & react.RefAttributes<HTMLDivElement>>;
|
|
1933
|
+
|
|
1934
|
+
export declare type IslandSurfaceProps = {
|
|
1935
|
+
/** Corner radius in px, from `frameFor`. */
|
|
1936
|
+
radius: number;
|
|
1937
|
+
/** Inner padding in px, per axis, from `frameFor`. */
|
|
1938
|
+
padding: PlanePadding;
|
|
1939
|
+
/** Max width in px, or `null` to fill the container. */
|
|
1940
|
+
maxWidth: number | null;
|
|
1941
|
+
/** Shared header-row height in px, from `frameFor`. */
|
|
1942
|
+
rowHeight: number;
|
|
1943
|
+
/** Inset from the container's edge in px, from `frameFor`. */
|
|
1944
|
+
edge: number;
|
|
1945
|
+
/**
|
|
1946
|
+
* Where in the anchor the frame sits, stamped as ONE ATTRIBUTE PER AXIS —
|
|
1947
|
+
* `data-align-block` and `data-align-inline` — because the stylesheet's rules are per
|
|
1948
|
+
* axis. The block half moves the frame, the planes and the pop's origin together, and
|
|
1949
|
+
* those must never disagree; the inline half only picks the side the frame docks to.
|
|
1950
|
+
* See `alignmentAxes`.
|
|
1951
|
+
*/
|
|
1952
|
+
align: IslandAlignment;
|
|
1953
|
+
/**
|
|
1954
|
+
* Where the ANCHOR is held — see `IslandPlacement`. Stamped on the anchor as
|
|
1955
|
+
* `data-placement` only when it is `screen`, with the block half of `align` beside it:
|
|
1956
|
+
* the rules that pin the reservation to an edge of the viewport are per block axis,
|
|
1957
|
+
* exactly as the frame's are.
|
|
1958
|
+
*/
|
|
1959
|
+
placement: IslandPlacement;
|
|
1960
|
+
/**
|
|
1961
|
+
* How far a pinned reservation stands off the screen's edge, in px — the COLLAPSED
|
|
1962
|
+
* frame's `edge`, for the reason `footprint` is the collapsed height: the reservation is
|
|
1963
|
+
* the island at rest, whatever it is showing now.
|
|
1964
|
+
*/
|
|
1965
|
+
footprintEdge: number;
|
|
1966
|
+
/**
|
|
1967
|
+
* THE PROVIDER'S FULLSCREEN JOURNEY, stamped as `data-journey`. Two rules hang off
|
|
1968
|
+
* it, and they hang off the ROOT because both are about what the root's own
|
|
1969
|
+
* geometry does to a fixed-position descendant: the journey overlay has to escape
|
|
1970
|
+
* the island entirely, and a centred island's `translateY(-50%)` would otherwise
|
|
1971
|
+
* become the overlay's containing block instead of the viewport.
|
|
1972
|
+
*/
|
|
1973
|
+
journeyFullscreen?: boolean;
|
|
1974
|
+
/**
|
|
1975
|
+
* Where the press gesture has got to, or `undefined` when nothing is being pressed.
|
|
1976
|
+
* Stamped as `data-press`.
|
|
1977
|
+
*/
|
|
1978
|
+
press?: PressPhase | null;
|
|
1979
|
+
/**
|
|
1980
|
+
* How the move should be acknowledged, or `undefined` when nothing is moving. Stamped
|
|
1981
|
+
* as the VALUE of `data-transitioning`. See `IslandGesture` for the three answers and
|
|
1982
|
+
* why a boolean could not hold them.
|
|
1983
|
+
*/
|
|
1984
|
+
gesture?: IslandGesture;
|
|
1985
|
+
/** True while a step change is in flight. */
|
|
1986
|
+
transitioning?: boolean;
|
|
1987
|
+
/** Which appearance to render, or `undefined` to follow the viewer's OS. */
|
|
1988
|
+
mode?: IslandMode;
|
|
1989
|
+
/**
|
|
1990
|
+
* The height the surface is to be, in px — the plane's measurement AND the bay's,
|
|
1991
|
+
* already added up by `IslandHost`, which is the one place that knows both. `null`
|
|
1992
|
+
* before the first measurement renders at `auto`, because a 0-height first paint would
|
|
1993
|
+
* flash an empty box on mount.
|
|
1994
|
+
*/
|
|
1995
|
+
height: number | null;
|
|
1996
|
+
/** Names the region for assistive technology. */
|
|
1997
|
+
label: string;
|
|
1998
|
+
/**
|
|
1999
|
+
* The height reserved in the host page's flow, in px — `footprintHeight` of the
|
|
2000
|
+
* island's COLLAPSED presentation, not its current one.
|
|
2001
|
+
*/
|
|
2002
|
+
footprint: number;
|
|
2003
|
+
/** WHICH AXES THE POP IS SPENT ON — `both`, or `block` alone. */
|
|
2004
|
+
popAxis?: 'both' | 'block';
|
|
2005
|
+
/**
|
|
2006
|
+
* THE BAY — a region that joins and leaves the card WITHOUT belonging to any
|
|
2007
|
+
* step, so its contents survive every plane change. The clip tears down and rebuilds
|
|
2008
|
+
* both planes on a step change; a payment frame mounted there would be destroyed at
|
|
2009
|
+
* the exact moment it must not be. Like `chrome`, the bay is a sibling of the clip
|
|
2010
|
+
* inside the surface, but at the other end: it grows the card instead of sitting
|
|
2011
|
+
* over its content.
|
|
2012
|
+
*/
|
|
2013
|
+
bay?: ReactNode;
|
|
2014
|
+
/**
|
|
2015
|
+
* The bay's own box, in px — `0` while it is closed. Published as
|
|
2016
|
+
* `--scopetickets-island-bay-height`, which is the bay element's own height and
|
|
2017
|
+
* nothing else's: the clip takes what is left of the surface by FLEX rather than by
|
|
2018
|
+
* subtracting this var, so the two cannot be told different numbers.
|
|
2019
|
+
*/
|
|
2020
|
+
bayHeight?: number | null;
|
|
2021
|
+
/** The element children are actually positioned inside. */
|
|
2022
|
+
clipRef?: Ref<HTMLDivElement>;
|
|
2023
|
+
children: ReactNode;
|
|
2024
|
+
/**
|
|
2025
|
+
* The persistent chrome — `IslandHeader`, drawn over both planes and rebuilt by
|
|
2026
|
+
* neither.
|
|
2027
|
+
*/
|
|
2028
|
+
chrome?: ReactNode;
|
|
2029
|
+
/**
|
|
2030
|
+
* Drawn OUTSIDE the clip, as a sibling of it — the carry layer, and so far the only
|
|
2031
|
+
* thing that belongs there.
|
|
2032
|
+
*/
|
|
2033
|
+
overlay?: ReactNode;
|
|
2034
|
+
/**
|
|
2035
|
+
* A sheet over the viewport, for a state that admits no input — see `IslandShield`.
|
|
2036
|
+
* Taken HERE rather than anywhere inside the frame because it is `position: fixed` and
|
|
2037
|
+
* the frame's transform would become its containing block.
|
|
2038
|
+
*/
|
|
2039
|
+
shield?: ReactNode;
|
|
2040
|
+
/**
|
|
2041
|
+
* Nothing may be pressed — see `IslandShield`. Softens the pop, because the press it is
|
|
2042
|
+
* answering did not do anything.
|
|
2043
|
+
*/
|
|
2044
|
+
sealed?: boolean;
|
|
2045
|
+
};
|
|
2046
|
+
|
|
2047
|
+
/**
|
|
2048
|
+
* The fewest cutouts that still leave a code behind.
|
|
2049
|
+
*
|
|
2050
|
+
* Derived rather than written down, because the floor moves with the padding rather than
|
|
2051
|
+
* with anything a reader could guess: it is the first count whose content survives having
|
|
2052
|
+
* the inset taken off both ends, so a padding re-tuned upward raises it by itself.
|
|
2053
|
+
*/
|
|
2054
|
+
export declare function minimumColumns({ segment, pad }: TicketEdgeTokens): number;
|
|
2055
|
+
|
|
2056
|
+
/**
|
|
2057
|
+
* CONTROLLED OR SELF-HELD. The widget passes both props, which is what keeps a typed
|
|
2058
|
+
* name when the buyer steps away and back — the card is rebuilt on every step, and an
|
|
2059
|
+
* answer held only here did not survive the rebuild. A caller that passes neither gets
|
|
2060
|
+
* the step's own memory, which is what the step had before.
|
|
2061
|
+
*/
|
|
2062
|
+
export declare function NameStep({ value, onChange, onAnsweredChange, }: AnswerReporting & {
|
|
2063
|
+
readonly value?: NameValue;
|
|
2064
|
+
readonly onChange?: (value: NameValue) => void;
|
|
2065
|
+
}): react_jsx_runtime.JSX.Element;
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* THE NAME AS THE BUYER'S TWO FIELDS — the same shape `BuyerDetails` takes apart, so
|
|
2069
|
+
* the widget's collected copy IS the answer and nothing has to be split or joined on the
|
|
2070
|
+
* way to the intent.
|
|
2071
|
+
*/
|
|
2072
|
+
declare type NameValue = {
|
|
2073
|
+
readonly firstName: string;
|
|
2074
|
+
readonly lastName: string;
|
|
2075
|
+
};
|
|
2076
|
+
|
|
2077
|
+
export declare type Notice = {
|
|
2078
|
+
readonly id: NoticeId;
|
|
2079
|
+
readonly severity: NoticeSeverity;
|
|
2080
|
+
/** Title Case. */
|
|
2081
|
+
readonly title: string;
|
|
2082
|
+
/** Sentence case. Never reported — see `noticeTelemetry`. */
|
|
2083
|
+
readonly subtitle: string;
|
|
2084
|
+
/** In order, so the first is the lead. */
|
|
2085
|
+
readonly actions: readonly NoticeAction[];
|
|
2086
|
+
};
|
|
2087
|
+
|
|
2088
|
+
export declare type NoticeAction = {
|
|
2089
|
+
readonly id: NoticeActionId;
|
|
2090
|
+
/** CONFIRM is the one likeliest to end in a sale, and is drawn as the lead. */
|
|
2091
|
+
readonly kind: 'CONFIRM' | 'SECONDARY';
|
|
2092
|
+
readonly label: string;
|
|
2093
|
+
};
|
|
2094
|
+
|
|
2095
|
+
/** What a button DOES, kept apart from what it says: the label is copy and will change. */
|
|
2096
|
+
export declare type NoticeActionId =
|
|
2097
|
+
/** Take the order as it stands — the smaller sale, completed. */
|
|
2098
|
+
'CONTINUE'
|
|
2099
|
+
/** Back to the party step with the order intact, to ask for something else. */
|
|
2100
|
+
| 'CHANGE_ORDER'
|
|
2101
|
+
/**
|
|
2102
|
+
* Make the call again. Only ever offered where there IS something to try — see
|
|
2103
|
+
* `ORDER_NOT_OPENED`, which deliberately has no retry because nothing could be retried
|
|
2104
|
+
* with.
|
|
2105
|
+
*/
|
|
2106
|
+
| 'RETRY'
|
|
2107
|
+
/**
|
|
2108
|
+
* Give up on the account and go on to the ticket. Only reachable after payment, which
|
|
2109
|
+
* is what makes it a real way out rather than an abandoned purchase: the tickets are
|
|
2110
|
+
* already the buyer's.
|
|
2111
|
+
*/
|
|
2112
|
+
| 'SKIP_ACCOUNT'
|
|
2113
|
+
/** Leave. Every notice offers one. */
|
|
2114
|
+
| 'CLOSE';
|
|
2115
|
+
|
|
2116
|
+
export declare type NoticeId =
|
|
2117
|
+
/**
|
|
2118
|
+
* FEWER TICKETS THAN WERE ASKED FOR ARE HELD. The platform fills what it can — see
|
|
2119
|
+
* `AllowPartialFulfillment` — so this is a smaller order the buyer already owns, which
|
|
2120
|
+
* is why it leads with taking it rather than with changing it.
|
|
2121
|
+
*/
|
|
2122
|
+
'ORDER_PART_FILLED'
|
|
2123
|
+
/**
|
|
2124
|
+
* NOT ONE OF THEM COULD BE HELD, for a party of more than one. The flag fills what it
|
|
2125
|
+
* can, and where it can fill NOTHING the platform refuses outright — so this is the
|
|
2126
|
+
* bottom of the same range as `ORDER_PART_FILLED` and not a different kind of event.
|
|
2127
|
+
*/
|
|
2128
|
+
| 'ORDER_NOT_ENOUGH'
|
|
2129
|
+
/** The same refusal met by a buyer on their own, where there is no party to speak of. */
|
|
2130
|
+
| 'ORDER_SOLD_OUT'
|
|
2131
|
+
/** The order could not be opened at all: no cart, and nothing to check out. */
|
|
2132
|
+
| 'ORDER_NOT_OPENED'
|
|
2133
|
+
/**
|
|
2134
|
+
* The verification code could not be SENT. Distinct from a code that was refused, which
|
|
2135
|
+
* is the buyer mistyping and is answered by the boxes themselves — validation, not a
|
|
2136
|
+
* failure of ours.
|
|
2137
|
+
*/
|
|
2138
|
+
| 'ACCOUNT_CODE_NOT_SENT'
|
|
2139
|
+
/** Everything was answered and `POST /api/Users` would not take it. */
|
|
2140
|
+
| 'ACCOUNT_NOT_CREATED'
|
|
2141
|
+
/**
|
|
2142
|
+
* The buyer rated their purchase and the rating did not reach us. THE ONLY NOTICE HERE
|
|
2143
|
+
* ABOUT SOMETHING THE BUYER DOES NOT NEED — the order is placed either way, and a
|
|
2144
|
+
* rating is a courtesy they have already paid. It is raised anyway because the
|
|
2145
|
+
* alternative is a press that silently did nothing: they chose four stars, pressed
|
|
2146
|
+
* Continue, and nothing on the platform has heard of it.
|
|
2147
|
+
*/
|
|
2148
|
+
| 'FEEDBACK_NOT_SENT'
|
|
2149
|
+
/**
|
|
2150
|
+
* The device signed something and the platform would not take it — or the challenge in
|
|
2151
|
+
* front of it never arrived. NOT a buyer who waved the prompt away, which is a normal
|
|
2152
|
+
* thing to do and raises nothing; see `usePasskeySignIn`, which draws that line.
|
|
2153
|
+
*/
|
|
2154
|
+
| 'SIGN_IN_NOT_COMPLETED'
|
|
2155
|
+
/**
|
|
2156
|
+
* The password door could not be reached — the call did not go, or did not come back.
|
|
2157
|
+
* NOT a password the platform refused, which is the buyer typing and is answered by the
|
|
2158
|
+
* card itself.
|
|
2159
|
+
*/
|
|
2160
|
+
| 'SIGN_IN_UNREACHABLE'
|
|
2161
|
+
/**
|
|
2162
|
+
* THE BOOKING WOULD NOT LOAD. The money moved, the tickets exist, and the one request
|
|
2163
|
+
* that says who they are for did not come back — so the buyer is looking at a card that
|
|
2164
|
+
* cannot list anything. NOT a cart that never became a transaction, which is an answer
|
|
2165
|
+
* and gets a card of its own rather than a failure.
|
|
2166
|
+
*/
|
|
2167
|
+
| 'BOOKING_NOT_LOADED'
|
|
2168
|
+
/**
|
|
2169
|
+
* THE PLATFORM WOULD NOT TAKE THE TICKETHOLDER. A refusal, not a failure to reach — the
|
|
2170
|
+
* details went and came back declined, which is a WARNING because the system worked and
|
|
2171
|
+
* something about the answer needs adjusting.
|
|
2172
|
+
*/
|
|
2173
|
+
| 'TICKETHOLDER_REFUSED'
|
|
2174
|
+
/**
|
|
2175
|
+
* The ticketholder's details never reached the platform. The ticket is unchanged and the
|
|
2176
|
+
* buyer is still holding what they typed, so this is the one of the two that is a fault.
|
|
2177
|
+
*/
|
|
2178
|
+
| 'TICKETHOLDER_NOT_SAVED';
|
|
2179
|
+
|
|
2180
|
+
/**
|
|
2181
|
+
* The notices whose words are the same every time. One so far: a notice whose words depend
|
|
2182
|
+
* on what the flow knows gets a builder instead.
|
|
2183
|
+
*/
|
|
2184
|
+
export declare const NOTICES: Readonly<Record<Exclude<NoticeId, 'ORDER_PART_FILLED'>, Notice>>;
|
|
2185
|
+
|
|
2186
|
+
/**
|
|
2187
|
+
* WHAT A BUYER IS TOLD WHEN THE ORDER DID NOT DO WHAT THEY ASKED.
|
|
2188
|
+
*
|
|
2189
|
+
* ONE CARD DRAWN FROM DATA — never a screen per failure, and never failure UI inside a
|
|
2190
|
+
* step. Adding a case is an entry here and a raise from the site that knows: see
|
|
2191
|
+
* `raiseFor` and the two effects in `ScopeTicketsCheckout` that call it.
|
|
2192
|
+
*
|
|
2193
|
+
* ONE VOCABULARY IN TWO PACKAGES, and that is a debt rather than a design. `@scopetickets
|
|
2194
|
+
* /sdk` has said all of this since before the island existed — the same two severities,
|
|
2195
|
+
* the same action ids, the same reporting rule — and `packages/checkout` cannot reach it:
|
|
2196
|
+
* neither package depends on the other, and the island exists to be the lean one. So the
|
|
2197
|
+
* vocabulary is copied, and the WORDING is too wherever the SDK has already said the same
|
|
2198
|
+
* thing to a buyer — copy that has been read beats copy invented twice. When the notices
|
|
2199
|
+
* module moves somewhere both can use, this file is what it replaces; the names are
|
|
2200
|
+
* deliberately identical so that merge is a deletion.
|
|
2201
|
+
*
|
|
2202
|
+
* Pure: no React, no network, no DOM.
|
|
2203
|
+
*/
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* WARNING: the system worked and something needs adjusting, so there is a way forward.
|
|
2207
|
+
* FAILURE: something broke — leave, or try again where there is anything to try.
|
|
2208
|
+
*
|
|
2209
|
+
* IT IS LOAD-BEARING. It decides how a notice is reported and how its lead button is
|
|
2210
|
+
* painted, so neither can disagree with the other: a sold-out ticket is inventory, and
|
|
2211
|
+
* filing warnings as faults buries the real ones within a week of a busy on-sale.
|
|
2212
|
+
*/
|
|
2213
|
+
export declare type NoticeSeverity = 'WARNING' | 'FAILURE';
|
|
2214
|
+
|
|
2215
|
+
/**
|
|
2216
|
+
* How a notice is FILED: a warning is a breadcrumb on the trail to the next fault, an
|
|
2217
|
+
* exception is the fault. The same rule the reporter in `@scopetickets/sdk` applies, and
|
|
2218
|
+
* the reason severity cannot be decorative.
|
|
2219
|
+
*/
|
|
2220
|
+
export declare function noticeTelemetry(severity: NoticeSeverity): 'BREADCRUMB' | 'EXCEPTION';
|
|
2221
|
+
|
|
2222
|
+
/**
|
|
2223
|
+
* "12:00 - 12:45", "12:00" for an event with no end, or `null` for one that sells no
|
|
2224
|
+
* sessions at all. A hyphen with spaces around it, which is the design's own.
|
|
2225
|
+
*/
|
|
2226
|
+
export declare function occasionTime(occasion: BookingOccasion): string | null;
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* WHAT THE ORDER CAME TO — one state rather than a count beside an error.
|
|
2230
|
+
*
|
|
2231
|
+
* It was `{ shortfall: number, error: Error | null }`, two fields tracking one event, and
|
|
2232
|
+
* the pair could not say the case that matters most: a session with nothing left refuses
|
|
2233
|
+
* the whole cart, so it arrives as a THROW rather than as a shortfall equal to what was
|
|
2234
|
+
* asked. Against two fields that reads as `failed`, indistinguishable from a dropped
|
|
2235
|
+
* connection, and inventory gets filed as breakage — see `noticeTelemetry`.
|
|
2236
|
+
*
|
|
2237
|
+
* Pure: no React, no network, no DOM.
|
|
2238
|
+
*/
|
|
2239
|
+
declare type OrderFill =
|
|
2240
|
+
/** No cart has been asked for yet, or one is in flight. */
|
|
2241
|
+
{
|
|
2242
|
+
readonly status: 'PENDING';
|
|
2243
|
+
}
|
|
2244
|
+
/** Every head asked for is held. */
|
|
2245
|
+
| {
|
|
2246
|
+
readonly status: 'FILLED';
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* FEWER HEADS THAN ASKED FOR ARE HELD, and they are the buyer's — see
|
|
2250
|
+
* `AllowPartialFulfillment`. Both numbers are stated rather than derived, so a notice
|
|
2251
|
+
* can say either without doing arithmetic to find the other.
|
|
2252
|
+
*/
|
|
2253
|
+
| {
|
|
2254
|
+
readonly status: 'SHORT';
|
|
2255
|
+
readonly held: number;
|
|
2256
|
+
readonly asked: number;
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* NOTHING COULD BE HELD. The platform refuses the whole request when it can fill none of
|
|
2260
|
+
* it, EVEN WITH the partial-fulfilment flag set. `asked` rides along because the party
|
|
2261
|
+
* that met the refusal decides the words — see `raiseFor`.
|
|
2262
|
+
*/
|
|
2263
|
+
| {
|
|
2264
|
+
readonly status: 'SOLD_OUT';
|
|
2265
|
+
readonly asked: number;
|
|
2266
|
+
}
|
|
2267
|
+
/** Something broke. The cart, the tickets or the fill did not answer. */
|
|
2268
|
+
| {
|
|
2269
|
+
readonly status: 'FAILED';
|
|
2270
|
+
readonly error: Error;
|
|
2271
|
+
};
|
|
2272
|
+
|
|
2273
|
+
export declare type OrderIntent = {
|
|
2274
|
+
/** The one field a host must supply: there is nothing to sell without it. */
|
|
2275
|
+
readonly subject: OrderSubject;
|
|
2276
|
+
/** Who is coming. Absent means the widget asks. */
|
|
2277
|
+
readonly composition?: IntentComposition;
|
|
2278
|
+
/** `YYYY-MM-DD`. Meaningless on an event subject, which carries its own day. */
|
|
2279
|
+
readonly day?: string;
|
|
2280
|
+
/** The slot's own key, where the event sells timed sessions. */
|
|
2281
|
+
readonly timeslot?: string;
|
|
2282
|
+
readonly buyer?: IntentBuyer;
|
|
2283
|
+
/**
|
|
2284
|
+
* WHETHER THE EVENT ASKS ITS OWN QUESTIONS, and the one field where absent does NOT
|
|
2285
|
+
* mean "you ask".
|
|
2286
|
+
*
|
|
2287
|
+
* Every other field here is optional because the widget can collect it: there is a
|
|
2288
|
+
* party stepper, a calendar, a name field. There is no such control for these. The
|
|
2289
|
+
* questions are the EVENT's, they vary in number and height, and they come from an
|
|
2290
|
+
* endpoint that takes an id the widget has no cart to read — see `DETAILS`'s blurb.
|
|
2291
|
+
* So "absent" cannot mean "ask them", because there is nothing to ask with; it means
|
|
2292
|
+
* the event asks nothing, which is the common case and the safe one.
|
|
2293
|
+
*
|
|
2294
|
+
* Saying `true` puts the More Information card in the flow as a GATE — it says
|
|
2295
|
+
* questions are waiting, and does not draw them.
|
|
2296
|
+
*/
|
|
2297
|
+
readonly asksQuestions?: boolean;
|
|
2298
|
+
/** Questionnaire answers already collected, by question id. */
|
|
2299
|
+
readonly answers?: Readonly<Record<string, string>>;
|
|
2300
|
+
/** A method the host has already had chosen. */
|
|
2301
|
+
readonly paymentMethodKey?: string;
|
|
2302
|
+
};
|
|
2303
|
+
|
|
2304
|
+
/**
|
|
2305
|
+
* WHAT A HOST HANDS THE WIDGET, complete or partial.
|
|
2306
|
+
*
|
|
2307
|
+
* A host calls the widget to do the parts it will not or cannot do itself. So it says
|
|
2308
|
+
* what it already knows and leaves the rest absent, and the widget collects whatever is
|
|
2309
|
+
* missing. Every field but the subject is optional for exactly that reason: absent means
|
|
2310
|
+
* "you ask", not "there is none".
|
|
2311
|
+
*
|
|
2312
|
+
* PARTIAL IS THE NORMAL CASE. A host with its own calendar fills the day and leaves the
|
|
2313
|
+
* buyer empty; a host with nothing but a series key fills only the subject. Both are
|
|
2314
|
+
* valid, and the difference between them is which steps the widget mounts.
|
|
2315
|
+
*/
|
|
2316
|
+
|
|
2317
|
+
/**
|
|
2318
|
+
* WHAT IS BEING BOUGHT INTO, as one value rather than two nullable keys.
|
|
2319
|
+
*
|
|
2320
|
+
* A series is a run of events sold together — the buyer still picks a day. An event is
|
|
2321
|
+
* one occasion, so the day is already decided and the widget must not ask for it. Two
|
|
2322
|
+
* separate `seriesKey`/`eventKey` fields would allow both at once and neither, and
|
|
2323
|
+
* would leave every reader deciding which wins.
|
|
2324
|
+
*/
|
|
2325
|
+
export declare type OrderSubject =
|
|
2326
|
+
/** A run the buyer chooses a day within. */
|
|
2327
|
+
{
|
|
2328
|
+
readonly kind: 'series';
|
|
2329
|
+
readonly key: string;
|
|
2330
|
+
}
|
|
2331
|
+
/** One occasion, its day already settled by the choice of it. */
|
|
2332
|
+
| {
|
|
2333
|
+
readonly kind: 'event';
|
|
2334
|
+
readonly key: string;
|
|
2335
|
+
};
|
|
2336
|
+
|
|
2337
|
+
/**
|
|
2338
|
+
* `16:00:00` -> `16:00`. Null for anything that is not a readable clock time, including
|
|
2339
|
+
* an hour or minute out of range..
|
|
2340
|
+
*/
|
|
2341
|
+
export declare function parseWallClockTime(value: string | null | undefined): string | null;
|
|
2342
|
+
|
|
2343
|
+
/**
|
|
2344
|
+
* ONLY N TICKETS ARE HELD — the notice the count made possible.
|
|
2345
|
+
*
|
|
2346
|
+
* The SDK's own `NOT_ENOUGH` says what this replaces: "No number, because the platform
|
|
2347
|
+
* refuses on availability without saying how many remain. With a count this becomes 'Only
|
|
2348
|
+
* 4 Tickets Left' and leads with Book 4 Instead — the strongest card in the set." The
|
|
2349
|
+
* count exists now, and it is better than a count: the tickets are already the buyer's,
|
|
2350
|
+
* so the lead button takes them rather than offering to try for them.
|
|
2351
|
+
*/
|
|
2352
|
+
export declare function partFilledNotice(held: number, asked: number): Notice;
|
|
2353
|
+
|
|
2354
|
+
/** The party step's controls, holding their own counts. */
|
|
2355
|
+
/** The step itself: rows when the event names its types, one line when it does not. */
|
|
2356
|
+
export declare function PartyStepper({ userTypes, counts, onChange, max, soloName, onRefuse, refused, }: PartyStepperProps): react_jsx_runtime.JSX.Element;
|
|
2357
|
+
|
|
2358
|
+
export declare type PartyStepperProps = {
|
|
2359
|
+
/** What the event offers. EMPTY draws the single unnamed line instead of rows. */
|
|
2360
|
+
readonly userTypes: readonly PartyUserTypeOption[];
|
|
2361
|
+
/** How many of each, by user-type key. */
|
|
2362
|
+
readonly counts: Readonly<Record<string, number>>;
|
|
2363
|
+
readonly onChange: (key: string, count: number) => void;
|
|
2364
|
+
/** The ticket's ceiling, across every row together. */
|
|
2365
|
+
readonly max: number;
|
|
2366
|
+
/** What the single line is called when there are no user types. */
|
|
2367
|
+
readonly soloName?: string;
|
|
2368
|
+
/**
|
|
2369
|
+
* A NUMBER OVER THE CEILING WAS ASKED FOR, or `null` once one within it is. The step is
|
|
2370
|
+
* not answered while this stands: a card showing a refusal and a live Continue would be
|
|
2371
|
+
* telling a buyer both that they cannot have it and that they may proceed.
|
|
2372
|
+
*/
|
|
2373
|
+
readonly onRefuse?: (asked: number | null) => void;
|
|
2374
|
+
/**
|
|
2375
|
+
* WHAT WAS ASKED FOR, HELD BY THE WIDGET. Controlled rather than kept here, because the
|
|
2376
|
+
* step's answered-ness depends on it and that lives up there — two copies of one fact is
|
|
2377
|
+
* how the note ends up on screen while Continue is live, or the other way round.
|
|
2378
|
+
*/
|
|
2379
|
+
readonly refused?: number | null;
|
|
2380
|
+
};
|
|
2381
|
+
|
|
2382
|
+
/**
|
|
2383
|
+
* THE PARTY STEP — one stepper per user type, or a single line when the event offers
|
|
2384
|
+
* none.
|
|
2385
|
+
*
|
|
2386
|
+
* Controlled: the caller holds the counts, because the composition belongs to the order
|
|
2387
|
+
* rather than to the control that edits it. `max` is the ticket's ceiling and is the
|
|
2388
|
+
* caller's too — a row has no opinion about how many people a party may hold.
|
|
2389
|
+
*/
|
|
2390
|
+
/** A user type the event offers, as the row needs it. */
|
|
2391
|
+
export declare type PartyUserTypeOption = {
|
|
2392
|
+
/**
|
|
2393
|
+
* WHAT THE COMPOSITION COUNTS UNDER. The platform's types are keyed by NAME, because an
|
|
2394
|
+
* assignment key belongs to a product no one has chosen yet — see `user-types`. A host
|
|
2395
|
+
* supplying its own may key them however it likes.
|
|
2396
|
+
*/
|
|
2397
|
+
readonly key: string;
|
|
2398
|
+
/** Always present: an event with no discount types still offers a default. */
|
|
2399
|
+
readonly name: string;
|
|
2400
|
+
/** The organiser's own condition on choosing it, or null. */
|
|
2401
|
+
readonly note: string | null;
|
|
2402
|
+
};
|
|
2403
|
+
|
|
2404
|
+
/**
|
|
2405
|
+
* "Add Password" — the design, whose counting is ported exactly: see
|
|
2406
|
+
* `@/domain/password` for why the confirm field's ring measures itself against the
|
|
2407
|
+
* FIRST FIELD's current length rather than against the rule.
|
|
2408
|
+
*/
|
|
2409
|
+
export declare function PasswordStep({ revealed, accountEmail, onAnsweredChange, onPasswordChange, }: {
|
|
2410
|
+
readonly revealed: boolean;
|
|
2411
|
+
/**
|
|
2412
|
+
* WHOSE PASSWORD THIS IS — the address the account is being made with, for the
|
|
2413
|
+
* browser's own save prompt. See the field below.
|
|
2414
|
+
*/
|
|
2415
|
+
readonly accountEmail?: string;
|
|
2416
|
+
/**
|
|
2417
|
+
* WHERE THE PASSWORD GOES. Reporting only that the step is ANSWERED is all a card
|
|
2418
|
+
* needs and not enough to make an account with — `POST /api/Users` wants the value,
|
|
2419
|
+
* two steps from here.
|
|
2420
|
+
*
|
|
2421
|
+
* ONLY WHEN IT IS WHOLE. A half-typed password reported on every keystroke would put a
|
|
2422
|
+
* dozen partial copies through the flow to no purpose; this hands over the one that
|
|
2423
|
+
* passed `canSubmitPassword`, and an empty string whenever it stops passing.
|
|
2424
|
+
*/
|
|
2425
|
+
readonly onPasswordChange?: (password: string) => void;
|
|
2426
|
+
} & AnswerReporting): react_jsx_runtime.JSX.Element;
|
|
2427
|
+
|
|
2428
|
+
/** The Payment Methods list — the design. */
|
|
2429
|
+
/** Which button role the pay action takes for a given method. */
|
|
2430
|
+
export declare function payButtonRole(kind: PaymentKind): 'action' | 'primary';
|
|
2431
|
+
|
|
2432
|
+
/** One way to pay, as the list needs it. */
|
|
2433
|
+
/** WHO DRAWS THE BUTTON, which is the only thing this distinction decides. */
|
|
2434
|
+
export declare type PaymentKind = 'WALLET' | 'CARD';
|
|
2435
|
+
|
|
2436
|
+
export declare type PaymentMethod = {
|
|
2437
|
+
readonly key: string;
|
|
2438
|
+
readonly kind: PaymentKind;
|
|
2439
|
+
/**
|
|
2440
|
+
* Drawn WHERE THE RADIO WOULD BE, for a row that is chosen the same way but is not a
|
|
2441
|
+
* stored method — "Add New Card". The design gives it a mark rather than a radio, and
|
|
2442
|
+
* it is still one of the six rows you pick between.
|
|
2443
|
+
*/
|
|
2444
|
+
readonly icon?: ReactNode;
|
|
2445
|
+
/**
|
|
2446
|
+
* What the row says. Once the marks ship, the mark says it and this names the row for
|
|
2447
|
+
* assistive technology instead.
|
|
2448
|
+
*/
|
|
2449
|
+
readonly label: string;
|
|
2450
|
+
/** The brand's own logo, when there is one to draw. */
|
|
2451
|
+
readonly mark?: ReactNode;
|
|
2452
|
+
/**
|
|
2453
|
+
* A card's last four, in the mono numerals — `• 2468`. PART OF THE LOCKUP: it says
|
|
2454
|
+
* which Mastercard, so it sits against the mark rather than at the row's trailing edge.
|
|
2455
|
+
* The pay button composes the same two into one phrase.
|
|
2456
|
+
*/
|
|
2457
|
+
readonly detail?: string;
|
|
2458
|
+
/**
|
|
2459
|
+
* A SUBTITLE for the method — Figma's own "Earn 2x RevPoints", a second thing said
|
|
2460
|
+
* about it rather than a continuation of its name. It takes the rest of the row and
|
|
2461
|
+
* ends flush with the trailing padding.
|
|
2462
|
+
*/
|
|
2463
|
+
readonly perk?: string;
|
|
2464
|
+
/**
|
|
2465
|
+
* THE ROW CANNOT BE CHOSEN — the wallet before the payment host has said the device
|
|
2466
|
+
* can pay (or has said it cannot). A row that cannot be pressed still owes the buyer
|
|
2467
|
+
* the reason, which is `note`.
|
|
2468
|
+
*/
|
|
2469
|
+
readonly disabled?: boolean;
|
|
2470
|
+
/**
|
|
2471
|
+
* WHY A DISABLED ROW IS DISABLED, in the trailing slot a perk occupies — "Checking
|
|
2472
|
+
* availability…" while the host has not answered, "Unavailable on this device" when
|
|
2473
|
+
* it answered no. Drawn only while the row cannot be pressed.
|
|
2474
|
+
*/
|
|
2475
|
+
readonly note?: string;
|
|
2476
|
+
};
|
|
2477
|
+
|
|
2478
|
+
export declare function PaymentMethods({ methods, selectedKey, onSelect, label }: PaymentMethodsProps): react_jsx_runtime.JSX.Element;
|
|
2479
|
+
|
|
2480
|
+
export declare type PaymentMethodsProps = {
|
|
2481
|
+
readonly methods: readonly PaymentMethod[];
|
|
2482
|
+
readonly selectedKey: string;
|
|
2483
|
+
readonly onSelect: (key: string) => void;
|
|
2484
|
+
/** Names the group for assistive technology. This package holds no copy. */
|
|
2485
|
+
readonly label: string;
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* WHAT A PAYMENT DID, in the platform's own three words.
|
|
2490
|
+
*
|
|
2491
|
+
* THE CHAIN, WHICH IS THE WHOLE POINT: the status endpoint's `completed` means the
|
|
2492
|
+
* PROVIDER took the money — lowercase because it is the platform API's own enum literal,
|
|
2493
|
+
* not ours. The frame's SUCCESS means the payment host then finalized it
|
|
2494
|
+
* (`convertToTransaction` succeeded), so the tickets exist. `PLACED` is what this widget
|
|
2495
|
+
* publishes, and it is set from SUCCESS alone — never from `completed`, which can arrive
|
|
2496
|
+
* while finalization is still pending or has failed.
|
|
2497
|
+
*/
|
|
2498
|
+
export declare type PaymentOutcome =
|
|
2499
|
+
/** Declined, with the provider's own words for why. */
|
|
2500
|
+
{
|
|
2501
|
+
readonly kind: 'FAILED';
|
|
2502
|
+
readonly reason: string;
|
|
2503
|
+
}
|
|
2504
|
+
/**
|
|
2505
|
+
* Taken but not finalized. The recovery view's state: no pay button, no resubmit —
|
|
2506
|
+
* a second charge against a completed order is the one mistake this flow must not
|
|
2507
|
+
* offer.
|
|
2508
|
+
*/
|
|
2509
|
+
| {
|
|
2510
|
+
readonly kind: 'PAID';
|
|
2511
|
+
}
|
|
2512
|
+
/** Taken. The tickets are the buyer's and nothing can change. */
|
|
2513
|
+
| {
|
|
2514
|
+
readonly kind: 'PLACED';
|
|
2515
|
+
/**
|
|
2516
|
+
* WHICH TICKET THE PAYMENT MADE — the first of them, and the one the rating card
|
|
2517
|
+
* rates. The payment host reads it off the transaction it has just converted and
|
|
2518
|
+
* names it on the frame's SUCCESS, which is the only moment it is knowable: there is
|
|
2519
|
+
* no attendee ticket until the money is finalized.
|
|
2520
|
+
*
|
|
2521
|
+
* OPTIONAL BECAUSE A HOST MAY ASSERT THIS OUTCOME ITSELF and have no ticket to name
|
|
2522
|
+
* — see `CheckoutProps.payment`. Nothing else in the flow reads it, so an outcome
|
|
2523
|
+
* without one is a complete answer to every question but the rating's.
|
|
2524
|
+
*/
|
|
2525
|
+
readonly attendeeTicketKey?: string;
|
|
2526
|
+
};
|
|
2527
|
+
|
|
2528
|
+
export declare function PaymentReturn({ apiKey, environment, checkoutPath, returnPath, onCompleted, }: PaymentReturnProps): react_jsx_runtime.JSX.Element;
|
|
2529
|
+
|
|
2530
|
+
/**
|
|
2531
|
+
* THE RETURN PAGE FOR A PAYMENT THAT LEFT THE BROWSER — the Revolut app-handoff and the
|
|
2532
|
+
* popup's landing, mounted by the site at `/revolut-return` on the checkout page's own
|
|
2533
|
+
* origin (the host's redirect URLs point there; see the payment host's Checkout route).
|
|
2534
|
+
*
|
|
2535
|
+
* The widget is unmounted by then: navigation took the buyer away, so nothing of the
|
|
2536
|
+
* purchase survives on this page — not the client, not the island, not `onCommit`. This
|
|
2537
|
+
* component is what stands in: it builds its own API client from the key, converts the
|
|
2538
|
+
* cart on success, and hands completion to the site through `onCompleted` or a redirect
|
|
2539
|
+
* to `returnPath`. That `onCommit` can never fire here is a documented divergence on the
|
|
2540
|
+
* TwinkleTown checklist, not an oversight.
|
|
2541
|
+
*/
|
|
2542
|
+
export declare interface PaymentReturnProps {
|
|
2543
|
+
/** The site's public API key — the same one the checkout widget mounts with. */
|
|
2544
|
+
readonly apiKey: string;
|
|
2545
|
+
/**
|
|
2546
|
+
* Which platform the cart lives on. The default matches the widget's own
|
|
2547
|
+
* (`production`); a site that mounts the widget on sandbox must say so here too.
|
|
2548
|
+
*/
|
|
2549
|
+
readonly environment?: Environment;
|
|
2550
|
+
/**
|
|
2551
|
+
* Where the buyer's checkout page lives, shown as the way back when the payment
|
|
2552
|
+
* did not complete (cancelled or failed). The site's own route; no default.
|
|
2553
|
+
*/
|
|
2554
|
+
readonly checkoutPath?: string;
|
|
2555
|
+
/**
|
|
2556
|
+
* Where to send the buyer after a successful conversion, when `onCompleted` is
|
|
2557
|
+
* not given. Navigation replaces this page — the buyer should not come "back" to
|
|
2558
|
+
* a return URL.
|
|
2559
|
+
*/
|
|
2560
|
+
readonly returnPath?: string;
|
|
2561
|
+
/**
|
|
2562
|
+
* Completion news for the site, called once after the cart is converted and the
|
|
2563
|
+
* once-marker is written — see `purchase-completion.ts` for why the order of those
|
|
2564
|
+
* two is the rule and not a detail.
|
|
2565
|
+
*/
|
|
2566
|
+
readonly onCompleted?: (cartKey: string) => void;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
/** "Phone Number" — the design, and it is TWO fields. CONTROLLED the same way Name is. */
|
|
2570
|
+
export declare function PhoneStep({ value, onChange, onAnsweredChange, }: AnswerReporting & {
|
|
2571
|
+
readonly value?: PhoneValue;
|
|
2572
|
+
readonly onChange?: (value: PhoneValue) => void;
|
|
2573
|
+
}): react_jsx_runtime.JSX.Element;
|
|
2574
|
+
|
|
2575
|
+
/** The pair the step holds — one row each. */
|
|
2576
|
+
declare type PhoneValue = {
|
|
2577
|
+
readonly dialCode: string;
|
|
2578
|
+
readonly national: string;
|
|
2579
|
+
};
|
|
2580
|
+
|
|
2581
|
+
/** Which steps wear the PICKER LAYOUT — no hero, so the card opens on the run. */
|
|
2582
|
+
export declare const PICKER_LAYOUT: Partial<Record<PurchaseStepId, boolean>>;
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* WHAT A FINISHED PURCHASE HANDS THE BOOKING.
|
|
2586
|
+
*
|
|
2587
|
+
* THE CART KEY AND NOT THE TRANSACTION'S: `Transactions/ByKey` takes the cart's, and the
|
|
2588
|
+
* transaction's own comes back inside the response — see `bookingGateway`.
|
|
2589
|
+
*
|
|
2590
|
+
* THE OCCASION TRAVELS WITH IT because the platform does not answer for it, and the flow is
|
|
2591
|
+
* the one place that holds every field: it has just walked a buyer through choosing the run,
|
|
2592
|
+
* the day and the session. See `BookingOccasion`.
|
|
2593
|
+
*/
|
|
2594
|
+
export declare type PlacedBooking = {
|
|
2595
|
+
readonly cartKey: string;
|
|
2596
|
+
readonly occasion: BookingOccasion;
|
|
2597
|
+
readonly attribution: TicketAttribution;
|
|
2598
|
+
/**
|
|
2599
|
+
* THE TICKETS, ALREADY READ — and this is why the handover is asynchronous.
|
|
2600
|
+
*
|
|
2601
|
+
* The island fetches its incoming content BEFORE it transitions, then morphs, then fades
|
|
2602
|
+
* in. Swapping to the booking and letting IT fetch puts a fifth card between the last step
|
|
2603
|
+
* of the purchase and the tickets: the buyer watches "Opening Your Booking" appear from
|
|
2604
|
+
* nothing and then transition again, which is two moves where the design draws one. So
|
|
2605
|
+
* the flow stays on the card the buyer just pressed until the read lands, and the swap is
|
|
2606
|
+
* the transition.
|
|
2607
|
+
*
|
|
2608
|
+
* ABSENT WHERE THE READ FAILED OR FOUND NOTHING, which is the one case the booking has to
|
|
2609
|
+
* work that out for itself — it has the notice and the Try Again, and this does not.
|
|
2610
|
+
*/
|
|
2611
|
+
readonly record?: BookingRecord;
|
|
2612
|
+
};
|
|
2613
|
+
|
|
2614
|
+
/** The inset a plane lays its content out at, in px, per axis. */
|
|
2615
|
+
declare type PlanePadding = {
|
|
2616
|
+
readonly block: number;
|
|
2617
|
+
readonly inline: number;
|
|
2618
|
+
};
|
|
2619
|
+
|
|
2620
|
+
export declare type PressHandlers = {
|
|
2621
|
+
readonly onPointerDown: (event: PointerEvent_2) => void;
|
|
2622
|
+
readonly onPointerUp: () => void;
|
|
2623
|
+
readonly onPointerLeave: () => void;
|
|
2624
|
+
readonly onPointerEnter: (event: PointerEvent_2) => void;
|
|
2625
|
+
readonly onPointerCancel: () => void;
|
|
2626
|
+
/** Present only on an `element` press — the island has its own attribute. */
|
|
2627
|
+
readonly 'data-pressed'?: '';
|
|
2628
|
+
};
|
|
2629
|
+
|
|
2630
|
+
/** Where the press has got to. There are only two answers. */
|
|
2631
|
+
declare type PressPhase = 'held';
|
|
2632
|
+
|
|
2633
|
+
/** WHAT the press compresses, which is decided by what the control DOES. */
|
|
2634
|
+
export declare type PressScope = 'island' | 'element';
|
|
2635
|
+
|
|
2636
|
+
/**
|
|
2637
|
+
* THE PHOTO GRID'S OWN WORDS — the group, its cells and the two refusals.
|
|
2638
|
+
*
|
|
2639
|
+
* A STOCK PHOTO HAS NO NAME. The platform stocks faces, not people, so a cell is named by
|
|
2640
|
+
* where it sits — which is the only thing that tells one from another out loud, and is
|
|
2641
|
+
* what a buyer counting across a grid would say themselves.
|
|
2642
|
+
*/
|
|
2643
|
+
export declare const PROFILE_PHOTO_COPY: {
|
|
2644
|
+
readonly group: "Profile photo";
|
|
2645
|
+
readonly photo: (position: number) => string;
|
|
2646
|
+
/** The cell an upload makes, which is the one face here that IS somebody's. */
|
|
2647
|
+
readonly uploaded: "Your photo";
|
|
2648
|
+
readonly refusal: {
|
|
2649
|
+
NOT_AN_IMAGE: string;
|
|
2650
|
+
TOO_LARGE: string;
|
|
2651
|
+
};
|
|
2652
|
+
};
|
|
2653
|
+
|
|
2654
|
+
/**
|
|
2655
|
+
* WHAT MAY BECOME SOMEBODY'S FACE — the one rule the photo step enforces on a file it did
|
|
2656
|
+
* not choose.
|
|
2657
|
+
*
|
|
2658
|
+
* `accept="image/*"` decides what the picker OFFERS and guarantees nothing: a browser
|
|
2659
|
+
* hands back whatever was dragged onto it. So a chosen file is external input, and the two
|
|
2660
|
+
* things knowable before anything is drawn are checked here, apart from the DOM.
|
|
2661
|
+
*/
|
|
2662
|
+
|
|
2663
|
+
/**
|
|
2664
|
+
* ONE OF THE STOCK FACES A NEW ACCOUNT CAN BE GIVEN — the platform's, exactly as the
|
|
2665
|
+
* calendar's days are: the widget owns the grid's layout and none of its faces.
|
|
2666
|
+
*/
|
|
2667
|
+
export declare type ProfilePhoto = {
|
|
2668
|
+
/** The id inside the `default:<id>` value an account stores. */
|
|
2669
|
+
readonly id: string;
|
|
2670
|
+
/** Where the picture is. */
|
|
2671
|
+
readonly url: string;
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2674
|
+
/** One face the grid offers, as the grid needs it. */
|
|
2675
|
+
export declare type ProfilePhotoOption = {
|
|
2676
|
+
/**
|
|
2677
|
+
* THE AVATAR VALUE THIS CELL STANDS FOR — `default:<id>` for one of the platform's
|
|
2678
|
+
* stock photos, and an uploaded photo's own url for the cell a buyer made. It is what
|
|
2679
|
+
* the account will store, so the grid never has to translate what it hands back.
|
|
2680
|
+
*/
|
|
2681
|
+
readonly value: string;
|
|
2682
|
+
/** Where the picture is. */
|
|
2683
|
+
readonly url: string;
|
|
2684
|
+
/** What this cell is called, for assistive technology. This package holds no copy. */
|
|
2685
|
+
readonly label: string;
|
|
2686
|
+
};
|
|
2687
|
+
|
|
2688
|
+
/** The Profile Photo step's grid — the design's `SelectableProfilePhotosWrapper`. */
|
|
2689
|
+
export declare function ProfilePhotoPicker({ photos, selectedValue, onSelect, label, inputRef, onFileChosen, refusal, }: ProfilePhotoPickerProps): react_jsx_runtime.JSX.Element;
|
|
2690
|
+
|
|
2691
|
+
export declare type ProfilePhotoPickerProps = {
|
|
2692
|
+
readonly photos: readonly ProfilePhotoOption[];
|
|
2693
|
+
/** The chosen value, or empty for a buyer who has not chosen yet. */
|
|
2694
|
+
readonly selectedValue: string;
|
|
2695
|
+
readonly onSelect: (value: string) => void;
|
|
2696
|
+
/** Names the group for assistive technology. */
|
|
2697
|
+
readonly label: string;
|
|
2698
|
+
/**
|
|
2699
|
+
* THE UPLOAD BUTTON IS ON THE CARD, under Continue, where the design puts it — so the
|
|
2700
|
+
* file input it opens is reached from out there rather than drawn beside the grid.
|
|
2701
|
+
* The input lives here because what it produces is a cell in this grid.
|
|
2702
|
+
*/
|
|
2703
|
+
readonly inputRef: RefObject<HTMLInputElement>;
|
|
2704
|
+
readonly onFileChosen: (file: File) => void;
|
|
2705
|
+
/** Why the last file was refused, in words, or absent while none was. */
|
|
2706
|
+
readonly refusal?: string | null;
|
|
2707
|
+
};
|
|
2708
|
+
|
|
2709
|
+
/**
|
|
2710
|
+
* THE TWO SETS THE PLATFORM PUBLISHES, as the folders it publishes them in.
|
|
2711
|
+
*
|
|
2712
|
+
* `256` IS WHAT THE WIDGET DRAWS, and is the default for that reason. The picker's cells
|
|
2713
|
+
* are 64px and the largest hero is 100, so this is 2.5x the biggest thing it is ever put
|
|
2714
|
+
* in — which is the headroom a retina screen wants and no more. The whole set is ~290KB.
|
|
2715
|
+
*
|
|
2716
|
+
* `1024` IS THE ORIGINAL, and nothing here asks for it: every avatar this package draws is
|
|
2717
|
+
* 100px or under, so it would be ten times the bytes for pixels no screen resolves. It is
|
|
2718
|
+
* named rather than left out because it exists, and because the day something draws a face
|
|
2719
|
+
* at full width the choice is this argument rather than a new path.
|
|
2720
|
+
*/
|
|
2721
|
+
export declare type ProfilePhotoSize = 256 | 1024;
|
|
2722
|
+
|
|
2723
|
+
/**
|
|
2724
|
+
* The steps of a purchase, in the buyer's order, and what the resting pill's action
|
|
2725
|
+
* says at each.
|
|
2726
|
+
*/
|
|
2727
|
+
|
|
2728
|
+
/** In the flow's own order, so the union reads as the sequence it names. */
|
|
2729
|
+
declare type PurchaseStepId = 'PARTY' | 'DATE' | 'TIME' | 'SIGN_IN' | 'NAME' | 'EMAIL' | 'PHONE' | 'DETAILS' | 'REVIEW' | 'PAYMENT' | 'PROMO' | 'ABANDON' | 'PROCESSING' | 'PAYMENT_FAILED' | 'PAYMENT_SUCCESS' | 'FEEDBACK' | 'CREATE_ACCOUNT' | 'CONFIRM_EMAIL' | 'VERIFY_EMAIL' | 'PASSWORD' | 'PROFILE_PHOTO' | 'ACCOUNT_CREATING' | 'ACCOUNT_CREATED' | 'PASSKEY' | 'FOLLOW';
|
|
2730
|
+
|
|
2731
|
+
/** @internal */
|
|
2732
|
+
declare interface QuestionnaireQuestion {
|
|
2733
|
+
Question: string;
|
|
2734
|
+
QuestionId: number;
|
|
2735
|
+
Type: 'text' | 'date' | 'checkbox' | string;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
/** One quick action: a glyph in a ring, and what it does, in two short words. */
|
|
2739
|
+
export declare type QuickAction = {
|
|
2740
|
+
readonly key: string;
|
|
2741
|
+
readonly glyph: ReactNode;
|
|
2742
|
+
/**
|
|
2743
|
+
* THE WORDS, AS LINES. The design sets "Show / QR" and "Edit / Ticketholder" on two lines
|
|
2744
|
+
* each, and it is not a wrap — it is where the phrase breaks. A single string broken by
|
|
2745
|
+
* the column's width would put "Edit Ticket" over "holder" on a narrow card, so the break
|
|
2746
|
+
* is the caller's and the accessible name is the lines joined.
|
|
2747
|
+
*/
|
|
2748
|
+
readonly lines: readonly string[];
|
|
2749
|
+
readonly disabled?: boolean;
|
|
2750
|
+
readonly onPress: () => void;
|
|
2751
|
+
};
|
|
2752
|
+
|
|
2753
|
+
/**
|
|
2754
|
+
* THE ROW OF QUICK ACTIONS under a ticket — the design's `QuickAction`, twice.
|
|
2755
|
+
*
|
|
2756
|
+
* NOT BUTTONS IN THE CARD'S OWN STACK, and the difference is what they mean. The stack at
|
|
2757
|
+
* the foot of a card is what the card is FOR — Save, Continue, Close — and these are the
|
|
2758
|
+
* two things a buyer might do with a ticket they are already looking at. The design draws
|
|
2759
|
+
* them above the stack, apart, under a hairline, and gives them a shape of their own.
|
|
2760
|
+
*
|
|
2761
|
+
* EQUAL COLUMNS whatever the count, so two read as a pair rather than as one control and a
|
|
2762
|
+
* leftover.
|
|
2763
|
+
*/
|
|
2764
|
+
export declare function QuickActions({ actions }: QuickActionsProps): react_jsx_runtime.JSX.Element;
|
|
2765
|
+
|
|
2766
|
+
export declare type QuickActionsProps = {
|
|
2767
|
+
readonly actions: readonly QuickAction[];
|
|
2768
|
+
};
|
|
2769
|
+
|
|
2770
|
+
/** What the buyer is being asked to pay, as one value. */
|
|
2771
|
+
declare type Quote =
|
|
2772
|
+
/** Nothing priceable at all — no floor, no total. See `quoteLines`. */
|
|
2773
|
+
{
|
|
2774
|
+
readonly kind: 'NONE';
|
|
2775
|
+
}
|
|
2776
|
+
/**
|
|
2777
|
+
* THE DEFAULT: the cheapest ticket, and the buyer may pay more. Qualified "From" on the
|
|
2778
|
+
* line above.
|
|
2779
|
+
*/
|
|
2780
|
+
| {
|
|
2781
|
+
readonly kind: 'FROM';
|
|
2782
|
+
readonly minorUnits: number;
|
|
2783
|
+
readonly currency: string;
|
|
2784
|
+
}
|
|
2785
|
+
/**
|
|
2786
|
+
* A price with a discount already applied. The saving REPLACES the "From" rather than
|
|
2787
|
+
* joining it — one qualifier, or the line says two things at once and the buyer has to
|
|
2788
|
+
* work out which governs.
|
|
2789
|
+
*/
|
|
2790
|
+
| {
|
|
2791
|
+
readonly kind: 'SAVING';
|
|
2792
|
+
readonly minorUnits: number;
|
|
2793
|
+
readonly currency: string;
|
|
2794
|
+
readonly savedMinorUnits: number;
|
|
2795
|
+
}
|
|
2796
|
+
/** Settled: what will actually be charged, with nothing to qualify. */
|
|
2797
|
+
| {
|
|
2798
|
+
readonly kind: 'TOTAL';
|
|
2799
|
+
readonly minorUnits: number;
|
|
2800
|
+
readonly currency: string;
|
|
2801
|
+
};
|
|
2802
|
+
|
|
2803
|
+
/**
|
|
2804
|
+
* WHAT THE ORDER'S STATE RAISES, or nothing at all — one place, so the flow does not grow
|
|
2805
|
+
* a second opinion about which card it is on.
|
|
2806
|
+
*
|
|
2807
|
+
* IT TAKES THE OUTCOME RATHER THAN READINGS OF IT. This was a shortfall beside a boolean,
|
|
2808
|
+
* and it had to rank them: a cart that filled short is an order the buyer HAS, while a
|
|
2809
|
+
* failure on the same state can be a later call going wrong against it, and telling
|
|
2810
|
+
* somebody their order failed while they hold four tickets is worse than telling them
|
|
2811
|
+
* about the four. With one state there is nothing to rank — see `OrderFill`.
|
|
2812
|
+
*/
|
|
2813
|
+
export declare function raiseFor(fill: OrderFill): Notice | null;
|
|
2814
|
+
|
|
2815
|
+
/**
|
|
2816
|
+
* WHAT WENT WRONG WITH THE BOOKING, or nothing — the same shape as `raiseForFeedback`, and
|
|
2817
|
+
* the same rule: only a state that IS a failure raises one.
|
|
2818
|
+
*
|
|
2819
|
+
* TWO SOURCES, ONE ANSWER. The read and the save cannot both be the matter at once — the
|
|
2820
|
+
* Edit card is only reachable from a booking that loaded — so the read is asked first and
|
|
2821
|
+
* the save is asked of the card the buyer is actually standing on.
|
|
2822
|
+
*/
|
|
2823
|
+
export declare function raiseForBooking(booking: BookingState, save: HolderSave): Notice | null;
|
|
2824
|
+
|
|
2825
|
+
/**
|
|
2826
|
+
* THE BOUNDARY — and it takes TWO responses, because neither endpoint is complete.
|
|
2827
|
+
*
|
|
2828
|
+
* ── WHY BOTH, AND WHY THIS COST A BOOKING ITS TICKETS ────────────────────────
|
|
2829
|
+
*
|
|
2830
|
+
* `Transactions/ByKey/{cartKey}` is the only call that carries a holder's NAME. It also
|
|
2831
|
+
* OMITS the nested `Attendee` entirely for a transaction made from the v2 cart endpoint —
|
|
2832
|
+
* which is every transaction this widget makes. `@scopetickets/sdk`'s own
|
|
2833
|
+
* `useTicketConfirmation` has said so since before the island existed: "do not rely on it
|
|
2834
|
+
* as the only source of the attendee ID".
|
|
2835
|
+
*
|
|
2836
|
+
* This file did rely on it. An item was a ticket when it had a key AND an attendee, so
|
|
2837
|
+
* against a real purchase every row was dropped, `readBooking` answered `null`, and a buyer
|
|
2838
|
+
* who had just paid was shown "No Tickets Here Yet".
|
|
2839
|
+
*
|
|
2840
|
+
* `Transactions/{transactionKey}/Items` is the other half: a list of ATTENDEE TICKETS by
|
|
2841
|
+
* definition, each with its `AttendeeTicketKey` and its numeric `ID` — and no names at
|
|
2842
|
+
* all.
|
|
2843
|
+
*
|
|
2844
|
+
* ── SO A ROW IS A TICKET WHEN EITHER HALF SAYS IT IS ─────────────────────────
|
|
2845
|
+
*
|
|
2846
|
+
* It is named by the attendee-ticket list, OR it carries an attendee. Two clauses, each
|
|
2847
|
+
* with its own reason: the first is the platform's own statement that this is a ticket, and
|
|
2848
|
+
* the second is that it belongs to a PERSON. A booking fee has neither, which is the whole
|
|
2849
|
+
* of what has to be excluded — and `Items[].Type` still goes unread, for the reason at the
|
|
2850
|
+
* top of this file.
|
|
2851
|
+
*
|
|
2852
|
+
* ── AND THE TRANSACTION KEY FALLS BACK TO THE CART'S ─────────────────────────
|
|
2853
|
+
*
|
|
2854
|
+
* `TransactionKey || cartKey` is the SDK's own line. On staging the two are the same 64-hex
|
|
2855
|
+
* token for a cart that became a transaction; where they are not, the platform accepts the
|
|
2856
|
+
* cart's on the routes that matter, so a summary that came back without one is not a reason
|
|
2857
|
+
* to refuse a buyer their tickets.
|
|
2858
|
+
*
|
|
2859
|
+
* BOTH ARE BOUNDED BY `WIRE_LIMITS.order` AND NOT BY `.key`, which is the whole of the bug
|
|
2860
|
+
* this function was written with: an attendee ticket's key is 32 characters and a
|
|
2861
|
+
* transaction's is 64, and the 50 that is generous for the first rejects the second
|
|
2862
|
+
* outright. See the limit's own note.
|
|
2863
|
+
*/
|
|
2864
|
+
export declare function readBooking(summary: TransactionByKeyResponse, attendeeTickets: readonly AttendeeTicket[],
|
|
2865
|
+
/** What the summary was asked for, as the last resort for the key a save needs. */
|
|
2866
|
+
cartKey: string): BookingRecord | null;
|
|
2867
|
+
|
|
2868
|
+
/** One item as the widget ASKED for it, reduced to the part a line needs. */
|
|
2869
|
+
export declare type RequestedItem = {
|
|
2870
|
+
readonly UserTypeAssignmentKey?: string | null;
|
|
2871
|
+
};
|
|
2872
|
+
|
|
2873
|
+
export declare const RESTING_CART: {
|
|
2874
|
+
readonly checkOut: "Check Out";
|
|
2875
|
+
readonly close: "Close";
|
|
2876
|
+
/** While the checks behind Check Out are running — see `runCheckoutPreflight`. */
|
|
2877
|
+
readonly checking: "Checking…";
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2880
|
+
/**
|
|
2881
|
+
* The resting cart as the props that draw it. The hero is the caller's, as it is for every
|
|
2882
|
+
* other card here.
|
|
2883
|
+
*
|
|
2884
|
+
* THE HOLD IS STILL TAKEN THOUGH IT NO LONGER PICKS THE SUBTITLE, because the hero's ring
|
|
2885
|
+
* is still drawn from it.
|
|
2886
|
+
*/
|
|
2887
|
+
export declare function restingCartViewProps(input: ReactNode, hold: EscrowHold | undefined, onCheckOut: () => void, onClose: () => void,
|
|
2888
|
+
/** Whether the checks are running, which shuts the button and says so. */
|
|
2889
|
+
checking: boolean): {
|
|
2890
|
+
variant: "cart";
|
|
2891
|
+
title: "My Cart";
|
|
2892
|
+
subtitle: "Includes all taxes and service fees.";
|
|
2893
|
+
input: ReactNode;
|
|
2894
|
+
actions: ({
|
|
2895
|
+
key: string;
|
|
2896
|
+
role: "primary";
|
|
2897
|
+
label: "Check Out" | "Checking…";
|
|
2898
|
+
disabled: boolean;
|
|
2899
|
+
onPress: () => void;
|
|
2900
|
+
} | {
|
|
2901
|
+
key: string;
|
|
2902
|
+
role: "secondary";
|
|
2903
|
+
label: "Close";
|
|
2904
|
+
onPress: () => void;
|
|
2905
|
+
disabled?: undefined;
|
|
2906
|
+
})[];
|
|
2907
|
+
};
|
|
2908
|
+
|
|
2909
|
+
/**
|
|
2910
|
+
* WHICH WAY ROUND AN ARC GROWS FROM 12 O'CLOCK.
|
|
2911
|
+
*
|
|
2912
|
+
* `cw` is a clock's own sense and the default everywhere — the countdown's hand, the
|
|
2913
|
+
* character counter, the design's `StepCompletionProgressRing`. `ccw` is its mirror, and
|
|
2914
|
+
* it earns a place because a ring that DEPLETES reads differently unwinding than it does
|
|
2915
|
+
* filling backwards: the timeslot's remaining ring runs down, not up.
|
|
2916
|
+
*/
|
|
2917
|
+
export declare type RingDirection = 'cw' | 'ccw';
|
|
2918
|
+
|
|
2919
|
+
/**
|
|
2920
|
+
* THE PICTURE EVERY LINE OF THE CART WEARS — `Backgrounds[0]`.
|
|
2921
|
+
*
|
|
2922
|
+
* THE RUN'S FIRST, THEN A NIGHT'S OWN: a series is one artwork over many nights, and the
|
|
2923
|
+
* same order `EventProvider` reads them in. A series that names none does NOT borrow a
|
|
2924
|
+
* night's — that would put a different picture on the cart depending on which day happened
|
|
2925
|
+
* to come first in the response.
|
|
2926
|
+
*
|
|
2927
|
+
* `undefined` where there is none, which the avatar answers with its own fill; an empty
|
|
2928
|
+
* string would be a src the browser resolves against the host's page.
|
|
2929
|
+
*/
|
|
2930
|
+
export declare function runArtwork(series: {
|
|
2931
|
+
readonly Theme?: ArtworkTheme;
|
|
2932
|
+
} | null | undefined, events: readonly {
|
|
2933
|
+
readonly Theme?: ArtworkTheme;
|
|
2934
|
+
}[],
|
|
2935
|
+
/** The CDN every Scope-hosted url is put on. Stated by the caller, never inferred here. */
|
|
2936
|
+
origin?: string): string | undefined;
|
|
2937
|
+
|
|
2938
|
+
/**
|
|
2939
|
+
* THE WIDGET A HOST MOUNTS, and the two decisions it makes before anything else: is there
|
|
2940
|
+
* an order, and has the buyer said they are checking out.
|
|
2941
|
+
*
|
|
2942
|
+
* FOUR FACES, ONE MOUNT. `RestingIsland` is the widget at rest — the account card, or the
|
|
2943
|
+
* cart once there is something in it. `PurchaseIsland` is the walk, which is everything this
|
|
2944
|
+
* file was. `BookingIsland` is what the walk ends at: the tickets it bought. A host that
|
|
2945
|
+
* hands in an order and says nothing gets the walk, exactly as before; a host that says
|
|
2946
|
+
* `opensOn="cart"` gets the cart until the buyer presses Check Out.
|
|
2947
|
+
*
|
|
2948
|
+
* TWO COMPONENTS AND NOT ONE WITH GUARDS. Every reading the flow makes — the excusal, the
|
|
2949
|
+
* refusal, the cart it opens, the fold `onCommit` hands back — is about an order it is
|
|
2950
|
+
* holding. Threading an absent one through all of them would put a `?.` on each and leave
|
|
2951
|
+
* the subject's requiredness true in the type and untrue in the code. Answering the
|
|
2952
|
+
* question once, here, keeps `PurchaseIsland` exactly as strict as it was.
|
|
2953
|
+
*/
|
|
2954
|
+
export declare function ScopeTicketsCheckout({ intent, opensOn, session: seed, ...props }: CheckoutProps): react_jsx_runtime.JSX.Element;
|
|
2955
|
+
|
|
2956
|
+
/** THE SIGN-IN FUNNEL'S CREDENTIAL CARD — the design. */
|
|
2957
|
+
export declare const SIGN_IN_FUNNEL_CARD: {
|
|
2958
|
+
readonly copy: {
|
|
2959
|
+
readonly title: react_jsx_runtime.JSX.Element;
|
|
2960
|
+
readonly subtitle: "Sign in below.";
|
|
2961
|
+
};
|
|
2962
|
+
/** the design primary, the design secondary. */
|
|
2963
|
+
readonly actions: readonly CardAction[];
|
|
2964
|
+
readonly accessory: undefined;
|
|
2965
|
+
};
|
|
2966
|
+
|
|
2967
|
+
/**
|
|
2968
|
+
* THE FOUR SESSIONS, READY MADE — and there is no machinery behind these on purpose.
|
|
2969
|
+
*
|
|
2970
|
+
* Auth needs nothing invented: `session` is already a plain data prop the host hands in,
|
|
2971
|
+
* so every state the flow reasons about is expressible today. Pass one and the widget
|
|
2972
|
+
* behaves as it will when accounts are real.
|
|
2973
|
+
*/
|
|
2974
|
+
export declare const SIMULATED_SESSIONS: {
|
|
2975
|
+
/** Nobody. The first visit, and the card that offers guest checkout. */
|
|
2976
|
+
readonly unrecognised: {
|
|
2977
|
+
readonly auth: {
|
|
2978
|
+
readonly status: "UNRECOGNISED";
|
|
2979
|
+
};
|
|
2980
|
+
readonly guest: "NOT_TAKEN";
|
|
2981
|
+
};
|
|
2982
|
+
/** Chose to check out without an account — sign-in is bypassed from here on. */
|
|
2983
|
+
readonly guest: {
|
|
2984
|
+
readonly auth: {
|
|
2985
|
+
readonly status: "UNRECOGNISED";
|
|
2986
|
+
};
|
|
2987
|
+
readonly guest: "TAKEN";
|
|
2988
|
+
};
|
|
2989
|
+
/** A profile we hold, no live session: the keyhole card, and a face on the island. */
|
|
2990
|
+
readonly recognised: {
|
|
2991
|
+
readonly auth: {
|
|
2992
|
+
readonly status: "RECOGNISED";
|
|
2993
|
+
readonly avatar: "initials:AL";
|
|
2994
|
+
};
|
|
2995
|
+
readonly guest: "NOT_TAKEN";
|
|
2996
|
+
};
|
|
2997
|
+
/** Signed in. Name, email and phone are answered by the account, not by the buyer. */
|
|
2998
|
+
readonly authenticated: {
|
|
2999
|
+
readonly auth: {
|
|
3000
|
+
readonly status: "AUTHENTICATED";
|
|
3001
|
+
readonly account: {
|
|
3002
|
+
readonly avatar: "initials:AL";
|
|
3003
|
+
readonly name: "Ada Lovelace";
|
|
3004
|
+
readonly email: "ada@example.test";
|
|
3005
|
+
readonly phone: "+353871234567";
|
|
3006
|
+
readonly userTypeKey: null;
|
|
3007
|
+
};
|
|
3008
|
+
};
|
|
3009
|
+
readonly guest: "NOT_TAKEN";
|
|
3010
|
+
};
|
|
3011
|
+
};
|
|
3012
|
+
|
|
3013
|
+
export declare function simulatedSchedule(today?: string, nights?: number): CheckoutSchedule;
|
|
3014
|
+
|
|
3015
|
+
/** The key the single line counts under when the event names no types. */
|
|
3016
|
+
export declare const SOLO_KEY = "default";
|
|
3017
|
+
|
|
3018
|
+
/**
|
|
3019
|
+
* THE RATING CARD'S FIVE STARS — the design's `StarRating`, in its well.
|
|
3020
|
+
*
|
|
3021
|
+
* ON ARRIVAL EVERY STAR IS FILLED, under the dim `island.css` holds the row at. It shows
|
|
3022
|
+
* what the control is FOR: five stars, waiting. It is emphatically NOT a rating of five,
|
|
3023
|
+
* and nothing downstream reads it as one — `value` is still `null`, the radios are all
|
|
3024
|
+
* unchecked, and Continue is shut until the buyer presses something.
|
|
3025
|
+
*/
|
|
3026
|
+
export declare function StarRating({ value, onChange, label }: StarRatingProps): react_jsx_runtime.JSX.Element;
|
|
3027
|
+
|
|
3028
|
+
export declare type StarRatingProps = {
|
|
3029
|
+
/** The rating so far, or `null` while the buyer has chosen none. */
|
|
3030
|
+
readonly value: FeedbackRating | null;
|
|
3031
|
+
/**
|
|
3032
|
+
* THE NEW RATING, OR `null` FOR ONE TAKEN BACK — see the star's own note. The card is
|
|
3033
|
+
* gated on `value`, so handing `null` back shuts Continue again, which is the whole
|
|
3034
|
+
* point: a buyer who has unrated has not rated.
|
|
3035
|
+
*/
|
|
3036
|
+
readonly onChange: (rating: FeedbackRating | null) => void;
|
|
3037
|
+
/** Names the group — see `ratingLabel` for what the options are called. */
|
|
3038
|
+
readonly label: string;
|
|
3039
|
+
};
|
|
3040
|
+
|
|
3041
|
+
/** The same badges, each NAMED by the step that owns it. */
|
|
3042
|
+
export declare const STEP_ACCESSORY: Partial<Record<PurchaseStepId, StepBadge & {
|
|
3043
|
+
readonly id: string;
|
|
3044
|
+
}>>;
|
|
3045
|
+
|
|
3046
|
+
/** The card's own buttons per step, with the roles the source gives them. */
|
|
3047
|
+
export declare const STEP_CARD_ACTIONS: Record<PurchaseStepId, readonly CardAction[]>;
|
|
3048
|
+
|
|
3049
|
+
/** The hero copy per step, quoted. */
|
|
3050
|
+
export declare const STEP_CARD_COPY: Record<PurchaseStepId, {
|
|
3051
|
+
title: string;
|
|
3052
|
+
subtitle: string;
|
|
3053
|
+
}>;
|
|
3054
|
+
|
|
3055
|
+
/**
|
|
3056
|
+
* Steps whose header button CLOSES rather than steps back, against the gallery's own
|
|
3057
|
+
* rule that only the first step has nothing behind it.
|
|
3058
|
+
*/
|
|
3059
|
+
export declare const STEP_DISMISS: Partial<Record<PurchaseStepId, 'back' | 'close'>>;
|
|
3060
|
+
|
|
3061
|
+
declare type StepBadge = {
|
|
3062
|
+
readonly shape: 'square' | 'circle';
|
|
3063
|
+
readonly content: ReactNode;
|
|
3064
|
+
};
|
|
3065
|
+
|
|
3066
|
+
/**
|
|
3067
|
+
* STui's `Switch` (`11376:2089`) — an on/off control, for a host composing its own rows.
|
|
3068
|
+
*
|
|
3069
|
+
* CONTROLLED, AND ONLY CONTROLLED. A switch that kept its own state would flip under a
|
|
3070
|
+
* finger and then disagree with the host the moment the host refused the change — an
|
|
3071
|
+
* opt-in the session could not save, say. So it draws `checked` and asks for the other,
|
|
3072
|
+
* and nothing moves until the host says so.
|
|
3073
|
+
*
|
|
3074
|
+
* A `button` WITH `role="switch"` rather than a hidden checkbox, which is how every other
|
|
3075
|
+
* pressable thing in this package is built — the stars are buttons with `role="radio"`.
|
|
3076
|
+
* It takes the ELEMENT press: turning something on does not change what the island is.
|
|
3077
|
+
*/
|
|
3078
|
+
export declare function Switch({ checked, onChange, label, size, disabled }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
3079
|
+
|
|
3080
|
+
export declare type SwitchProps = {
|
|
3081
|
+
/** Whether it is on. The switch keeps no state of its own — see below. */
|
|
3082
|
+
readonly checked: boolean;
|
|
3083
|
+
/** Called with the state asked for, which is always the opposite of `checked`. */
|
|
3084
|
+
readonly onChange: (checked: boolean) => void;
|
|
3085
|
+
/**
|
|
3086
|
+
* The accessible name. The design draws the switch bare — its label is whatever row it
|
|
3087
|
+
* sits in — so without this a screen reader announces an unnamed switch. Pass the row's
|
|
3088
|
+
* own text.
|
|
3089
|
+
*/
|
|
3090
|
+
readonly label: string;
|
|
3091
|
+
/** Default `wide`. */
|
|
3092
|
+
readonly size?: SwitchSize;
|
|
3093
|
+
readonly disabled?: boolean;
|
|
3094
|
+
};
|
|
3095
|
+
|
|
3096
|
+
/** STui `Switch`'s two sizes: `wide` is `$12` across with a long thumb, `thin` `$8` with a short upright one. */
|
|
3097
|
+
export declare type SwitchSize = 'wide' | 'thin';
|
|
3098
|
+
|
|
3099
|
+
/** Figma's `InputTextShort`, ported from. */
|
|
3100
|
+
export declare function TextField({ label, value, onChange, flag, flagTitle, trailing, icon, note, type, inputMode, prose, autoComplete, autoCapitalize, passwordRules, enterKeyHint, onSubmit, monospace, placeholder, maxLength, autoFocus, id, name, }: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
3101
|
+
|
|
3102
|
+
export declare type TextFieldProps = {
|
|
3103
|
+
/** The field's name, and its only label — there is no placeholder. */
|
|
3104
|
+
readonly label: string;
|
|
3105
|
+
readonly value: string;
|
|
3106
|
+
readonly onChange?: (value: string) => void;
|
|
3107
|
+
/**
|
|
3108
|
+
* The mark at the trailing end, or absent while the field has nothing to say. `none` in
|
|
3109
|
+
* the domain's `ContentFlag` is this being omitted.
|
|
3110
|
+
*/
|
|
3111
|
+
readonly flag?: ContentFlagTone;
|
|
3112
|
+
/**
|
|
3113
|
+
* WHAT THE MARK MEANS, for anyone who cannot see it. `ContentFlag` hides an untitled
|
|
3114
|
+
* mark from the accessibility tree, which is right where the field's own text already
|
|
3115
|
+
* says what is wrong and wrong where the mark is the ONLY thing saying it — the email
|
|
3116
|
+
* field's `warning`, where nothing else on the card mentions the suspected typo.
|
|
3117
|
+
*/
|
|
3118
|
+
readonly flagTitle?: string;
|
|
3119
|
+
/**
|
|
3120
|
+
* Replaces the flag entirely — the password field's counter ring, which is not one of
|
|
3121
|
+
* the three marks., and its reasoning: the ring is a fourth thing a field can show and
|
|
3122
|
+
* folding it into the flag set would make the set mean two different kinds of thing.
|
|
3123
|
+
*/
|
|
3124
|
+
readonly trailing?: ReactNode;
|
|
3125
|
+
/** A mark at the LEADING end — `InputIconWrapper`. */
|
|
3126
|
+
readonly icon?: ReactNode;
|
|
3127
|
+
/**
|
|
3128
|
+
* A quiet note between the value and the flag, right-aligned — `inputNoteText`, which
|
|
3129
|
+
* the design fills with "2º". Here it is the phone step's dial code.
|
|
3130
|
+
*/
|
|
3131
|
+
readonly note?: ReactNode;
|
|
3132
|
+
/**
|
|
3133
|
+
* `text` unless said otherwise. `password` masks and, with
|
|
3134
|
+
* `autoComplete="new-password"`, is what asks the browser's password manager to suggest
|
|
3135
|
+
* one.
|
|
3136
|
+
*/
|
|
3137
|
+
readonly type?: 'text' | 'password' | 'email' | 'tel';
|
|
3138
|
+
/** Drives the on-screen keyboard on a touch device. */
|
|
3139
|
+
readonly inputMode?: 'text' | 'email' | 'tel' | 'numeric';
|
|
3140
|
+
/**
|
|
3141
|
+
* The autofill contract. Passed straight through; see `PASSWORD_RULES` for the one case
|
|
3142
|
+
* where a second attribute goes with it.
|
|
3143
|
+
*/
|
|
3144
|
+
readonly autoComplete?: string;
|
|
3145
|
+
readonly autoCapitalize?: 'none' | 'words' | 'sentences';
|
|
3146
|
+
/**
|
|
3147
|
+
* TURN THE PHONE'S HELP OFF, for a value it cannot help with: iOS autocorrects and
|
|
3148
|
+
* spell-checks a text input by default, and on an address, a surname or a revealed
|
|
3149
|
+
* password that is a phone rewriting an answer only the buyer knows.
|
|
3150
|
+
*
|
|
3151
|
+
* ONE PROP FOR BOTH ATTRIBUTES — a field either holds prose or it does not.
|
|
3152
|
+
*/
|
|
3153
|
+
readonly prose?: boolean;
|
|
3154
|
+
/**
|
|
3155
|
+
* Safari's Password Rules string, which is what makes "Suggest Strong Password"
|
|
3156
|
+
* generate to OUR minimum rather than its own default. Other browsers ignore it.
|
|
3157
|
+
*/
|
|
3158
|
+
readonly passwordRules?: string;
|
|
3159
|
+
/**
|
|
3160
|
+
* What the return key says, and what it does. Pair them: a key labelled "next" that
|
|
3161
|
+
* submits is worse than an unlabelled one.
|
|
3162
|
+
*/
|
|
3163
|
+
readonly enterKeyHint?: 'next' | 'done' | 'go';
|
|
3164
|
+
readonly onSubmit?: () => void;
|
|
3165
|
+
/**
|
|
3166
|
+
* The value in `text/mono/md` — Add Password's own instance does this, so a masked
|
|
3167
|
+
* password's dots sit on an even rhythm.
|
|
3168
|
+
*/
|
|
3169
|
+
readonly monospace?: boolean;
|
|
3170
|
+
/**
|
|
3171
|
+
* TAKE FOCUS ON MOUNT — the first field of a step, so a buyer can start typing the
|
|
3172
|
+
* answer to the question the card just asked.
|
|
3173
|
+
*
|
|
3174
|
+
* NOT the `autofocus` ATTRIBUTE, which fires at parse time and belongs to the document:
|
|
3175
|
+
* this widget is a guest on somebody's page and its steps mount long after that page
|
|
3176
|
+
* loaded. Focused with `preventScroll`, for the same reason — a card that yanked the
|
|
3177
|
+
* host's scroll position to itself would be a widget rearranging a site it does not own.
|
|
3178
|
+
*/
|
|
3179
|
+
readonly autoFocus?: boolean;
|
|
3180
|
+
/** A value to be confirmed rather than typed — see `ConfirmEmailStep`. */
|
|
3181
|
+
readonly placeholder?: string;
|
|
3182
|
+
/**
|
|
3183
|
+
* THE CEILING THE PLATFORM ITSELF ENFORCES, passed to the input rather than checked
|
|
3184
|
+
* after: a buyer who types past the line is stopped by the field they are standing in,
|
|
3185
|
+
* not told by a notice two presses later. Omitted where the wire sets no limit.
|
|
3186
|
+
*/
|
|
3187
|
+
readonly maxLength?: number;
|
|
3188
|
+
/** Given so a preceding field's return key can move focus here. */
|
|
3189
|
+
readonly id?: string;
|
|
3190
|
+
readonly name?: string;
|
|
3191
|
+
};
|
|
3192
|
+
|
|
3193
|
+
declare interface Ticket {
|
|
3194
|
+
/** @deprecated Legacy numeric ID — populated from v1 for cart compat, remove when v2 cart ships */
|
|
3195
|
+
ID?: number;
|
|
3196
|
+
Key: string;
|
|
3197
|
+
Name: string;
|
|
3198
|
+
Note: string | null;
|
|
3199
|
+
BasePrice: number;
|
|
3200
|
+
SalePrice: number;
|
|
3201
|
+
Fees: number;
|
|
3202
|
+
Total: number;
|
|
3203
|
+
/**
|
|
3204
|
+
* The product's own currency, where it states one — the most specific of the three
|
|
3205
|
+
* places this is set, above its event's and the run's. Optional because it is not on
|
|
3206
|
+
* every response, and a caller that finds it absent falls up rather than guessing.
|
|
3207
|
+
*/
|
|
3208
|
+
Currency?: string | null;
|
|
3209
|
+
Remaining: number;
|
|
3210
|
+
Available: boolean;
|
|
3211
|
+
Status: string | null;
|
|
3212
|
+
Starts: string | null;
|
|
3213
|
+
Ends: string | null;
|
|
3214
|
+
LocalStartTime: string | null;
|
|
3215
|
+
LocalEndTime: string | null;
|
|
3216
|
+
MinPerTransaction: number;
|
|
3217
|
+
MaxPerTransaction: number;
|
|
3218
|
+
PaymentsEnabled: boolean;
|
|
3219
|
+
AttendeeDetailsRequired: boolean;
|
|
3220
|
+
HasTimeslot: boolean;
|
|
3221
|
+
Questions: QuestionnaireQuestion[] | null;
|
|
3222
|
+
Timeslots: EventTimeslot[] | null;
|
|
3223
|
+
UrgencyTags: string[];
|
|
3224
|
+
/** Nullable for the same reason as the run's — see `EventInfoResponse`. */
|
|
3225
|
+
UserTypes: UserType[] | null;
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
/**
|
|
3229
|
+
* What `island.css` carries today, for a renderer with no layout — a test, SSR.
|
|
3230
|
+
*
|
|
3231
|
+
* ── 8 / 24 / 12: THE SCALE THE DESIGN WAS DRAWN AT ───────────────────────────
|
|
3232
|
+
*
|
|
3233
|
+
* `@scopetickets/sdk`'s ticket ships at 12/64/16, tuned on its own `/qr-lab` bench where a
|
|
3234
|
+
* ticket stands alone on a page and can afford a long, deep notch. This one is a card in a
|
|
3235
|
+
* 270px column, and at that measure the same numbers read as a coarse zigzag rather than a
|
|
3236
|
+
* perforation — and the granularity swallows the carousel: a 64px pitch leaves the frame up
|
|
3237
|
+
* to 64px short of the room on offer, where 24 leaves at most 24.
|
|
3238
|
+
*
|
|
3239
|
+
* So the island keeps the drawn values. The two tickets are deliberately free to differ:
|
|
3240
|
+
* the scale is a host-tunable token in both packages and the rule that reads it is the same
|
|
3241
|
+
* rule, which is the part that had to be shared.
|
|
3242
|
+
*/
|
|
3243
|
+
export declare const TICKET_EDGE_FALLBACK: TicketEdgeTokens;
|
|
3244
|
+
|
|
3245
|
+
/** The ticket a key names, or `null`. */
|
|
3246
|
+
export declare function ticketAt(booking: Booking, key: string): BookingTicket | null;
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* WHAT THE CALLER KNOWS THAT THE WIRE DOES NOT — the product and the user type.
|
|
3250
|
+
*
|
|
3251
|
+
* ── TWO LEVELS, BECAUSE THE TWO FACTS ARE KNOWN AT DIFFERENT GRAINS ──────────
|
|
3252
|
+
*
|
|
3253
|
+
* `product` is the whole booking's: this widget fills one cart from one event, so "Peak" is
|
|
3254
|
+
* true of every ticket in it, and the flow holds that name from the moment the cart was
|
|
3255
|
+
* opened (`CheckoutOrder.productName`).
|
|
3256
|
+
*
|
|
3257
|
+
* `tickets` is per ATTENDEE TICKET KEY, and almost nothing can fill it. The user type is a
|
|
3258
|
+
* fact about a cart ITEM, the key is a fact about an attendee ticket, and the platform
|
|
3259
|
+
* exposes no join between them — so the flow supplies none and a host that has its own
|
|
3260
|
+
* records supplies what it has. Keyed rather than positional because the two lists have no
|
|
3261
|
+
* order in common.
|
|
3262
|
+
*
|
|
3263
|
+
* A KEY THAT IS NOT IN HERE resolves to the booking-wide product and no user type, which is
|
|
3264
|
+
* a ticket drawn with a shorter qualifier rather than one that is dropped.
|
|
3265
|
+
*/
|
|
3266
|
+
export declare type TicketAttribution = {
|
|
3267
|
+
/** "Peak" — true of every ticket, where the caller knows it. */
|
|
3268
|
+
readonly product?: string | null;
|
|
3269
|
+
/** Per attendee ticket key, where the caller can tell them apart. */
|
|
3270
|
+
readonly tickets?: Readonly<Record<string, {
|
|
3271
|
+
readonly product?: string | null;
|
|
3272
|
+
readonly userType?: string | null;
|
|
3273
|
+
}>>;
|
|
3274
|
+
};
|
|
3275
|
+
|
|
3276
|
+
/**
|
|
3277
|
+
* ONE TICKET'S CODE, as one value.
|
|
3278
|
+
*
|
|
3279
|
+
* A union rather than a picture beside an error, so "still fetching" cannot be mistaken for
|
|
3280
|
+
* "came back empty" — which is the difference between a ticket that is about to appear and
|
|
3281
|
+
* a buyer standing at a gate with nothing to show.
|
|
3282
|
+
*/
|
|
3283
|
+
declare type TicketCode$1 = {
|
|
3284
|
+
readonly status: 'LOADING';
|
|
3285
|
+
}
|
|
3286
|
+
/** Ready to draw: a `data:` URL an `<img>` can take. See `ticketCodeDataUrl`. */
|
|
3287
|
+
| {
|
|
3288
|
+
readonly status: 'DRAWN';
|
|
3289
|
+
readonly src: string;
|
|
3290
|
+
} | {
|
|
3291
|
+
readonly status: 'ERROR';
|
|
3292
|
+
};
|
|
3293
|
+
|
|
3294
|
+
/**
|
|
3295
|
+
* ONE TICKET — the code inside its perforated edge, with who it is for printed above.
|
|
3296
|
+
*
|
|
3297
|
+
* ── THE MEASURE IS CHOSEN, NOT TAKEN ─────────────────────────────────────────
|
|
3298
|
+
*
|
|
3299
|
+
* The edge tiles one cutout, so neither rail can be a fraction of one. This component
|
|
3300
|
+
* measures two things and `fitTicketEdge` decides the rest: the room the parent offers
|
|
3301
|
+
* ACROSS, which fixes how many cutouts the top and bottom rails carry, and the HEADER's
|
|
3302
|
+
* height, which is what the side rails have to contain once the square code is added under
|
|
3303
|
+
* it. See `island-ticket-edge.ts`, which is the whole rule as pure data.
|
|
3304
|
+
*
|
|
3305
|
+
* MEASURED HERE AND SPENT IN CSS. What crosses is two COUNTS; the stylesheet multiplies
|
|
3306
|
+
* them by its own tokens, so a host that re-tunes the scale moves the drawing and the
|
|
3307
|
+
* arithmetic together.
|
|
3308
|
+
*
|
|
3309
|
+
* THE HEADER IS MEASURED AND THE CODE IS NOT. The code's size follows from the width, which
|
|
3310
|
+
* is settled before its height is asked for — measuring the whole stack instead would be
|
|
3311
|
+
* measuring the answer.
|
|
3312
|
+
*/
|
|
3313
|
+
export declare function TicketCode({ qualifier, name, avatar, day, time, code, codeLabel, codeMissing, }: TicketCodeProps): react_jsx_runtime.JSX.Element;
|
|
3314
|
+
|
|
3315
|
+
/** One ticket in the run: everything its own card draws, plus what names it. */
|
|
3316
|
+
export declare type TicketCodeEntry = TicketCodeProps & {
|
|
3317
|
+
readonly key: string;
|
|
3318
|
+
};
|
|
3319
|
+
|
|
3320
|
+
/**
|
|
3321
|
+
* WHICH TICKET IS SHOWING, AND THE TWO WAYS TO CHANGE IT — the design's pill under the run.
|
|
3322
|
+
*
|
|
3323
|
+
* ── NOT ONE OF THE CARD'S OWN BUTTONS, AND IT CANNOT BE ─────────────────────
|
|
3324
|
+
*
|
|
3325
|
+
* `IslandAction` is one label and one press. This is one label between TWO presses, so it
|
|
3326
|
+
* lives in the card's content where a control with its own shape belongs, and the codes
|
|
3327
|
+
* card draws no button stack at all. The way out of it is the header's Back arrow, which is
|
|
3328
|
+
* what the design gives it.
|
|
3329
|
+
*
|
|
3330
|
+
* ── THE ENDS ARE SHUT, NOT WRAPPED ──────────────────────────────────────────
|
|
3331
|
+
*
|
|
3332
|
+
* A run of three that goes 3 -> 1 reads as a bug the first time and as a lost ticket the
|
|
3333
|
+
* second. The arrow at an end is drawn and declines, exactly as every other stopped control
|
|
3334
|
+
* here does — see `IslandAction.disabled`.
|
|
3335
|
+
*
|
|
3336
|
+
* ── AND A BOOKING OF ONE STILL GETS IT ──────────────────────────────────────
|
|
3337
|
+
*
|
|
3338
|
+
* It used to be withheld below two, on the argument that "1 of 1" between two dead arrows
|
|
3339
|
+
* is three controls describing a run with no alternatives. What that actually produced was
|
|
3340
|
+
* a card that changes SHAPE with the size of the booking: one ticket and the run sits on
|
|
3341
|
+
* the card's floor, two and a pill appears under it. The count is the thing that varies,
|
|
3342
|
+
* not the card, and both arrows decline here exactly as the end of any longer run does.
|
|
3343
|
+
*/
|
|
3344
|
+
export declare function TicketCodePager({ at, count, onAtChange, position, positionOf, previousLabel, nextLabel, }: TicketCodePagerProps): react_jsx_runtime.JSX.Element;
|
|
3345
|
+
|
|
3346
|
+
export declare type TicketCodePagerProps = {
|
|
3347
|
+
readonly at: number;
|
|
3348
|
+
readonly count: number;
|
|
3349
|
+
readonly onAtChange: (at: number) => void;
|
|
3350
|
+
/** "1" — the ticket being read, full strength. */
|
|
3351
|
+
readonly position: string;
|
|
3352
|
+
/** " of 3" — the run it is out of, a step quieter. See `BOOKING_COPY.positionOf`. */
|
|
3353
|
+
readonly positionOf: string;
|
|
3354
|
+
/** What the two arrows are called, for anyone who cannot see them. */
|
|
3355
|
+
readonly previousLabel: string;
|
|
3356
|
+
readonly nextLabel: string;
|
|
3357
|
+
};
|
|
3358
|
+
|
|
3359
|
+
export declare type TicketCodeProps = {
|
|
3360
|
+
/** "Peak • Adult", or absent where the caller knows neither half. */
|
|
3361
|
+
readonly qualifier: string | null;
|
|
3362
|
+
/** "Alex Whelan", or absent where the platform holds no name. */
|
|
3363
|
+
readonly name: string | null;
|
|
3364
|
+
/**
|
|
3365
|
+
* The holder's face — an `Avatar`, composed by the caller as every hero here is. `null`
|
|
3366
|
+
* is a real answer and is not a slot: see `TicketRow.artwork`, which draws the same line.
|
|
3367
|
+
*/
|
|
3368
|
+
readonly avatar?: ReactNode;
|
|
3369
|
+
/** The booking's day, already in words: "12 December 2026". */
|
|
3370
|
+
readonly day: string;
|
|
3371
|
+
/** When it starts, or absent where the event sells no sessions. */
|
|
3372
|
+
readonly time: string | null;
|
|
3373
|
+
readonly code: TicketCode$1;
|
|
3374
|
+
/** What the code IS, for anyone who cannot see it. */
|
|
3375
|
+
readonly codeLabel: string;
|
|
3376
|
+
/** What stands in its place when it did not come back. */
|
|
3377
|
+
readonly codeMissing: string;
|
|
3378
|
+
};
|
|
3379
|
+
|
|
3380
|
+
/**
|
|
3381
|
+
* THE CODES, ONE AT A TIME, WITH THE NEXT ONE SHOWING.
|
|
3382
|
+
*
|
|
3383
|
+
* ── IT IS THE WEEK STRIP, WITH TICKETS IN IT ─────────────────────────────────
|
|
3384
|
+
*
|
|
3385
|
+
* The mechanism is `CalendarWeekSection`'s and deliberately so: a scroll-snapping pager that
|
|
3386
|
+
* BLEEDS past the content column on both sides, so the ends of the previous and next tickets
|
|
3387
|
+
* show. Stopping at the column cuts the run off mid-air with nothing to say there is
|
|
3388
|
+
* anywhere to scroll to — which on a booking of one ticket and a booking of four look
|
|
3389
|
+
* identical.
|
|
3390
|
+
*
|
|
3391
|
+
* THE BLEED IS THE CARD'S OWN INLINE PADDING, referenced rather than restated. One bleed is
|
|
3392
|
+
* `$7`, which is enough of a neighbouring ticket to read as a ticket rather than a stripe.
|
|
3393
|
+
*
|
|
3394
|
+
* ── WHY THE INDEX IS REPORTED AND NOT OWNED ──────────────────────────────────
|
|
3395
|
+
*
|
|
3396
|
+
* The pager button under the run says "1 of 3" and its arrows move the run, so the number
|
|
3397
|
+
* and the scroll position are two readings of one fact. Owned here, the button would need
|
|
3398
|
+
* to reach in for it; owned by the caller, both come from the same value. What this keeps
|
|
3399
|
+
* is the SCROLL, which is the browser's.
|
|
3400
|
+
*/
|
|
3401
|
+
export declare function TicketCodes({ tickets, at, onAtChange, label }: TicketCodesProps): react_jsx_runtime.JSX.Element | null;
|
|
3402
|
+
|
|
3403
|
+
export declare type TicketCodesProps = {
|
|
3404
|
+
readonly tickets: readonly TicketCodeEntry[];
|
|
3405
|
+
/** Which ticket is on screen, counted from zero. */
|
|
3406
|
+
readonly at: number;
|
|
3407
|
+
/** Reported as the run moves — from the live offset, not once it has settled. */
|
|
3408
|
+
readonly onAtChange: (at: number) => void;
|
|
3409
|
+
/** Names the run for assistive technology. */
|
|
3410
|
+
readonly label: string;
|
|
3411
|
+
};
|
|
3412
|
+
|
|
3413
|
+
/**
|
|
3414
|
+
* Too narrow to draw: below {@link minimumColumns} cutouts the padding has eaten the centre
|
|
3415
|
+
* and what is left is a frame around nothing — which is worse than no ticket, because it
|
|
3416
|
+
* looks like a code that failed to load.
|
|
3417
|
+
*/
|
|
3418
|
+
export declare type TicketEdgeFit = ({
|
|
3419
|
+
readonly ok: true;
|
|
3420
|
+
} & TicketEdgeFrame) | {
|
|
3421
|
+
readonly ok: false;
|
|
3422
|
+
readonly reason: 'TOO_NARROW';
|
|
3423
|
+
};
|
|
3424
|
+
|
|
3425
|
+
/** The ticket's measurements, all of them, in px. */
|
|
3426
|
+
export declare type TicketEdgeFrame = {
|
|
3427
|
+
/** Whole cutouts across the top and bottom rails. */
|
|
3428
|
+
readonly columns: number;
|
|
3429
|
+
/** Whole cutouts down each side rail. */
|
|
3430
|
+
readonly rows: number;
|
|
3431
|
+
/** The frame's outside width, rails included. */
|
|
3432
|
+
readonly frame: number;
|
|
3433
|
+
/** The centre's width, inside the rails. */
|
|
3434
|
+
readonly width: number;
|
|
3435
|
+
/** The centre's height, inside the rails — `rows` cutouts, so the side rails tile. */
|
|
3436
|
+
readonly height: number;
|
|
3437
|
+
/** The code's measure, inside the centre's padding. Square. */
|
|
3438
|
+
readonly code: number;
|
|
3439
|
+
};
|
|
3440
|
+
|
|
3441
|
+
/**
|
|
3442
|
+
* THE TICKET'S PERFORATED EDGE, AS PURE DATA.
|
|
3443
|
+
*
|
|
3444
|
+
* The edge is one cutout tiled along a rail, so a rail can only ever be a whole number of
|
|
3445
|
+
* cutouts long. A ticket that simply took the room it was offered would end its rails
|
|
3446
|
+
* mid-notch at every size but the handful that happen to divide — and the scale is a
|
|
3447
|
+
* host-tunable token, so "the handful that divide" is not something this file gets to know
|
|
3448
|
+
* in advance.
|
|
3449
|
+
*
|
|
3450
|
+
* So the measure is not taken, it is CHOSEN, on BOTH axes:
|
|
3451
|
+
*
|
|
3452
|
+
* - ACROSS, the rule is the offered width's. The two corners come out of the budget
|
|
3453
|
+
* first and the run is the most whole cutouts that fit what is left.
|
|
3454
|
+
* - DOWN, the rule is the CONTENT's. The centre holds a name, a date and a square code,
|
|
3455
|
+
* and that stack is as tall as it is — so the run is the FEWEST whole cutouts that
|
|
3456
|
+
* contain it, and the slack lands as paper at the bottom of the ticket.
|
|
3457
|
+
*
|
|
3458
|
+
* ── WHY THE TWO AXES DIFFER, AND WHY THAT IS NOT A SECOND RULE ───────────────
|
|
3459
|
+
*
|
|
3460
|
+
* `@scopetickets/sdk`'s `fitTicketEdge` chooses one count and spends it on all four rails,
|
|
3461
|
+
* and it is right to: the ticket there is a code and nothing else, so its centre is square
|
|
3462
|
+
* and a run turned through a right angle fits the side exactly. This ticket has a
|
|
3463
|
+
* ticketholder and a booking above the code, so its centre is taller than it is wide and
|
|
3464
|
+
* there is no single count. The rule is the same one — whole cutouts, never a fraction —
|
|
3465
|
+
* asked of two measures instead of one.
|
|
3466
|
+
*
|
|
3467
|
+
* The two are deliberately separate files rather than one shared with the SDK: this package
|
|
3468
|
+
* is mounted by hosts that never touch the SDK, and a widget that pulled a component
|
|
3469
|
+
* library in to draw a border would be exactly the dependency `ScopeTicketsCheckout` exists
|
|
3470
|
+
* to avoid.
|
|
3471
|
+
*/
|
|
3472
|
+
/**
|
|
3473
|
+
* The four measurements a ticket is built from, in px, read off the spacing scale at
|
|
3474
|
+
* RUNTIME rather than compiled in — a host that re-tunes the scale moves the CSS without
|
|
3475
|
+
* this hearing about it, so the numbers are taken from the rendered element.
|
|
3476
|
+
*/
|
|
3477
|
+
export declare type TicketEdgeTokens = {
|
|
3478
|
+
/**
|
|
3479
|
+
* `$2` — the rail's thickness, which is ALSO the corner's side and the cutout's short
|
|
3480
|
+
* side. One value in three places, not three that happen to agree: a rail thicker than
|
|
3481
|
+
* the cutout leaves a band of uncut material behind every notch.
|
|
3482
|
+
*/
|
|
3483
|
+
readonly edge: number;
|
|
3484
|
+
/** `$6` — the cutout's long side, and therefore the pitch a rail repeats at. */
|
|
3485
|
+
readonly segment: number;
|
|
3486
|
+
/** `$3` — the centre's inset, equal on four sides. */
|
|
3487
|
+
readonly pad: number;
|
|
3488
|
+
/** `$2` — the seam between the centre's rows, and between the last of them and the code. */
|
|
3489
|
+
readonly gap: number;
|
|
3490
|
+
};
|
|
3491
|
+
|
|
3492
|
+
/**
|
|
3493
|
+
* MY BOOKING — what a buyer owns once the money has moved, as the cards draw it.
|
|
3494
|
+
*
|
|
3495
|
+
* ── THE TWO HALVES, AND WHY THEY COME FROM DIFFERENT PLACES ──────────────────
|
|
3496
|
+
*
|
|
3497
|
+
* A booking is an OCCASION and a set of TICKETS, and the platform answers for only one of
|
|
3498
|
+
* them. `GET /api/Transactions/ByKey/{cartKey}` returns the attendee tickets — a key each,
|
|
3499
|
+
* and the person each is for — and says nothing about what was bought into: no event name,
|
|
3500
|
+
* no artwork, no day, no session. It carries a numeric `EventID`, which no endpoint here
|
|
3501
|
+
* takes.
|
|
3502
|
+
*
|
|
3503
|
+
* So the occasion is the CALLER'S, exactly as `cartLines` is: the flow has just walked a
|
|
3504
|
+
* buyer through choosing it and holds every field, and a host mounting this on its own page
|
|
3505
|
+
* holds them too or it would not have had anything to sell. Inventing a lookup that cannot
|
|
3506
|
+
* be made is the alternative, and it ends in a card that says "Ice Skating" for one mount
|
|
3507
|
+
* and nothing for the other.
|
|
3508
|
+
*
|
|
3509
|
+
* ── WHICH IS WHY THERE ARE TWO TYPES AND NOT ONE ─────────────────────────────
|
|
3510
|
+
*
|
|
3511
|
+
* `BookingRecord` is what the platform holds. `Booking` is that record with the caller's
|
|
3512
|
+
* facts folded in, and `dressBooking` is the fold. Keeping them apart is not tidiness: the
|
|
3513
|
+
* occasion and the attribution are written inline by most callers and are therefore new
|
|
3514
|
+
* objects on every render, so a read that took them would refetch the whole booking every
|
|
3515
|
+
* time anything above it moved. Folded at render, the request depends on the cart key and
|
|
3516
|
+
* nothing else.
|
|
3517
|
+
*
|
|
3518
|
+
* ── WHAT A TICKET IS, AND WHAT IT IS NOT ─────────────────────────────────────
|
|
3519
|
+
*
|
|
3520
|
+
* `Items[].Key` IS the `AttendeeTicketKey` — what a QR code is drawn FROM, and the only
|
|
3521
|
+
* identity a ticket has on screen. `Attendee.ID` is separate and is what `PUT /Attendees`
|
|
3522
|
+
* names when a holder is edited; the two are not interchangeable and both are kept.
|
|
3523
|
+
*
|
|
3524
|
+
* `Items[].Type` IS DELIBERATELY NOT READ. A booking must list tickets and not booking fees,
|
|
3525
|
+
* and the tempting way to say so is to narrow that free text to a closed union. The honest
|
|
3526
|
+
* rule is the one the cards actually need: an item is a ticket when it has a key a code can
|
|
3527
|
+
* be drawn from AND an attendee it belongs to. A fee has neither. Narrowing `Type` would
|
|
3528
|
+
* mean a closed union over spellings nobody here has seen, and the first unrecognised one
|
|
3529
|
+
* would empty a buyer's booking rather than draw an extra row.
|
|
3530
|
+
*/
|
|
3531
|
+
|
|
3532
|
+
/** Who a ticket is for. */
|
|
3533
|
+
export declare type Ticketholder = {
|
|
3534
|
+
readonly firstName: string;
|
|
3535
|
+
readonly lastName: string;
|
|
3536
|
+
readonly email: string;
|
|
3537
|
+
/** The platform takes one and the design never asks for it — carried so a save keeps it. */
|
|
3538
|
+
readonly phone: string | null;
|
|
3539
|
+
/**
|
|
3540
|
+
* A FACE THE PLATFORM ACTUALLY HOLDS, or none — and "none" is the ordinary answer.
|
|
3541
|
+
*
|
|
3542
|
+
* IT IS NOT DERIVED. Initials are a thing this package can always manufacture, which is
|
|
3543
|
+
* exactly why they are the wrong answer here: a ticket drawn with a generated mark claims
|
|
3544
|
+
* to show somebody, and what it shows is two letters off a name already printed beside it.
|
|
3545
|
+
* A ticket with no face draws no face.
|
|
3546
|
+
*/
|
|
3547
|
+
readonly photo: string | null;
|
|
3548
|
+
};
|
|
3549
|
+
|
|
3550
|
+
/**
|
|
3551
|
+
* "Peak • Adult" — what the ticket IS, on one line, or `null` where the caller supplied
|
|
3552
|
+
* neither half. Either half alone stands on its own; the bullet is a separator and never a
|
|
3553
|
+
* decoration, so it is not drawn against an empty side.
|
|
3554
|
+
*/
|
|
3555
|
+
export declare function ticketQualifier(ticket: BookingTicket): string | null;
|
|
3556
|
+
|
|
3557
|
+
/** One row of the booking: who a ticket is for, what it is, and the way into it. */
|
|
3558
|
+
export declare type TicketRow = {
|
|
3559
|
+
readonly key: string;
|
|
3560
|
+
/**
|
|
3561
|
+
* WHO HOLDS IT, or the card's own words for nobody — see `BOOKING_COPY.awaiting`. Always
|
|
3562
|
+
* a string, because the row always draws this line: a ticket with no holder is the
|
|
3563
|
+
* commonest case there is and an empty line would read as a row that failed to load.
|
|
3564
|
+
*/
|
|
3565
|
+
readonly holder: string;
|
|
3566
|
+
/** Whether that line is the PLACEHOLDER, which the design sets a step quieter. */
|
|
3567
|
+
readonly awaiting: boolean;
|
|
3568
|
+
/** "Adult" — what the ticket is. */
|
|
3569
|
+
readonly qualifier: string | null;
|
|
3570
|
+
/**
|
|
3571
|
+
* The design's `Add` pill — drawn in place of the arrow on a ticket awaiting details, and
|
|
3572
|
+
* always where they can actually be added, the save being key-addressed (see
|
|
3573
|
+
* `BookingGateway.saveHolder`). Its presence is also what says the row opens the FORM
|
|
3574
|
+
* rather than the ticket.
|
|
3575
|
+
*/
|
|
3576
|
+
readonly add?: string;
|
|
3577
|
+
};
|
|
3578
|
+
|
|
3579
|
+
/**
|
|
3580
|
+
* THE TICKETS IN A BOOKING — the design's `TicketsInBooking`.
|
|
3581
|
+
*
|
|
3582
|
+
* HAIRLINES AND NOT A WELL. The rows are ruled above the first and below each of them, with
|
|
3583
|
+
* no fill and no border around the run: the list is part of the card rather than a panel
|
|
3584
|
+
* set into it, which is what the surrounding `$3` of inset says too.
|
|
3585
|
+
*
|
|
3586
|
+
* NO FACE ON A ROW. The design draws none — a booking is a list of tickets on one event, and
|
|
3587
|
+
* a column of identical marks beside identical names says nothing that the words do not.
|
|
3588
|
+
*
|
|
3589
|
+
* EVERY ROW IS A DOOR, and there is no other way to a ticket, so the row is the button and
|
|
3590
|
+
* the `Add` pill inside it is an affordance rather than a second target.
|
|
3591
|
+
*/
|
|
3592
|
+
export declare function TicketsInBooking({ tickets, onOpen }: TicketsInBookingProps): react_jsx_runtime.JSX.Element;
|
|
3593
|
+
|
|
3594
|
+
export declare type TicketsInBookingProps = {
|
|
3595
|
+
readonly tickets: readonly TicketRow[];
|
|
3596
|
+
readonly onOpen: (key: string) => void;
|
|
3597
|
+
};
|
|
3598
|
+
|
|
3599
|
+
/**
|
|
3600
|
+
* "Alex’s Ticket" — the ticket card's own title, or `null` where nobody is named.
|
|
3601
|
+
*
|
|
3602
|
+
* ALWAYS `’s`, INCLUDING AFTER AN `s`. Both "James’s" and "James’" are correct English and
|
|
3603
|
+
* house styles differ; what is not defensible is a rule that inspects the last letter of a
|
|
3604
|
+
* stranger's name and guesses. One form, applied to everyone, and the apostrophe is the
|
|
3605
|
+
* typographic one because this is prose rather than code.
|
|
3606
|
+
*/
|
|
3607
|
+
export declare function ticketTitle(holder: Ticketholder): string | null;
|
|
3608
|
+
|
|
3609
|
+
/**
|
|
3610
|
+
* THE CLOCK STOPPED — the design `3803:7329`, and the card the whole island gives itself
|
|
3611
|
+
* over to once a hold has run out.
|
|
3612
|
+
*
|
|
3613
|
+
* ── TWO ANSWERS, AND THEY ARE THE TWO THINGS LEFT TO DO ─────────────────────
|
|
3614
|
+
*
|
|
3615
|
+
* The news has been read; what remains is whether the buyer wants these tickets or not.
|
|
3616
|
+
* TRY AGAIN is re-entry — the walk returns to its first stop and the island stays OPEN, so
|
|
3617
|
+
* they carry straight on. CLOSE is leaving — the same reset, collapsed.
|
|
3618
|
+
*
|
|
3619
|
+
* NEITHER MINTS A CART HERE, which is what kept Try Again off this card before. It hands
|
|
3620
|
+
* the buyer back to the flow, and the flow opens a cart when it reaches a step that needs
|
|
3621
|
+
* one — so the card that says the tickets went in the meantime is the step that knows,
|
|
3622
|
+
* exactly as it was when Close was the only way through.
|
|
3623
|
+
*
|
|
3624
|
+
* WHAT THEY ANSWERED SURVIVES either way: they said two adults for Saturday and gave their
|
|
3625
|
+
* email, and none of that stopped being true when the clock did. It is the CART that is
|
|
3626
|
+
* new, because the old one is gone.
|
|
3627
|
+
*
|
|
3628
|
+
* A HOST'S OWN EXPIRED HOLD IS NOT OURS TO RENEW, and Try Again cannot pretend otherwise:
|
|
3629
|
+
* `restart` throws away the cart THIS widget opened, so where the hold came from a prop it
|
|
3630
|
+
* is still expired and this card comes back. That is the truth about their reservation
|
|
3631
|
+
* rather than a state we are stuck in — see `useAssertedHold`.
|
|
3632
|
+
*/
|
|
3633
|
+
export declare function timedOutViewProps(expanded: boolean, onTryAgain: () => void, onClose: () => void): {
|
|
3634
|
+
variant: "hold";
|
|
3635
|
+
expanded: boolean;
|
|
3636
|
+
onToggle: () => void;
|
|
3637
|
+
actionLabel: "Close";
|
|
3638
|
+
title: "Your Order Timed Out";
|
|
3639
|
+
subtitle: "Your tickets have been released. They may still be available.";
|
|
3640
|
+
actions: ({
|
|
3641
|
+
key: string;
|
|
3642
|
+
role: "action";
|
|
3643
|
+
label: "Try Again";
|
|
3644
|
+
onPress: () => void;
|
|
3645
|
+
} | {
|
|
3646
|
+
key: string;
|
|
3647
|
+
role: "secondary";
|
|
3648
|
+
label: "Close";
|
|
3649
|
+
onPress: () => void;
|
|
3650
|
+
})[];
|
|
3651
|
+
};
|
|
3652
|
+
|
|
3653
|
+
/** The time it is right now on a given zone's clock, as `HH:MM`. */
|
|
3654
|
+
export declare function timeOfDayInZone(now: Date, timeZone: string | null): string;
|
|
3655
|
+
|
|
3656
|
+
/** Select Time — the timeslot picker's content. */
|
|
3657
|
+
export declare function TimePicker({ series, today, nowTime, selection, onSelectDay, slots, onSelectTime, remaining, accessory, onVisibleMonthChange, }: TimePickerProps): react_jsx_runtime.JSX.Element;
|
|
3658
|
+
|
|
3659
|
+
export declare type TimePickerProps = {
|
|
3660
|
+
/**
|
|
3661
|
+
* The run the chosen day belongs to. The week strip scrolls through all of it,
|
|
3662
|
+
* including weeks the run skips.
|
|
3663
|
+
*/
|
|
3664
|
+
readonly series: CalendarSeries;
|
|
3665
|
+
/** `YYYY-MM-DD` in the VENUE's local day, never the device's. */
|
|
3666
|
+
readonly today: string;
|
|
3667
|
+
/** `HH:MM` in the VENUE's local time (`timeOfDayInZone`). */
|
|
3668
|
+
readonly nowTime: string;
|
|
3669
|
+
/** THE WHOLE ANSWER THIS CARD IS COLLECTING: the day, and the time on it. */
|
|
3670
|
+
readonly selection: TimeSelection;
|
|
3671
|
+
/**
|
|
3672
|
+
* Picking a day in the strip REPLACES the chosen one; it never clears it — and it drops
|
|
3673
|
+
* any time chosen on the day before it. See `withSelectedDay`.
|
|
3674
|
+
*/
|
|
3675
|
+
readonly onSelectDay: (day: string) => void;
|
|
3676
|
+
/** ONE ticket's slots for `selection.day`, in the order the wire gave them. */
|
|
3677
|
+
readonly slots: readonly Timeslot[];
|
|
3678
|
+
readonly onSelectTime: (startTime: string) => void;
|
|
3679
|
+
/**
|
|
3680
|
+
* Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD` — the RAW signal, exactly as
|
|
3681
|
+
* `DayPicker` takes it, for the strip's own seven cells. A slot's own
|
|
3682
|
+
* availability rides on the slot and never comes from here.
|
|
3683
|
+
*/
|
|
3684
|
+
readonly remaining?: Readonly<Record<string, number>>;
|
|
3685
|
+
/**
|
|
3686
|
+
* Defaults to the variant both pickers draw. A prop only so a host can turn the line
|
|
3687
|
+
* off; there is no per-cell answer.
|
|
3688
|
+
*/
|
|
3689
|
+
readonly accessory?: DatePickerCellAccessory;
|
|
3690
|
+
/**
|
|
3691
|
+
* The month the WEEK STRIP is showing, reported as it pages — the same fact
|
|
3692
|
+
* `DayPicker` publishes, for the same header pill. The timeslots below never move
|
|
3693
|
+
* it: they all belong to one day.
|
|
3694
|
+
*/
|
|
3695
|
+
readonly onVisibleMonthChange?: (month: CalendarMonthKey) => void;
|
|
3696
|
+
};
|
|
3697
|
+
|
|
3698
|
+
/**
|
|
3699
|
+
* THE DAY AND THE TIME ON IT, AS ONE VALUE — because they are one answer, and holding
|
|
3700
|
+
* them apart is what let a time outlive the day it was chosen on.
|
|
3701
|
+
*/
|
|
3702
|
+
export declare type TimeSelection = {
|
|
3703
|
+
/**
|
|
3704
|
+
* `YYYY-MM-DD` — the day being bought, on the VENUE's own local calendar. Not nullable:
|
|
3705
|
+
* there is no version of Select Time with no day, because the slots on it belong to
|
|
3706
|
+
* one.
|
|
3707
|
+
*/
|
|
3708
|
+
readonly day: string;
|
|
3709
|
+
/**
|
|
3710
|
+
* The picked slot's `startTime`, which is the only identity a slot has, or null for a
|
|
3711
|
+
* day whose time has not been chosen yet.
|
|
3712
|
+
*/
|
|
3713
|
+
readonly startTime: string | null;
|
|
3714
|
+
};
|
|
3715
|
+
|
|
3716
|
+
/**
|
|
3717
|
+
* The times within one day that a ticket is sold for — the timeslot picker's whole
|
|
3718
|
+
* domain.
|
|
3719
|
+
*/
|
|
3720
|
+
|
|
3721
|
+
/** One slot a ticket is sold for. */
|
|
3722
|
+
export declare type Timeslot = {
|
|
3723
|
+
/**
|
|
3724
|
+
* `HH:MM` on the VENUE's clock — never the viewer's. Also the slot's IDENTITY: the wire
|
|
3725
|
+
* gives no key, so the start time is what a selection points at.
|
|
3726
|
+
*/
|
|
3727
|
+
readonly startTime: string;
|
|
3728
|
+
/** `HH:MM` on the VENUE's clock, or null where the slot does not say. */
|
|
3729
|
+
readonly endTime: string | null;
|
|
3730
|
+
/**
|
|
3731
|
+
* How full this slot is, 0..1 — the platform's own `Remaining`, exactly as a day
|
|
3732
|
+
* reports it. Null where the slot does not say.
|
|
3733
|
+
*/
|
|
3734
|
+
readonly remaining: number | null;
|
|
3735
|
+
};
|
|
3736
|
+
|
|
3737
|
+
/**
|
|
3738
|
+
* The selection after a day is pressed: the day, or NOTHING if it was already the
|
|
3739
|
+
* chosen one.
|
|
3740
|
+
*/
|
|
3741
|
+
export declare function toggleSelectedDay(selected: string | null, day: string): string | null;
|
|
3742
|
+
|
|
3743
|
+
/** @internal */
|
|
3744
|
+
/** @internal */
|
|
3745
|
+
declare interface TransactionByKeyResponse {
|
|
3746
|
+
ID: number;
|
|
3747
|
+
TransactionKey: string;
|
|
3748
|
+
StripeStatus: string;
|
|
3749
|
+
TotalAmount: number;
|
|
3750
|
+
Currency: string;
|
|
3751
|
+
EventID?: number;
|
|
3752
|
+
Items: Array<{
|
|
3753
|
+
Key: string;
|
|
3754
|
+
Type: string;
|
|
3755
|
+
ItemId: number;
|
|
3756
|
+
TotalAmount: number;
|
|
3757
|
+
OrganisationAmount: number;
|
|
3758
|
+
ScopeAmount: number;
|
|
3759
|
+
BrokerAmount: number;
|
|
3760
|
+
DiscountAmount: number;
|
|
3761
|
+
Attendee?: {
|
|
3762
|
+
ID: number;
|
|
3763
|
+
FirstName: string;
|
|
3764
|
+
LastName: string;
|
|
3765
|
+
Email: string;
|
|
3766
|
+
Phone?: string | null;
|
|
3767
|
+
Photo?: string | null;
|
|
3768
|
+
};
|
|
3769
|
+
}>;
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
export declare function useIslandPress(scope?: PressScope): PressHandlers;
|
|
3773
|
+
|
|
3774
|
+
export declare function useReportAnswered(answered: boolean, onAnsweredChange: AnswerReporting['onAnsweredChange']): void;
|
|
3775
|
+
|
|
3776
|
+
/**
|
|
3777
|
+
* WHO A TICKET IS FOR — "Child", "Student".
|
|
3778
|
+
*
|
|
3779
|
+
* `AssignmentKey` IDENTIFIES THE ASSIGNMENT, NOT THE TYPE. One entry is this type
|
|
3780
|
+
* assigned to one product on one event, so the same "Child" appears once per product per
|
|
3781
|
+
* night, each with its own key, its own discount and its own conditions. `Name` is the
|
|
3782
|
+
* only field that identifies what a buyer is choosing — see `groupUserTypes`, which is
|
|
3783
|
+
* the only thing that should be building rows out of these.
|
|
3784
|
+
*
|
|
3785
|
+
* @internal
|
|
3786
|
+
*/
|
|
3787
|
+
declare interface UserType {
|
|
3788
|
+
AssignmentKey: string;
|
|
3789
|
+
Name: string;
|
|
3790
|
+
DiscountNominal: number;
|
|
3791
|
+
DiscountRate: number;
|
|
3792
|
+
/** The organiser's own condition on choosing it, drawn under the name at `PARTY`. */
|
|
3793
|
+
Note?: string | null;
|
|
3794
|
+
/** Whether the buyer must show ID. Varies BY PRODUCT under one name — see `agreed`. */
|
|
3795
|
+
IdRequired?: boolean;
|
|
3796
|
+
AgeMinimum?: number | null;
|
|
3797
|
+
AgeMaximum?: number | null;
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
/**
|
|
3801
|
+
* EVERY ASSIGNMENT KEY TO THE WORD IT STANDS FOR. `attributeCartItems` reads the key back
|
|
3802
|
+
* off the REQUEST, where it is the resolved assignment rather than the name the
|
|
3803
|
+
* composition held — so this covers every assignment in the run, not the rows drawn.
|
|
3804
|
+
*/
|
|
3805
|
+
export declare function userTypeNames(rows: readonly UserType[]): Record<string, string>;
|
|
3806
|
+
|
|
3807
|
+
/** The selection after a day is picked: the new day, and NO time. */
|
|
3808
|
+
export declare function withSelectedDay(selection: TimeSelection, day: string): TimeSelection;
|
|
3809
|
+
|
|
3810
|
+
/** The selection after a time is picked, on the day already chosen. */
|
|
3811
|
+
export declare function withSelectedTime(selection: TimeSelection, startTime: string): TimeSelection;
|
|
3812
|
+
|
|
3813
|
+
export { }
|