@ticketlayer/elements 0.3.3 → 1.0.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.
Files changed (179) hide show
  1. package/README.md +3 -2
  2. package/dist/cjs/{index-BpfoKd9Q.js → index-DanPUX0s.js} +1 -1
  3. package/dist/cjs/index.cjs.js +2 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/ticket-selector-BYVL13k_.js +3623 -0
  6. package/dist/cjs/ticketlayer-elements.cjs.js +2 -2
  7. package/dist/cjs/tl-buy-modal.cjs.entry.js +4 -4
  8. package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +89 -71
  9. package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +62 -31
  10. package/dist/cjs/tl-cart-badge.cjs.entry.js +75 -62
  11. package/dist/cjs/tl-cart-drawer.cjs.entry.js +52 -24
  12. package/dist/cjs/tl-cart.cjs.entry.js +72 -98
  13. package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +52 -30
  14. package/dist/cjs/tl-event-card.cjs.entry.js +44 -105
  15. package/dist/cjs/tl-event-list.cjs.entry.js +73 -36
  16. package/dist/cjs/tl-login.cjs.entry.js +75 -141
  17. package/dist/cjs/tl-my-orders.cjs.entry.js +53 -92
  18. package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +205 -641
  19. package/dist/cjs/tl-order-confirmation.cjs.entry.js +72 -105
  20. package/dist/cjs/tl-order-tickets_2.cjs.entry.js +50 -76
  21. package/dist/cjs/tl-promo-code.cjs.entry.js +51 -47
  22. package/dist/cjs/tl-seat-map.cjs.entry.js +4 -4
  23. package/dist/cjs/web-query-Ce73jB4k.js +16 -0
  24. package/dist/collection/components/tl-buy-modal/tl-buy-modal.css +12 -19
  25. package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +2 -2
  26. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +41 -4
  27. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +105 -76
  28. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.css +2 -2
  29. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.js +73 -30
  30. package/dist/collection/components/tl-cart/tl-cart.css +52 -51
  31. package/dist/collection/components/tl-cart/tl-cart.js +82 -101
  32. package/dist/collection/components/tl-cart-badge/tl-cart-badge.css +11 -11
  33. package/dist/collection/components/tl-cart-badge/tl-cart-badge.js +62 -62
  34. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.css +6 -6
  35. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +56 -24
  36. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.css +2 -2
  37. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.js +61 -29
  38. package/dist/collection/components/tl-event-card/event-card-adapter.js +11 -23
  39. package/dist/collection/components/tl-event-card/tl-event-card.css +22 -22
  40. package/dist/collection/components/tl-event-card/tl-event-card.js +51 -84
  41. package/dist/collection/components/tl-event-list/tl-event-list.css +17 -17
  42. package/dist/collection/components/tl-event-list/tl-event-list.js +82 -38
  43. package/dist/collection/components/tl-login/tl-login.css +26 -26
  44. package/dist/collection/components/tl-login/tl-login.js +83 -147
  45. package/dist/collection/components/tl-my-orders/tl-my-orders.css +40 -40
  46. package/dist/collection/components/tl-my-orders/tl-my-orders.js +58 -96
  47. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.css +54 -65
  48. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +137 -516
  49. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.css +38 -38
  50. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +81 -113
  51. package/dist/collection/components/tl-order-tickets/tl-order-tickets.css +9 -9
  52. package/dist/collection/components/tl-order-tickets/tl-order-tickets.js +57 -92
  53. package/dist/collection/components/tl-promo-code/tl-promo-code.css +25 -25
  54. package/dist/collection/components/tl-promo-code/tl-promo-code.js +55 -50
  55. package/dist/collection/components/tl-seat-map/tl-seat-map.css +10 -10
  56. package/dist/collection/components/tl-seat-map/tl-seat-map.js +2 -2
  57. package/dist/collection/components/tl-ticket/tl-ticket.css +13 -13
  58. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.css +74 -49
  59. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +95 -135
  60. package/dist/collection/utils/cart-totals.js +9 -0
  61. package/dist/collection/utils/order-summary.js +15 -99
  62. package/dist/collection/utils/testing/deep-text.js +29 -0
  63. package/dist/collection/utils/testing/fixtures.js +290 -0
  64. package/dist/collection/utils/testing/mock-sdk.js +13 -2
  65. package/dist/collection/utils/web-query.js +12 -0
  66. package/dist/collection/utils/web-storage.js +22 -0
  67. package/dist/components/ticket-selector.js +1 -0
  68. package/dist/components/tl-buy-modal.js +1 -1
  69. package/dist/components/tl-buy-tickets-button.js +1 -1
  70. package/dist/components/tl-buy-tickets-wrapper2.js +1 -1
  71. package/dist/components/tl-cart-badge.js +1 -1
  72. package/dist/components/tl-cart-drawer.js +1 -1
  73. package/dist/components/tl-cart2.js +1 -1
  74. package/dist/components/tl-checkout-wrapper2.js +1 -1
  75. package/dist/components/tl-event-card2.js +1 -1
  76. package/dist/components/tl-event-list.js +1 -1
  77. package/dist/components/tl-login2.js +1 -1
  78. package/dist/components/tl-my-orders.js +1 -1
  79. package/dist/components/tl-occurrence-selector2.js +1 -1
  80. package/dist/components/tl-order-confirmation.js +1 -1
  81. package/dist/components/tl-order-tickets2.js +1 -1
  82. package/dist/components/tl-promo-code.js +1 -1
  83. package/dist/components/tl-seat-map.js +1 -1
  84. package/dist/components/tl-ticket-selector2.js +1 -1
  85. package/dist/components/tl-ticket2.js +1 -1
  86. package/dist/components/web-query.js +1 -0
  87. package/dist/elements.docs.json +36 -36
  88. package/dist/esm/{index-CNX8hZa8.js → index-imfxp765.js} +1 -1
  89. package/dist/esm/index.js +2 -1
  90. package/dist/esm/loader.js +3 -3
  91. package/dist/esm/ticket-selector-BwChnHVC.js +3606 -0
  92. package/dist/esm/ticketlayer-elements.js +3 -3
  93. package/dist/esm/tl-buy-modal.entry.js +4 -4
  94. package/dist/esm/tl-buy-tickets-button.entry.js +90 -72
  95. package/dist/esm/tl-buy-tickets-wrapper.entry.js +63 -32
  96. package/dist/esm/tl-cart-badge.entry.js +76 -63
  97. package/dist/esm/tl-cart-drawer.entry.js +53 -25
  98. package/dist/esm/tl-cart.entry.js +73 -99
  99. package/dist/esm/tl-checkout-wrapper.entry.js +53 -31
  100. package/dist/esm/tl-event-card.entry.js +45 -106
  101. package/dist/esm/tl-event-list.entry.js +74 -37
  102. package/dist/esm/tl-login.entry.js +76 -142
  103. package/dist/esm/tl-my-orders.entry.js +54 -93
  104. package/dist/esm/tl-occurrence-selector_2.entry.js +206 -642
  105. package/dist/esm/tl-order-confirmation.entry.js +73 -106
  106. package/dist/esm/tl-order-tickets_2.entry.js +51 -77
  107. package/dist/esm/tl-promo-code.entry.js +52 -48
  108. package/dist/esm/tl-seat-map.entry.js +4 -4
  109. package/dist/esm/web-query-Bdbb2lk5.js +14 -0
  110. package/dist/ticketlayer-elements/index.esm.js +1 -1
  111. package/dist/ticketlayer-elements/p-45923d2c.entry.js +1 -0
  112. package/dist/ticketlayer-elements/p-492adc77.entry.js +1 -0
  113. package/dist/ticketlayer-elements/p-4cfc9e53.entry.js +1 -0
  114. package/dist/ticketlayer-elements/p-5135630e.entry.js +1 -0
  115. package/dist/ticketlayer-elements/p-5bbce3b5.entry.js +1 -0
  116. package/dist/ticketlayer-elements/p-7d547721.entry.js +1 -0
  117. package/dist/ticketlayer-elements/p-7fe7b6ba.entry.js +1 -0
  118. package/dist/ticketlayer-elements/p-8122f0c1.entry.js +1 -0
  119. package/dist/ticketlayer-elements/p-98d40869.entry.js +1 -0
  120. package/dist/ticketlayer-elements/p-Bdbb2lk5.js +1 -0
  121. package/dist/ticketlayer-elements/p-BwChnHVC.js +1 -0
  122. package/dist/ticketlayer-elements/p-abec290a.entry.js +1 -0
  123. package/dist/ticketlayer-elements/p-ac79a3f6.entry.js +1 -0
  124. package/dist/ticketlayer-elements/p-d01f4429.entry.js +1 -0
  125. package/dist/ticketlayer-elements/p-d7ffaf46.entry.js +1 -0
  126. package/dist/ticketlayer-elements/p-e7170f3c.entry.js +1 -0
  127. package/dist/ticketlayer-elements/p-e787e862.entry.js +1 -0
  128. package/dist/ticketlayer-elements/p-f1ff931f.entry.js +1 -0
  129. package/dist/ticketlayer-elements/p-imfxp765.js +3 -0
  130. package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -1
  131. package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -1
  132. package/dist/types/components/tl-buy-tickets-button/tl-buy-tickets-button.d.ts +40 -8
  133. package/dist/types/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.d.ts +20 -1
  134. package/dist/types/components/tl-cart/tl-cart.d.ts +40 -32
  135. package/dist/types/components/tl-cart-badge/tl-cart-badge.d.ts +22 -7
  136. package/dist/types/components/tl-cart-drawer/tl-cart-drawer.d.ts +28 -5
  137. package/dist/types/components/tl-checkout-wrapper/tl-checkout-wrapper.d.ts +18 -1
  138. package/dist/types/components/tl-event-card/event-card-adapter.d.ts +9 -20
  139. package/dist/types/components/tl-event-card/tl-event-card.d.ts +25 -28
  140. package/dist/types/components/tl-event-list/tl-event-list.d.ts +46 -6
  141. package/dist/types/components/tl-login/tl-login.d.ts +68 -22
  142. package/dist/types/components/tl-my-orders/tl-my-orders.d.ts +30 -12
  143. package/dist/types/components/tl-occurrence-selector/tl-occurrence-selector.d.ts +73 -161
  144. package/dist/types/components/tl-order-confirmation/tl-order-confirmation.d.ts +48 -15
  145. package/dist/types/components/tl-order-tickets/tl-order-tickets.d.ts +29 -31
  146. package/dist/types/components/tl-promo-code/tl-promo-code.d.ts +28 -10
  147. package/dist/types/components/tl-ticket/tl-ticket.d.ts +2 -11
  148. package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +61 -32
  149. package/dist/types/components.d.ts +302 -62
  150. package/dist/types/utils/cart-totals.d.ts +10 -0
  151. package/dist/types/utils/order-summary.d.ts +16 -65
  152. package/dist/types/utils/testing/deep-text.d.ts +13 -0
  153. package/dist/types/utils/testing/fixtures.d.ts +225 -0
  154. package/dist/types/utils/testing/mock-sdk.d.ts +14 -1
  155. package/dist/types/utils/web-query.d.ts +18 -0
  156. package/dist/types/utils/web-storage.d.ts +16 -0
  157. package/elements.catalogue.json +676 -55
  158. package/package.json +14 -6
  159. package/dist/cjs/order-summary-ZMkJ5bez.js +0 -116
  160. package/dist/components/order-summary.js +0 -1
  161. package/dist/esm/order-summary-BGekdjN9.js +0 -103
  162. package/dist/ticketlayer-elements/p-0b1d16f8.entry.js +0 -1
  163. package/dist/ticketlayer-elements/p-1471f6d8.entry.js +0 -1
  164. package/dist/ticketlayer-elements/p-1c51cbc1.entry.js +0 -1
  165. package/dist/ticketlayer-elements/p-5169f68b.entry.js +0 -1
  166. package/dist/ticketlayer-elements/p-895ba1f3.entry.js +0 -1
  167. package/dist/ticketlayer-elements/p-8d5722e1.entry.js +0 -1
  168. package/dist/ticketlayer-elements/p-917d8e09.entry.js +0 -1
  169. package/dist/ticketlayer-elements/p-9629029a.entry.js +0 -1
  170. package/dist/ticketlayer-elements/p-BGekdjN9.js +0 -1
  171. package/dist/ticketlayer-elements/p-CNX8hZa8.js +0 -3
  172. package/dist/ticketlayer-elements/p-a22714d0.entry.js +0 -1
  173. package/dist/ticketlayer-elements/p-bf73044b.entry.js +0 -1
  174. package/dist/ticketlayer-elements/p-e02079fa.entry.js +0 -1
  175. package/dist/ticketlayer-elements/p-e04ace15.entry.js +0 -1
  176. package/dist/ticketlayer-elements/p-e6fab1d5.entry.js +0 -1
  177. package/dist/ticketlayer-elements/p-f826b753.entry.js +0 -1
  178. package/dist/ticketlayer-elements/p-fa639d88.entry.js +0 -1
  179. package/dist/ticketlayer-elements/p-fbaca948.entry.js +0 -1
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The money rows a cart-shaped view renders.
3
+ *
4
+ * The rule and the arithmetic moved to `@ticketlayer/elements-core` with the
5
+ * core split (TKT-68): it is behaviour, and behaviour lives in a core so every
6
+ * harness derives the same figures. This file stays as the import path the
7
+ * components and their specs already use.
8
+ */
9
+ export { cartTotals, expressesFee, minorUnits, selectionTotals, FEE_LABEL_FALLBACK, } from '@ticketlayer/elements-core';
10
+ export type { TlCartLike, TlFeeQuote, TlSelectionLine, TlSelectionTotals, TlTotals, } from '@ticketlayer/elements-core';
@@ -1,67 +1,18 @@
1
1
  /**
2
- * Shared helpers for the order-facing components (tl-order-confirmation,
3
- * tl-my-orders). The sales order view carries line items, totals and tickets
4
- * but no event name, occurrence date or customer email, so these derive what
5
- * they can from the order and resolve the rest through the SDK.
2
+ * The order helpers, as the components have always imported them.
3
+ *
4
+ * Everything here now lives in `@ticketlayer/elements-core`
5
+ * (`src/orders.ts`): the order shape, the money rows, the status tone, the
6
+ * date and price formatting and the occurrence lookup all moved across with
7
+ * the split of `tl-my-orders` and `tl-order-confirmation` (TKT-69), so a
8
+ * native harness answers the same questions the same way. This module stays as
9
+ * the import path, unchanged for callers, because `tl-order-tickets` and
10
+ * `tl-ticket` are not split yet and read these helpers from here.
11
+ *
12
+ * `resolveOccurrence` is the one signature that moved: it takes the core's
13
+ * `ElementClient` rather than this package's `TicketlayerSDK`. A
14
+ * `TicketlayerSDK` satisfies that shape, so every existing call still
15
+ * compiles, which is why it is re-exported rather than wrapped.
6
16
  */
