@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
@@ -1,12 +1,16 @@
1
1
  import { h } from "@stencil/core";
2
- import { whenSDK } from "../../utils/sdk-connector";
3
- import { errorMessage, formatDate, formatPrice, isAuthError, orderEventName, statusLabel, statusTone, ticketCount, } from "../../utils/order-summary";
2
+ import { createElement, myOrdersCore, } from "@ticketlayer/elements-core";
3
+ import { getSDK, whenSDK } from "../../utils/sdk-connector";
4
4
  /**
5
5
  * tl-my-orders - the signed-in customer's orders (GET /sales/my-orders through
6
6
  * the SDK): event, date, ticket count, total and status per row. Clicking a
7
7
  * row expands it to show the order's tickets (tl-order-tickets). Shows
8
8
  * tl-login inline when nobody is signed in.
9
9
  *
10
+ * The web harness for `myOrdersCore`: it renders and it forwards. Who is
11
+ * signed in, the two auth subscriptions that keep that current, the listing
12
+ * and every string are in `@ticketlayer/elements-core` (AGENTS.md, TKT-11).
13
+ *
10
14
  * Usage: <tl-my-orders></tl-my-orders>
11
15
  *
12
16
  * @event tlOrderSelect - a row was expanded ({ orderId })
@@ -18,107 +22,60 @@ export class TlMyOrders {
18
22
  this.emptyMessage = "When you buy tickets they'll show up here, ready to view and download.";
19
23
  /** Columns for the expanded ticket grid. */
20
24
  this.columns = 2;
21
- this.orders = [];
22
- this.authenticated = false;
23
- this.loading = true;
24
- this.error = null;
25
- this.expandedId = null;
26
- this.sdk = null;
27
- this.unsubscribes = [];
25
+ this.element = createElement(myOrdersCore, {
26
+ client: () => getSDK(),
27
+ clientReady: () => whenSDK(),
28
+ emit: (event, detail) => this.forward(event, detail),
29
+ });
30
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
31
+ this.view = this.element.view;
28
32
  }
