@ticketlayer/elements 0.3.3 → 0.4.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/README.md +3 -2
- package/dist/cjs/{index-BpfoKd9Q.js → index-I9CoYv3k.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/money-BtmM2gt-.js +118 -0
- package/dist/cjs/{order-summary-ZMkJ5bez.js → order-summary-X3TlZxc2.js} +34 -0
- package/dist/cjs/ticketlayer-elements.cjs.js +2 -2
- package/dist/cjs/tl-buy-modal.cjs.entry.js +3 -3
- package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +10 -7
- package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +2 -2
- package/dist/cjs/tl-cart-badge.cjs.entry.js +2 -2
- package/dist/cjs/tl-cart-drawer.cjs.entry.js +3 -3
- package/dist/cjs/tl-cart.cjs.entry.js +10 -4
- package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +2 -2
- package/dist/cjs/tl-event-card.cjs.entry.js +4 -3
- package/dist/cjs/tl-event-list.cjs.entry.js +2 -2
- package/dist/cjs/tl-login.cjs.entry.js +4 -3
- package/dist/cjs/tl-my-orders.cjs.entry.js +4 -3
- package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +454 -122
- package/dist/cjs/tl-order-confirmation.cjs.entry.js +11 -8
- package/dist/cjs/tl-order-tickets_2.cjs.entry.js +3 -3
- package/dist/cjs/tl-promo-code.cjs.entry.js +4 -3
- package/dist/cjs/tl-seat-map.cjs.entry.js +2 -2
- package/dist/collection/components/tl-buy-modal/tl-buy-modal.css +12 -19
- package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +1 -1
- package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +4 -4
- package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +8 -5
- package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.css +2 -2
- package/dist/collection/components/tl-cart/tl-cart.css +52 -51
- package/dist/collection/components/tl-cart/tl-cart.js +8 -2
- package/dist/collection/components/tl-cart-badge/tl-cart-badge.css +11 -11
- package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.css +6 -6
- package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +1 -1
- package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.css +2 -2
- package/dist/collection/components/tl-event-card/tl-event-card.css +22 -22
- package/dist/collection/components/tl-event-list/tl-event-list.css +17 -17
- package/dist/collection/components/tl-login/tl-login.css +26 -26
- package/dist/collection/components/tl-my-orders/tl-my-orders.css +40 -40
- package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.css +54 -65
- package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.css +38 -38
- package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +8 -6
- package/dist/collection/components/tl-order-tickets/tl-order-tickets.css +9 -9
- package/dist/collection/components/tl-promo-code/tl-promo-code.css +25 -25
- package/dist/collection/components/tl-seat-map/tl-seat-map.css +10 -10
- package/dist/collection/components/tl-ticket/tl-ticket.css +13 -13
- package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.css +74 -49
- package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +72 -126
- package/dist/collection/utils/cart-totals.js +9 -0
- package/dist/collection/utils/order-summary.js +36 -0
- package/dist/components/money.js +1 -0
- package/dist/components/order-summary.js +1 -1
- package/dist/components/tl-buy-modal.js +1 -1
- package/dist/components/tl-buy-tickets-button.js +1 -1
- package/dist/components/tl-buy-tickets-wrapper2.js +1 -1
- package/dist/components/tl-cart-badge.js +1 -1
- package/dist/components/tl-cart-drawer.js +1 -1
- package/dist/components/tl-cart2.js +1 -1
- package/dist/components/tl-checkout-wrapper2.js +1 -1
- package/dist/components/tl-event-card2.js +1 -1
- package/dist/components/tl-event-list.js +1 -1
- package/dist/components/tl-login2.js +1 -1
- package/dist/components/tl-my-orders.js +1 -1
- package/dist/components/tl-occurrence-selector2.js +1 -1
- package/dist/components/tl-order-confirmation.js +1 -1
- package/dist/components/tl-order-tickets2.js +1 -1
- package/dist/components/tl-promo-code.js +1 -1
- package/dist/components/tl-seat-map.js +1 -1
- package/dist/components/tl-ticket-selector2.js +1 -1
- package/dist/components/tl-ticket2.js +1 -1
- package/dist/elements.docs.json +4 -4
- package/dist/esm/{index-CNX8hZa8.js → index-OoYV1faY.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/money-4ig0-WB6.js +112 -0
- package/dist/esm/{order-summary-BGekdjN9.js → order-summary-DiDtvfZM.js} +34 -1
- package/dist/esm/ticketlayer-elements.js +3 -3
- package/dist/esm/tl-buy-modal.entry.js +3 -3
- package/dist/esm/tl-buy-tickets-button.entry.js +10 -7
- package/dist/esm/tl-buy-tickets-wrapper.entry.js +2 -2
- package/dist/esm/tl-cart-badge.entry.js +2 -2
- package/dist/esm/tl-cart-drawer.entry.js +3 -3
- package/dist/esm/tl-cart.entry.js +10 -4
- package/dist/esm/tl-checkout-wrapper.entry.js +2 -2
- package/dist/esm/tl-event-card.entry.js +4 -3
- package/dist/esm/tl-event-list.entry.js +2 -2
- package/dist/esm/tl-login.entry.js +4 -3
- package/dist/esm/tl-my-orders.entry.js +4 -3
- package/dist/esm/tl-occurrence-selector_2.entry.js +455 -123
- package/dist/esm/tl-order-confirmation.entry.js +11 -8
- package/dist/esm/tl-order-tickets_2.entry.js +3 -3
- package/dist/esm/tl-promo-code.entry.js +4 -3
- package/dist/esm/tl-seat-map.entry.js +2 -2
- package/dist/ticketlayer-elements/index.esm.js +1 -1
- package/dist/ticketlayer-elements/p-0814420f.entry.js +1 -0
- package/dist/ticketlayer-elements/p-0acabc26.entry.js +1 -0
- package/dist/ticketlayer-elements/{p-9629029a.entry.js → p-109a3feb.entry.js} +1 -1
- package/dist/ticketlayer-elements/{p-e02079fa.entry.js → p-1a4ba71c.entry.js} +1 -1
- package/dist/ticketlayer-elements/p-318965c1.entry.js +1 -0
- package/dist/ticketlayer-elements/p-347c7fd1.entry.js +1 -0
- package/dist/ticketlayer-elements/p-3649c26d.entry.js +1 -0
- package/dist/ticketlayer-elements/p-40260cc9.entry.js +1 -0
- package/dist/ticketlayer-elements/p-4ig0-WB6.js +1 -0
- package/dist/ticketlayer-elements/p-55fd2f9f.entry.js +1 -0
- package/dist/ticketlayer-elements/p-62ee659b.entry.js +1 -0
- package/dist/ticketlayer-elements/p-7d4ecc2b.entry.js +1 -0
- package/dist/ticketlayer-elements/p-7f0abf95.entry.js +1 -0
- package/dist/ticketlayer-elements/p-BXpVGW51.js +1 -0
- package/dist/ticketlayer-elements/p-OoYV1faY.js +3 -0
- package/dist/ticketlayer-elements/p-a3c1b26c.entry.js +1 -0
- package/dist/ticketlayer-elements/{p-1c51cbc1.entry.js → p-ac264adc.entry.js} +1 -1
- package/dist/ticketlayer-elements/{p-895ba1f3.entry.js → p-aeb4c6fb.entry.js} +1 -1
- package/dist/ticketlayer-elements/{p-fa639d88.entry.js → p-ba62541f.entry.js} +1 -1
- package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -1
- package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -1
- package/dist/types/components/tl-cart/tl-cart.d.ts +10 -0
- package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +40 -29
- package/dist/types/components.d.ts +32 -0
- package/dist/types/utils/cart-totals.d.ts +10 -0
- package/dist/types/utils/order-summary.d.ts +34 -0
- package/elements.catalogue.json +91 -22
- package/package.json +12 -6
- package/dist/ticketlayer-elements/p-0b1d16f8.entry.js +0 -1
- package/dist/ticketlayer-elements/p-1471f6d8.entry.js +0 -1
- package/dist/ticketlayer-elements/p-5169f68b.entry.js +0 -1
- package/dist/ticketlayer-elements/p-8d5722e1.entry.js +0 -1
- package/dist/ticketlayer-elements/p-917d8e09.entry.js +0 -1
- package/dist/ticketlayer-elements/p-BGekdjN9.js +0 -1
- package/dist/ticketlayer-elements/p-CNX8hZa8.js +0 -3
- package/dist/ticketlayer-elements/p-a22714d0.entry.js +0 -1
- package/dist/ticketlayer-elements/p-bf73044b.entry.js +0 -1
- package/dist/ticketlayer-elements/p-e04ace15.entry.js +0 -1
- package/dist/ticketlayer-elements/p-e6fab1d5.entry.js +0 -1
- package/dist/ticketlayer-elements/p-f826b753.entry.js +0 -1
- package/dist/ticketlayer-elements/p-fbaca948.entry.js +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-I9CoYv3k.js');
|
|
4
4
|
var sdkConnector = require('./sdk-connector-ClDF3013.js');
|
|
5
|
-
var orderSummary = require('./order-summary-
|
|
5
|
+
var orderSummary = require('./order-summary-X3TlZxc2.js');
|
|
6
|
+
require('./money-BtmM2gt-.js');
|
|
6
7
|
|
|
7
|
-
const tlOrderConfirmationCss = () => `:host{display:block;font-family:var(--tl-font-family
|
|
8
|
+
const tlOrderConfirmationCss = () => `:host{display:block;font-family:var(--tl-font-family);color:var(--tl-foreground)}.confirmation{text-align:center}.check{width:4rem;height:4rem;margin:0 auto var(--tl-spacing-4);display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--tl-success);color:var(--tl-success-foreground)}.check svg{width:2rem;height:2rem}.title{margin:0 0 var(--tl-spacing-2);font-size:1.875rem;font-weight:700;line-height:1.2}.lead{margin:0 0 var(--tl-spacing-6);color:var(--tl-muted-foreground)}.error{margin:0 0 var(--tl-spacing-6);font-size:0.875rem;color:var(--tl-error)}.summary{text-align:left;padding:var(--tl-spacing-6);margin-bottom:var(--tl-spacing-6);background:var(--tl-muted);border:1px solid var(--tl-border);border-radius:var(--tl-radius-lg)}.rows{display:grid;gap:var(--tl-spacing-2);margin:0 0 var(--tl-spacing-4);padding:0 0 var(--tl-spacing-4);border-bottom:1px solid var(--tl-border)}.row{display:flex;justify-content:space-between;gap:var(--tl-spacing-4);font-size:0.875rem}.row dt{color:var(--tl-muted-foreground)}.row dd{margin:0;text-align:right;overflow-wrap:anywhere}.reference{font-family:var(--tl-font-family-mono);font-weight:600}.lines{list-style:none;margin:0;padding:0;display:grid;gap:var(--tl-spacing-2)}.line{display:flex;justify-content:space-between;gap:var(--tl-spacing-4);font-size:0.875rem}.totals{margin-top:var(--tl-spacing-3);padding-top:var(--tl-spacing-3);border-top:1px solid var(--tl-border);display:grid;gap:var(--tl-spacing-1);font-size:0.875rem}.total-row{display:flex;justify-content:space-between;color:var(--tl-muted-foreground)}.total-row.discount{color:var(--tl-success)}.total-row.total{margin-top:var(--tl-spacing-1);font-size:1rem;font-weight:600;color:var(--tl-foreground)}.tickets{text-align:left}.subtitle{margin:0 0 var(--tl-spacing-4);font-size:1.125rem;font-weight:600}.hint{margin:var(--tl-spacing-3) 0 0;font-size:0.75rem;color:var(--tl-muted-foreground)}.skeleton-line,.skeleton-block{background:var(--tl-secondary);border-radius:var(--tl-radius-md);animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;margin:0 auto var(--tl-spacing-3)}.skeleton-line{height:1rem}.skeleton-line.short{width:40%;height:1.75rem}.skeleton-line.long{width:70%}.skeleton-block{height:8rem}@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.5}}`;
|
|
8
9
|
|
|
9
10
|
const TlOrderConfirmation = class {
|
|
10
11
|
constructor(hostRef) {
|
|
@@ -111,12 +112,14 @@ const TlOrderConfirmation = class {
|
|
|
111
112
|
const startsAt = this.occurrence?.startsAt;
|
|
112
113
|
return (index.h("dl", { class: "rows" }, index.h("div", { class: "row" }, index.h("dt", null, "Order reference"), index.h("dd", { class: "reference" }, order.orderNumber)), email && (index.h("div", { class: "row" }, index.h("dt", null, "Email"), index.h("dd", null, email))), eventName && (index.h("div", { class: "row" }, index.h("dt", null, "Event"), index.h("dd", null, eventName))), startsAt && (index.h("div", { class: "row" }, index.h("dt", null, "Date"), index.h("dd", null, orderSummary.formatDateTime(startsAt))))));
|
|
113
114
|
}
|
|
115
|
+
// Money comes from orderTotals: the booking fee is its own row named after
|
|
116
|
+
// the channel's fee profile, the subtotal is the ticket lines alone (the
|
|
117
|
+
// order's own `subtotal` folds the fee line into it) and the total is the
|
|
118
|
+
// order's figure, so what is shown is what was charged.
|
|
114
119
|
renderTotals(order) {
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
const discounts = Number(order.totalDiscounts) || 0;
|
|
119
|
-
return (index.h("div", { class: "totals" }, index.h("div", { class: "total-row" }, index.h("span", null, "Subtotal"), index.h("span", null, orderSummary.formatPrice(order.subtotal, c))), fees > 0 && (index.h("div", { class: "total-row" }, index.h("span", null, "Fees"), index.h("span", null, orderSummary.formatPrice(order.totalFees, c)))), tax > 0 && (index.h("div", { class: "total-row" }, index.h("span", null, "Tax"), index.h("span", null, orderSummary.formatPrice(order.totalTax, c)))), discounts > 0 && (index.h("div", { class: "total-row discount" }, index.h("span", null, "Discount"), index.h("span", null, "-", orderSummary.formatPrice(order.totalDiscounts, c)))), index.h("div", { class: "total-row total" }, index.h("span", null, "Total"), index.h("span", null, orderSummary.formatPrice(order.total, c)))));
|
|
120
|
+
const totals = orderSummary.orderTotals(order);
|
|
121
|
+
const c = totals.currency;
|
|
122
|
+
return (index.h("div", { class: "totals" }, index.h("div", { class: "total-row" }, index.h("span", null, "Subtotal"), index.h("span", null, orderSummary.formatPrice(totals.subtotal, c))), totals.showFee && (index.h("div", { class: "total-row fee" }, index.h("span", null, totals.feeLabel), index.h("span", null, orderSummary.formatPrice(totals.fees, c)))), totals.tax > 0 && (index.h("div", { class: "total-row" }, index.h("span", null, "Tax"), index.h("span", null, orderSummary.formatPrice(totals.tax, c)))), totals.discount > 0 && (index.h("div", { class: "total-row discount" }, index.h("span", null, "Discount"), index.h("span", null, "-", orderSummary.formatPrice(totals.discount, c)))), index.h("div", { class: "total-row total" }, index.h("span", null, "Total"), index.h("span", null, orderSummary.formatPrice(totals.total, c)))));
|
|
120
123
|
}
|
|
121
124
|
render() {
|
|
122
125
|
if (this.paymentFailed) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-I9CoYv3k.js');
|
|
4
4
|
var sdkConnector = require('./sdk-connector-ClDF3013.js');
|
|
5
5
|
|
|
6
|
-
const tlOrderTicketsCss = () => `:host{display:block;font-family:var(--tl-font-family
|
|
6
|
+
const tlOrderTicketsCss = () => `:host{display:block;font-family:var(--tl-font-family)}.grid{display:grid;gap:var(--tl-spacing-4);grid-template-columns:1fr}@media (min-width: 480px){.grid.cols-2{grid-template-columns:repeat(2, 1fr)}.grid.cols-3{grid-template-columns:repeat(3, 1fr)}}.state{padding:var(--tl-spacing-6);text-align:center;color:var(--tl-muted-foreground);font-size:0.875rem}.state.error{color:var(--tl-error)}.state.issuing{display:flex;align-items:center;justify-content:center;gap:var(--tl-spacing-2)}.spinner{width:0.875rem;height:0.875rem;border:2px solid var(--tl-border);border-top-color:var(--tl-primary);border-radius:50%;animation:tl-spin 0.7s linear infinite;flex:none}@keyframes tl-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation:none;border-top-color:var(--tl-border)}}`;
|
|
7
7
|
|
|
8
8
|
const TlOrderTickets = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -3178,7 +3178,7 @@ function requireBrowser () {
|
|
|
3178
3178
|
var browserExports = requireBrowser();
|
|
3179
3179
|
var QRCode = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
3180
3180
|
|
|
3181
|
-
const tlTicketCss = () => `:host{display:block;font-family:var(--tl-font-family
|
|
3181
|
+
const tlTicketCss = () => `:host{display:block;font-family:var(--tl-font-family)}.ticket{border:1px solid var(--tl-border);border-radius:var(--tl-radius-lg);background:var(--tl-card);padding:var(--tl-spacing-5);text-align:center}.qr-wrap{position:relative;width:160px;height:160px;margin:0 auto}.qr{width:160px;height:160px}.qr svg{width:100%;height:100%;display:block}.qr.inactive{opacity:0.3}.stamp{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);padding:0.25rem 0.5rem;border-radius:var(--tl-radius-sm);background:rgba(17, 24, 39, 0.85);color:#ffffff;font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em}.name{margin:1rem 0 0;font-weight:600;color:var(--tl-foreground)}.meta{margin:0.125rem 0 0;font-size:0.875rem;color:var(--tl-muted-foreground)}.barcode{margin:0.25rem 0 0;font-family:ui-monospace, monospace;font-size:0.625rem;color:var(--tl-muted-foreground);word-break:break-all}.download{margin-top:0.75rem;padding:0.375rem 0.75rem;border:1px solid var(--tl-border);border-radius:var(--tl-radius-md);background:transparent;color:var(--tl-foreground);font-size:0.875rem;font-weight:500;cursor:pointer}.download:hover{background:var(--tl-muted)}.download:disabled{opacity:0.5;cursor:default}`;
|
|
3182
3182
|
|
|
3183
3183
|
const TlTicket = class {
|
|
3184
3184
|
constructor(hostRef) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-I9CoYv3k.js');
|
|
4
4
|
var sdkConnector = require('./sdk-connector-ClDF3013.js');
|
|
5
|
-
var orderSummary = require('./order-summary-
|
|
5
|
+
var orderSummary = require('./order-summary-X3TlZxc2.js');
|
|
6
|
+
require('./money-BtmM2gt-.js');
|
|
6
7
|
|
|
7
|
-
const tlPromoCodeCss = () => `:host{display:block;font-family:var(--tl-font-family
|
|
8
|
+
const tlPromoCodeCss = () => `:host{display:block;font-family:var(--tl-font-family);color:var(--tl-foreground)}.field{display:flex;gap:var(--tl-spacing-2)}.input{flex:1;min-width:0;padding:var(--tl-spacing-3);font:inherit;font-size:0.875rem;color:var(--tl-foreground);background:var(--tl-background);border:1px solid var(--tl-border);border-radius:var(--tl-radius-md);text-transform:uppercase}.input::placeholder{text-transform:none;color:var(--tl-muted-foreground)}.input:focus{outline:2px solid var(--tl-primary);outline-offset:1px}.apply{padding:var(--tl-spacing-3) var(--tl-spacing-4);font:inherit;font-size:0.875rem;font-weight:500;color:var(--tl-primary-foreground);background:var(--tl-primary);border:none;border-radius:var(--tl-radius-md);cursor:pointer;white-space:nowrap}.apply:hover:not(:disabled){opacity:0.9}.apply:disabled,.input:disabled{opacity:0.6;cursor:not-allowed}.error{margin:var(--tl-spacing-2) 0 0;font-size:0.8125rem;color:var(--tl-error)}.applied{display:flex;align-items:center;justify-content:space-between;gap:var(--tl-spacing-3);padding:var(--tl-spacing-3);font-size:0.875rem;background:var(--tl-muted);border:1px solid var(--tl-border);border-radius:var(--tl-radius-md)}.applied-text{display:flex;align-items:center;gap:var(--tl-spacing-2)}.icon{width:1rem;height:1rem;flex-shrink:0;color:var(--tl-success)}.code{font-family:var(--tl-font-family-mono)}.link{padding:0;font:inherit;font-size:0.8125rem;color:var(--tl-primary);background:none;border:none;cursor:pointer;white-space:nowrap}.link:hover{text-decoration:underline}`;
|
|
8
9
|
|
|
9
10
|
const TlPromoCode = class {
|
|
10
11
|
constructor(hostRef) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-I9CoYv3k.js');
|
|
4
4
|
var sdkConnector = require('./sdk-connector-ClDF3013.js');
|
|
5
5
|
|
|
6
|
-
const tlSeatMapCss = () => `:host{display:block;font-family:var(--tl-font-family
|
|
6
|
+
const tlSeatMapCss = () => `:host{display:block;font-family:var(--tl-font-family)}.seat-map-container{position:relative;overflow:hidden;border-radius:var(--tl-radius-md);background:var(--tl-color-background)}.seat-map-iframe{width:100%;height:100%;border:none}.seat-map-iframe.hidden{display:none}.loading{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--tl-color-background);color:var(--tl-color-foreground);gap:1rem}.loading p{margin:0;font-size:0.875rem;color:var(--tl-color-muted-foreground)}.spinner{width:40px;height:40px;border:3px solid var(--tl-color-border);border-top-color:var(--tl-color-primary);border-radius:50%;animation:tl-seat-map-spin 1s linear infinite}@keyframes tl-seat-map-spin{to{transform:rotate(360deg)}}.error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--tl-color-background);color:var(--tl-color-error);padding:1.5rem;text-align:center}.error-title{margin:0 0 0.5rem;font-size:1.125rem;font-weight:600}.error-message{margin:0;font-size:0.875rem;opacity:0.9}`;
|
|
7
7
|
|
|
8
8
|
const TlSeatMap = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
/* Local
|
|
3
|
-
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--_muted: var(--tl-muted
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--_primary: var(--tl-primary
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--_font: var(--tl-font-family, system-ui, -apple-system, sans-serif);
|
|
2
|
+
/* Local shorthands over the theme tokens, which pierce the shadow boundary. */
|
|
3
|
+
--_bg: var(--tl-background);
|
|
4
|
+
--_fg: var(--tl-foreground);
|
|
5
|
+
--_muted: var(--tl-muted);
|
|
6
|
+
--_muted-fg: var(--tl-muted-foreground);
|
|
7
|
+
--_border: var(--tl-border);
|
|
8
|
+
--_primary: var(--tl-primary);
|
|
9
|
+
--_primary-fg: var(--tl-primary-foreground);
|
|
10
|
+
--_radius: var(--tl-radius-lg);
|
|
11
|
+
--_font: var(--tl-font-family);
|
|
13
12
|
|
|
14
13
|
font-family: var(--_font);
|
|
15
14
|
}
|
|
@@ -53,12 +52,6 @@
|
|
|
53
52
|
|
|
54
53
|
/* Floating chrome beneath the panel: platform links left, brand right. */
|
|
55
54
|
.powered-by {
|
|
56
|
-
/* The dashes are a cut-out, so they have to be the colour BEHIND the ticket.
|
|
57
|
-
This chrome floats on the modal's dark backdrop rather than on the page
|
|
58
|
-
surface, so --tl-background (a light value in most themes) would draw
|
|
59
|
-
white dashes on a white icon and vanish. The drawer's footer sits on the
|
|
60
|
-
panel itself and takes the default. */
|
|
61
|
-
--tl-pb-perforation: rgba(8, 8, 16, 0.6);
|
|
62
55
|
width: 100%;
|
|
63
56
|
max-width: 460px;
|
|
64
57
|
display: flex;
|
|
@@ -267,7 +260,7 @@
|
|
|
267
260
|
width: 100%;
|
|
268
261
|
padding: 13px;
|
|
269
262
|
border: 0;
|
|
270
|
-
border-radius: var(--tl-radius-md
|
|
263
|
+
border-radius: var(--tl-radius-md);
|
|
271
264
|
background: var(--_primary);
|
|
272
265
|
color: var(--_primary-fg);
|
|
273
266
|
font-size: 0.98rem;
|
|
@@ -285,7 +278,7 @@
|
|
|
285
278
|
margin-top: 8px;
|
|
286
279
|
padding: 12px;
|
|
287
280
|
border: 1px solid var(--_border);
|
|
288
|
-
border-radius: var(--tl-radius-md
|
|
281
|
+
border-radius: var(--tl-radius-md);
|
|
289
282
|
background: transparent;
|
|
290
283
|
color: var(--_fg);
|
|
291
284
|
font-size: 0.95rem;
|
|
@@ -129,7 +129,7 @@ export class TlBuyModal {
|
|
|
129
129
|
return (h(Host, { key: '1245e518c2b5232f4d9dba091cf808cd3867fbef' }, h("div", { key: '4e770fccdd785444f1cc87df4adab5a5dc1bf58a', class: "overlay", onClick: (e) => {
|
|
130
130
|
if (e.target === e.currentTarget)
|
|
131
131
|
this.close();
|
|
132
|
-
} }, h("div", { key: '57b13dac690028aeebd6a601acfba07f00854c40', class: { panel: true, 'panel--wide': this.step === 'occurrence' }, role: "dialog", "aria-modal": "true", "aria-label": this.eventName }, h("header", { key: '881e9cc70a0ca25947f272b9ebcb2e6d4b4268f2', class: "panel-header" }, this.imageUrl && (h("div", { key: '753f7df1b5118dfacbbc6b89b4e5d7ba114f6cdf', class: "event-thumb", style: { backgroundImage: `url(${this.imageUrl})` } })), h("div", { key: '9aaa32d1add90fabd1b0ea0c100f198962f4e6a5', class: "titles" }, h("span", { key: '538032bdf2338206ad763417386852ff97cc472f', class: "kicker" }, this.stepKicker()), h("h2", { key: '71429804179e7fbbea1fa90a2937a065517092f5', class: "event-name" }, this.eventName), this.venueLabel && h("p", { key: 'dd968b397deab890df3a4fbdff33226e82bd9660', class: "event-meta" }, this.venueLabel), this.dateSummary && h("p", { key: 'f40e6049d09b06c9f599e7d14d6fbb43b39b22fd', class: "event-meta" }, this.dateSummary)), h("button", { key: 'dbe0908f8cd8544654b627921f68cc4961802b77', class: "close-btn", "aria-label": "Close", onClick: this.close }, h("svg", { key: '23a750830e6e16d28cbcd5025507d25848aaadf7', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'e81b8763a5c781f72c1ca8a2113482948e3ba8cc', d: "M6 6l12 12M18 6L6 18", "stroke-linecap": "round" })))), h("div", { key: 'da71e610f907cf53e78246d2065aaf526d5ceffd', class: "panel-body" }, this.step === 'loading' && (h("div", { key: '28cbb9a98c7b08fa8dcb9d8d5dfbf3bec93fe38d', class: "state-msg" }, h("span", { key: '915c8de87cbdc7da1ccf0622ce6c0f02fccf2cad', class: "spinner" }), " Loading\u2026")), this.step === 'error' && h("div", { key: '5785578bfef6f1ee81d938d91ffd3ded975f8c12', class: "state-msg error" }, this.error), this.step === 'occurrence' && (h("tl-occurrence-selector", { key: 'eeb853eab141c3c103015e82d221a140f6a3a109', eventId: this.eventId, onTlSelect: this.handleOccurrenceSelect })), this.step === 'tickets' && this.selectedOccurrenceId && (h("div", { key: 'f608f592ba651eb431375433eb4ff9393863ade5', class: "tickets-step" }, this.occurrenceCount > 1 && (h("button", { key: '84adfbdbeaceb2cf4238c6ffd09558b4499ca940', class: "back-link", onClick: this.backToDates }, "\u2190 Change date")), this.occurrenceLabel && h("p", { key: '0317e9194049608711e8c622142c3ad2c0a5dc12', class: "occ-label" }, this.occurrenceLabel), h("tl-ticket-selector", { key: '27b1e05d9d92fb8d519375e2b27d4b5ea0a4890a', eventId: this.eventId, occurrenceId: this.selectedOccurrenceId, onTlAddToCart: this.handleAdded }))), this.step === 'done' && (h("div", { key: '0853088206988c66d489f8804df7899821d49e64', class: "done-step" }, h("div", { key: 'c2955b893c4dffaadcdfd27bee96ef2724a131a6', class: "done-mark" }, "\uD83C\uDF9F\uFE0F"), h("p", { key: '370c30dfcbc0c25b4794d984dd261a3a5779a9dc', class: "done-title" }, "Added to your cart"), h("p", { key: 'c462f3c9292740e2fd2c74b173484f80a5dc1a30', class: "done-sub" }, "Held for you while you check out."), h("button", { key: '484991f79572e3213ad6413a1af87599880c3643', class: "primary-btn", onClick: this.goCheckout }, "Go to checkout"), h("button", { key: '5b4ba5a472b794e8f5af0f131dad1c8c11b869f5', class: "ghost-btn", onClick: this.close }, "Keep browsing"))))), h("div", { key: '9acdd36744d363f41f0bed7938ecea33322362d1', class: "powered-by" }, h("div", { key: 'f45545a8fc625336618352f0c0e9e84a1babce96', class: "pb-links" }, h("a", { key: 'dd929b12419b8353d9a09ad242a9f351dfd699e2', href: "https://ticketlayer.com/privacy", target: "_blank", rel: "noopener noreferrer" }, "Privacy Policy"), h("a", { key: '859be221bdc76602defaebdb89a997778cda6a91', href: "https://ticketlayer.com/report-abuse", target: "_blank", rel: "noopener noreferrer" }, "Report Abuse")), h("a", { key: 'd4e1f44b3b084160d2df8b9d15e075ddc5e05363', class: "pb-brand", href: "https://ticketlayer.com", target: "_blank", rel: "noopener noreferrer" }, h("span", { key: 'fe7fd86576a4e9772daa2c4c449da060f20fa143', class: "pb-pre" }, "Powered by"), h("svg", { key: '19412bd9e5522f0af9f847fe8fda6aa0f0004a3a', width: "14", height: "14", viewBox: "0 0
|
|
132
|
+
} }, h("div", { key: '57b13dac690028aeebd6a601acfba07f00854c40', class: { panel: true, 'panel--wide': this.step === 'occurrence' }, role: "dialog", "aria-modal": "true", "aria-label": this.eventName }, h("header", { key: '881e9cc70a0ca25947f272b9ebcb2e6d4b4268f2', class: "panel-header" }, this.imageUrl && (h("div", { key: '753f7df1b5118dfacbbc6b89b4e5d7ba114f6cdf', class: "event-thumb", style: { backgroundImage: `url(${this.imageUrl})` } })), h("div", { key: '9aaa32d1add90fabd1b0ea0c100f198962f4e6a5', class: "titles" }, h("span", { key: '538032bdf2338206ad763417386852ff97cc472f', class: "kicker" }, this.stepKicker()), h("h2", { key: '71429804179e7fbbea1fa90a2937a065517092f5', class: "event-name" }, this.eventName), this.venueLabel && h("p", { key: 'dd968b397deab890df3a4fbdff33226e82bd9660', class: "event-meta" }, this.venueLabel), this.dateSummary && h("p", { key: 'f40e6049d09b06c9f599e7d14d6fbb43b39b22fd', class: "event-meta" }, this.dateSummary)), h("button", { key: 'dbe0908f8cd8544654b627921f68cc4961802b77', class: "close-btn", "aria-label": "Close", onClick: this.close }, h("svg", { key: '23a750830e6e16d28cbcd5025507d25848aaadf7', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'e81b8763a5c781f72c1ca8a2113482948e3ba8cc', d: "M6 6l12 12M18 6L6 18", "stroke-linecap": "round" })))), h("div", { key: 'da71e610f907cf53e78246d2065aaf526d5ceffd', class: "panel-body" }, this.step === 'loading' && (h("div", { key: '28cbb9a98c7b08fa8dcb9d8d5dfbf3bec93fe38d', class: "state-msg" }, h("span", { key: '915c8de87cbdc7da1ccf0622ce6c0f02fccf2cad', class: "spinner" }), " Loading\u2026")), this.step === 'error' && h("div", { key: '5785578bfef6f1ee81d938d91ffd3ded975f8c12', class: "state-msg error" }, this.error), this.step === 'occurrence' && (h("tl-occurrence-selector", { key: 'eeb853eab141c3c103015e82d221a140f6a3a109', eventId: this.eventId, onTlSelect: this.handleOccurrenceSelect })), this.step === 'tickets' && this.selectedOccurrenceId && (h("div", { key: 'f608f592ba651eb431375433eb4ff9393863ade5', class: "tickets-step" }, this.occurrenceCount > 1 && (h("button", { key: '84adfbdbeaceb2cf4238c6ffd09558b4499ca940', class: "back-link", onClick: this.backToDates }, "\u2190 Change date")), this.occurrenceLabel && h("p", { key: '0317e9194049608711e8c622142c3ad2c0a5dc12', class: "occ-label" }, this.occurrenceLabel), h("tl-ticket-selector", { key: '27b1e05d9d92fb8d519375e2b27d4b5ea0a4890a', eventId: this.eventId, occurrenceId: this.selectedOccurrenceId, onTlAddToCart: this.handleAdded }))), this.step === 'done' && (h("div", { key: '0853088206988c66d489f8804df7899821d49e64', class: "done-step" }, h("div", { key: 'c2955b893c4dffaadcdfd27bee96ef2724a131a6', class: "done-mark" }, "\uD83C\uDF9F\uFE0F"), h("p", { key: '370c30dfcbc0c25b4794d984dd261a3a5779a9dc', class: "done-title" }, "Added to your cart"), h("p", { key: 'c462f3c9292740e2fd2c74b173484f80a5dc1a30', class: "done-sub" }, "Held for you while you check out."), h("button", { key: '484991f79572e3213ad6413a1af87599880c3643', class: "primary-btn", onClick: this.goCheckout }, "Go to checkout"), h("button", { key: '5b4ba5a472b794e8f5af0f131dad1c8c11b869f5', class: "ghost-btn", onClick: this.close }, "Keep browsing"))))), h("div", { key: '9acdd36744d363f41f0bed7938ecea33322362d1', class: "powered-by" }, h("div", { key: 'f45545a8fc625336618352f0c0e9e84a1babce96', class: "pb-links" }, h("a", { key: 'dd929b12419b8353d9a09ad242a9f351dfd699e2', href: "https://ticketlayer.com/privacy", target: "_blank", rel: "noopener noreferrer" }, "Privacy Policy"), h("a", { key: '859be221bdc76602defaebdb89a997778cda6a91', href: "https://ticketlayer.com/report-abuse", target: "_blank", rel: "noopener noreferrer" }, "Report Abuse")), h("a", { key: 'd4e1f44b3b084160d2df8b9d15e075ddc5e05363', class: "pb-brand", href: "https://ticketlayer.com", target: "_blank", rel: "noopener noreferrer" }, h("span", { key: 'fe7fd86576a4e9772daa2c4c449da060f20fa143', class: "pb-pre" }, "Powered by"), h("svg", { key: '19412bd9e5522f0af9f847fe8fda6aa0f0004a3a', width: "14", height: "14", viewBox: "0 0 50 50", fill: "none", "aria-hidden": "true" }, h("g", { key: '8e82f14ab1e8094a210db95b1310ce6c0feef446', transform: "matrix(0.0129 0 0 -0.0129 25.4752 25.4752)" }, h("path", { key: 'b50b04cfc07c4e55fcf5ce92967f69b99d34dd34', fill: "currentColor", transform: "translate(-1781.5, -1759.4003)", d: "M 41 2973 c 1 -285 5 -734 9 -998 c 7 -444 9 -488 30 -580 c 81 -364 235 -634 512 -900 c 135 -130 263 -220 423 -299 c 156 -77 249 -109 409 -143 c 110 -23 142 -25 354 -24 c 230 1 310 8 427 37 c 241 60 453 162 640 309 c 82 64 252 234 317 315 c 210 264 340 604 355 926 l 6 121 l -69 6 c -86 8 -706 9 -755 1 l -36 -6 l -21 -125 c -34 -191 -98 -317 -236 -462 c -111 -115 -249 -198 -396 -238 c -98 -27 -356 -24 -463 5 c -100 27 -183 69 -273 137 c -226 173 -353 409 -354 660 c 0 44 -5 120 -10 169 c -6 49 -8 91 -6 94 c 3 3 65 -22 138 -55 c 140 -64 251 -103 358 -127 c 71 -17 295 -46 347 -46 l 33 0 l 0 434 l 0 434 l -67 7 c -147 14 -269 56 -393 133 c -222 139 -378 393 -397 648 l -6 71 l -75 7 c -41 3 -239 6 -439 6 l -363 0 l 1 -517 z" }))), h("span", { key: '2623449abd22f36f5af80d5605d3b274a4c214c4', class: "pb-word" }, "ticketlayer"))))));
|
|
133
133
|
}
|
|
134
134
|
static get is() { return "tl-buy-modal"; }
|
|
135
135
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
:host {
|
|
6
6
|
display: inline-block;
|
|
7
|
-
font-family: var(--tl-font-family
|
|
7
|
+
font-family: var(--tl-font-family);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
:host(.full-width) {
|
|
@@ -51,19 +51,19 @@
|
|
|
51
51
|
.buy-button.size-sm {
|
|
52
52
|
padding: 0.5rem 1rem;
|
|
53
53
|
font-size: 0.875rem;
|
|
54
|
-
border-radius: var(--tl-radius-sm
|
|
54
|
+
border-radius: var(--tl-radius-sm);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.buy-button.size-md {
|
|
58
58
|
padding: 0.75rem 1.5rem;
|
|
59
59
|
font-size: 1rem;
|
|
60
|
-
border-radius: var(--tl-radius-md
|
|
60
|
+
border-radius: var(--tl-radius-md);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.buy-button.size-lg {
|
|
64
64
|
padding: 1rem 2rem;
|
|
65
65
|
font-size: 1.125rem;
|
|
66
|
-
border-radius: var(--tl-radius-lg
|
|
66
|
+
border-radius: var(--tl-radius-lg);
|
|
67
67
|
min-height: 51px;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -22,9 +22,12 @@ import { getSDK, hasSDK } from "../../utils/sdk-connector";
|
|
|
22
22
|
const STATE_CONFIGS = {
|
|
23
23
|
available: {
|
|
24
24
|
defaultLabel: 'Buy Tickets',
|
|
25
|
-
color: 'var(--tl-primary
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
color: 'var(--tl-primary)',
|
|
26
|
+
// The hover shade used to be a second colour smuggled into the token's
|
|
27
|
+
// fallback slot, which meant it stopped following the channel's brand the
|
|
28
|
+
// moment a theme was applied. Derive it instead.
|
|
29
|
+
hoverColor: 'color-mix(in srgb, var(--tl-primary) 90%, black)',
|
|
30
|
+
foreground: 'var(--tl-primary-foreground)',
|
|
28
31
|
},
|
|
29
32
|
soldOut: {
|
|
30
33
|
defaultLabel: 'Sold Out',
|
|
@@ -112,7 +115,7 @@ export class TlBuyTicketsButton {
|
|
|
112
115
|
const config = this.getStateConfig();
|
|
113
116
|
const buttonLabel = this.label || config.defaultLabel;
|
|
114
117
|
const isInteractive = this.isInteractive();
|
|
115
|
-
return (h(Host, { key: '
|
|
118
|
+
return (h(Host, { key: '86ee9a81d82c10398dab4e22b3bbae15abb8f449', class: { 'full-width': this.fullWidth } }, h("button", { key: 'b581e199ced7ffd14669ebe0cc727edc2f8c8914', type: "button", class: {
|
|
116
119
|
'buy-button': true,
|
|
117
120
|
[`variant-${this.variant}`]: true,
|
|
118
121
|
[`size-${this.size}`]: true,
|
|
@@ -122,7 +125,7 @@ export class TlBuyTicketsButton {
|
|
|
122
125
|
'--button-color': config.color,
|
|
123
126
|
'--button-hover-color': config.hoverColor,
|
|
124
127
|
'--button-foreground': config.foreground,
|
|
125
|
-
}, disabled: !isInteractive, onClick: this.handleClick, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false) }, h("span", { key: '
|
|
128
|
+
}, disabled: !isInteractive, onClick: this.handleClick, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false) }, h("span", { key: 'f776bab4a999ed36b25400424d639b4c9261c02a', class: "icon" }, this.state === 'soldOut' && this.renderSoldOutIcon(), this.state === 'waitlist' && this.renderWaitlistIcon(), this.state === 'comingSoon' && this.renderComingSoonIcon(), this.state === 'available' && this.renderTicketIcon()), h("span", { key: 'e98ecbe6debc5c2c18ce1d304b60bf1074b003b3', class: "label" }, buttonLabel), this.price !== undefined && (h("span", { key: 'e7e261d09a541b126b02b88d00992f3a6483a9b8', class: "price" }, h("span", { key: '5eab43a47c2dd4c1339fe84b583902b1e38a0b2a', class: "price-prefix" }, this.pricePrefix), h("span", { key: 'f03b514ff2bc3c9a1b2e922d93a92accdedd0fad', class: "price-value" }, this.formatPrice(this.price)))))));
|
|
126
129
|
}
|
|
127
130
|
renderTicketIcon() {
|
|
128
131
|
return (h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { 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", { d: "M13 5v2" }), h("path", { d: "M13 17v2" }), h("path", { d: "M13 11v2" })));
|
|
@@ -10,9 +10,9 @@ tl-buy-tickets-wrapper,
|
|
|
10
10
|
|
|
11
11
|
tl-buy-tickets-wrapper:focus,
|
|
12
12
|
.tl-buy-tickets-wrapper:focus {
|
|
13
|
-
outline: 2px solid var(--tl-ring
|
|
13
|
+
outline: 2px solid var(--tl-ring);
|
|
14
14
|
outline-offset: 2px;
|
|
15
|
-
border-radius: var(--tl-radius-sm
|
|
15
|
+
border-radius: var(--tl-radius-sm);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
tl-buy-tickets-wrapper[disabled],
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: block;
|
|
3
|
-
font-family: var(--tl-font-family
|
|
3
|
+
font-family: var(--tl-font-family);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
/* Skeleton loading */
|
|
7
7
|
.skeleton-container {
|
|
8
|
-
padding: var(--tl-spacing-4
|
|
8
|
+
padding: var(--tl-spacing-4);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.skeleton-item {
|
|
12
12
|
height: 70px;
|
|
13
|
-
background: var(--tl-color-muted
|
|
14
|
-
border-radius: var(--tl-radius-md
|
|
15
|
-
margin-bottom: var(--tl-spacing-3
|
|
13
|
+
background: var(--tl-color-muted);
|
|
14
|
+
border-radius: var(--tl-radius-md);
|
|
15
|
+
margin-bottom: var(--tl-spacing-3);
|
|
16
16
|
animation: pulse 1.5s ease-in-out infinite;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.skeleton-totals {
|
|
20
20
|
height: 100px;
|
|
21
|
-
background: var(--tl-color-muted
|
|
22
|
-
border-radius: var(--tl-radius-md
|
|
21
|
+
background: var(--tl-color-muted);
|
|
22
|
+
border-radius: var(--tl-radius-md);
|
|
23
23
|
animation: pulse 1.5s ease-in-out infinite;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -34,50 +34,50 @@
|
|
|
34
34
|
flex-direction: column;
|
|
35
35
|
align-items: center;
|
|
36
36
|
justify-content: center;
|
|
37
|
-
padding: var(--tl-spacing-8
|
|
37
|
+
padding: var(--tl-spacing-8);
|
|
38
38
|
text-align: center;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.empty-icon {
|
|
42
42
|
width: 48px;
|
|
43
43
|
height: 48px;
|
|
44
|
-
color: var(--tl-color-muted-foreground
|
|
45
|
-
margin-bottom: var(--tl-spacing-4
|
|
44
|
+
color: var(--tl-color-muted-foreground);
|
|
45
|
+
margin-bottom: var(--tl-spacing-4);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.empty-title {
|
|
49
|
-
margin: 0 0 var(--tl-spacing-2
|
|
49
|
+
margin: 0 0 var(--tl-spacing-2);
|
|
50
50
|
font-size: 16px;
|
|
51
51
|
font-weight: 600;
|
|
52
|
-
color: var(--tl-color-foreground
|
|
52
|
+
color: var(--tl-color-foreground);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.empty-message {
|
|
56
56
|
margin: 0;
|
|
57
57
|
font-size: 14px;
|
|
58
|
-
color: var(--tl-color-muted-foreground
|
|
58
|
+
color: var(--tl-color-muted-foreground);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/* Cart */
|
|
62
62
|
.cart {
|
|
63
|
-
background: var(--tl-color-background
|
|
63
|
+
background: var(--tl-color-background);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.cart.compact .cart-items {
|
|
67
|
-
margin-bottom: var(--tl-spacing-2
|
|
67
|
+
margin-bottom: var(--tl-spacing-2);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/* Cart items */
|
|
71
71
|
.cart-items {
|
|
72
|
-
margin-bottom: var(--tl-spacing-4
|
|
72
|
+
margin-bottom: var(--tl-spacing-4);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.cart-item {
|
|
76
76
|
display: flex;
|
|
77
77
|
justify-content: space-between;
|
|
78
78
|
align-items: flex-start;
|
|
79
|
-
padding: var(--tl-spacing-3
|
|
80
|
-
border-bottom: 1px solid var(--tl-color-border
|
|
79
|
+
padding: var(--tl-spacing-3) 0;
|
|
80
|
+
border-bottom: 1px solid var(--tl-color-border);
|
|
81
81
|
transition: opacity 0.2s;
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -98,39 +98,39 @@
|
|
|
98
98
|
margin: 0;
|
|
99
99
|
font-weight: 600;
|
|
100
100
|
font-size: 15px;
|
|
101
|
-
color: var(--tl-color-foreground
|
|
101
|
+
color: var(--tl-color-foreground);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.item-event {
|
|
105
|
-
margin: var(--tl-spacing-1
|
|
105
|
+
margin: var(--tl-spacing-1) 0 0;
|
|
106
106
|
font-size: 14px;
|
|
107
|
-
color: var(--tl-color-muted-foreground
|
|
107
|
+
color: var(--tl-color-muted-foreground);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.item-date {
|
|
111
|
-
margin: var(--tl-spacing-1
|
|
111
|
+
margin: var(--tl-spacing-1) 0 0;
|
|
112
112
|
font-size: 13px;
|
|
113
|
-
color: var(--tl-color-muted-foreground
|
|
113
|
+
color: var(--tl-color-muted-foreground);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
.item-quantity {
|
|
117
|
-
margin: var(--tl-spacing-1
|
|
117
|
+
margin: var(--tl-spacing-1) 0 0;
|
|
118
118
|
font-size: 13px;
|
|
119
|
-
color: var(--tl-color-muted-foreground
|
|
119
|
+
color: var(--tl-color-muted-foreground);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
.item-actions {
|
|
123
123
|
display: flex;
|
|
124
124
|
align-items: center;
|
|
125
|
-
gap: var(--tl-spacing-3
|
|
126
|
-
margin-left: var(--tl-spacing-4
|
|
125
|
+
gap: var(--tl-spacing-3);
|
|
126
|
+
margin-left: var(--tl-spacing-4);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.item-price {
|
|
130
130
|
margin: 0;
|
|
131
131
|
font-weight: 600;
|
|
132
132
|
font-size: 15px;
|
|
133
|
-
color: var(--tl-color-foreground
|
|
133
|
+
color: var(--tl-color-foreground);
|
|
134
134
|
white-space: nowrap;
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -140,8 +140,8 @@
|
|
|
140
140
|
padding: 0;
|
|
141
141
|
border: none;
|
|
142
142
|
background: transparent;
|
|
143
|
-
border-radius: var(--tl-radius-sm
|
|
144
|
-
color: var(--tl-color-muted-foreground
|
|
143
|
+
border-radius: var(--tl-radius-sm);
|
|
144
|
+
color: var(--tl-color-muted-foreground);
|
|
145
145
|
cursor: pointer;
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
.remove-btn:hover:not(:disabled) {
|
|
153
|
-
background-color: var(--tl-color-destructive-bg
|
|
154
|
-
color: var(--tl-color-destructive
|
|
153
|
+
background-color: var(--tl-color-destructive-bg);
|
|
154
|
+
color: var(--tl-color-destructive);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
.remove-btn:disabled {
|
|
@@ -167,8 +167,8 @@
|
|
|
167
167
|
.spinner {
|
|
168
168
|
width: 14px;
|
|
169
169
|
height: 14px;
|
|
170
|
-
border: 2px solid var(--tl-color-border
|
|
171
|
-
border-top-color: var(--tl-color-primary
|
|
170
|
+
border: 2px solid var(--tl-color-border);
|
|
171
|
+
border-top-color: var(--tl-color-primary);
|
|
172
172
|
border-radius: 50%;
|
|
173
173
|
animation: spin 0.6s linear infinite;
|
|
174
174
|
}
|
|
@@ -179,41 +179,42 @@
|
|
|
179
179
|
|
|
180
180
|
/* Cart totals */
|
|
181
181
|
.cart-totals {
|
|
182
|
-
padding: var(--tl-spacing-3
|
|
183
|
-
border-top: 1px solid var(--tl-color-border
|
|
182
|
+
padding: var(--tl-spacing-3) 0;
|
|
183
|
+
border-top: 1px solid var(--tl-color-border);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
.total-row {
|
|
187
187
|
display: flex;
|
|
188
188
|
justify-content: space-between;
|
|
189
189
|
align-items: center;
|
|
190
|
-
padding: var(--tl-spacing-1
|
|
190
|
+
padding: var(--tl-spacing-1) 0;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
.total-row.subtotal,
|
|
194
|
-
.total-row.fees
|
|
194
|
+
.total-row.fees,
|
|
195
|
+
.total-row.discount {
|
|
195
196
|
font-size: 14px;
|
|
196
|
-
color: var(--tl-color-muted-foreground
|
|
197
|
+
color: var(--tl-color-muted-foreground);
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
.total-row.total {
|
|
200
201
|
font-size: 16px;
|
|
201
202
|
font-weight: 700;
|
|
202
|
-
color: var(--tl-color-foreground
|
|
203
|
-
padding-top: var(--tl-spacing-2
|
|
204
|
-
border-top: 1px solid var(--tl-color-border
|
|
205
|
-
margin-top: var(--tl-spacing-2
|
|
203
|
+
color: var(--tl-color-foreground);
|
|
204
|
+
padding-top: var(--tl-spacing-2);
|
|
205
|
+
border-top: 1px solid var(--tl-color-border);
|
|
206
|
+
margin-top: var(--tl-spacing-2);
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
/* Checkout button */
|
|
209
210
|
.checkout-btn {
|
|
210
211
|
width: 100%;
|
|
211
|
-
margin-top: var(--tl-spacing-4
|
|
212
|
-
padding: var(--tl-spacing-3
|
|
213
|
-
border-radius: var(--tl-radius-md
|
|
212
|
+
margin-top: var(--tl-spacing-4);
|
|
213
|
+
padding: var(--tl-spacing-3) var(--tl-spacing-4);
|
|
214
|
+
border-radius: var(--tl-radius-md);
|
|
214
215
|
border: none;
|
|
215
|
-
background-color: var(--tl-color-primary
|
|
216
|
-
color: var(--tl-color-primary-foreground
|
|
216
|
+
background-color: var(--tl-color-primary);
|
|
217
|
+
color: var(--tl-color-primary-foreground);
|
|
217
218
|
font-weight: 600;
|
|
218
219
|
font-size: 16px;
|
|
219
220
|
cursor: pointer;
|
|
@@ -229,8 +230,8 @@
|
|
|
229
230
|
}
|
|
230
231
|
|
|
231
232
|
.checkout-btn:disabled {
|
|
232
|
-
background-color: var(--tl-color-muted
|
|
233
|
-
color: var(--tl-color-muted-foreground
|
|
233
|
+
background-color: var(--tl-color-muted);
|
|
234
|
+
color: var(--tl-color-muted-foreground);
|
|
234
235
|
cursor: not-allowed;
|
|
235
236
|
}
|
|
236
237
|
|
|
@@ -241,7 +242,7 @@
|
|
|
241
242
|
}
|
|
242
243
|
|
|
243
244
|
.cart.compact .cart-totals {
|
|
244
|
-
padding: var(--tl-spacing-2
|
|
245
|
+
padding: var(--tl-spacing-2) 0;
|
|
245
246
|
}
|
|
246
247
|
|
|
247
248
|
.cart.compact .total-row.total {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { getSDK, hasSDK, whenSDK } from "../../utils/sdk-connector";
|
|
3
|
+
import { cartTotals } from "../../utils/cart-totals";
|
|
3
4
|
export class TlCart {
|
|
4
5
|
constructor() {
|
|
5
6
|
/**
|
|
@@ -129,8 +130,13 @@ export class TlCart {
|
|
|
129
130
|
if (!this.cart || this.cart.items.length === 0) {
|
|
130
131
|
return this.renderEmptyCart();
|
|
131
132
|
}
|
|
132
|
-
const { items
|
|
133
|
-
|
|
133
|
+
const { items } = this.cart;
|
|
134
|
+
// Money comes from the response through cartTotals: the fee row is shown
|
|
135
|
+
// when the surface expressed a fee, and the total is the server's figure,
|
|
136
|
+
// never a sum taken here.
|
|
137
|
+
const totals = cartTotals(this.cart);
|
|
138
|
+
const currency = totals.currency;
|
|
139
|
+
return (h("div", { class: `cart ${this.compact ? 'compact' : ''}` }, h("div", { class: "cart-items" }, items.map(item => this.renderCartItem(item))), h("div", { class: "cart-totals" }, !this.compact && (h("div", { class: "total-row subtotal" }, h("span", null, "Subtotal"), h("span", null, this.formatPrice(totals.subtotal, currency)))), totals.showFee && !this.compact && (h("div", { class: "total-row fees" }, h("span", null, totals.feeLabel), h("span", null, this.formatPrice(totals.fees, currency)))), totals.discount > 0 && !this.compact && (h("div", { class: "total-row discount" }, h("span", null, "Discount"), h("span", null, "-", this.formatPrice(totals.discount, currency)))), h("div", { class: "total-row total" }, h("span", null, "Total"), h("span", null, this.formatPrice(totals.total, currency)))), this.showCheckoutButton && (h("button", { class: "checkout-btn", onClick: this.handleCheckout, disabled: items.length === 0 }, this.checkoutLabel))));
|
|
134
140
|
}
|
|
135
141
|
static get is() { return "tl-cart"; }
|
|
136
142
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
background: transparent;
|
|
11
11
|
border: none;
|
|
12
12
|
cursor: pointer;
|
|
13
|
-
padding: var(--tl-spacing-2
|
|
14
|
-
border-radius: var(--tl-radius-md
|
|
15
|
-
color: var(--tl-color-foreground
|
|
13
|
+
padding: var(--tl-spacing-2);
|
|
14
|
+
border-radius: var(--tl-radius-md);
|
|
15
|
+
color: var(--tl-color-foreground);
|
|
16
16
|
transition: background-color 0.2s, transform 0.15s;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.cart-badge:hover {
|
|
20
|
-
background-color: var(--tl-color-muted
|
|
20
|
+
background-color: var(--tl-color-muted);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.cart-badge:active {
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.cart-badge:focus-visible {
|
|
28
|
-
outline: 2px solid var(--tl-color-primary
|
|
28
|
+
outline: 2px solid var(--tl-color-primary);
|
|
29
29
|
outline-offset: 2px;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/* Size variants */
|
|
33
33
|
.size-sm {
|
|
34
|
-
padding: var(--tl-spacing-1
|
|
34
|
+
padding: var(--tl-spacing-1);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.size-sm .icon-svg,
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.size-lg {
|
|
52
|
-
padding: var(--tl-spacing-3
|
|
52
|
+
padding: var(--tl-spacing-3);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.size-lg .icon-svg,
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
height: 18px;
|
|
81
81
|
padding: 0 5px;
|
|
82
82
|
border-radius: 9px;
|
|
83
|
-
background-color: var(--tl-color-primary
|
|
84
|
-
color: var(--tl-color-primary-foreground
|
|
83
|
+
background-color: var(--tl-color-primary);
|
|
84
|
+
color: var(--tl-color-primary-foreground);
|
|
85
85
|
font-size: 11px;
|
|
86
86
|
font-weight: 600;
|
|
87
|
-
font-family: var(--tl-font-family
|
|
87
|
+
font-family: var(--tl-font-family);
|
|
88
88
|
display: flex;
|
|
89
89
|
align-items: center;
|
|
90
90
|
justify-content: center;
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
color: inherit;
|
|
120
120
|
font-size: 12px;
|
|
121
121
|
font-weight: 600;
|
|
122
|
-
font-family: var(--tl-font-family
|
|
122
|
+
font-family: var(--tl-font-family);
|
|
123
123
|
line-height: 1;
|
|
124
124
|
}
|
|
125
125
|
|