7
- import type { TicketlayerSDK } from './sdk-connector';
8
- export interface TlOrderItem {
9
- name: string;
10
- description?: string | null;
11
- type?: string;
12
- quantity: number;
13
- unitPrice: number | string;
14
- subtotal: number | string;
15
- }
16
- export interface TlOrderTicketRef {
17
- id: string;
18
- name: string;
19
- eventOccurrenceId: string | null;
20
- }
21
- export interface TlOrderData {
22
- id: string;
23
- orderNumber: string;
24
- status: string;
25
- paymentStatus?: string;
26
- currency: string;
27
- items: TlOrderItem[];
28
- subtotal: number | string;
29
- totalFees?: number | string;
30
- totalTax?: number | string;
31
- totalDiscounts?: number | string;
32
- total: number | string;
33
- tickets?: TlOrderTicketRef[];
34
- createdAt?: string;
35
- eventName?: string | null;
36
- customerEmail?: string | null;
37
- customer?: {
38
- email?: string | null;
39
- } | null;
40
- }
41
- export interface TlResolvedOccurrence {
42
- eventId: string;
43
- eventName: string;
44
- startsAt: string | null;
45
- }
46
- /** Money arrives as minor-unit integers or decimal strings ("50.00"). */
47
- export declare function formatPrice(value: number | string | null | undefined, currency?: string): string;
48
- export declare function formatDateTime(iso: string): string;
49
- export declare function formatDate(iso: string): string;
50
- /** Line items that are tickets (fees, taxes and discounts have their own type). */
51
- export declare function ticketItems(order: TlOrderData): TlOrderItem[];
52
- export declare function ticketCount(order: TlOrderData): number;
53
- /** Event name as the order view exposes it: the first ticket line's name. */
54
- export declare function orderEventName(order: TlOrderData): string | null;
55
- export declare function orderCustomerEmail(order: TlOrderData | null, customer: unknown): string | null;
56
- export declare function statusLabel(status: string | undefined): string;
57
- export type StatusTone = 'success' | 'info' | 'warning' | 'error' | 'muted';
58
- export declare function statusTone(status: string | undefined): StatusTone;
59
- export declare function errorMessage(err: unknown, fallback: string): string;
60
- /** True for the "not signed in" family of API errors (401/403, NO_SESSION, NOT_AUTHENTICATED). */
61
- export declare function isAuthError(err: unknown): boolean;
62
- /**
63
- * Find the event and start time for an occurrence id. The order view only
64
- * carries the occurrence id, so this walks the channel's listings (cached by
65
- * live-api) until one owns the occurrence. Best effort: null when not found.
66
- */
67
- export declare function resolveOccurrence(sdk: TicketlayerSDK, occurrenceId: string, maxEvents?: number): Promise<TlResolvedOccurrence | null>;
17
+ export { errorMessage, formatDate, formatDateTime, formatPrice, isAuthError, orderCustomerEmail, orderEventName, orderTotals, resolveOccurrence, statusLabel, statusTone, ticketCount, ticketItems, totalsAgree, } from '@ticketlayer/elements-core';
18
+ export type { StatusTone, TlOrderData, TlOrderItem, TlOrderTicketRef, TlOrderTotals, TlResolvedOccurrence, } from '@ticketlayer/elements-core';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The text an element actually shows, shadow roots included.
3
+ *
4
+ * `textContent` stops at a shadow boundary, and every element here renders
5
+ * into one (and several compose others: `tl-cart-drawer` holds a `tl-cart`,
6
+ * `tl-order-tickets` a grid of `tl-ticket`). A check that an element rendered
7
+ * something has to see through that, or it reads an empty string from an
8
+ * element that is perfectly full.
9
+ *
10
+ * Used by the stories' `expectRendered` in the browser and by
11
+ * story-coverage.spec.tsx in jsdom, so both are asking the same question.
12
+ */
13
+ export declare function deepText(node: Node | null | undefined): string;
@@ -0,0 +1,225 @@
1
+ export declare const FIXTURE_CUSTOMER: {
2
+ id: string;
3
+ email: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ };
7
+ /** `events.list` items, i.e. what a card is handed by `tl-event-list`. */
8
+ export declare const FIXTURE_EVENT_CARDS: {
9
+ id: string;
10
+ name: string;
11
+ shortDescription: string;
12
+ availabilityStatus: string;
13
+ venue: {
14
+ id: string;
15
+ name: string;
16
+ city: string;
17
+ };
18
+ nextOccurrence: {
19
+ startsAt: string;
20
+ };
21
+ }[];
22
+ /** `events.get` details, keyed by event id. */
23
+ export declare const FIXTURE_EVENT_DETAILS: Record<string, unknown>;
24
+ /** `events.getTicketTypes` for `evoc_1`. */
25
+ export declare const FIXTURE_TICKET_TYPES: {
26
+ id: string;
27
+ occurrenceId: string;
28
+ name: string;
29
+ description: string;
30
+ price: number;
31
+ currency: string;
32
+ availableQuantity: number;
33
+ maxPerOrder: number;
34
+ minPerOrder: number;
35
+ availabilityStatus: string;
36
+ sortOrder: number;
37
+ }[];
38
+ /** A cart with lines, a fee the surface quoted and a discount. */
39
+ export declare const FIXTURE_CART: {
40
+ items: {
41
+ id: string;
42
+ ticketTypeId: string;
43
+ ticketTypeName: string;
44
+ eventName: string;
45
+ occurrenceDate: string;
46
+ quantity: number;
47
+ unitPrice: number;
48
+ totalPrice: number;
49
+ subtotal: number;
50
+ currency: string;
51
+ }[];
52
+ itemCount: number;
53
+ subtotal: number;
54
+ fees: number;
55
+ discount: number;
56
+ total: number;
57
+ hasFees: boolean;
58
+ feeLabel: string;
59
+ currency: string;
60
+ };
61
+ /** An empty cart, for the states an element only reaches with nothing in it. */
62
+ export declare const FIXTURE_EMPTY_CART: {
63
+ items: never[];
64
+ itemCount: number;
65
+ subtotal: number;
66
+ fees: number;
67
+ discount: number;
68
+ total: number;
69
+ hasFees: boolean;
70
+ feeLabel: null;
71
+ currency: string;
72
+ };
73
+ /** Passes on the order: what `tl-ticket` renders and `tl-order-tickets` grids. */
74
+ export declare const FIXTURE_TICKETS: {
75
+ id: string;
76
+ barcode: string;
77
+ type: string;
78
+ status: string;
79
+ holderName: string;
80
+ name: string;
81
+ admissionStatus: string;
82
+ eventOccurrenceId: string;
83
+ seatLabel: string;
84
+ }[];
85
+ export declare const FIXTURE_ORDER: {
86
+ id: string;
87
+ orderNumber: string;
88
+ status: string;
89
+ paymentStatus: string;
90
+ currency: string;
91
+ items: {
92
+ name: string;
93
+ description: null;
94
+ type: string;
95
+ quantity: number;
96
+ unitPrice: number;
97
+ subtotal: number;
98
+ }[];
99
+ subtotal: number;
100
+ totalFees: number;
101
+ totalTax: number;
102
+ total: number;
103
+ tickets: {
104
+ id: string;
105
+ barcode: string;
106
+ type: string;
107
+ status: string;
108
+ holderName: string;
109
+ name: string;
110
+ admissionStatus: string;
111
+ eventOccurrenceId: string;
112
+ seatLabel: string;
113
+ }[];
114
+ expiresAt: null;
115
+ createdAt: string;
116
+ };
117
+ export declare const FIXTURE_ORDERS: {
118
+ id: string;
119
+ orderNumber: string;
120
+ status: string;
121
+ paymentStatus: string;
122
+ currency: string;
123
+ items: {
124
+ name: string;
125
+ description: null;
126
+ type: string;
127
+ quantity: number;
128
+ unitPrice: number;
129
+ subtotal: number;
130
+ }[];
131
+ subtotal: number;
132
+ totalFees: number;
133
+ totalTax: number;
134
+ total: number;
135
+ tickets: {
136
+ id: string;
137
+ barcode: string;
138
+ type: string;
139
+ status: string;
140
+ holderName: string;
141
+ name: string;
142
+ admissionStatus: string;
143
+ eventOccurrenceId: string;
144
+ seatLabel: string;
145
+ }[];
146
+ expiresAt: null;
147
+ createdAt: string;
148
+ }[];
149
+ /**
150
+ * The datasets a story may ask for by name, through
151
+ * `parameters.ticketlayer.dataset`. Keep the set small: a dataset is a state
152
+ * of the whole channel, not a per-element fixture.
153
+ */
154
+ export declare const FIXTURE_DATASETS: {
155
+ /** Signed in, three events on sale, a cart with lines and two orders. */
156
+ default: {
157
+ cart: {
158
+ get: () => Promise<{
159
+ items: {
160
+ id: string;
161
+ ticketTypeId: string;
162
+ ticketTypeName: string;
163
+ eventName: string;
164
+ occurrenceDate: string;
165
+ quantity: number;
166
+ unitPrice: number;
167
+ totalPrice: number;
168
+ subtotal: number;
169
+ currency: string;
170
+ }[];
171
+ itemCount: number;
172
+ subtotal: number;
173
+ fees: number;
174
+ discount: number;
175
+ total: number;
176
+ hasFees: boolean;
177
+ feeLabel: string;
178
+ currency: string;
179
+ }>;
180
+ };
181
+ authState: {
182
+ customer: {
183
+ id: string;
184
+ email: string;
185
+ firstName: string;
186
+ lastName: string;
187
+ };
188
+ authenticated: true;
189
+ };
190
+ events?: Partial<ReturnType<import("../sdk-connector").TicketlayerSDK["getEventsManager"]>>;
191
+ orders?: Partial<NonNullable<ReturnType<NonNullable<import("../sdk-connector").TicketlayerSDK["getOrdersManager"]>>>>;
192
+ auth?: Partial<NonNullable<ReturnType<NonNullable<import("../sdk-connector").TicketlayerSDK["getAuthManager"]>>>>;
193
+ presale?: Partial<NonNullable<ReturnType<NonNullable<import("../sdk-connector").TicketlayerSDK["getPresaleManager"]>>>>;
194
+ withoutAuth?: boolean;
195
+ withoutPresale?: boolean;
196
+ };
197
+ /** Nobody signed in and nothing in the cart. */
198
+ 'signed-out': {
199
+ cart: {
200
+ get: () => Promise<{
201
+ items: never[];
202
+ itemCount: number;
203
+ subtotal: number;
204
+ fees: number;
205
+ discount: number;
206
+ total: number;
207
+ hasFees: boolean;
208
+ feeLabel: null;
209
+ currency: string;
210
+ }>;
211
+ };
212
+ authState: {
213
+ customer: null;
214
+ authenticated: false;
215
+ };
216
+ events?: Partial<ReturnType<import("../sdk-connector").TicketlayerSDK["getEventsManager"]>>;
217
+ orders?: Partial<NonNullable<ReturnType<NonNullable<import("../sdk-connector").TicketlayerSDK["getOrdersManager"]>>>>;
218
+ auth?: Partial<NonNullable<ReturnType<NonNullable<import("../sdk-connector").TicketlayerSDK["getAuthManager"]>>>>;
219
+ presale?: Partial<NonNullable<ReturnType<NonNullable<import("../sdk-connector").TicketlayerSDK["getPresaleManager"]>>>>;
220
+ withoutAuth?: boolean;
221
+ withoutPresale?: boolean;
222
+ };
223
+ };
224
+ export type FixtureDataset = keyof typeof FIXTURE_DATASETS;
225
+ export declare const FIXTURE_DATASET_NAMES: FixtureDataset[];
@@ -3,13 +3,26 @@
3
3
  * slot the sdk-connector reads, with an in-memory bus so tests can push