29
- async componentWillLoad() {
30
- this.sdk = await whenSDK().catch(() => null);
31
- if (!this.sdk) {
32
- this.loading = false;
33
- this.error = 'Orders are not available right now';
34
- return;
35
- }
36
- // Older SDKs have no auth accessor: try the list and let a 401 decide.
37
- const auth = this.sdk.getAuthManager?.();
38
- this.authenticated = auth ? auth.authenticated : true;
39
- // The session hydrates after the SDK publishes; follow both signals.
40
- this.unsubscribes.push(this.sdk.on('auth:changed', () => this.syncAuth()));
41
- this.unsubscribes.push(this.sdk.on('session:changed', () => this.syncAuth()));
42
- if (this.authenticated) {
43
- await this.load();
44
- }
45
- else {
46
- this.loading = false;
47
- }
33
+ syncProps() {
34
+ this.element.setProps({ emptyMessage: this.emptyMessage, columns: this.columns });
48
35
  }
49
- disconnectedCallback() {
50
- this.unsubscribes.forEach((off) => off());
51
- this.unsubscribes = [];
36
+ connectedCallback() {
37
+ this.syncProps();
38
+ this.unsubscribe ?? (this.unsubscribe = this.element.subscribe((view) => {
39
+ this.view = view;
40
+ }));
41
+ this.view = this.element.view;
42
+ this.teardown = this.element.mount();
52
43
  }
53
- syncAuth() {
54
- const auth = this.sdk?.getAuthManager?.();
55
- if (!auth)
56
- return;
57
- const was = this.authenticated;
58
- this.authenticated = auth.authenticated;
59
- if (this.authenticated && !was) {
60
- this.load();
61
- }
62
- else if (!this.authenticated && was) {
63
- this.orders = [];
64
- this.expandedId = null;
65
- }
66
- }
67
- async load() {
68
- if (!this.sdk)
69
- return;
70
- try {
71
- this.loading = true;
72
- this.error = null;
73
- const orders = this.sdk.getOrdersManager?.();
74
- if (!orders)
75
- throw new Error('Orders are not available');
76
- const list = (await orders.mine());
77
- this.orders = list ?? [];
78
- this.authenticated = true;
79
- }
80
- catch (err) {
81
- if (isAuthError(err)) {
82
- // Not signed in: fall through to the inline login rather than an error.
83
- this.authenticated = false;
84
- this.orders = [];
85
- }
86
- else {
87
- console.error('[tl-my-orders] Failed to load orders:', err);
88
- this.error = errorMessage(err, 'Failed to load your orders');
89
- this.tlError.emit({ message: this.error });
90
- }
91
- }
92
- finally {
93
- this.loading = false;
94
- }
44
+ /**
45
+ * Off screen: run the mount's teardown, which drops both auth
46
+ * subscriptions. Not `destroy()`: Stencil calls this for a DOM move as well
47
+ * as a removal, and a destroyed core never mounts again.
48
+ */
49
+ disconnectedCallback() {
50
+ this.teardown?.();
51
+ this.teardown = undefined;
52
+ this.unsubscribe?.();
53
+ this.unsubscribe = undefined;
95
54
  }
96
- toggle(orderId) {
97
- const opening = this.expandedId !== orderId;
98
- this.expandedId = opening ? orderId : null;
99
- if (opening)
100
- this.tlOrderSelect.emit({ orderId });
55
+ forward(event, detail) {
56
+ if (event === 'tlOrderSelect')
57
+ this.tlOrderSelect.emit(detail);
58
+ else if (event === 'tlError')
59
+ this.tlError.emit(detail);
101
60
  }
102
- renderRow(order) {
103
- const expanded = this.expandedId === order.id;
104
- const count = ticketCount(order);
105
- const tone = statusTone(order.status);
106
- return (h("li", { class: { order: true, expanded }, key: order.id }, h("button", { type: "button", class: "order-row", "aria-expanded": expanded ? 'true' : 'false', onClick: () => this.toggle(order.id) }, h("span", { class: "order-main" }, h("span", { class: "order-number" }, "Order ", order.orderNumber), h("span", { class: "order-event" }, orderEventName(order) ?? 'Order'), h("span", { class: "order-meta" }, order.createdAt && h("span", null, formatDate(order.createdAt)), h("span", null, count, " ticket", count === 1 ? '' : 's'))), h("span", { class: "order-side" }, h("span", { class: "order-total" }, formatPrice(order.total, order.currency)), h("span", { class: `status status-${tone}` }, statusLabel(order.status)), h("svg", { class: "chevron", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "aria-hidden": "true" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 18l6-6-6-6" })))), expanded && (h("div", { class: "order-tickets" }, h("tl-order-tickets", { orderId: order.id, columns: this.columns })))));
61
+ renderRow(row) {
62
+ return (h("li", { class: { order: true, expanded: row.expanded }, key: row.id }, h("button", { type: "button", class: "order-row", "aria-expanded": row.expanded ? 'true' : 'false', onClick: () => this.element.actions.toggle(row.id) }, h("span", { class: "order-main" }, h("span", { class: "order-number" }, row.numberLabel), h("span", { class: "order-event" }, row.eventName), h("span", { class: "order-meta" }, row.dateLabel && h("span", null, row.dateLabel), h("span", null, row.countLabel))), h("span", { class: "order-side" }, h("span", { class: "order-total" }, row.totalLabel), h("span", { class: `status status-${row.statusTone}` }, row.statusLabel), h("svg", { class: "chevron", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "aria-hidden": "true" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 18l6-6-6-6" })))), row.expanded && (h("div", { class: "order-tickets" }, h("tl-order-tickets", { orderId: row.id, columns: this.columns })))));
107
63
  }
108
64
  render() {
109
- if (this.loading) {
65
+ const { status, strings, state, derived } = this.view;
66
+ if (status === 'loading') {
110
67
  return (h("div", { class: "orders" }, [0, 1, 2].map((i) => (h("div", { class: "skeleton", key: i })))));
111
68
  }
112
- if (!this.authenticated) {
113
- return (h("div", { class: "orders" }, h("div", { class: "signin" }, h("p", { class: "signin-title" }, "Sign in to see your orders"), h("p", { class: "signin-text" }, "Your tickets and order history live in your account.")), h("tl-login", null)));
69
+ if (status === 'signed-out') {
70
+ return (h("div", { class: "orders" }, h("div", { class: "signin" }, h("p", { class: "signin-title" }, strings.signInTitle), h("p", { class: "signin-text" }, strings.signInText)), h("tl-login", null)));
114
71
  }
115
- if (this.error) {
116
- return (h("div", { class: "orders" }, h("div", { class: "state error" }, h("p", { class: "state-title" }, "Could not load your orders"), h("p", { class: "state-text" }, this.error))));
72
+ if (status === 'error') {
73
+ return (h("div", { class: "orders" }, h("div", { class: "state error" }, h("p", { class: "state-title" }, strings.errorTitle), h("p", { class: "state-text" }, state.error))));
117
74
  }
118
- if (this.orders.length === 0) {
119
- return (h("div", { class: "orders" }, h("div", { class: "state empty" }, h("svg", { class: "empty-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "aria-hidden": "true" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "1.5", d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z" }), h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "1.5", d: "M13 5v2M13 17v2M13 11v2" })), h("p", { class: "state-title" }, "No orders yet"), h("p", { class: "state-text" }, this.emptyMessage))));
75
+ if (status === 'empty') {
76
+ return (h("div", { class: "orders" }, h("div", { class: "state empty" }, h("svg", { class: "empty-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "aria-hidden": "true" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "1.5", d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z" }), h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "1.5", d: "M13 5v2M13 17v2M13 11v2" })), h("p", { class: "state-title" }, strings.emptyTitle), h("p", { class: "state-text" }, this.emptyMessage))));
120
77
  }
121
- return (h("div", { class: "orders" }, h("ul", { class: "order-list" }, this.orders.map((o) => this.renderRow(o)))));
78
+ return (h("div", { class: "orders" }, h("ul", { class: "order-list" }, derived.rows.map((row) => this.renderRow(row)))));
122
79
  }
123
80
  static get is() { return "tl-my-orders"; }
124
81
  static get encapsulation() { return "shadow"; }
@@ -178,11 +135,7 @@ export class TlMyOrders {
178
135
  }
179
136
  static get states() {
180
137
  return {
181
- "orders": {},
182
- "authenticated": {},
183
- "loading": {},
184
- "error": {},
185
- "expandedId": {}
138
+ "view": {}
186
139
  };
187
140
  }
188
141
  static get events() {
@@ -218,4 +171,13 @@ export class TlMyOrders {
218
171
  }
219
172
  }];
220
173
  }
174
+ static get watchers() {
175
+ return [{
176
+ "propName": "emptyMessage",
177
+ "methodName": "syncProps"
178
+ }, {
179
+ "propName": "columns",
180
+ "methodName": "syncProps"
181
+ }];
182
+ }
221
183
  }
@@ -1,26 +1,15 @@
1
1
  /**
2
2
  * TlOccurrenceSelector Styles
3
- *
4
- * CSS custom properties for theming:
5
- * --tl-primary: Primary brand colour (default: #e64b12)
6
- * --tl-primary-foreground: Text on primary (default: #ffffff)
7
- * --tl-background: Background colour (default: #ffffff)
8
- * --tl-foreground: Main text colour (default: #0f172a)
9
- * --tl-muted: Muted background (default: #f1f5f9)
10
- * --tl-muted-foreground: Muted text (default: #64748b)
11
- * --tl-border: Border colour (default: #e2e8f0)
12
- * --tl-radius: Border radius (default: 0.5rem)
13
- * --tl-font-family: Font family (default: system-ui)
3
+ *
4
+ * The --tl-* tokens this reads, and their defaults, are declared once in
5
+ * @ticketlayer/theme (packages/theme/tokens.json) and shipped in the global
6
+ * stylesheet. There is nothing to repeat here.
14
7
  */
15
8
 
16
9
  :host {
17
- /* Don't redefine CSS variables - let them inherit from parent document */
18
- /* Only define local fallback for radius mapping */
19
- --tl-radius: var(--tl-radius-md, 0.5rem);
20
-
21
10
  display: block;
22
- font-family: var(--tl-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
23
- color: var(--tl-foreground, #0f172a);
11
+ font-family: var(--tl-font-family);
12
+ color: var(--tl-foreground);
24
13
  }
25
14
 
26
15
  * {
@@ -37,7 +26,7 @@
37
26
  .no-occurrences {
38
27
  text-align: center;
39
28
  padding: 3rem 1rem;
40
- color: var(--tl-muted-foreground, #64748b);
29
+ color: var(--tl-muted-foreground);
41
30
  }
42
31
 
43
32
  /* =========================================================================
@@ -56,8 +45,8 @@
56
45
  align-items: flex-start;
57
46
  width: 100%;
58
47
  padding: 1rem 1.25rem;
59
- background: var(--tl-background, #ffffff);
60
- border: 1px solid var(--tl-border, #e2e8f0);
48
+ background: var(--tl-background);
49
+ border: 1px solid var(--tl-border);
61
50
  border-radius: var(--tl-radius);
62
51
  text-align: left;
63
52
  cursor: pointer;
@@ -66,8 +55,8 @@
66
55
  }
67
56
 
68
57
  .occurrence-item:hover:not(:disabled) {
69
- border-color: var(--tl-primary, #e64b12);
70
- background: color-mix(in srgb, var(--tl-primary, #e64b12) 5%, var(--tl-background, #ffffff));
58
+ border-color: var(--tl-primary);
59
+ background: color-mix(in srgb, var(--tl-primary) 5%, var(--tl-background));
71
60
  }
72
61
 
73
62
  .occurrence-item:focus-visible {
@@ -78,12 +67,12 @@
78
67
  .occurrence-item:disabled {
79
68
  cursor: not-allowed;
80
69
  opacity: 0.6;
81
- background: var(--tl-muted, #f1f5f9);
70
+ background: var(--tl-muted);
82
71
  }
83
72
 
84
73
  .occurrence-item.sold-out {
85
74
  opacity: 0.6;
86
- background: var(--tl-muted, #f1f5f9);
75
+ background: var(--tl-muted);
87
76
  }
88
77
 
89
78
  .occurrence-info {
@@ -93,7 +82,7 @@
93
82
  .occurrence-date {
94
83
  font-weight: 600;
95
84
  font-size: 0.9375rem;
96
- color: var(--tl-foreground, #0f172a);
85
+ color: var(--tl-foreground);
97
86
  margin-bottom: 0.25rem;
98
87
  }
99
88
 
@@ -120,7 +109,7 @@
120
109
 
121
110
  .status-arrow {
122
111
  font-size: 1.25rem;
123
- color: var(--tl-primary, #e64b12);
112
+ color: var(--tl-primary);
124
113
  }
125
114
 
126
115
  /* =========================================================================
@@ -136,7 +125,7 @@
136
125
  .slots-date-header {
137
126
  font-size: 1.125rem;
138
127
  font-weight: 600;
139
- color: var(--tl-foreground, #0f172a);
128
+ color: var(--tl-foreground);
140
129
  padding-bottom: 0.5rem;
141
130
  border-bottom: 1px solid var(--tl-border);
142
131
  }
@@ -153,8 +142,8 @@
153
142
  align-items: center;
154
143
  justify-content: center;
155
144
  padding: 0.75rem 0.5rem;
156
- background: var(--tl-background, #ffffff);
157
- border: 1px solid var(--tl-border, #e2e8f0);
145
+ background: var(--tl-background);
146
+ border: 1px solid var(--tl-border);
158
147
  border-radius: var(--tl-radius);
159
148
  cursor: pointer;
160
149
  transition: all 0.15s ease;
@@ -163,8 +152,8 @@
163
152
  }
164
153
 
165
154
  .time-slot:hover:not(:disabled) {
166
- border-color: var(--tl-primary, #e64b12);
167
- background: color-mix(in srgb, var(--tl-primary, #e64b12) 5%, var(--tl-background, #ffffff));
155
+ border-color: var(--tl-primary);
156
+ background: color-mix(in srgb, var(--tl-primary) 5%, var(--tl-background));
168
157
  }
169
158
 
170
159
  .time-slot:focus-visible {
@@ -175,18 +164,18 @@
175
164
  .time-slot:disabled {
176
165
  cursor: not-allowed;
177
166
  opacity: 0.6;
178
- background: var(--tl-muted, #f1f5f9);
167
+ background: var(--tl-muted);
179
168
  }
180
169
 
181
170
  .time-slot.sold-out {
182
171
  opacity: 0.6;
183
- background: var(--tl-muted, #f1f5f9);
172
+ background: var(--tl-muted);
184
173
  }
185
174
 
186
175
  .slot-time {
187
176
  font-size: 0.9375rem;
188
177
  font-weight: 600;
189
- color: var(--tl-foreground, #0f172a);
178
+ color: var(--tl-foreground);
190
179
  }
191
180
 
192
181
  .slot-sold-out {
@@ -230,7 +219,7 @@
230
219
  }
231
220
 
232
221
  .calendar-panel {
233
- border: 1px solid var(--tl-border, #e2e8f0);
222
+ border: 1px solid var(--tl-border);
234
223
  border-radius: var(--tl-radius);
235
224
  padding: 1rem;
236
225
  }
@@ -246,7 +235,7 @@
246
235
  .month-label {
247
236
  font-size: 1rem;
248
237
  font-weight: 600;
249
- color: var(--tl-foreground, #0f172a);
238
+ color: var(--tl-foreground);
250
239
  flex: 1;
251
240
  }
252
241
 
@@ -262,16 +251,16 @@
262
251
  width: 1.75rem;
263
252
  height: 1.75rem;
264
253
  padding: 0;
265
- background: var(--tl-background, #ffffff);
266
- border: 1px solid var(--tl-border, #e2e8f0);
254
+ background: var(--tl-background);
255
+ border: 1px solid var(--tl-border);
267
256
  border-radius: var(--tl-radius);
268
257
  cursor: pointer;
269
258
  transition: all 0.15s ease;
270
- color: var(--tl-foreground, #0f172a);
259
+ color: var(--tl-foreground);
271
260
  }
272
261
 
273
262
  .nav-button:hover:not(:disabled) {
274
- background: var(--tl-muted, #f1f5f9);
263
+ background: var(--tl-muted);
275
264
  }
276
265
 
277
266
  .nav-button:disabled {
@@ -309,7 +298,7 @@
309
298
  justify-content: center;
310
299
  aspect-ratio: 1;
311
300
  padding: 0.1875rem;
312
- background: var(--tl-background, #ffffff);
301
+ background: var(--tl-background);
313
302
  border: 1px solid transparent;
314
303
  border-radius: var(--tl-radius);
315
304
  cursor: default;
@@ -317,7 +306,7 @@
317
306
  font-family: inherit;
318
307
  font-size: 0.9375rem;
319
308
  font-weight: 500;
320
- color: var(--tl-foreground, #0f172a);
309
+ color: var(--tl-foreground);
321
310
  }
322
311
 
323
312
  .calendar-day.other-month {
@@ -327,35 +316,35 @@
327
316
 
328
317
  .calendar-day.has-occurrences {
329
318
  cursor: pointer;
330
- background: color-mix(in srgb, var(--tl-primary, #e64b12) 10%, var(--tl-background, #ffffff));
319
+ background: color-mix(in srgb, var(--tl-primary) 10%, var(--tl-background));
331
320
  border-color: transparent;
332
321
  font-weight: 600;
333
- color: var(--tl-primary, #e64b12);
322
+ color: var(--tl-primary);
334
323
  }
335
324
 
336
325
  .calendar-day.has-occurrences:hover {
337
- background: color-mix(in srgb, var(--tl-primary, #e64b12) 18%, var(--tl-background, #ffffff));
326
+ background: color-mix(in srgb, var(--tl-primary) 18%, var(--tl-background));
338
327
  border-color: transparent;
339
328
  }
340
329
 
341
330
  .calendar-day.has-occurrences.sold-out {
342
- background: var(--tl-muted, #f1f5f9);
331
+ background: var(--tl-muted);
343
332
  border-color: transparent;
344
333
  }
345
334
 
346
335
  .calendar-day.has-occurrences.sold-out:hover {
347
- background: color-mix(in srgb, var(--tl-muted, #f1f5f9) 80%, var(--tl-background, #ffffff));
336
+ background: color-mix(in srgb, var(--tl-muted) 80%, var(--tl-background));
348
337
  border-color: transparent;
349
338
  }
350
339
 
351
340
  .calendar-day.selected {
352
- background: var(--tl-primary, #e64b12);
353
- border-color: var(--tl-primary, #e64b12);
354
- color: var(--tl-primary-foreground, #ffffff);
341
+ background: var(--tl-primary);
342
+ border-color: var(--tl-primary);
343
+ color: var(--tl-primary-foreground);
355
344
  }
356
345
 
357
346
  .calendar-day.selected:hover {
358
- background: color-mix(in srgb, var(--tl-primary, #e64b12) 90%, black);
347
+ background: color-mix(in srgb, var(--tl-primary) 90%, black);
359
348
  }
360
349
 
361
350
  .calendar-day.selected .occurrence-dot {
@@ -394,7 +383,7 @@
394
383
  align-items: center;
395
384
  justify-content: center;
396
385
  color: var(--tl-muted-foreground);
397
- background: var(--tl-muted, #f1f5f9);
386
+ background: var(--tl-muted);
398
387
  border-radius: var(--tl-radius);
399
388
  padding: 2rem 1rem;
400
389
  text-align: center;
@@ -405,7 +394,7 @@
405
394
  .selected-date-header {
406
395
  font-size: 0.9375rem;
407
396
  font-weight: 600;
408
- color: var(--tl-foreground, #0f172a);
397
+ color: var(--tl-foreground);
409
398
  padding-bottom: 0.625rem;
410
399
  margin-bottom: 0.625rem;
411
400
  }
@@ -422,8 +411,8 @@
422
411
  justify-content: space-between;
423
412
  width: 100%;
424
413
  padding: 0.625rem 0.875rem;
425
- background: var(--tl-background, #ffffff);
426
- border: 1px solid var(--tl-border, #e2e8f0);
414
+ background: var(--tl-background);
415
+ border: 1px solid var(--tl-border);
427
416
  border-radius: var(--tl-radius);
428
417
  text-align: left;
429
418
  cursor: pointer;
@@ -432,8 +421,8 @@
432
421
  }
433
422
 
434
423
  .time-slot-item:hover:not(:disabled) {
435
- border-color: var(--tl-primary, #e64b12);
436
- background: color-mix(in srgb, var(--tl-primary, #e64b12) 5%, var(--tl-background, #ffffff));
424
+ border-color: var(--tl-primary);
425
+ background: color-mix(in srgb, var(--tl-primary) 5%, var(--tl-background));
437
426
  }
438
427
 
439
428
  .time-slot-item:focus-visible {
@@ -444,12 +433,12 @@
444
433
  .time-slot-item:disabled {
445
434
  cursor: not-allowed;
446
435
  opacity: 0.6;
447
- background: var(--tl-muted, #f1f5f9);
436
+ background: var(--tl-muted);
448
437
  }
449
438
 
450
439
  .time-slot-item.sold-out {
451
440
  opacity: 0.6;
452
- background: var(--tl-muted, #f1f5f9);
441
+ background: var(--tl-muted);
453
442
  }
454
443
 
455
444
  .time-slot-item .slot-time {
@@ -538,7 +527,7 @@
538
527
  }
539
528
 
540
529
  .skeleton {
541
- background: var(--tl-muted, #f1f5f9);
530
+ background: var(--tl-muted);
542
531
  border-radius: var(--tl-radius);
543
532
  animation: skeleton-pulse 1.5s ease-in-out infinite;
544
533
  }
@@ -557,7 +546,7 @@
557
546
 
558
547
  /* Skeleton for calendar view */
559
548
  .skeleton-calendar {
560
- border: 1px solid var(--tl-border, #e2e8f0);
549
+ border: 1px solid var(--tl-border);
561
550
  border-radius: var(--tl-radius);
562
551
  padding: 1rem;
563
552
  min-height: 350px;
@@ -629,7 +618,7 @@
629
618
  }
630
619
 
631
620
  .error-message {
632
- color: var(--tl-foreground, #0f172a);
621
+ color: var(--tl-foreground);
633
622
  font-size: 0.9375rem;
634
623
  max-width: 400px;
635
624
  }
@@ -637,8 +626,8 @@
637
626
  .retry-button {
638
627
  margin-top: 0.5rem;
639
628
  padding: 0.625rem 1.25rem;
640
- background: var(--tl-primary, #e64b12);
641
- color: var(--tl-primary-foreground, #ffffff);
629
+ background: var(--tl-primary);
630
+ color: var(--tl-primary-foreground);
642
631
  border: none;
643
632
  border-radius: var(--tl-radius);
644
633
  font-family: inherit;
@@ -649,7 +638,7 @@
649
638
  }
650
639
 
651
640
  .retry-button:hover {
652
- background: color-mix(in srgb, var(--tl-primary, #e64b12) 90%, black);
641
+ background: color-mix(in srgb, var(--tl-primary) 90%, black);
653
642
  }
654
643
 
655
644
  .retry-button:focus-visible {