@zorgo/next 1.1.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +344 -1
- package/dist/cli.js.map +1 -0
- package/dist/cli.mjs +344 -1
- package/dist/cli.mjs.map +1 -0
- package/dist/components.d.mts +315 -87
- package/dist/components.d.ts +315 -87
- package/dist/components.js +1216 -820
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +1195 -832
- package/dist/components.mjs.map +1 -1
- package/dist/images.d.mts +36 -0
- package/dist/images.d.ts +36 -0
- package/dist/images.js +62 -0
- package/dist/images.js.map +1 -0
- package/dist/images.mjs +32 -0
- package/dist/images.mjs.map +1 -0
- package/dist/index.d.mts +175 -6
- package/dist/index.d.ts +175 -6
- package/dist/index.js +162 -1
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +162 -1
- package/dist/index.mjs.map +1 -0
- package/dist/item-page.d.mts +151 -0
- package/dist/item-page.d.ts +151 -0
- package/dist/item-page.js +166 -0
- package/dist/item-page.js.map +1 -0
- package/dist/item-page.mjs +129 -0
- package/dist/item-page.mjs.map +1 -0
- package/dist/seo.d.mts +31 -1
- package/dist/seo.d.ts +31 -1
- package/dist/server.js +541 -1
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +504 -1
- package/dist/server.mjs.map +1 -0
- package/dist/slugs.js.map +1 -1
- package/dist/slugs.mjs.map +1 -1
- package/dist/tree/app/components/ClientItemForm.tsx +7 -0
- package/dist/tree/app/components/Header.tsx +3 -0
- package/dist/tree/app/components/ModalRegistry.tsx +3 -2
- package/dist/tree/app/components/index.ts +2 -1
- package/dist/tree/app/globals.css.gen.ts +1 -0
- package/dist/tree/app/menu/[slug]/page.tsx +16 -48
- package/dist/tree/gitignore +1 -0
- package/dist/tree/image-loader.ts +4 -0
- package/dist/tree/next.config.ts +12 -0
- package/package.json +11 -1
- package/dist/cli.d.mts +0 -9
- package/dist/cli.d.ts +0 -9
- package/dist/tree/app/menu/[slug]/ItemCustomizationClient.tsx +0 -18
package/dist/components.d.mts
CHANGED
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
declare function CookieConsent(): react_jsx_runtime.JSX.Element | null;
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
declare const BREADCRUMBS_DEFAULT_ITEM_CLASSES: Required<BreadcrumbsItemClasses>;
|
|
22
|
-
declare function mergeBreadcrumbsItemClasses(overrides?: BreadcrumbsItemClasses): {
|
|
23
|
-
baseContainer: string;
|
|
24
|
-
crumbLink: string;
|
|
25
|
-
crumbText: string;
|
|
26
|
-
separator: string;
|
|
27
|
-
};
|
|
28
|
-
/** Minimal, presentational breadcrumb trail (e.g. Menu -> Category -> Item). */
|
|
29
|
-
declare function Breadcrumbs({ items, itemClasses, }: {
|
|
30
|
-
items: BreadcrumbItem[];
|
|
31
|
-
itemClasses?: BreadcrumbsItemClasses;
|
|
32
|
-
}): react_jsx_runtime.JSX.Element;
|
|
7
|
+
/** A row of `portion_schemes` — a franchise-owned, franchise-named menu entity. */
|
|
8
|
+
declare const PortionSchemeSchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodNumber;
|
|
10
|
+
franchise_id: z.ZodNumber;
|
|
11
|
+
geometry: z.ZodEnum<{
|
|
12
|
+
radial: "radial";
|
|
13
|
+
grid: "grid";
|
|
14
|
+
linear: "linear";
|
|
15
|
+
count: "count";
|
|
16
|
+
}>;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
min_divisions: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
max_divisions: z.ZodNumber;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
type PortionScheme = z.infer<typeof PortionSchemeSchema>;
|
|
33
22
|
|
|
34
23
|
type LocationStatus = "active" | "permanently_closed";
|
|
35
24
|
interface Location {
|
|
@@ -72,16 +61,27 @@ interface ItemVariant {
|
|
|
72
61
|
components?: Component[];
|
|
73
62
|
base_item_id?: number;
|
|
74
63
|
rules?: Rule[];
|
|
64
|
+
portion_scheme_id?: number | null;
|
|
65
|
+
portion_scheme?: PortionScheme | null;
|
|
75
66
|
display_price?: number;
|
|
76
67
|
active_promo_id?: number;
|
|
77
68
|
}
|
|
69
|
+
interface BaseItemImage {
|
|
70
|
+
image_id: number;
|
|
71
|
+
base_item_id: number;
|
|
72
|
+
alias: string;
|
|
73
|
+
raw_path?: string | null;
|
|
74
|
+
processed_path?: string | null;
|
|
75
|
+
sort_index?: number;
|
|
76
|
+
local_key?: string | null;
|
|
77
|
+
}
|
|
78
78
|
interface MenuItem {
|
|
79
79
|
base_item_id: number;
|
|
80
80
|
category_id: number;
|
|
81
81
|
franchise_id: number;
|
|
82
82
|
name: string;
|
|
83
83
|
per_person?: boolean | null;
|
|
84
|
-
|
|
84
|
+
images?: BaseItemImage[];
|
|
85
85
|
variants: ItemVariant[];
|
|
86
86
|
rules: Rule[];
|
|
87
87
|
description?: string | null;
|
|
@@ -119,6 +119,7 @@ interface Rule {
|
|
|
119
119
|
min_selection: number;
|
|
120
120
|
max_selection?: number;
|
|
121
121
|
included_quantity: number;
|
|
122
|
+
is_portionable?: boolean;
|
|
122
123
|
items?: RuleItem[];
|
|
123
124
|
components?: RuleComponent[];
|
|
124
125
|
}
|
|
@@ -139,6 +140,36 @@ interface RuleComponent {
|
|
|
139
140
|
behavior?: ScalingBehavior;
|
|
140
141
|
serving_weight?: number;
|
|
141
142
|
}
|
|
143
|
+
interface CustomizationOption {
|
|
144
|
+
key: string;
|
|
145
|
+
id: number;
|
|
146
|
+
type: "item" | "component";
|
|
147
|
+
name: string;
|
|
148
|
+
description?: string | null;
|
|
149
|
+
upcharge: number;
|
|
150
|
+
selected: boolean;
|
|
151
|
+
disabled: boolean;
|
|
152
|
+
toggle: () => void;
|
|
153
|
+
/** Section this option currently targets; null when editing the whole item. */
|
|
154
|
+
portion?: string | null;
|
|
155
|
+
/** Section indices this option already covers, for shading the picker. */
|
|
156
|
+
coveredSections?: number[];
|
|
157
|
+
/** Already applied to the whole item, so individual sections are moot. */
|
|
158
|
+
coveredWhole?: boolean;
|
|
159
|
+
}
|
|
160
|
+
interface CustomizationRule extends Rule {
|
|
161
|
+
rule_id: number;
|
|
162
|
+
max: number;
|
|
163
|
+
/** Weighted, not a row count: two halves of one topping count as 1. */
|
|
164
|
+
selectedCount: number;
|
|
165
|
+
satisfied: boolean;
|
|
166
|
+
/** "Choose 1. Select up to 5. 1 included" — the rule's limits in words. */
|
|
167
|
+
subtext: string;
|
|
168
|
+
message: () => string | null;
|
|
169
|
+
options: CustomizationOption[];
|
|
170
|
+
/** This rule can be applied per-section under the item's scheme. */
|
|
171
|
+
portionable?: boolean;
|
|
172
|
+
}
|
|
142
173
|
interface OrderItem {
|
|
143
174
|
item_id: number;
|
|
144
175
|
base_item_id: number;
|
|
@@ -155,6 +186,7 @@ interface OrderItem {
|
|
|
155
186
|
components?: OrderComponent[];
|
|
156
187
|
selections?: RuleSelection[];
|
|
157
188
|
comments?: string;
|
|
189
|
+
portion_scheme?: PortionScheme | null;
|
|
158
190
|
status?: "removed" | "modified";
|
|
159
191
|
applied_promo_id?: number;
|
|
160
192
|
discount_amount?: number;
|
|
@@ -163,6 +195,7 @@ interface OrderComponent extends Component {
|
|
|
163
195
|
quantity_servings: number;
|
|
164
196
|
upcharge?: number;
|
|
165
197
|
rule_id?: number;
|
|
198
|
+
portion?: string | null;
|
|
166
199
|
}
|
|
167
200
|
interface RuleSelection {
|
|
168
201
|
rule_id: number;
|
|
@@ -177,6 +210,7 @@ interface Selection {
|
|
|
177
210
|
serving_price?: number;
|
|
178
211
|
name: string;
|
|
179
212
|
status?: "removed" | "modified" | "added";
|
|
213
|
+
portion?: string | null;
|
|
180
214
|
component_type_id?: number;
|
|
181
215
|
serving_weight?: number;
|
|
182
216
|
measurement_type?: "weight" | "count";
|
|
@@ -261,8 +295,9 @@ declare function AccordionMenu({ items, categories, itemClasses, }: {
|
|
|
261
295
|
itemClasses?: AccordionMenuItemClasses;
|
|
262
296
|
}): react_jsx_runtime.JSX.Element;
|
|
263
297
|
|
|
298
|
+
declare function money(cents: number): string;
|
|
264
299
|
/** Per-slot Tailwind classes for the item customization form. */
|
|
265
|
-
type
|
|
300
|
+
type ClientItemFormItemClasses = Partial<{
|
|
266
301
|
baseContainer: string;
|
|
267
302
|
title: string;
|
|
268
303
|
description: string;
|
|
@@ -280,6 +315,7 @@ type ItemCustomizationFormItemClasses = Partial<{
|
|
|
280
315
|
incrementButton: string;
|
|
281
316
|
servingsValue: string;
|
|
282
317
|
ruleError: string;
|
|
318
|
+
portionHint: string;
|
|
283
319
|
commentsTextarea: string;
|
|
284
320
|
quantityRow: string;
|
|
285
321
|
submitButton: string;
|
|
@@ -287,10 +323,10 @@ type ItemCustomizationFormItemClasses = Partial<{
|
|
|
287
323
|
}>;
|
|
288
324
|
/**
|
|
289
325
|
* Structural / theme defaults. Merged with `itemClasses` via
|
|
290
|
-
* {@link
|
|
326
|
+
* {@link mergeClientItemFormItemClasses}.
|
|
291
327
|
*/
|
|
292
|
-
declare const
|
|
293
|
-
declare function
|
|
328
|
+
declare const CLIENT_ITEM_FORM_DEFAULT_ITEM_CLASSES: Required<ClientItemFormItemClasses>;
|
|
329
|
+
declare function mergeClientItemFormItemClasses(overrides?: ClientItemFormItemClasses): {
|
|
294
330
|
baseContainer: string;
|
|
295
331
|
title: string;
|
|
296
332
|
description: string;
|
|
@@ -308,19 +344,174 @@ declare function mergeItemCustomizationFormItemClasses(overrides?: ItemCustomiza
|
|
|
308
344
|
incrementButton: string;
|
|
309
345
|
servingsValue: string;
|
|
310
346
|
ruleError: string;
|
|
347
|
+
portionHint: string;
|
|
311
348
|
commentsTextarea: string;
|
|
312
349
|
quantityRow: string;
|
|
313
350
|
submitButton: string;
|
|
314
351
|
notFound: string;
|
|
315
352
|
};
|
|
316
|
-
|
|
353
|
+
/**
|
|
354
|
+
* Fully-resolved classes. Every section takes this (not the partial overrides)
|
|
355
|
+
* so a subcomponent used on its own and one composed into ClientItemForm merge
|
|
356
|
+
* the defaults exactly once.
|
|
357
|
+
*/
|
|
358
|
+
type ClientItemFormSlots = ReturnType<typeof mergeClientItemFormItemClasses>;
|
|
359
|
+
declare const CLIENT_ITEM_FORM_SLOTS: ClientItemFormSlots;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* The stock item form. Every section here is exported on its own — a site that
|
|
363
|
+
* wants its own layout composes these instead of forking the file.
|
|
364
|
+
*/
|
|
365
|
+
declare function ClientItemForm({ baseItemId, seed, editIndex, itemClasses, onSubmitSuccess, }: {
|
|
317
366
|
baseItemId: number;
|
|
318
367
|
seed?: OrderItem;
|
|
319
368
|
editIndex?: number;
|
|
320
|
-
itemClasses?:
|
|
369
|
+
itemClasses?: ClientItemFormItemClasses;
|
|
370
|
+
/** Defaults to navigating back to /menu. */
|
|
321
371
|
onSubmitSuccess?: () => void;
|
|
322
372
|
}): react_jsx_runtime.JSX.Element;
|
|
323
373
|
|
|
374
|
+
declare function OptionButton({ label, subtext, selected, onClick, slots, }: {
|
|
375
|
+
label: string;
|
|
376
|
+
subtext?: string;
|
|
377
|
+
selected: boolean;
|
|
378
|
+
onClick: () => void;
|
|
379
|
+
slots?: ClientItemFormSlots;
|
|
380
|
+
}): react_jsx_runtime.JSX.Element;
|
|
381
|
+
|
|
382
|
+
/** Size / variant picker. Renders nothing when there is only one variant. */
|
|
383
|
+
declare function VariantSection({ variants, variant, setVariant, title, slots, }: {
|
|
384
|
+
variants: ItemVariant[];
|
|
385
|
+
variant: ItemVariant;
|
|
386
|
+
setVariant: (variant: ItemVariant) => void;
|
|
387
|
+
title?: string;
|
|
388
|
+
slots?: ClientItemFormSlots;
|
|
389
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* What the variant already includes, each togglable on or off — for the whole
|
|
393
|
+
* item, or for whichever section is being edited ("no cheese on the left").
|
|
394
|
+
*/
|
|
395
|
+
declare function ComponentsSection({ variant, draft, setComponentServings, activeSection, divisions, scheme, title, slots, }: {
|
|
396
|
+
variant: ItemVariant;
|
|
397
|
+
draft?: OrderItem | null;
|
|
398
|
+
setComponentServings: (componentId: number, servings: number, portion?: string | null) => void;
|
|
399
|
+
/** Section being edited; null = the whole item. */
|
|
400
|
+
activeSection?: number | null;
|
|
401
|
+
divisions?: number;
|
|
402
|
+
/** Names the section a removal applies to. */
|
|
403
|
+
scheme?: PortionScheme | null;
|
|
404
|
+
title?: string;
|
|
405
|
+
slots?: ClientItemFormSlots;
|
|
406
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
407
|
+
|
|
408
|
+
/** The item's cut selector, wrapped in a titled form section. */
|
|
409
|
+
declare function PortionSection({ scheme, divisions, activeSection, setActiveSection, setDivisions, slots, }: {
|
|
410
|
+
scheme: PortionScheme;
|
|
411
|
+
divisions: number;
|
|
412
|
+
activeSection: number | null;
|
|
413
|
+
setActiveSection: (section: number | null) => void;
|
|
414
|
+
setDivisions: (divisions: number) => void;
|
|
415
|
+
slots?: ClientItemFormSlots;
|
|
416
|
+
}): react_jsx_runtime.JSX.Element;
|
|
417
|
+
|
|
418
|
+
/** One rule group (toppings, sides, …) and its unmet-requirement message. */
|
|
419
|
+
declare function RuleSection({ rule, activeSection, divisions, scheme, placeOption, slots, }: {
|
|
420
|
+
rule: CustomizationRule;
|
|
421
|
+
/** Section currently being edited, so a whole-item-only rule can say so. */
|
|
422
|
+
activeSection?: number | null;
|
|
423
|
+
/** How the item is currently cut, for the portion this section writes. */
|
|
424
|
+
divisions?: number;
|
|
425
|
+
/** Names the section an option sits on; omit when the item can't be cut. */
|
|
426
|
+
scheme?: PortionScheme | null;
|
|
427
|
+
/** Defaults to the option's own whole-item toggle. */
|
|
428
|
+
placeOption?: (ruleId: number, baseKey: string, portion: string | null, max?: number) => void;
|
|
429
|
+
slots?: ClientItemFormSlots;
|
|
430
|
+
}): react_jsx_runtime.JSX.Element;
|
|
431
|
+
|
|
432
|
+
/** Free-text special instructions. */
|
|
433
|
+
declare function CommentsSection({ comments, setComments, title, placeholder, rows, slots, }: {
|
|
434
|
+
comments: string;
|
|
435
|
+
setComments: (comments: string) => void;
|
|
436
|
+
title?: string;
|
|
437
|
+
placeholder?: string;
|
|
438
|
+
rows?: number;
|
|
439
|
+
slots?: ClientItemFormSlots;
|
|
440
|
+
}): react_jsx_runtime.JSX.Element;
|
|
441
|
+
|
|
442
|
+
/** Line quantity stepper. The hook already floors quantity at 1. */
|
|
443
|
+
declare function QuantitySection({ quantity, setQuantity, title, slots, }: {
|
|
444
|
+
quantity: number;
|
|
445
|
+
setQuantity: (next: number | ((current: number) => number)) => void;
|
|
446
|
+
title?: string;
|
|
447
|
+
slots?: ClientItemFormSlots;
|
|
448
|
+
}): react_jsx_runtime.JSX.Element;
|
|
449
|
+
|
|
450
|
+
/** Add-to-cart button: names the first unmet rule, otherwise the price. */
|
|
451
|
+
declare function SubmitButton({ canSubmit, unmetRule, price, salePrice, isEditMode, onSubmit, slots, }: {
|
|
452
|
+
canSubmit: boolean;
|
|
453
|
+
unmetRule?: CustomizationRule | null;
|
|
454
|
+
price: number;
|
|
455
|
+
salePrice?: number | null;
|
|
456
|
+
isEditMode?: boolean;
|
|
457
|
+
onSubmit: () => void;
|
|
458
|
+
slots?: ClientItemFormSlots;
|
|
459
|
+
}): react_jsx_runtime.JSX.Element;
|
|
460
|
+
|
|
461
|
+
interface BreadcrumbItem {
|
|
462
|
+
label: string;
|
|
463
|
+
/** Omit (or leave undefined) to render the crumb as plain, non-clickable text. */
|
|
464
|
+
href?: string;
|
|
465
|
+
}
|
|
466
|
+
/** Per-slot Tailwind classes for the breadcrumb trail. */
|
|
467
|
+
type BreadcrumbsItemClasses = Partial<{
|
|
468
|
+
baseContainer: string;
|
|
469
|
+
crumbLink: string;
|
|
470
|
+
crumbText: string;
|
|
471
|
+
separator: string;
|
|
472
|
+
}>;
|
|
473
|
+
/**
|
|
474
|
+
* Structural / theme defaults. Merged with `itemClasses` via
|
|
475
|
+
* {@link mergeBreadcrumbsItemClasses}.
|
|
476
|
+
*/
|
|
477
|
+
declare const BREADCRUMBS_DEFAULT_ITEM_CLASSES: Required<BreadcrumbsItemClasses>;
|
|
478
|
+
declare function mergeBreadcrumbsItemClasses(overrides?: BreadcrumbsItemClasses): {
|
|
479
|
+
baseContainer: string;
|
|
480
|
+
crumbLink: string;
|
|
481
|
+
crumbText: string;
|
|
482
|
+
separator: string;
|
|
483
|
+
};
|
|
484
|
+
/** Minimal, presentational breadcrumb trail (e.g. Menu -> Category -> Item). */
|
|
485
|
+
declare function Breadcrumbs({ items, itemClasses, }: {
|
|
486
|
+
items: BreadcrumbItem[];
|
|
487
|
+
itemClasses?: BreadcrumbsItemClasses;
|
|
488
|
+
}): react_jsx_runtime.JSX.Element;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Section pickers. One per geometry, all with the same props and all dumb: they
|
|
492
|
+
* draw `divisions` sections, highlight `active`, shade `covered`, and call
|
|
493
|
+
* `onSelect`. Every indexing rule lives in the scheme and in portionUtils —
|
|
494
|
+
* a renderer never decides what section 2 means. See docs/portions.md §4.
|
|
495
|
+
*/
|
|
496
|
+
interface PortionShapeProps {
|
|
497
|
+
divisions: number;
|
|
498
|
+
active: number | null;
|
|
499
|
+
/** Sections already carrying the selection being edited, shaded not selected. */
|
|
500
|
+
covered?: number[];
|
|
501
|
+
onSelect: (index: number | null) => void;
|
|
502
|
+
}
|
|
503
|
+
interface PortionPickerProps extends PortionShapeProps {
|
|
504
|
+
scheme: PortionScheme;
|
|
505
|
+
onDivisionsChange: (divisions: number) => void;
|
|
506
|
+
className?: string;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* The one portion control: a cut selector plus the geometry's shape. Adding a
|
|
510
|
+
* geometry means adding a `portion_geometry` enum value and a case here, in the
|
|
511
|
+
* same change — which is exactly why geometry is a closed enum.
|
|
512
|
+
*/
|
|
513
|
+
declare function PortionPicker({ scheme, divisions, active, covered, onSelect, onDivisionsChange, className, }: PortionPickerProps): react_jsx_runtime.JSX.Element;
|
|
514
|
+
|
|
324
515
|
/** Per-slot Tailwind classes for the find-location layout. */
|
|
325
516
|
type FindLocationItemClasses = Partial<{
|
|
326
517
|
baseContainer: string;
|
|
@@ -423,58 +614,20 @@ type CheckoutFormItemClasses = Partial<{
|
|
|
423
614
|
* {@link mergeCheckoutFormItemClasses}.
|
|
424
615
|
*/
|
|
425
616
|
declare const CHECKOUT_FORM_DEFAULT_ITEM_CLASSES: Required<CheckoutFormItemClasses>;
|
|
426
|
-
declare function mergeCheckoutFormItemClasses(overrides?: CheckoutFormItemClasses):
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
fieldContainer: string;
|
|
436
|
-
fieldLabel: string;
|
|
437
|
-
fieldError: string;
|
|
438
|
-
statusPanel: string;
|
|
439
|
-
statusTitle: string;
|
|
440
|
-
statusMessage: string;
|
|
441
|
-
statusMessageError: string;
|
|
442
|
-
statusActions: string;
|
|
443
|
-
stepSection: string;
|
|
444
|
-
sectionTitle: string;
|
|
445
|
-
cartList: string;
|
|
446
|
-
totals: string;
|
|
447
|
-
totalsRow: string;
|
|
448
|
-
totalsDivider: string;
|
|
449
|
-
totalsTotalRow: string;
|
|
450
|
-
form: string;
|
|
451
|
-
formActions: string;
|
|
452
|
-
submitError: string;
|
|
453
|
-
paymentSurface: string;
|
|
454
|
-
steps: string;
|
|
455
|
-
stepBadge: string;
|
|
456
|
-
stepBadgeActive: string;
|
|
457
|
-
stepBadgeInactive: string;
|
|
458
|
-
stepLabel: string;
|
|
459
|
-
stepLabelActive: string;
|
|
460
|
-
stepLabelInactive: string;
|
|
461
|
-
stepDivider: string;
|
|
462
|
-
stepDividerActive: string;
|
|
463
|
-
stepDividerInactive: string;
|
|
464
|
-
cartLine: string;
|
|
465
|
-
cartLineName: string;
|
|
466
|
-
cartLineSelection: string;
|
|
467
|
-
cartLinePrice: string;
|
|
468
|
-
cartLineControls: string;
|
|
469
|
-
cartLineQuantity: string;
|
|
470
|
-
promoApplied: string;
|
|
471
|
-
promoAppliedLabel: string;
|
|
472
|
-
promoRow: string;
|
|
473
|
-
promoInput: string;
|
|
474
|
-
promoError: string;
|
|
475
|
-
};
|
|
617
|
+
declare function mergeCheckoutFormItemClasses(overrides?: CheckoutFormItemClasses): Required<CheckoutFormItemClasses>;
|
|
618
|
+
/**
|
|
619
|
+
* Fully-resolved classes. Every subcomponent takes this (not the partial
|
|
620
|
+
* overrides) so a piece used on its own and one composed into CheckoutForm
|
|
621
|
+
* merge the defaults exactly once.
|
|
622
|
+
*/
|
|
623
|
+
type CheckoutFormSlots = Required<CheckoutFormItemClasses>;
|
|
624
|
+
declare const CHECKOUT_FORM_SLOTS: CheckoutFormSlots;
|
|
625
|
+
|
|
476
626
|
/**
|
|
477
|
-
*
|
|
627
|
+
* The stock checkout flow: cart + customer details, then Stripe payment.
|
|
628
|
+
* Every piece here is exported on its own — a site that wants its own layout
|
|
629
|
+
* composes these instead of forking the file.
|
|
630
|
+
*
|
|
478
631
|
* The order + payment intent are created on details submit (not on mount),
|
|
479
632
|
* so the collected customer and any applied promo are baked into the charge.
|
|
480
633
|
*/
|
|
@@ -485,4 +638,79 @@ declare function CheckoutForm({ itemClasses, homeHref, menuHref, checkoutHref, }
|
|
|
485
638
|
checkoutHref?: string;
|
|
486
639
|
}): react_jsx_runtime.JSX.Element;
|
|
487
640
|
|
|
488
|
-
|
|
641
|
+
/** Page wrapper + title every checkout state renders inside. */
|
|
642
|
+
declare function CheckoutShell({ children, title, slots, }: {
|
|
643
|
+
children: ReactNode;
|
|
644
|
+
title?: ReactNode;
|
|
645
|
+
slots?: CheckoutFormSlots;
|
|
646
|
+
}): react_jsx_runtime.JSX.Element;
|
|
647
|
+
|
|
648
|
+
/** Numbered progress header shown above each step. */
|
|
649
|
+
declare function CheckoutSteps({ current, labels, slots, }: {
|
|
650
|
+
current: number;
|
|
651
|
+
labels?: string[];
|
|
652
|
+
slots?: CheckoutFormSlots;
|
|
653
|
+
}): react_jsx_runtime.JSX.Element;
|
|
654
|
+
|
|
655
|
+
/** Terminal states: empty cart, payment result, errors, location prompt. */
|
|
656
|
+
declare function StatusPanel({ title, message, action, tone, slots, }: {
|
|
657
|
+
title: string;
|
|
658
|
+
message?: string;
|
|
659
|
+
action: ReactNode;
|
|
660
|
+
tone?: "default" | "error";
|
|
661
|
+
slots?: CheckoutFormSlots;
|
|
662
|
+
}): react_jsx_runtime.JSX.Element;
|
|
663
|
+
|
|
664
|
+
/** One cart line: selections, price, edit + quantity controls. */
|
|
665
|
+
declare function OrderLine({ item, index, onRemove, slots, }: {
|
|
666
|
+
item: OrderItem;
|
|
667
|
+
index: number;
|
|
668
|
+
onRemove: () => void;
|
|
669
|
+
slots?: CheckoutFormSlots;
|
|
670
|
+
}): react_jsx_runtime.JSX.Element;
|
|
671
|
+
/** Every line in the cart. */
|
|
672
|
+
declare function OrderLines({ slots, }: {
|
|
673
|
+
slots?: CheckoutFormSlots;
|
|
674
|
+
}): react_jsx_runtime.JSX.Element;
|
|
675
|
+
|
|
676
|
+
/** Subtotal, discount, tax, service fee, total. */
|
|
677
|
+
declare function OrderTotals({ slots, }: {
|
|
678
|
+
slots?: CheckoutFormSlots;
|
|
679
|
+
}): react_jsx_runtime.JSX.Element;
|
|
680
|
+
|
|
681
|
+
/** Promo code entry; swaps to the applied-promo row once one sticks. */
|
|
682
|
+
declare function PromoCode({ placeholder, slots, }: {
|
|
683
|
+
placeholder?: string;
|
|
684
|
+
slots?: CheckoutFormSlots;
|
|
685
|
+
}): react_jsx_runtime.JSX.Element;
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Name / phone / email inputs, seeded from the stored customer. Must be
|
|
689
|
+
* rendered inside a `DynamicFormShell`.
|
|
690
|
+
*/
|
|
691
|
+
declare function ContactFields({ slots, }: {
|
|
692
|
+
slots?: CheckoutFormSlots;
|
|
693
|
+
}): react_jsx_runtime.JSX.Element;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Terms + marketing checkboxes. Must be rendered inside a `DynamicFormShell`;
|
|
697
|
+
* the submit handler reads `termsAccepted` / `marketingConsent`.
|
|
698
|
+
*/
|
|
699
|
+
declare function ConsentFields({ termsLabel, marketingLabel, slots, }: {
|
|
700
|
+
termsLabel?: React.ReactNode;
|
|
701
|
+
marketingLabel?: React.ReactNode;
|
|
702
|
+
slots?: CheckoutFormSlots;
|
|
703
|
+
}): react_jsx_runtime.JSX.Element;
|
|
704
|
+
|
|
705
|
+
/** Step 1: review the cart, apply a promo, hand over contact details. */
|
|
706
|
+
declare function DetailsStep({ slots, }: {
|
|
707
|
+
slots?: CheckoutFormSlots;
|
|
708
|
+
}): react_jsx_runtime.JSX.Element;
|
|
709
|
+
|
|
710
|
+
/** Step 2: the Stripe payment element. Must be rendered inside `<Elements>`. */
|
|
711
|
+
declare function PaymentStep({ slots, checkoutHref, }: {
|
|
712
|
+
slots?: CheckoutFormSlots;
|
|
713
|
+
checkoutHref?: string;
|
|
714
|
+
}): react_jsx_runtime.JSX.Element;
|
|
715
|
+
|
|
716
|
+
export { ACCORDION_MENU_DEFAULT_ITEM_CLASSES, AccordionMenu, type AccordionMenuItemClasses, BREADCRUMBS_DEFAULT_ITEM_CLASSES, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsItemClasses, CHECKOUT_FORM_DEFAULT_ITEM_CLASSES, CHECKOUT_FORM_SLOTS, CLIENT_ITEM_FORM_DEFAULT_ITEM_CLASSES, CLIENT_ITEM_FORM_SLOTS, CheckoutForm, type CheckoutFormItemClasses, type CheckoutFormSlots, CheckoutShell, CheckoutSteps, ClientItemForm, type ClientItemFormItemClasses, type ClientItemFormSlots, CommentsSection, ComponentsSection, ConsentFields, ContactFields, CookieConsent, DetailsStep, FIND_LOCATION_DEFAULT_ITEM_CLASSES, FindLocation, type FindLocationItemClasses, GRID_MENU_DEFAULT_ITEM_CLASSES, GridMenu, type GridMenuItemClasses, CLIENT_ITEM_FORM_DEFAULT_ITEM_CLASSES as ITEM_CUSTOMIZATION_FORM_DEFAULT_ITEM_CLASSES, ClientItemForm as ItemCustomizationClient, ClientItemForm as ItemCustomizationForm, type ClientItemFormItemClasses as ItemCustomizationFormItemClasses, OptionButton, OrderLine, OrderLines, OrderTotals, PaymentStep, PortionPicker, type PortionPickerProps, PortionSection, type PortionShapeProps, PromoCode, QuantitySection, RuleSection, StatusPanel, SubmitButton, VariantSection, mergeAccordionMenuItemClasses, mergeBreadcrumbsItemClasses, mergeCheckoutFormItemClasses, mergeClientItemFormItemClasses, mergeFindLocationItemClasses, mergeGridMenuItemClasses, mergeClientItemFormItemClasses as mergeItemCustomizationFormItemClasses, money };
|