4
4
  * SDK events (cart:updated, auth:changed, checkout:completed) at components.
5
5
  */
6
- import { type TicketlayerSDK } from '../sdk-connector';
6
+ import { type ModalOptions, type TicketlayerSDK } from '../sdk-connector';
7
+ /** One `openModal` an element asked for, with the callbacks it passed. */
8
+ export interface MockModalCall {
9
+ kind: 'event' | 'checkout';
10
+ /** The event the modal was opened for, for `kind: 'event'`. */
11
+ eventId?: string;
12
+ options: ModalOptions;
13
+ }
7
14
  export interface MockSDK extends TicketlayerSDK {
8
15
  emit(event: string, payload?: unknown): void;
9
16
  authState: {
10
17
  customer: unknown | null;
11
18
  authenticated: boolean;
12
19
  };
20
+ /**
21
+ * Every modal an element has asked for, oldest first. The wrapper elements
22
+ * report the modal's outcome to the page, so a test replies by calling the
23
+ * callbacks recorded here.
24
+ */
25
+ modalCalls: MockModalCall[];
13
26
  }
14
27
  export interface MockSDKOptions {
15
28
  events?: Partial<ReturnType<TicketlayerSDK['getEventsManager']>>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `window.location.search` as the cores' query seam.
3
+ *
4
+ * Two elements are the far end of a link: `tl-login` exchanges the `?code=` a
5
+ * magic-link email lands on, and `tl-order-confirmation` finds its order in
6
+ * `?orderId=` and reads `?redirect_status=` to know whether the payment
7
+ * provider sent the buyer back on a success. What they read is theirs to
8
+ * decide; where a parameter comes from is the runtime's, and a React Native
9
+ * harness will answer the same question from its deep-link router rather than
10
+ * from an address bar (AGENTS.md: a harness renders and forwards, it does not
11
+ * decide).
12
+ *
13
+ * Read per call rather than parsed once, because a host may have pushed a new
14
+ * URL since the element mounted, which is what `window.location` reports and
15
+ * what the components read.
16
+ */
17
+ import type { ElementQuery } from '@ticketlayer/elements-core';
18
+ export declare const webQuery: ElementQuery;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `localStorage` as the cores' storage seam.
3
+ *
4
+ * A core is allowed to remember a little between visits (`tl-cart-badge` keeps
5
+ * the last item count so the badge does not flash empty), and where that is
6
+ * written down is per runtime: the browser has `localStorage`, React Native
7
+ * will have something asynchronous of its own. So the core states what it
8
+ * remembers and the harness supplies the store (AGENTS.md: a harness renders
9
+ * and forwards, it does not decide).
10
+ *
11
+ * Everything is wrapped: `localStorage` throws on access in a sandboxed frame
12
+ * and in Safari's private mode, and a component that cannot remember a number
13
+ * still has to render.
14
+ */
15
+ import type { ElementStorage } from '@ticketlayer/elements-core';
16
+ export declare const webStorage: ElementStorage;