@zorgo/next 1.1.2 → 1.1.3
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/dist/cli.js +1 -343
- package/dist/cli.mjs +1 -343
- package/dist/index.d.mts +802 -238
- package/dist/index.d.ts +802 -238
- package/dist/index.js +1 -158
- package/dist/index.mjs +1 -158
- package/dist/seo.d.mts +13 -8
- package/dist/seo.d.ts +13 -8
- package/dist/server.js +1 -459
- package/dist/server.mjs +1 -422
- package/package.json +1 -1
- package/dist/cli.d.mts +0 -9
- package/dist/cli.d.ts +0 -9
- package/dist/cli.js.map +0 -1
- package/dist/cli.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/server.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,242 +1,9 @@
|
|
|
1
1
|
import * as _stripe_stripe_js from '@stripe/stripe-js';
|
|
2
2
|
import { StripeElementsOptions } from '@stripe/stripe-js';
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
export { Platforms } from '../interfaces';
|
|
8
|
-
export { default as DynamicFormShell } from './Form';
|
|
9
|
-
export { default as SubmitButton } from './components/SubmitButton';
|
|
10
|
-
export { default as FieldError } from './components/FieldError';
|
|
11
|
-
export { default as Header } from './components/Header';
|
|
12
|
-
export { default as PricePreview } from './components/PricePreview';
|
|
13
|
-
export { default as SectionLabel } from './components/SectionLabel';
|
|
14
|
-
export { default as DisclaimerText } from './components/DisclaimerText';
|
|
15
|
-
export { default as ConditionalRenderer } from './composites/ConditionalRenderer';
|
|
16
|
-
export { default as TextField } from './fields/TextField';
|
|
17
|
-
export { default as PhoneField } from './fields/PhoneField';
|
|
18
|
-
export { default as EmailField } from './fields/EmailField';
|
|
19
|
-
export { default as ClickableField } from './fields/ClickableField';
|
|
20
|
-
export { default as LocationField } from './fields/Location';
|
|
21
|
-
export { default as TimeField } from './fields/TimeField';
|
|
22
|
-
export { default as DateField } from './fields/DateField';
|
|
23
|
-
export { default as DiscreteNumberField } from './fields/DiscreteNumberField';
|
|
24
|
-
export { default as SliderField } from './fields/SliderField';
|
|
25
|
-
export { default as CheckboxField } from './fields/CheckboxField';
|
|
26
|
-
export { default as FieldLabel } from './fields/FieldLabel';
|
|
27
|
-
export { default as IncrementField } from './fields/Increment';
|
|
28
|
-
export { default as NameFields } from './composites/NameFields';
|
|
29
|
-
export { default as DateTime } from './composites/DateTime';
|
|
30
|
-
export { default as DateTimeRange } from './composites/DateTimeRange';
|
|
31
|
-
export { default as GuestCountField } from './composites/GuestCountField';
|
|
32
|
-
export { TimeConstraints } from './timeConstraints';
|
|
33
|
-
export { default as useRegisterField } from './hooks/useRegisterField';
|
|
34
|
-
export { default as useField } from './hooks/useField';
|
|
35
|
-
export { default as useFormStatus } from './hooks/useFormStatus';
|
|
36
|
-
export { default as useFormValues } from './hooks/useFormValues';
|
|
37
|
-
export { default as useFormValidity } from './hooks/useFormValidity';
|
|
38
|
-
|
|
39
|
-
declare function setZorgoBoot(fn: () => Promise<void>): void;
|
|
40
|
-
declare function setZorgoPathnameHook(fn: () => string): void;
|
|
41
|
-
/**
|
|
42
|
-
* Modal stack control + usage. Consumers call `open(type, props)` to push a
|
|
43
|
-
* modal; the app's ModalHost renders whatever's on top via its registry map.
|
|
44
|
-
* `type` is a plain string keyed to that registry — no coupling here.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* const { open } = useModal();
|
|
48
|
-
* open("ITEM_MODAL", { itemId });
|
|
49
|
-
*/
|
|
50
|
-
declare function useModal(): {
|
|
51
|
-
current: ModalInstance | null;
|
|
52
|
-
isOpen: boolean;
|
|
53
|
-
depth: number;
|
|
54
|
-
open: (type: string, props?: unknown, displayStyle?: ModalInstance["displayStyle"]) => void;
|
|
55
|
-
close: () => void;
|
|
56
|
-
back: () => void;
|
|
57
|
-
setWorkingData: (data: any, index?: number) => void;
|
|
58
|
-
getWorkingData: (index?: number) => any;
|
|
59
|
-
};
|
|
60
|
-
declare function useCart(): {
|
|
61
|
-
items: OrderItem$1[];
|
|
62
|
-
itemCount: number;
|
|
63
|
-
isEmpty: boolean;
|
|
64
|
-
customer: Customer$1;
|
|
65
|
-
promoCode: string | undefined;
|
|
66
|
-
tip: number | undefined;
|
|
67
|
-
subtotal: number;
|
|
68
|
-
discount: number;
|
|
69
|
-
tax: number;
|
|
70
|
-
serviceFee: number;
|
|
71
|
-
total: number;
|
|
72
|
-
addItem: (item: OrderItem$1, promoOverride?: Promotion$1 | null) => void;
|
|
73
|
-
removeItem: (index: number) => void;
|
|
74
|
-
updateItem: (item: OrderItem$1, index: number, promoOverride?: Promotion$1 | null) => void;
|
|
75
|
-
resetCart: () => void;
|
|
76
|
-
setCustomer: (customer: Customer$1) => void;
|
|
77
|
-
setLocationId: (location_id: number) => void;
|
|
78
|
-
setOrderType: (type_id: number) => void;
|
|
79
|
-
setTimeRequested: (t: string) => void;
|
|
80
|
-
setTip: (tip: number) => void;
|
|
81
|
-
getItemTotal: (item: OrderItem$1) => number;
|
|
82
|
-
getOrder: () => Order$1;
|
|
83
|
-
resolveShortUrl: (slug: string) => Promise<boolean>;
|
|
84
|
-
};
|
|
85
|
-
declare function useLocation(options?: {
|
|
86
|
-
promptLocationSelection?: boolean;
|
|
87
|
-
}): {
|
|
88
|
-
availableLocations: Location$1[];
|
|
89
|
-
currentLocation: Location$1 | null;
|
|
90
|
-
setLocation: (location: Location$1) => void;
|
|
91
|
-
getIsCurrentLocationOpen: () => boolean;
|
|
92
|
-
needsLocationSelection: boolean;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* Reactive menu data for the configured franchise.
|
|
96
|
-
*
|
|
97
|
-
* `items` excludes catering categories; use `allItems`,
|
|
98
|
-
* `cateringPrimaryItem`, or `cateringAddOns` when building catering flows.
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* const { items, categories } = useMenu();
|
|
102
|
-
*/
|
|
103
|
-
declare function useMenu(): {
|
|
104
|
-
items: MenuItem$1[];
|
|
105
|
-
allItems: MenuItem$1[];
|
|
106
|
-
categories: Category$1[];
|
|
107
|
-
getItemImageUrl: (imagePath?: string | null) => string | null;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Seeds a store with prebuilt data (see the app's prebuild script) during the
|
|
111
|
-
* first render, so the first client paint already shows content instead of empty
|
|
112
|
-
* state. Boot then refreshes the store from Supabase.
|
|
113
|
-
*
|
|
114
|
-
* Only seeds when the store is still empty (`isEmpty`), so client-side navigation
|
|
115
|
-
* never clobbers freshly fetched data with the stale build-time snapshot.
|
|
116
|
-
*
|
|
117
|
-
* Note: this only helps the client's first paint — zustand serves
|
|
118
|
-
* getInitialState() during SSR, so the seed never reaches server HTML. Pages that
|
|
119
|
-
* need SSR content must read the prebuilt data directly (see app/menu/page.tsx).
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* useHydrateStore(MenuStore, menu, (s) => s.hydrate, (s) => !s.items?.length);
|
|
123
|
-
*/
|
|
124
|
-
declare function useHydrateStore<S, D>(store: {
|
|
125
|
-
getState: () => S;
|
|
126
|
-
}, seed: D, getHydrate: (state: S) => (data: D) => void, isEmpty: (state: S) => boolean): void;
|
|
127
|
-
/** MenuStore-specific wrapper. `items` may be nullish before persist rehydrates. */
|
|
128
|
-
declare function useHydrateMenu(menu: Menu$1): void;
|
|
129
|
-
/**
|
|
130
|
-
* Drives the item customization flow for a single menu item: variant choice,
|
|
131
|
-
* rule selections, component servings, quantity, and comments. Produces a
|
|
132
|
-
* live `draft` OrderItem and a `submit` that adds or updates the cart.
|
|
133
|
-
*
|
|
134
|
-
* @param baseItemId - `base_item_id` of the menu item being customized.
|
|
135
|
-
* @param seed - Existing OrderItem to pre-fill from, e.g. when editing a cart line.
|
|
136
|
-
* @param editIndex - Cart index to update on submit; omit to add a new item instead.
|
|
137
|
-
*
|
|
138
|
-
* @returns `item`/`variant`/`variants` for the item being built, `setVariant`
|
|
139
|
-
* to switch variants, `ruleGroups` for rendering rule UI (each option carries
|
|
140
|
-
* a `toggle`), `unmetRule`/`canSubmit` for validation state, `submit` to
|
|
141
|
-
* commit the draft to the cart, `quantity`/`setQuantity`, `comments`/`setComments`,
|
|
142
|
-
* `setComponentServings`, `price`/`salePrice`, `isEditMode`, and the raw `draft`.
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* const { item, ruleGroups, canSubmit, submit } = useItemCustomization(baseItemId);
|
|
146
|
-
*/
|
|
147
|
-
declare function useItemCustomization(baseItemId: number, seed?: OrderItem$1, editIndex?: number): {
|
|
148
|
-
item: MenuItem$1 | undefined;
|
|
149
|
-
variant: ItemVariant$1;
|
|
150
|
-
variants: ItemVariant$1[];
|
|
151
|
-
setVariant: (next: ItemVariant$1) => void;
|
|
152
|
-
ruleGroups: CustomizationRule$1[];
|
|
153
|
-
unmetRule: CustomizationRule$1 | null;
|
|
154
|
-
canSubmit: boolean;
|
|
155
|
-
submit: () => OrderItem$1 | null;
|
|
156
|
-
quantity: number;
|
|
157
|
-
setQuantity: react.Dispatch<react.SetStateAction<number>>;
|
|
158
|
-
comments: string;
|
|
159
|
-
setComments: react.Dispatch<react.SetStateAction<string>>;
|
|
160
|
-
setComponentServings: (componentId: number, qty: number) => void;
|
|
161
|
-
price: number;
|
|
162
|
-
salePrice: number | undefined;
|
|
163
|
-
isEditMode: boolean;
|
|
164
|
-
draft: OrderItem$1 | null;
|
|
165
|
-
};
|
|
166
|
-
declare function usePromotions(): {
|
|
167
|
-
promoCode: string;
|
|
168
|
-
setPromoCode: (code: string) => void;
|
|
169
|
-
appliedPromo: Promotion$1 | null;
|
|
170
|
-
discountAmount: number;
|
|
171
|
-
error: string | null;
|
|
172
|
-
loading: boolean;
|
|
173
|
-
applyPromo: (code: string) => Promise<void>;
|
|
174
|
-
removePromo: () => void;
|
|
175
|
-
activePromotions: Promotion$1[];
|
|
176
|
-
};
|
|
177
|
-
declare function usePayment(): {
|
|
178
|
-
clientSecret: string | null;
|
|
179
|
-
intentType: "payment_intent" | "setup_intent" | null;
|
|
180
|
-
stripe: _stripe_stripe_js.Stripe | undefined;
|
|
181
|
-
elementOptions: StripeElementsOptions | null;
|
|
182
|
-
total: number | null;
|
|
183
|
-
isLoading: boolean;
|
|
184
|
-
error: string | null;
|
|
185
|
-
isReady: boolean;
|
|
186
|
-
startCheckout: () => Promise<void>;
|
|
187
|
-
resetCheckout: () => void;
|
|
188
|
-
submitPayment: (stripe: unknown, elements: unknown, clientSecret: string, returnUrl: string, customer: Customer$1) => Promise<{
|
|
189
|
-
success: boolean;
|
|
190
|
-
error?: string;
|
|
191
|
-
paymentIntentId?: string;
|
|
192
|
-
}>;
|
|
193
|
-
paymentElementOptions: {
|
|
194
|
-
layout: "accordion";
|
|
195
|
-
fields: {
|
|
196
|
-
billingDetails: {
|
|
197
|
-
name: "never";
|
|
198
|
-
email: "never";
|
|
199
|
-
phone: "never";
|
|
200
|
-
address: "auto";
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
getReturnStatus: (url: string | URL) => {
|
|
205
|
-
succeeded: boolean;
|
|
206
|
-
amount?: number;
|
|
207
|
-
paymentIntentId?: string;
|
|
208
|
-
error?: string;
|
|
209
|
-
};
|
|
210
|
-
getReturnUrl: () => string | undefined;
|
|
211
|
-
};
|
|
212
|
-
declare function useCateringConfig(): {
|
|
213
|
-
minimum_notice_hours: number | null | undefined;
|
|
214
|
-
minimum_people_required: number | null | undefined;
|
|
215
|
-
minimum_price: number | null | undefined;
|
|
216
|
-
does_cater: boolean | null | undefined;
|
|
217
|
-
does_deliver: boolean | null | undefined;
|
|
218
|
-
delivery_fee_cents: number | null | undefined;
|
|
219
|
-
max_delivery_radius_miles: number | null | undefined;
|
|
220
|
-
cents_per_mile: number | null | undefined;
|
|
221
|
-
};
|
|
222
|
-
declare function useRecommendations(): {
|
|
223
|
-
recommendations: RecommendationResult$1[];
|
|
224
|
-
isLoading: boolean;
|
|
225
|
-
error: string | null;
|
|
226
|
-
strategy: RecommendationStrategy$1;
|
|
227
|
-
lastFetchedAt: Date | null;
|
|
228
|
-
refresh: (request: RecommendationRequest$1) => Promise<void>;
|
|
229
|
-
setStrategy: (s: RecommendationStrategy$1) => void;
|
|
230
|
-
clear: () => void;
|
|
231
|
-
};
|
|
232
|
-
declare function useCustomer(): {
|
|
233
|
-
customer: Customer$1;
|
|
234
|
-
consentGiven: boolean;
|
|
235
|
-
setCustomer: (customer: Customer$1) => void;
|
|
236
|
-
consentAnswered: boolean;
|
|
237
|
-
setConsent: (granted: boolean) => void;
|
|
238
|
-
anonymousId: string | null;
|
|
239
|
-
};
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import React__default, { RefObject } from 'react';
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { z } from 'zod';
|
|
240
7
|
|
|
241
8
|
type LocationStatus = "active" | "permanently_closed";
|
|
242
9
|
interface Location {
|
|
@@ -541,4 +308,801 @@ interface Menu {
|
|
|
541
308
|
rules: Rule[];
|
|
542
309
|
}
|
|
543
310
|
|
|
544
|
-
|
|
311
|
+
interface ModalInstance {
|
|
312
|
+
type: string;
|
|
313
|
+
props: any;
|
|
314
|
+
workingData?: any;
|
|
315
|
+
displayStyle?: "fullscreen" | "dialog" | "sheet";
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
declare function setZorgoBoot(fn: () => Promise<void>): void;
|
|
319
|
+
declare function setZorgoPathnameHook(fn: () => string): void;
|
|
320
|
+
/**
|
|
321
|
+
* Modal stack control + usage. Consumers call `open(type, props)` to push a
|
|
322
|
+
* modal; the app's ModalHost renders whatever's on top via its registry map.
|
|
323
|
+
* `type` is a plain string keyed to that registry — no coupling here.
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* const { open } = useModal();
|
|
327
|
+
* open("ITEM_MODAL", { itemId });
|
|
328
|
+
*/
|
|
329
|
+
declare function useModal(): {
|
|
330
|
+
current: ModalInstance | null;
|
|
331
|
+
isOpen: boolean;
|
|
332
|
+
depth: number;
|
|
333
|
+
open: (type: string, props?: unknown, displayStyle?: ModalInstance["displayStyle"]) => void;
|
|
334
|
+
close: () => void;
|
|
335
|
+
back: () => void;
|
|
336
|
+
setWorkingData: (data: any, index?: number) => void;
|
|
337
|
+
getWorkingData: (index?: number) => any;
|
|
338
|
+
};
|
|
339
|
+
declare function useCart(): {
|
|
340
|
+
items: OrderItem[];
|
|
341
|
+
itemCount: number;
|
|
342
|
+
isEmpty: boolean;
|
|
343
|
+
customer: Customer;
|
|
344
|
+
promoCode: string | undefined;
|
|
345
|
+
tip: number | undefined;
|
|
346
|
+
subtotal: number;
|
|
347
|
+
discount: number;
|
|
348
|
+
tax: number;
|
|
349
|
+
serviceFee: number;
|
|
350
|
+
total: number;
|
|
351
|
+
addItem: (item: OrderItem, promoOverride?: Promotion | null) => void;
|
|
352
|
+
removeItem: (index: number) => void;
|
|
353
|
+
updateItem: (item: OrderItem, index: number, promoOverride?: Promotion | null) => void;
|
|
354
|
+
resetCart: () => void;
|
|
355
|
+
setCustomer: (customer: Customer) => void;
|
|
356
|
+
setLocationId: (location_id: number) => void;
|
|
357
|
+
setOrderType: (type_id: number) => void;
|
|
358
|
+
setTimeRequested: (t: string) => void;
|
|
359
|
+
setTip: (tip: number) => void;
|
|
360
|
+
getItemTotal: (item: OrderItem) => number;
|
|
361
|
+
getOrder: () => Order;
|
|
362
|
+
resolveShortUrl: (slug: string) => Promise<boolean>;
|
|
363
|
+
};
|
|
364
|
+
declare function useLocation(options?: {
|
|
365
|
+
promptLocationSelection?: boolean;
|
|
366
|
+
}): {
|
|
367
|
+
availableLocations: Location[];
|
|
368
|
+
currentLocation: Location | null;
|
|
369
|
+
setLocation: (location: Location) => void;
|
|
370
|
+
getIsCurrentLocationOpen: () => boolean;
|
|
371
|
+
needsLocationSelection: boolean;
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* Reactive menu data for the configured franchise.
|
|
375
|
+
*
|
|
376
|
+
* `items` excludes catering categories; use `allItems`,
|
|
377
|
+
* `cateringPrimaryItem`, or `cateringAddOns` when building catering flows.
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* const { items, categories } = useMenu();
|
|
381
|
+
*/
|
|
382
|
+
declare function useMenu(): {
|
|
383
|
+
items: MenuItem[];
|
|
384
|
+
allItems: MenuItem[];
|
|
385
|
+
categories: Category[];
|
|
386
|
+
getItemImageUrl: (imagePath?: string | null) => string | null;
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* Seeds a store with prebuilt data (see the app's prebuild script) during the
|
|
390
|
+
* first render, so the first client paint already shows content instead of empty
|
|
391
|
+
* state. Boot then refreshes the store from Supabase.
|
|
392
|
+
*
|
|
393
|
+
* Only seeds when the store is still empty (`isEmpty`), so client-side navigation
|
|
394
|
+
* never clobbers freshly fetched data with the stale build-time snapshot.
|
|
395
|
+
*
|
|
396
|
+
* Note: this only helps the client's first paint — zustand serves
|
|
397
|
+
* getInitialState() during SSR, so the seed never reaches server HTML. Pages that
|
|
398
|
+
* need SSR content must read the prebuilt data directly (see app/menu/page.tsx).
|
|
399
|
+
*
|
|
400
|
+
* @example
|
|
401
|
+
* useHydrateStore(MenuStore, menu, (s) => s.hydrate, (s) => !s.items?.length);
|
|
402
|
+
*/
|
|
403
|
+
declare function useHydrateStore<S, D>(store: {
|
|
404
|
+
getState: () => S;
|
|
405
|
+
}, seed: D, getHydrate: (state: S) => (data: D) => void, isEmpty: (state: S) => boolean): void;
|
|
406
|
+
/** MenuStore-specific wrapper. `items` may be nullish before persist rehydrates. */
|
|
407
|
+
declare function useHydrateMenu(menu: Menu): void;
|
|
408
|
+
/**
|
|
409
|
+
* Drives the item customization flow for a single menu item: variant choice,
|
|
410
|
+
* rule selections, component servings, quantity, and comments. Produces a
|
|
411
|
+
* live `draft` OrderItem and a `submit` that adds or updates the cart.
|
|
412
|
+
*
|
|
413
|
+
* @param baseItemId - `base_item_id` of the menu item being customized.
|
|
414
|
+
* @param seed - Existing OrderItem to pre-fill from, e.g. when editing a cart line.
|
|
415
|
+
* @param editIndex - Cart index to update on submit; omit to add a new item instead.
|
|
416
|
+
*
|
|
417
|
+
* @returns `item`/`variant`/`variants` for the item being built, `setVariant`
|
|
418
|
+
* to switch variants, `ruleGroups` for rendering rule UI (each option carries
|
|
419
|
+
* a `toggle`), `unmetRule`/`canSubmit` for validation state, `submit` to
|
|
420
|
+
* commit the draft to the cart, `quantity`/`setQuantity`, `comments`/`setComments`,
|
|
421
|
+
* `setComponentServings`, `price`/`salePrice`, `isEditMode`, and the raw `draft`.
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* const { item, ruleGroups, canSubmit, submit } = useItemCustomization(baseItemId);
|
|
425
|
+
*/
|
|
426
|
+
declare function useItemCustomization(baseItemId: number, seed?: OrderItem, editIndex?: number): {
|
|
427
|
+
item: MenuItem | undefined;
|
|
428
|
+
variant: ItemVariant;
|
|
429
|
+
variants: ItemVariant[];
|
|
430
|
+
setVariant: (next: ItemVariant) => void;
|
|
431
|
+
ruleGroups: CustomizationRule[];
|
|
432
|
+
unmetRule: CustomizationRule | null;
|
|
433
|
+
canSubmit: boolean;
|
|
434
|
+
submit: () => OrderItem | null;
|
|
435
|
+
quantity: number;
|
|
436
|
+
setQuantity: React.Dispatch<React.SetStateAction<number>>;
|
|
437
|
+
comments: string;
|
|
438
|
+
setComments: React.Dispatch<React.SetStateAction<string>>;
|
|
439
|
+
setComponentServings: (componentId: number, qty: number) => void;
|
|
440
|
+
price: number;
|
|
441
|
+
salePrice: number | undefined;
|
|
442
|
+
isEditMode: boolean;
|
|
443
|
+
draft: OrderItem | null;
|
|
444
|
+
};
|
|
445
|
+
declare function usePromotions(): {
|
|
446
|
+
promoCode: string;
|
|
447
|
+
setPromoCode: (code: string) => void;
|
|
448
|
+
appliedPromo: Promotion | null;
|
|
449
|
+
discountAmount: number;
|
|
450
|
+
error: string | null;
|
|
451
|
+
loading: boolean;
|
|
452
|
+
applyPromo: (code: string) => Promise<void>;
|
|
453
|
+
removePromo: () => void;
|
|
454
|
+
activePromotions: Promotion[];
|
|
455
|
+
};
|
|
456
|
+
declare function usePayment(): {
|
|
457
|
+
clientSecret: string | null;
|
|
458
|
+
intentType: "payment_intent" | "setup_intent" | null;
|
|
459
|
+
stripe: _stripe_stripe_js.Stripe | undefined;
|
|
460
|
+
elementOptions: StripeElementsOptions | null;
|
|
461
|
+
total: number | null;
|
|
462
|
+
isLoading: boolean;
|
|
463
|
+
error: string | null;
|
|
464
|
+
isReady: boolean;
|
|
465
|
+
startCheckout: () => Promise<void>;
|
|
466
|
+
resetCheckout: () => void;
|
|
467
|
+
submitPayment: (stripe: unknown, elements: unknown, clientSecret: string, returnUrl: string, customer: Customer) => Promise<{
|
|
468
|
+
success: boolean;
|
|
469
|
+
error?: string;
|
|
470
|
+
paymentIntentId?: string;
|
|
471
|
+
}>;
|
|
472
|
+
paymentElementOptions: {
|
|
473
|
+
layout: "accordion";
|
|
474
|
+
fields: {
|
|
475
|
+
billingDetails: {
|
|
476
|
+
name: "never";
|
|
477
|
+
email: "never";
|
|
478
|
+
phone: "never";
|
|
479
|
+
address: "auto";
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
getReturnStatus: (url: string | URL) => {
|
|
484
|
+
succeeded: boolean;
|
|
485
|
+
amount?: number;
|
|
486
|
+
paymentIntentId?: string;
|
|
487
|
+
error?: string;
|
|
488
|
+
};
|
|
489
|
+
getReturnUrl: () => string | undefined;
|
|
490
|
+
};
|
|
491
|
+
declare function useCateringConfig(): {
|
|
492
|
+
minimum_notice_hours: number | null | undefined;
|
|
493
|
+
minimum_people_required: number | null | undefined;
|
|
494
|
+
minimum_price: number | null | undefined;
|
|
495
|
+
does_cater: boolean | null | undefined;
|
|
496
|
+
does_deliver: boolean | null | undefined;
|
|
497
|
+
delivery_fee_cents: number | null | undefined;
|
|
498
|
+
max_delivery_radius_miles: number | null | undefined;
|
|
499
|
+
cents_per_mile: number | null | undefined;
|
|
500
|
+
};
|
|
501
|
+
declare function useRecommendations(): {
|
|
502
|
+
recommendations: RecommendationResult[];
|
|
503
|
+
isLoading: boolean;
|
|
504
|
+
error: string | null;
|
|
505
|
+
strategy: RecommendationStrategy;
|
|
506
|
+
lastFetchedAt: Date | null;
|
|
507
|
+
refresh: (request: RecommendationRequest) => Promise<void>;
|
|
508
|
+
setStrategy: (s: RecommendationStrategy) => void;
|
|
509
|
+
clear: () => void;
|
|
510
|
+
};
|
|
511
|
+
declare function useCustomer(): {
|
|
512
|
+
customer: Customer;
|
|
513
|
+
consentGiven: boolean;
|
|
514
|
+
setCustomer: (customer: Customer) => void;
|
|
515
|
+
consentAnswered: boolean;
|
|
516
|
+
setConsent: (granted: boolean) => void;
|
|
517
|
+
anonymousId: string | null;
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
declare function DynamicFormShell({ className, onSubmit, children, }: {
|
|
521
|
+
className?: string;
|
|
522
|
+
onSubmit: (values: Record<string, unknown>) => void | Promise<void>;
|
|
523
|
+
children: React__default.ReactNode;
|
|
524
|
+
}): react_jsx_runtime.JSX.Element;
|
|
525
|
+
|
|
526
|
+
declare const SubmitButtonSchema: z.ZodObject<{
|
|
527
|
+
label: z.ZodDefault<z.ZodString>;
|
|
528
|
+
loadingLabel: z.ZodDefault<z.ZodString>;
|
|
529
|
+
className: z.ZodDefault<z.ZodString>;
|
|
530
|
+
}, z.core.$strip>;
|
|
531
|
+
type SubmitButtonProps = Partial<z.infer<typeof SubmitButtonSchema>> & {
|
|
532
|
+
labelFn?: (values: Record<string, unknown>) => string;
|
|
533
|
+
};
|
|
534
|
+
declare function SubmitButton(props: SubmitButtonProps): react_jsx_runtime.JSX.Element;
|
|
535
|
+
|
|
536
|
+
declare function FieldError({ name, className }: {
|
|
537
|
+
name: string;
|
|
538
|
+
className?: string;
|
|
539
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
540
|
+
|
|
541
|
+
declare function Header({ className, title, titleClassName, subtitle, subtitleClassName, }: {
|
|
542
|
+
className?: string;
|
|
543
|
+
title: string;
|
|
544
|
+
titleClassName?: string;
|
|
545
|
+
subtitle?: string;
|
|
546
|
+
subtitleClassName?: string;
|
|
547
|
+
}): react_jsx_runtime.JSX.Element;
|
|
548
|
+
|
|
549
|
+
interface SummaryItem {
|
|
550
|
+
id: string;
|
|
551
|
+
name: string;
|
|
552
|
+
priceCents: number;
|
|
553
|
+
isBase?: boolean;
|
|
554
|
+
active_promo_id?: number;
|
|
555
|
+
}
|
|
556
|
+
interface RuleGroupPricing {
|
|
557
|
+
ruleId: number;
|
|
558
|
+
options: {
|
|
559
|
+
value: string;
|
|
560
|
+
label: string;
|
|
561
|
+
upcharge: number;
|
|
562
|
+
}[];
|
|
563
|
+
}
|
|
564
|
+
interface PerPersonSummaryProps {
|
|
565
|
+
items: SummaryItem[];
|
|
566
|
+
ruleGroups?: RuleGroupPricing[];
|
|
567
|
+
guestCountFieldId?: string;
|
|
568
|
+
className?: string;
|
|
569
|
+
}
|
|
570
|
+
declare function PerPersonSummary({ items, ruleGroups, guestCountFieldId, className, }: PerPersonSummaryProps): react_jsx_runtime.JSX.Element;
|
|
571
|
+
|
|
572
|
+
declare function SectionLabel({ label, className, }: {
|
|
573
|
+
label: string;
|
|
574
|
+
className?: string;
|
|
575
|
+
}): react_jsx_runtime.JSX.Element;
|
|
576
|
+
|
|
577
|
+
declare function DisclaimerText({ children, className, }: {
|
|
578
|
+
children: React__default.ReactNode;
|
|
579
|
+
className?: string;
|
|
580
|
+
}): react_jsx_runtime.JSX.Element;
|
|
581
|
+
|
|
582
|
+
declare function ConditionalRenderer({ whenFormVal, whenFunction, whenMediaQuery, children, }: {
|
|
583
|
+
whenFormVal?: (values: Record<string, unknown>) => boolean;
|
|
584
|
+
whenFunction?: () => boolean;
|
|
585
|
+
whenMediaQuery?: string;
|
|
586
|
+
children: React__default.ReactNode;
|
|
587
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
588
|
+
|
|
589
|
+
declare const TextFieldSchema: z.ZodObject<{
|
|
590
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
591
|
+
number: "number";
|
|
592
|
+
date: "date";
|
|
593
|
+
time: "time";
|
|
594
|
+
text: "text";
|
|
595
|
+
}>>;
|
|
596
|
+
fieldId: z.ZodString;
|
|
597
|
+
label: z.ZodOptional<z.ZodString>;
|
|
598
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
599
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
600
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
601
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
602
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
603
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
604
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
605
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
606
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
607
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
608
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
609
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
610
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
611
|
+
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
612
|
+
validate: z.ZodAny;
|
|
613
|
+
sanitize: z.ZodAny;
|
|
614
|
+
min: z.ZodOptional<z.ZodString>;
|
|
615
|
+
max: z.ZodOptional<z.ZodString>;
|
|
616
|
+
}, z.core.$strip>;
|
|
617
|
+
type TextFieldInput = Partial<z.infer<typeof TextFieldSchema>> & {
|
|
618
|
+
fieldId: string;
|
|
619
|
+
inputRef?: RefObject<HTMLInputElement | null>;
|
|
620
|
+
};
|
|
621
|
+
declare const ClickableSchema: z.ZodObject<{
|
|
622
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
623
|
+
number: "number";
|
|
624
|
+
date: "date";
|
|
625
|
+
time: "time";
|
|
626
|
+
text: "text";
|
|
627
|
+
}>>;
|
|
628
|
+
fieldId: z.ZodString;
|
|
629
|
+
label: z.ZodOptional<z.ZodString>;
|
|
630
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
631
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
632
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
633
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
634
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
635
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
636
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
637
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
638
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
639
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
640
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
641
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
642
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
643
|
+
minSelections: z.ZodDefault<z.ZodNumber>;
|
|
644
|
+
maxSelections: z.ZodDefault<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<number>]>>;
|
|
645
|
+
tooFewText: z.ZodOptional<z.ZodString>;
|
|
646
|
+
tooManyText: z.ZodOptional<z.ZodString>;
|
|
647
|
+
options: z.ZodArray<z.ZodObject<{
|
|
648
|
+
label: z.ZodString;
|
|
649
|
+
value: z.ZodString;
|
|
650
|
+
sublabel: z.ZodOptional<z.ZodString>;
|
|
651
|
+
description: z.ZodOptional<z.ZodString>;
|
|
652
|
+
disabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
653
|
+
}, z.core.$strip>>;
|
|
654
|
+
optionClassName: z.ZodDefault<z.ZodString>;
|
|
655
|
+
optionActiveClassName: z.ZodDefault<z.ZodString>;
|
|
656
|
+
optionLabelClassName: z.ZodDefault<z.ZodString>;
|
|
657
|
+
optionActiveLabelClassName: z.ZodDefault<z.ZodString>;
|
|
658
|
+
optionSublabelClassName: z.ZodDefault<z.ZodString>;
|
|
659
|
+
inputClassName: z.ZodDefault<z.ZodString>;
|
|
660
|
+
}, z.core.$strip>;
|
|
661
|
+
type ClickableInput = Partial<z.infer<typeof ClickableSchema>> & {
|
|
662
|
+
fieldId: string;
|
|
663
|
+
options: z.infer<typeof ClickableSchema>["options"];
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
declare function TextField(raw: TextFieldInput): react_jsx_runtime.JSX.Element;
|
|
667
|
+
|
|
668
|
+
declare const PhoneFieldSchema: z.ZodObject<{
|
|
669
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
670
|
+
number: "number";
|
|
671
|
+
date: "date";
|
|
672
|
+
time: "time";
|
|
673
|
+
text: "text";
|
|
674
|
+
}>>;
|
|
675
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
676
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
677
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
678
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
679
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
680
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
681
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
682
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
683
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
684
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
685
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
686
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
687
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
688
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
689
|
+
label: z.ZodDefault<z.ZodString>;
|
|
690
|
+
}, z.core.$strip>;
|
|
691
|
+
declare function PhoneField(raw: Partial<z.infer<typeof PhoneFieldSchema>>): react_jsx_runtime.JSX.Element;
|
|
692
|
+
|
|
693
|
+
declare const EmailFieldSchema: z.ZodObject<{
|
|
694
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
695
|
+
number: "number";
|
|
696
|
+
date: "date";
|
|
697
|
+
time: "time";
|
|
698
|
+
text: "text";
|
|
699
|
+
}>>;
|
|
700
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
701
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
702
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
703
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
704
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
705
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
706
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
707
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
708
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
709
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
710
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
711
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
712
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
713
|
+
label: z.ZodDefault<z.ZodString>;
|
|
714
|
+
autoCompleteType: z.ZodDefault<z.ZodString>;
|
|
715
|
+
}, z.core.$strip>;
|
|
716
|
+
declare function EmailField(raw: Partial<z.infer<typeof EmailFieldSchema>>): react_jsx_runtime.JSX.Element;
|
|
717
|
+
|
|
718
|
+
declare function ClickableField(raw: ClickableInput): react_jsx_runtime.JSX.Element;
|
|
719
|
+
|
|
720
|
+
declare const LocationFieldSchema: z.ZodObject<{
|
|
721
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
722
|
+
number: "number";
|
|
723
|
+
date: "date";
|
|
724
|
+
time: "time";
|
|
725
|
+
text: "text";
|
|
726
|
+
}>>;
|
|
727
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
728
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
729
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
730
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
731
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
732
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
733
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
734
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
735
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
736
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
737
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
738
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
739
|
+
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
740
|
+
validate: z.ZodAny;
|
|
741
|
+
sanitize: z.ZodAny;
|
|
742
|
+
min: z.ZodOptional<z.ZodString>;
|
|
743
|
+
max: z.ZodOptional<z.ZodString>;
|
|
744
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
745
|
+
label: z.ZodDefault<z.ZodString>;
|
|
746
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
747
|
+
}, z.core.$strip>;
|
|
748
|
+
declare function LocationField(raw: Partial<z.infer<typeof LocationFieldSchema>>): react_jsx_runtime.JSX.Element;
|
|
749
|
+
|
|
750
|
+
declare const TimeFieldSchema: z.ZodObject<{
|
|
751
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
752
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
753
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
754
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
755
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
756
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
757
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
758
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
759
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
760
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
761
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
762
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
763
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
764
|
+
label: z.ZodDefault<z.ZodString>;
|
|
765
|
+
autoCompleteType: z.ZodDefault<z.ZodString>;
|
|
766
|
+
inputType: z.ZodDefault<z.ZodLiteral<"time">>;
|
|
767
|
+
minTime: z.ZodOptional<z.ZodString>;
|
|
768
|
+
maxTime: z.ZodOptional<z.ZodString>;
|
|
769
|
+
closedSpans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
770
|
+
from: z.ZodString;
|
|
771
|
+
to: z.ZodString;
|
|
772
|
+
}, z.core.$strip>>>;
|
|
773
|
+
minimumNoticeHours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
774
|
+
dateFieldId: z.ZodDefault<z.ZodString>;
|
|
775
|
+
timezone: z.ZodDefault<z.ZodString>;
|
|
776
|
+
}, z.core.$strip>;
|
|
777
|
+
declare function TimeField(raw: Partial<z.infer<typeof TimeFieldSchema>>): react_jsx_runtime.JSX.Element;
|
|
778
|
+
|
|
779
|
+
declare const DateFieldSchema: z.ZodObject<{
|
|
780
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
781
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
782
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
783
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
784
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
785
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
786
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
787
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
788
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
789
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
790
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
791
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
792
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
793
|
+
label: z.ZodDefault<z.ZodString>;
|
|
794
|
+
autoCompleteType: z.ZodDefault<z.ZodString>;
|
|
795
|
+
inputType: z.ZodDefault<z.ZodLiteral<"date">>;
|
|
796
|
+
minimumNoticeHours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
797
|
+
minDate: z.ZodOptional<z.ZodDate>;
|
|
798
|
+
maxDate: z.ZodOptional<z.ZodDate>;
|
|
799
|
+
unavailableDates: z.ZodOptional<z.ZodArray<z.ZodDate>>;
|
|
800
|
+
}, z.core.$strip>;
|
|
801
|
+
declare function DateField(raw: Partial<z.infer<typeof DateFieldSchema>>): react_jsx_runtime.JSX.Element;
|
|
802
|
+
|
|
803
|
+
declare const DiscreteNumberFieldSchema: z.ZodObject<{
|
|
804
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
805
|
+
number: "number";
|
|
806
|
+
date: "date";
|
|
807
|
+
time: "time";
|
|
808
|
+
text: "text";
|
|
809
|
+
}>>;
|
|
810
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
811
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
812
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
813
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
814
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
815
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
816
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
817
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
818
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
819
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
820
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
821
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
822
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
823
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
824
|
+
label: z.ZodDefault<z.ZodString>;
|
|
825
|
+
min: z.ZodDefault<z.ZodNumber>;
|
|
826
|
+
max: z.ZodDefault<z.ZodNumber>;
|
|
827
|
+
minErrorText: z.ZodOptional<z.ZodString>;
|
|
828
|
+
maxErrorText: z.ZodOptional<z.ZodString>;
|
|
829
|
+
step: z.ZodDefault<z.ZodNumber>;
|
|
830
|
+
}, z.core.$strip>;
|
|
831
|
+
declare function DiscreteNumberField(raw: Partial<z.infer<typeof DiscreteNumberFieldSchema>>): react_jsx_runtime.JSX.Element;
|
|
832
|
+
|
|
833
|
+
declare const SliderFieldSchema: z.ZodObject<{
|
|
834
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
835
|
+
number: "number";
|
|
836
|
+
date: "date";
|
|
837
|
+
time: "time";
|
|
838
|
+
text: "text";
|
|
839
|
+
}>>;
|
|
840
|
+
fieldId: z.ZodString;
|
|
841
|
+
label: z.ZodOptional<z.ZodString>;
|
|
842
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
843
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
844
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
845
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
846
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
847
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
848
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
849
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
850
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
851
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
852
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
853
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
854
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
855
|
+
min: z.ZodDefault<z.ZodNumber>;
|
|
856
|
+
max: z.ZodDefault<z.ZodNumber>;
|
|
857
|
+
step: z.ZodDefault<z.ZodNumber>;
|
|
858
|
+
onChange: z.ZodOptional<z.ZodAny>;
|
|
859
|
+
}, z.core.$strip>;
|
|
860
|
+
type SliderFieldInput = Partial<z.infer<typeof SliderFieldSchema>> & {
|
|
861
|
+
fieldId: string;
|
|
862
|
+
};
|
|
863
|
+
declare function SliderField(raw: SliderFieldInput): react_jsx_runtime.JSX.Element;
|
|
864
|
+
|
|
865
|
+
declare const CheckboxFieldSchema: z.ZodObject<{
|
|
866
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
867
|
+
number: "number";
|
|
868
|
+
date: "date";
|
|
869
|
+
time: "time";
|
|
870
|
+
text: "text";
|
|
871
|
+
}>>;
|
|
872
|
+
fieldId: z.ZodString;
|
|
873
|
+
label: z.ZodOptional<z.ZodString>;
|
|
874
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
875
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
876
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
877
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
878
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
879
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
880
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
881
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
882
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
883
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
884
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
885
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
886
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
887
|
+
checkboxClassName: z.ZodDefault<z.ZodString>;
|
|
888
|
+
labelClassName: z.ZodDefault<z.ZodString>;
|
|
889
|
+
}, z.core.$strip>;
|
|
890
|
+
type CheckboxFieldInput = Partial<z.infer<typeof CheckboxFieldSchema>> & {
|
|
891
|
+
fieldId: string;
|
|
892
|
+
children: React__default.ReactNode;
|
|
893
|
+
};
|
|
894
|
+
declare function CheckboxField({ children, ...raw }: CheckboxFieldInput): react_jsx_runtime.JSX.Element;
|
|
895
|
+
|
|
896
|
+
declare function FieldLabel({ children, required, className, asteriskClassName, }: {
|
|
897
|
+
children: React__default.ReactNode;
|
|
898
|
+
required: boolean;
|
|
899
|
+
className?: string;
|
|
900
|
+
asteriskClassName?: string;
|
|
901
|
+
}): react_jsx_runtime.JSX.Element;
|
|
902
|
+
|
|
903
|
+
declare function IncrementField({ name, label, initalVal, showLabel, showError, showIncrement, showDecrement, }: {
|
|
904
|
+
name: any;
|
|
905
|
+
label?: string | undefined;
|
|
906
|
+
initalVal?: number | undefined;
|
|
907
|
+
showLabel?: boolean | undefined;
|
|
908
|
+
showError?: boolean | undefined;
|
|
909
|
+
showIncrement?: boolean | undefined;
|
|
910
|
+
showDecrement?: boolean | undefined;
|
|
911
|
+
}): react_jsx_runtime.JSX.Element;
|
|
912
|
+
|
|
913
|
+
declare const NameFieldsSchema: z.ZodObject<{
|
|
914
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
915
|
+
number: "number";
|
|
916
|
+
date: "date";
|
|
917
|
+
time: "time";
|
|
918
|
+
text: "text";
|
|
919
|
+
}>>;
|
|
920
|
+
label: z.ZodOptional<z.ZodString>;
|
|
921
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
922
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
923
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
924
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
925
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
926
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
927
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
928
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
929
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
930
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
931
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
932
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
933
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
934
|
+
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
935
|
+
validate: z.ZodAny;
|
|
936
|
+
sanitize: z.ZodAny;
|
|
937
|
+
min: z.ZodOptional<z.ZodString>;
|
|
938
|
+
max: z.ZodOptional<z.ZodString>;
|
|
939
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
940
|
+
outerClassName: z.ZodDefault<z.ZodString>;
|
|
941
|
+
firstNamePlaceholder: z.ZodDefault<z.ZodString>;
|
|
942
|
+
lastNamePlaceholder: z.ZodDefault<z.ZodString>;
|
|
943
|
+
firstNameInitialValue: z.ZodDefault<z.ZodString>;
|
|
944
|
+
lastNameInitialValue: z.ZodDefault<z.ZodString>;
|
|
945
|
+
childClassName: z.ZodDefault<z.ZodString>;
|
|
946
|
+
}, z.core.$strip>;
|
|
947
|
+
declare function NameFields(raw: Partial<z.infer<typeof NameFieldsSchema>>): react_jsx_runtime.JSX.Element;
|
|
948
|
+
|
|
949
|
+
type ReactiveTimeProp = string | ((values: Record<string, unknown>) => string | undefined);
|
|
950
|
+
declare const DateTimeSchema: z.ZodObject<{
|
|
951
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
952
|
+
number: "number";
|
|
953
|
+
date: "date";
|
|
954
|
+
time: "time";
|
|
955
|
+
text: "text";
|
|
956
|
+
}>>;
|
|
957
|
+
label: z.ZodOptional<z.ZodString>;
|
|
958
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
959
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
960
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
961
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
962
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
963
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
964
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
965
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
966
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
967
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
968
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
969
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
970
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
971
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
972
|
+
outerClassName: z.ZodDefault<z.ZodString>;
|
|
973
|
+
childClassName: z.ZodDefault<z.ZodString>;
|
|
974
|
+
dateLabel: z.ZodDefault<z.ZodString>;
|
|
975
|
+
dateFieldId: z.ZodDefault<z.ZodString>;
|
|
976
|
+
minDate: z.ZodOptional<z.ZodDate>;
|
|
977
|
+
maxDate: z.ZodOptional<z.ZodDate>;
|
|
978
|
+
unavailableDates: z.ZodOptional<z.ZodArray<z.ZodDate>>;
|
|
979
|
+
minimumNoticeHours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
980
|
+
timeLabel: z.ZodDefault<z.ZodString>;
|
|
981
|
+
timeFieldId: z.ZodDefault<z.ZodString>;
|
|
982
|
+
closedSpans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
983
|
+
from: z.ZodString;
|
|
984
|
+
to: z.ZodString;
|
|
985
|
+
}, z.core.$strip>>>;
|
|
986
|
+
timezone: z.ZodDefault<z.ZodString>;
|
|
987
|
+
dateInitialValue: z.ZodOptional<z.ZodString>;
|
|
988
|
+
timeInitialValue: z.ZodOptional<z.ZodString>;
|
|
989
|
+
}, z.core.$strip>;
|
|
990
|
+
type DateTimeInput = Omit<Partial<z.infer<typeof DateTimeSchema>>, "minTime" | "maxTime"> & {
|
|
991
|
+
minTime?: ReactiveTimeProp;
|
|
992
|
+
maxTime?: ReactiveTimeProp;
|
|
993
|
+
timeBounds?: (values: Record<string, unknown>) => {
|
|
994
|
+
min?: string;
|
|
995
|
+
max?: string;
|
|
996
|
+
};
|
|
997
|
+
};
|
|
998
|
+
declare function DateTime(rawInput: DateTimeInput): react_jsx_runtime.JSX.Element;
|
|
999
|
+
|
|
1000
|
+
declare const DateTimeRangeSchema: z.ZodObject<{
|
|
1001
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
1002
|
+
number: "number";
|
|
1003
|
+
date: "date";
|
|
1004
|
+
time: "time";
|
|
1005
|
+
text: "text";
|
|
1006
|
+
}>>;
|
|
1007
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1008
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
1009
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
1010
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
1011
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
1012
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
1013
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
1014
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
1015
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
1016
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
1017
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
1018
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
1019
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
1020
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
1021
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
1022
|
+
dateLabel: z.ZodDefault<z.ZodString>;
|
|
1023
|
+
dateFieldId: z.ZodDefault<z.ZodString>;
|
|
1024
|
+
minDate: z.ZodOptional<z.ZodDate>;
|
|
1025
|
+
maxDate: z.ZodOptional<z.ZodDate>;
|
|
1026
|
+
unavailableDates: z.ZodOptional<z.ZodArray<z.ZodDate>>;
|
|
1027
|
+
minimumNoticeHours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1028
|
+
startTimeLabel: z.ZodDefault<z.ZodString>;
|
|
1029
|
+
startTimeFieldId: z.ZodDefault<z.ZodString>;
|
|
1030
|
+
endTimeLabel: z.ZodDefault<z.ZodString>;
|
|
1031
|
+
endTimeFieldId: z.ZodDefault<z.ZodString>;
|
|
1032
|
+
closedSpans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1033
|
+
from: z.ZodString;
|
|
1034
|
+
to: z.ZodString;
|
|
1035
|
+
}, z.core.$strip>>>;
|
|
1036
|
+
timezone: z.ZodDefault<z.ZodString>;
|
|
1037
|
+
dateInitialValue: z.ZodOptional<z.ZodString>;
|
|
1038
|
+
startTimeInitialValue: z.ZodOptional<z.ZodString>;
|
|
1039
|
+
endTimeInitialValue: z.ZodOptional<z.ZodString>;
|
|
1040
|
+
}, z.core.$strip>;
|
|
1041
|
+
declare function DateTimeRange(raw: Partial<z.infer<typeof DateTimeRangeSchema>>): react_jsx_runtime.JSX.Element;
|
|
1042
|
+
|
|
1043
|
+
declare const GuestCountFieldSchema: z.ZodObject<{
|
|
1044
|
+
inputType: z.ZodDefault<z.ZodEnum<{
|
|
1045
|
+
number: "number";
|
|
1046
|
+
date: "date";
|
|
1047
|
+
time: "time";
|
|
1048
|
+
text: "text";
|
|
1049
|
+
}>>;
|
|
1050
|
+
autoCompleteType: z.ZodOptional<z.ZodString>;
|
|
1051
|
+
requiredText: z.ZodDefault<z.ZodString>;
|
|
1052
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
1053
|
+
showLabel: z.ZodDefault<z.ZodBoolean>;
|
|
1054
|
+
showError: z.ZodDefault<z.ZodBoolean>;
|
|
1055
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
1056
|
+
fieldClassName: z.ZodDefault<z.ZodString>;
|
|
1057
|
+
containerClassName: z.ZodDefault<z.ZodString>;
|
|
1058
|
+
fieldLabelClassName: z.ZodDefault<z.ZodString>;
|
|
1059
|
+
fieldErrorClassName: z.ZodDefault<z.ZodString>;
|
|
1060
|
+
fieldAsteriskClassName: z.ZodDefault<z.ZodString>;
|
|
1061
|
+
initialValue: z.ZodOptional<z.ZodUnknown>;
|
|
1062
|
+
fieldId: z.ZodDefault<z.ZodString>;
|
|
1063
|
+
label: z.ZodDefault<z.ZodString>;
|
|
1064
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
1065
|
+
min: z.ZodDefault<z.ZodNumber>;
|
|
1066
|
+
max: z.ZodDefault<z.ZodNumber>;
|
|
1067
|
+
step: z.ZodDefault<z.ZodNumber>;
|
|
1068
|
+
minErrorText: z.ZodOptional<z.ZodString>;
|
|
1069
|
+
maxErrorText: z.ZodOptional<z.ZodString>;
|
|
1070
|
+
sliderClassName: z.ZodDefault<z.ZodString>;
|
|
1071
|
+
}, z.core.$strip>;
|
|
1072
|
+
type GuestCountFieldInput = Partial<z.infer<typeof GuestCountFieldSchema>>;
|
|
1073
|
+
declare function GuestCountField(raw: GuestCountFieldInput): react_jsx_runtime.JSX.Element;
|
|
1074
|
+
|
|
1075
|
+
interface TimeConstraints {
|
|
1076
|
+
startTz: string;
|
|
1077
|
+
endTz: string;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
declare function useRegisterField<T>({ name, required, validate, initialValue, }: {
|
|
1081
|
+
name: string;
|
|
1082
|
+
required?: boolean;
|
|
1083
|
+
validate?: (value: T) => string | null;
|
|
1084
|
+
initialValue?: T;
|
|
1085
|
+
}): void;
|
|
1086
|
+
|
|
1087
|
+
declare function useField<T>(name: string): {
|
|
1088
|
+
value: T;
|
|
1089
|
+
error: string | null;
|
|
1090
|
+
setValue: (next: T) => void;
|
|
1091
|
+
clearError: () => void;
|
|
1092
|
+
validate: () => string | null;
|
|
1093
|
+
setError: (message: string) => void;
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
declare function useFormStatus(): {
|
|
1097
|
+
status: "error" | "sent" | "idle" | "sending";
|
|
1098
|
+
isIdle: boolean;
|
|
1099
|
+
isSubmitting: boolean;
|
|
1100
|
+
isSubmitted: boolean;
|
|
1101
|
+
isError: boolean;
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
declare function useFormValues(): Record<string, unknown>;
|
|
1105
|
+
|
|
1106
|
+
declare function useFormValidity(): boolean;
|
|
1107
|
+
|
|
1108
|
+
export { type Category, CheckboxField, ClickableField, ConditionalRenderer, type Customer, type CustomizationOption, type CustomizationRule, DateField, DateTime, DateTimeRange, DisclaimerText, DiscreteNumberField, DynamicFormShell, EmailField, FieldError, FieldLabel, GuestCountField, Header, IncrementField, type ItemVariant, type Location, LocationField, type Menu, type MenuItem, NameFields, type Order, type OrderComponent, type OrderItem, PhoneField, Platforms, PerPersonSummary as PricePreview, type Promotion, type RecommendationRequest, type RecommendationResult, type RecommendationStrategy, type Rule, type RuleComponent, type RuleItem, type RuleSelection, SectionLabel, type Selection, SliderField, SubmitButton, TextField, type TimeConstraints, TimeField, setZorgoBoot, setZorgoPathnameHook, useCart, useCateringConfig, useCustomer, useField, useFormStatus, useFormValidity, useFormValues, useHydrateMenu, useHydrateStore, useItemCustomization, useLocation, useMenu, useModal, usePayment, usePromotions, useRecommendations, useRegisterField };
|