@ticketlayer/elements 0.2.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/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/cjs/index-DfzcrE9-.js +3598 -0
- package/dist/cjs/index.cjs.js +16 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/order-summary-ZMkJ5bez.js +116 -0
- package/dist/cjs/sdk-connector-ClDF3013.js +108 -0
- package/dist/cjs/ticketlayer-elements.cjs.js +24 -0
- package/dist/cjs/tl-buy-modal.cjs.entry.js +127 -0
- package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +131 -0
- package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +58 -0
- package/dist/cjs/tl-cart-badge.cjs.entry.js +109 -0
- package/dist/cjs/tl-cart-drawer.cjs.entry.js +67 -0
- package/dist/cjs/tl-cart.cjs.entry.js +148 -0
- package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +57 -0
- package/dist/cjs/tl-event-card.cjs.entry.js +140 -0
- package/dist/cjs/tl-event-list.cjs.entry.js +80 -0
- package/dist/cjs/tl-login.cjs.entry.js +184 -0
- package/dist/cjs/tl-my-orders.cjs.entry.js +123 -0
- package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +754 -0
- package/dist/cjs/tl-order-confirmation.cjs.entry.js +146 -0
- package/dist/cjs/tl-order-tickets_2.cjs.entry.js +3198 -0
- package/dist/cjs/tl-promo-code.cjs.entry.js +75 -0
- package/dist/cjs/tl-seat-map.cjs.entry.js +147 -0
- package/dist/collection/collection-manifest.json +29 -0
- package/dist/collection/components/tl-buy-modal/tl-buy-modal.css +264 -0
- package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +249 -0
- package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +120 -0
- package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +412 -0
- package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.css +23 -0
- package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.js +192 -0
- package/dist/collection/components/tl-cart/tl-cart.css +251 -0
- package/dist/collection/components/tl-cart/tl-cart.js +314 -0
- package/dist/collection/components/tl-cart-badge/tl-cart-badge.css +138 -0
- package/dist/collection/components/tl-cart-badge/tl-cart-badge.js +217 -0
- package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.css +98 -0
- package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +185 -0
- package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.css +23 -0
- package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.js +148 -0
- package/dist/collection/components/tl-event-card/event-card-adapter.js +23 -0
- package/dist/collection/components/tl-event-card/tl-event-card.css +175 -0
- package/dist/collection/components/tl-event-card/tl-event-card.js +205 -0
- package/dist/collection/components/tl-event-list/tl-event-list.css +134 -0
- package/dist/collection/components/tl-event-list/tl-event-list.js +171 -0
- package/dist/collection/components/tl-login/tl-login.css +133 -0
- package/dist/collection/components/tl-login/tl-login.js +309 -0
- package/dist/collection/components/tl-my-orders/tl-my-orders.css +204 -0
- package/dist/collection/components/tl-my-orders/tl-my-orders.js +221 -0
- package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.css +658 -0
- package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +707 -0
- package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.css +176 -0
- package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +298 -0
- package/dist/collection/components/tl-order-tickets/tl-order-tickets.css +30 -0
- package/dist/collection/components/tl-order-tickets/tl-order-tickets.js +122 -0
- package/dist/collection/components/tl-promo-code/tl-promo-code.css +106 -0
- package/dist/collection/components/tl-promo-code/tl-promo-code.js +181 -0
- package/dist/collection/components/tl-seat-map/tl-seat-map.css +85 -0
- package/dist/collection/components/tl-seat-map/tl-seat-map.js +366 -0
- package/dist/collection/components/tl-ticket/tl-ticket.css +90 -0
- package/dist/collection/components/tl-ticket/tl-ticket.js +129 -0
- package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.css +205 -0
- package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +332 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/utils/order-summary.js +101 -0
- package/dist/collection/utils/sdk-connector.js +100 -0
- package/dist/collection/utils/testing/mock-sdk.js +95 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/order-summary.js +1 -0
- package/dist/components/sdk-connector.js +1 -0
- package/dist/components/tl-buy-modal.d.ts +11 -0
- package/dist/components/tl-buy-modal.js +1 -0
- package/dist/components/tl-buy-tickets-button.d.ts +11 -0
- package/dist/components/tl-buy-tickets-button.js +1 -0
- package/dist/components/tl-buy-tickets-wrapper.d.ts +11 -0
- package/dist/components/tl-buy-tickets-wrapper.js +1 -0
- package/dist/components/tl-buy-tickets-wrapper2.js +1 -0
- package/dist/components/tl-cart-badge.d.ts +11 -0
- package/dist/components/tl-cart-badge.js +1 -0
- package/dist/components/tl-cart-drawer.d.ts +11 -0
- package/dist/components/tl-cart-drawer.js +1 -0
- package/dist/components/tl-cart.d.ts +11 -0
- package/dist/components/tl-cart.js +1 -0
- package/dist/components/tl-cart2.js +1 -0
- package/dist/components/tl-checkout-wrapper.d.ts +11 -0
- package/dist/components/tl-checkout-wrapper.js +1 -0
- package/dist/components/tl-checkout-wrapper2.js +1 -0
- package/dist/components/tl-event-card.d.ts +11 -0
- package/dist/components/tl-event-card.js +1 -0
- package/dist/components/tl-event-card2.js +1 -0
- package/dist/components/tl-event-list.d.ts +11 -0
- package/dist/components/tl-event-list.js +1 -0
- package/dist/components/tl-login.d.ts +11 -0
- package/dist/components/tl-login.js +1 -0
- package/dist/components/tl-login2.js +1 -0
- package/dist/components/tl-my-orders.d.ts +11 -0
- package/dist/components/tl-my-orders.js +1 -0
- package/dist/components/tl-occurrence-selector.d.ts +11 -0
- package/dist/components/tl-occurrence-selector.js +1 -0
- package/dist/components/tl-occurrence-selector2.js +1 -0
- package/dist/components/tl-order-confirmation.d.ts +11 -0
- package/dist/components/tl-order-confirmation.js +1 -0
- package/dist/components/tl-order-tickets.d.ts +11 -0
- package/dist/components/tl-order-tickets.js +1 -0
- package/dist/components/tl-order-tickets2.js +1 -0
- package/dist/components/tl-promo-code.d.ts +11 -0
- package/dist/components/tl-promo-code.js +1 -0
- package/dist/components/tl-seat-map.d.ts +11 -0
- package/dist/components/tl-seat-map.js +1 -0
- package/dist/components/tl-ticket-selector.d.ts +11 -0
- package/dist/components/tl-ticket-selector.js +1 -0
- package/dist/components/tl-ticket-selector2.js +1 -0
- package/dist/components/tl-ticket.d.ts +11 -0
- package/dist/components/tl-ticket.js +1 -0
- package/dist/components/tl-ticket2.js +1 -0
- package/dist/elements.docs.d.ts +454 -0
- package/dist/elements.docs.json +3008 -0
- package/dist/esm/index-Ba-RZTFI.js +3588 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/order-summary-BGekdjN9.js +103 -0
- package/dist/esm/sdk-connector-CqhvfyKV.js +102 -0
- package/dist/esm/ticketlayer-elements.js +20 -0
- package/dist/esm/tl-buy-modal.entry.js +125 -0
- package/dist/esm/tl-buy-tickets-button.entry.js +129 -0
- package/dist/esm/tl-buy-tickets-wrapper.entry.js +56 -0
- package/dist/esm/tl-cart-badge.entry.js +107 -0
- package/dist/esm/tl-cart-drawer.entry.js +65 -0
- package/dist/esm/tl-cart.entry.js +146 -0
- package/dist/esm/tl-checkout-wrapper.entry.js +55 -0
- package/dist/esm/tl-event-card.entry.js +138 -0
- package/dist/esm/tl-event-list.entry.js +78 -0
- package/dist/esm/tl-login.entry.js +182 -0
- package/dist/esm/tl-my-orders.entry.js +121 -0
- package/dist/esm/tl-occurrence-selector_2.entry.js +751 -0
- package/dist/esm/tl-order-confirmation.entry.js +144 -0
- package/dist/esm/tl-order-tickets_2.entry.js +3195 -0
- package/dist/esm/tl-promo-code.entry.js +73 -0
- package/dist/esm/tl-seat-map.entry.js +145 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/ticketlayer-elements/index.esm.js +1 -0
- package/dist/ticketlayer-elements/p-0291df4c.entry.js +1 -0
- package/dist/ticketlayer-elements/p-10f01a1f.entry.js +1 -0
- package/dist/ticketlayer-elements/p-11273f8f.entry.js +1 -0
- package/dist/ticketlayer-elements/p-340ab4f5.entry.js +1 -0
- package/dist/ticketlayer-elements/p-41d22d7c.entry.js +1 -0
- package/dist/ticketlayer-elements/p-82752e3b.entry.js +1 -0
- package/dist/ticketlayer-elements/p-976770f3.entry.js +1 -0
- package/dist/ticketlayer-elements/p-9a903ff6.entry.js +1 -0
- package/dist/ticketlayer-elements/p-9c9072c8.entry.js +1 -0
- package/dist/ticketlayer-elements/p-9d8163d6.entry.js +1 -0
- package/dist/ticketlayer-elements/p-BGekdjN9.js +1 -0
- package/dist/ticketlayer-elements/p-Ba-RZTFI.js +2 -0
- package/dist/ticketlayer-elements/p-CqhvfyKV.js +1 -0
- package/dist/ticketlayer-elements/p-a5c90b68.entry.js +1 -0
- package/dist/ticketlayer-elements/p-b6d479ad.entry.js +1 -0
- package/dist/ticketlayer-elements/p-dd43f015.entry.js +1 -0
- package/dist/ticketlayer-elements/p-eb640760.entry.js +1 -0
- package/dist/ticketlayer-elements/p-ee3aa227.entry.js +1 -0
- package/dist/ticketlayer-elements/p-fb9444c4.entry.js +1 -0
- package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -0
- package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -0
- package/dist/types/components/tl-buy-modal/tl-buy-modal.d.ts +54 -0
- package/dist/types/components/tl-buy-tickets-button/tl-buy-tickets-button.d.ts +61 -0
- package/dist/types/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.d.ts +52 -0
- package/dist/types/components/tl-cart/tl-cart.d.ts +80 -0
- package/dist/types/components/tl-cart-badge/tl-cart-badge.d.ts +36 -0
- package/dist/types/components/tl-cart-drawer/tl-cart-drawer.d.ts +35 -0
- package/dist/types/components/tl-checkout-wrapper/tl-checkout-wrapper.d.ts +39 -0
- package/dist/types/components/tl-event-card/event-card-adapter.d.ts +23 -0
- package/dist/types/components/tl-event-card/tl-event-card.d.ts +55 -0
- package/dist/types/components/tl-event-list/tl-event-list.d.ts +30 -0
- package/dist/types/components/tl-login/tl-login.d.ts +59 -0
- package/dist/types/components/tl-my-orders/tl-my-orders.d.ts +39 -0
- package/dist/types/components/tl-occurrence-selector/tl-occurrence-selector.d.ts +208 -0
- package/dist/types/components/tl-order-confirmation/tl-order-confirmation.d.ts +54 -0
- package/dist/types/components/tl-order-tickets/tl-order-tickets.d.ts +21 -0
- package/dist/types/components/tl-promo-code/tl-promo-code.d.ts +39 -0
- package/dist/types/components/tl-seat-map/tl-seat-map.d.ts +68 -0
- package/dist/types/components/tl-ticket/tl-ticket.d.ts +28 -0
- package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +78 -0
- package/dist/types/components.d.ts +1629 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/stencil-public-runtime.d.ts +1839 -0
- package/dist/types/utils/order-summary.d.ts +67 -0
- package/dist/types/utils/sdk-connector.d.ts +113 -0
- package/dist/types/utils/testing/mock-sdk.d.ts +36 -0
- package/elements.catalogue.json +968 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +101 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: var(--tl-font-family, system-ui, sans-serif);
|
|
4
|
+
color: var(--tl-foreground, #111827);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.field {
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: var(--tl-spacing-2, 0.5rem);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.input {
|
|
13
|
+
flex: 1;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
padding: var(--tl-spacing-3, 0.75rem);
|
|
16
|
+
font: inherit;
|
|
17
|
+
font-size: 0.875rem;
|
|
18
|
+
color: var(--tl-foreground, #111827);
|
|
19
|
+
background: var(--tl-background, #ffffff);
|
|
20
|
+
border: 1px solid var(--tl-border, #e5e7eb);
|
|
21
|
+
border-radius: var(--tl-radius-md, 0.5rem);
|
|
22
|
+
text-transform: uppercase;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.input::placeholder {
|
|
26
|
+
text-transform: none;
|
|
27
|
+
color: var(--tl-muted-foreground, #6b7280);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.input:focus {
|
|
31
|
+
outline: 2px solid var(--tl-primary, #6366f1);
|
|
32
|
+
outline-offset: 1px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.apply {
|
|
36
|
+
padding: var(--tl-spacing-3, 0.75rem) var(--tl-spacing-4, 1rem);
|
|
37
|
+
font: inherit;
|
|
38
|
+
font-size: 0.875rem;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
color: var(--tl-primary-foreground, #ffffff);
|
|
41
|
+
background: var(--tl-primary, #6366f1);
|
|
42
|
+
border: none;
|
|
43
|
+
border-radius: var(--tl-radius-md, 0.5rem);
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.apply:hover:not(:disabled) {
|
|
49
|
+
opacity: 0.9;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.apply:disabled,
|
|
53
|
+
.input:disabled {
|
|
54
|
+
opacity: 0.6;
|
|
55
|
+
cursor: not-allowed;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.error {
|
|
59
|
+
margin: var(--tl-spacing-2, 0.5rem) 0 0;
|
|
60
|
+
font-size: 0.8125rem;
|
|
61
|
+
color: var(--tl-error, #ef4444);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.applied {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
gap: var(--tl-spacing-3, 0.75rem);
|
|
69
|
+
padding: var(--tl-spacing-3, 0.75rem);
|
|
70
|
+
font-size: 0.875rem;
|
|
71
|
+
background: var(--tl-muted, #f9fafb);
|
|
72
|
+
border: 1px solid var(--tl-border, #e5e7eb);
|
|
73
|
+
border-radius: var(--tl-radius-md, 0.5rem);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.applied-text {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: var(--tl-spacing-2, 0.5rem);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.icon {
|
|
83
|
+
width: 1rem;
|
|
84
|
+
height: 1rem;
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
color: var(--tl-success, #10b981);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.code {
|
|
90
|
+
font-family: var(--tl-font-family-mono, ui-monospace, monospace);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.link {
|
|
94
|
+
padding: 0;
|
|
95
|
+
font: inherit;
|
|
96
|
+
font-size: 0.8125rem;
|
|
97
|
+
color: var(--tl-primary, #6366f1);
|
|
98
|
+
background: none;
|
|
99
|
+
border: none;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.link:hover {
|
|
105
|
+
text-decoration: underline;
|
|
106
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { whenSDK } from "../../utils/sdk-connector";
|
|
3
|
+
import { errorMessage, isAuthError } from "../../utils/order-summary";
|
|
4
|
+
/**
|
|
5
|
+
* tl-promo-code - an input plus Apply button that redeems a presale or promo
|
|
6
|
+
* code for the current cart (POST /sales/presale-codes/redeem through the
|
|
7
|
+
* SDK). Redemption unlocks gated pricing on the customer; the SDK re-reads the
|
|
8
|
+
* cart and publishes cart:updated, so tl-cart and badges re-render on their own.
|
|
9
|
+
*
|
|
10
|
+
* The API has no un-redeem, so the applied state offers only "use a different
|
|
11
|
+
* code", which clears the input for another redemption.
|
|
12
|
+
*
|
|
13
|
+
* Usage: <tl-promo-code></tl-promo-code>
|
|
14
|
+
*
|
|
15
|
+
* @event tlPromoApplied - a code was redeemed ({ code, benefit, alreadyHeld, cart })
|
|
16
|
+
* @event tlError - the code was rejected
|
|
17
|
+
*/
|
|
18
|
+
export class TlPromoCode {
|
|
19
|
+
constructor() {
|
|
20
|
+
/** Input placeholder. */
|
|
21
|
+
this.placeholder = 'Promo or presale code';
|
|
22
|
+
/** Apply button label. */
|
|
23
|
+
this.buttonLabel = 'Apply';
|
|
24
|
+
this.code = '';
|
|
25
|
+
this.applying = false;
|
|
26
|
+
this.applied = null;
|
|
27
|
+
this.error = null;
|
|
28
|
+
this.handleInput = (e) => {
|
|
29
|
+
this.code = e.target.value;
|
|
30
|
+
this.error = null;
|
|
31
|
+
};
|
|
32
|
+
this.handleSubmit = (e) => {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
this.apply();
|
|
35
|
+
};
|
|
36
|
+
this.reset = () => {
|
|
37
|
+
this.applied = null;
|
|
38
|
+
this.error = null;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async apply() {
|
|
42
|
+
const code = this.code.trim();
|
|
43
|
+
if (!code) {
|
|
44
|
+
this.error = 'Enter a code';
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.applying = true;
|
|
48
|
+
this.error = null;
|
|
49
|
+
try {
|
|
50
|
+
const sdk = await whenSDK();
|
|
51
|
+
const presale = sdk.getPresaleManager?.();
|
|
52
|
+
if (!presale)
|
|
53
|
+
throw new Error('Promo codes are not available');
|
|
54
|
+
const result = await presale.redeem(code);
|
|
55
|
+
// The SDK refreshed the cart on redeem; read the cached copy for the payload.
|
|
56
|
+
const cart = await sdk.getCartManager?.()?.get().catch(() => null) ?? null;
|
|
57
|
+
this.applied = { code: code.toUpperCase(), ...result, cart };
|
|
58
|
+
this.code = '';
|
|
59
|
+
this.tlPromoApplied.emit(this.applied);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
console.error('[tl-promo-code] Redeem failed:', err);
|
|
63
|
+
this.error = isAuthError(err)
|
|
64
|
+
? 'Sign in to use this code'
|
|
65
|
+
: errorMessage(err, 'That code could not be applied');
|
|
66
|
+
this.tlError.emit({ message: this.error });
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
this.applying = false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
if (this.applied) {
|
|
74
|
+
return (h("div", { class: "applied", role: "status" }, h("span", { class: "applied-text" }, h("svg", { class: "icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "aria-hidden": "true" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M5 13l4 4L19 7" })), "Code ", h("strong", { class: "code" }, this.applied.code), this.applied.alreadyHeld ? ' was already applied' : ' applied'), h("button", { type: "button", class: "link", onClick: this.reset }, "Use a different code")));
|
|
75
|
+
}
|
|
76
|
+
return (h("form", { class: "promo", onSubmit: this.handleSubmit }, h("div", { class: "field" }, h("input", { class: "input", type: "text", autocomplete: "off", autoCapitalize: "characters", spellcheck: false, "aria-label": this.placeholder, placeholder: this.placeholder, value: this.code, disabled: this.applying, onInput: this.handleInput }), h("button", { type: "submit", class: "apply", disabled: this.applying }, this.applying ? 'Applying…' : this.buttonLabel)), this.error && (h("p", { class: "error", role: "alert" }, this.error))));
|
|
77
|
+
}
|
|
78
|
+
static get is() { return "tl-promo-code"; }
|
|
79
|
+
static get encapsulation() { return "shadow"; }
|
|
80
|
+
static get originalStyleUrls() {
|
|
81
|
+
return {
|
|
82
|
+
"$": ["tl-promo-code.css"]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
static get styleUrls() {
|
|
86
|
+
return {
|
|
87
|
+
"$": ["tl-promo-code.css"]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static get properties() {
|
|
91
|
+
return {
|
|
92
|
+
"placeholder": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "string",
|
|
97
|
+
"resolved": "string",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": "Input placeholder."
|
|
105
|
+
},
|
|
106
|
+
"getter": false,
|
|
107
|
+
"setter": false,
|
|
108
|
+
"reflect": false,
|
|
109
|
+
"attribute": "placeholder",
|
|
110
|
+
"defaultValue": "'Promo or presale code'"
|
|
111
|
+
},
|
|
112
|
+
"buttonLabel": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Apply button label."
|
|
125
|
+
},
|
|
126
|
+
"getter": false,
|
|
127
|
+
"setter": false,
|
|
128
|
+
"reflect": false,
|
|
129
|
+
"attribute": "button-label",
|
|
130
|
+
"defaultValue": "'Apply'"
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
static get states() {
|
|
135
|
+
return {
|
|
136
|
+
"code": {},
|
|
137
|
+
"applying": {},
|
|
138
|
+
"applied": {},
|
|
139
|
+
"error": {}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
static get events() {
|
|
143
|
+
return [{
|
|
144
|
+
"method": "tlPromoApplied",
|
|
145
|
+
"name": "tlPromoApplied",
|
|
146
|
+
"bubbles": true,
|
|
147
|
+
"cancelable": true,
|
|
148
|
+
"composed": true,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": ""
|
|
152
|
+
},
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "TlPromoApplied",
|
|
155
|
+
"resolved": "TlPromoApplied",
|
|
156
|
+
"references": {
|
|
157
|
+
"TlPromoApplied": {
|
|
158
|
+
"location": "local",
|
|
159
|
+
"path": "/home/runner/work/live-elements/live-elements/src/components/tl-promo-code/tl-promo-code.tsx",
|
|
160
|
+
"id": "src/components/tl-promo-code/tl-promo-code.tsx::TlPromoApplied"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
"method": "tlError",
|
|
166
|
+
"name": "tlError",
|
|
167
|
+
"bubbles": true,
|
|
168
|
+
"cancelable": true,
|
|
169
|
+
"composed": true,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": ""
|
|
173
|
+
},
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "{ message: string }",
|
|
176
|
+
"resolved": "{ message: string; }",
|
|
177
|
+
"references": {}
|
|
178
|
+
}
|
|
179
|
+
}];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TlSeatMap styles
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
font-family: var(--tl-font-family, system-ui, -apple-system, sans-serif);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.seat-map-container {
|
|
11
|
+
position: relative;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
border-radius: var(--tl-radius-md, 0.5rem);
|
|
14
|
+
background: var(--tl-color-background, #ffffff);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.seat-map-iframe {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
border: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.seat-map-iframe.hidden {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Loading state */
|
|
28
|
+
.loading {
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset: 0;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
background: var(--tl-color-background, #ffffff);
|
|
36
|
+
color: var(--tl-color-foreground, #0f172a);
|
|
37
|
+
gap: 1rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.loading p {
|
|
41
|
+
margin: 0;
|
|
42
|
+
font-size: 0.875rem;
|
|
43
|
+
color: var(--tl-color-muted-foreground, #64748b);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.spinner {
|
|
47
|
+
width: 40px;
|
|
48
|
+
height: 40px;
|
|
49
|
+
border: 3px solid var(--tl-color-border, #e2e8f0);
|
|
50
|
+
border-top-color: var(--tl-color-primary, #e64b12);
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
animation: tl-seat-map-spin 1s linear infinite;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes tl-seat-map-spin {
|
|
56
|
+
to {
|
|
57
|
+
transform: rotate(360deg);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Error state */
|
|
62
|
+
.error {
|
|
63
|
+
position: absolute;
|
|
64
|
+
inset: 0;
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
background: var(--tl-color-background, #ffffff);
|
|
70
|
+
color: var(--tl-color-error, #ef4444);
|
|
71
|
+
padding: 1.5rem;
|
|
72
|
+
text-align: center;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.error-title {
|
|
76
|
+
margin: 0 0 0.5rem;
|
|
77
|
+
font-size: 1.125rem;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.error-message {
|
|
82
|
+
margin: 0;
|
|
83
|
+
font-size: 0.875rem;
|
|
84
|
+
opacity: 0.9;
|
|
85
|
+
}
|