@transcodes/ui-components 0.2.0 → 0.3.1

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 (47) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +124 -79
  3. package/dist/controllers/animation.controller.js +32 -0
  4. package/dist/controllers/base.controller.js +8 -0
  5. package/dist/controllers/form-validation.controller.js +49 -0
  6. package/dist/controllers/history.controller.js +26 -0
  7. package/dist/controllers/loading.controller.js +27 -0
  8. package/dist/controllers/match-media.controller.js +20 -0
  9. package/dist/controllers/message-bus.controller.js +45 -0
  10. package/dist/controllers/storage.controller.js +40 -0
  11. package/dist/index.d.ts +78 -0
  12. package/dist/index.js +80 -0
  13. package/dist/primitives/tc-box.js +38 -0
  14. package/dist/primitives/tc-button.js +167 -0
  15. package/dist/primitives/tc-callout.js +86 -0
  16. package/dist/primitives/tc-card.js +76 -0
  17. package/dist/primitives/tc-chip.js +79 -0
  18. package/dist/primitives/tc-container.js +62 -0
  19. package/dist/primitives/tc-divider.js +76 -0
  20. package/dist/primitives/tc-error-message.js +74 -0
  21. package/dist/primitives/tc-form-header.js +120 -0
  22. package/dist/primitives/tc-icon.js +95 -0
  23. package/dist/primitives/tc-input-with-chip.js +242 -0
  24. package/dist/primitives/tc-input.js +262 -0
  25. package/dist/primitives/tc-item-button.js +168 -0
  26. package/dist/primitives/tc-item.js +93 -0
  27. package/dist/primitives/tc-otp-input.js +230 -0
  28. package/dist/primitives/tc-section.js +48 -0
  29. package/dist/primitives/tc-spinner.js +87 -0
  30. package/dist/primitives/tc-symbol.js +56 -0
  31. package/dist/primitives/tc-text.js +145 -0
  32. package/dist/primitives/tc-toast.js +189 -0
  33. package/dist/screens/tc-error-screen.js +119 -0
  34. package/dist/screens/tc-loading-screen.js +77 -0
  35. package/dist/screens/tc-success-screen.js +192 -0
  36. package/dist/styles/shared.js +7 -0
  37. package/dist/widgets/tc-authenticator-card.js +213 -0
  38. package/dist/widgets/tc-floating-button.js +132 -0
  39. package/dist/widgets/tc-iframe-modal.js +263 -0
  40. package/dist/widgets/tc-installation-banner.js +234 -0
  41. package/dist/widgets/tc-ios-installation-guide.js +240 -0
  42. package/dist/widgets/tc-notification-modal.js +230 -0
  43. package/dist/widgets/tc-offline-modal.js +202 -0
  44. package/dist/widgets/tc-page-decoration.js +126 -0
  45. package/package.json +25 -7
  46. package/dist/ui-components.css +0 -1
  47. package/dist/ui-components.js +0 -4468
@@ -1,4468 +0,0 @@
1
- import "@transcodes/design-tokens";
2
- import { css as c, LitElement as d, html as l, unsafeCSS as kt } from "lit";
3
- import { property as n, customElement as p, state as S } from "lit/decorators.js";
4
- import { styleMap as m } from "lit/directives/style-map.js";
5
- import { classMap as M } from "lit/directives/class-map.js";
6
- import { unsafeStatic as $t, html as zt } from "lit/static-html.js";
7
- class P {
8
- constructor(e) {
9
- this.host = e, this.host.addController(this);
10
- }
11
- }
12
- class j extends P {
13
- constructor(e, s = 300) {
14
- super(e), this._state = "hidden", typeof s == "number" ? (this.showDuration = s, this.hideDuration = s) : (this.showDuration = s.showDuration ?? 300, this.hideDuration = s.hideDuration ?? 300);
15
- }
16
- get state() {
17
- return this._state;
18
- }
19
- get isVisible() {
20
- return this._state === "visible" || this._state === "showing";
21
- }
22
- get isHidden() {
23
- return this._state === "hidden";
24
- }
25
- async show() {
26
- this._state === "visible" || this._state === "showing" || (this._state = "showing", this.host.requestUpdate(), await this.waitForTransition(this.showDuration), this._state = "visible", this.host.requestUpdate());
27
- }
28
- async hide() {
29
- this._state === "hidden" || this._state === "hiding" || (this._state = "hiding", this.host.requestUpdate(), await this.waitForTransition(this.hideDuration), this._state = "hidden", this.host.requestUpdate());
30
- }
31
- toggle() {
32
- return this.isVisible ? this.hide() : this.show();
33
- }
34
- waitForTransition(e) {
35
- return new Promise((s) => {
36
- setTimeout(s, e);
37
- });
38
- }
39
- }
40
- class He extends P {
41
- constructor() {
42
- super(...arguments), this.errors = /* @__PURE__ */ new Map();
43
- }
44
- get isValid() {
45
- return this.errors.size === 0;
46
- }
47
- getError(e) {
48
- return this.errors.get(e);
49
- }
50
- getAllErrors() {
51
- return new Map(this.errors);
52
- }
53
- validate(e, s, i) {
54
- this.clearError(e);
55
- for (const t of i)
56
- if (!this.runRule(s, t))
57
- return this.errors.set(e, t.message), this.host.requestUpdate(), !1;
58
- return !0;
59
- }
60
- clearError(e) {
61
- this.errors.has(e) && (this.errors.delete(e), this.host.requestUpdate());
62
- }
63
- reset() {
64
- this.errors.clear(), this.host.requestUpdate();
65
- }
66
- runRule(e, s) {
67
- switch (s.type) {
68
- case "required":
69
- return e.trim().length > 0;
70
- case "email":
71
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
72
- case "minLength":
73
- return e.length >= s.value;
74
- case "maxLength":
75
- return e.length <= s.value;
76
- case "pattern":
77
- return s.value.test(e);
78
- case "custom":
79
- return s.validator ? s.validator(e) : !0;
80
- default:
81
- return !0;
82
- }
83
- }
84
- }
85
- class Ct extends P {
86
- constructor() {
87
- super(...arguments), this.hasAddedEntry = !1, this.handlePopState = () => {
88
- this.hasAddedEntry && (this.hasAddedEntry = !1, this.onPopCallback?.());
89
- };
90
- }
91
- push(e = { modal: !0 }) {
92
- this.hasAddedEntry || (history.pushState(e, ""), this.hasAddedEntry = !0);
93
- }
94
- pop() {
95
- this.hasAddedEntry && (this.hasAddedEntry = !1);
96
- }
97
- onPopState(e) {
98
- this.onPopCallback = e;
99
- }
100
- hostConnected() {
101
- window.addEventListener("popstate", this.handlePopState);
102
- }
103
- hostDisconnected() {
104
- window.removeEventListener("popstate", this.handlePopState), this.onPopCallback = void 0;
105
- }
106
- }
107
- class _t extends P {
108
- constructor() {
109
- super(...arguments), this._isLoading = !1, this._progress = 0;
110
- }
111
- get isLoading() {
112
- return this._isLoading;
113
- }
114
- get progress() {
115
- return this._progress;
116
- }
117
- start() {
118
- this._isLoading = !0, this._progress = 0, this.host.requestUpdate();
119
- }
120
- setProgress(e) {
121
- this._progress = Math.max(0, Math.min(100, e)), this.host.requestUpdate();
122
- }
123
- complete() {
124
- this._progress = 100, this._isLoading = !1, this.host.requestUpdate();
125
- }
126
- reset() {
127
- this._isLoading = !1, this._progress = 0, this.host.requestUpdate();
128
- }
129
- }
130
- class Dt extends P {
131
- constructor(e, s) {
132
- super(e), this._matches = !1, this.handleChange = (i) => {
133
- this._matches = i.matches, this.host.requestUpdate();
134
- }, this.mediaQuery = window.matchMedia(s), this._matches = this.mediaQuery.matches;
135
- }
136
- get matches() {
137
- return this._matches;
138
- }
139
- hostConnected() {
140
- this.mediaQuery.addEventListener("change", this.handleChange);
141
- }
142
- hostDisconnected() {
143
- this.mediaQuery.removeEventListener("change", this.handleChange);
144
- }
145
- }
146
- class Ot extends P {
147
- /**
148
- * @param host - The reactive controller host
149
- * @param targetOrigin - The origin to accept messages from and send messages to.
150
- * SECURITY NOTE: Using '*' accepts messages from any origin which can be dangerous.
151
- * Always specify an explicit origin in production environments.
152
- */
153
- constructor(e, s = "*") {
154
- super(e), this.handlers = /* @__PURE__ */ new Map(), this.wildcardHandlers = /* @__PURE__ */ new Set(), this.handleMessage = (i) => {
155
- if (!(this.targetOrigin !== "*" && i.origin !== this.targetOrigin) && i.data && typeof i.data == "object" && typeof i.data.type == "string") {
156
- const { type: t, payload: a } = i.data;
157
- this.handlers.get(t)?.forEach((dt) => {
158
- dt(a);
159
- }), this.wildcardHandlers.forEach((dt) => {
160
- dt(t, a);
161
- });
162
- }
163
- }, this.targetOrigin = s, s === "*" && typeof window < "u" && window.location.protocol !== "file:" && console.warn(
164
- '[MessageBusController] Using targetOrigin="*" accepts messages from any origin. For security, specify an explicit origin in production.'
165
- );
166
- }
167
- send(e, s, i = window) {
168
- i.postMessage({ type: e, payload: s }, this.targetOrigin);
169
- }
170
- sendToFrame(e, s, i) {
171
- e.contentWindow?.postMessage({ type: s, payload: i }, this.targetOrigin);
172
- }
173
- onMessage(e, s) {
174
- return e === "*" ? (this.wildcardHandlers.add(s), () => {
175
- this.wildcardHandlers.delete(s);
176
- }) : (this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set()), this.handlers.get(e)?.add(s), () => {
177
- this.handlers.get(e)?.delete(s);
178
- });
179
- }
180
- hostConnected() {
181
- window.addEventListener("message", this.handleMessage);
182
- }
183
- hostDisconnected() {
184
- window.removeEventListener("message", this.handleMessage), this.handlers.clear();
185
- }
186
- }
187
- class bt extends P {
188
- constructor(e, s, i = localStorage) {
189
- super(e), this._value = null, this.handleStorageChange = (t) => {
190
- t.key === this.key && t.storageArea === this.storage && (this.load(), this.host.requestUpdate());
191
- }, this.key = s, this.storage = i, this.load();
192
- }
193
- get value() {
194
- return this._value;
195
- }
196
- set(e) {
197
- this._value = e;
198
- try {
199
- this.storage.setItem(this.key, JSON.stringify(e));
200
- } catch {
201
- console.warn(`Failed to save to storage: ${this.key}`);
202
- }
203
- this.host.requestUpdate();
204
- }
205
- remove() {
206
- this._value = null, this.storage.removeItem(this.key), this.host.requestUpdate();
207
- }
208
- load() {
209
- try {
210
- const e = this.storage.getItem(this.key);
211
- e !== null && (this._value = JSON.parse(e));
212
- } catch {
213
- this._value = null;
214
- }
215
- }
216
- hostConnected() {
217
- window.addEventListener("storage", this.handleStorageChange);
218
- }
219
- hostDisconnected() {
220
- window.removeEventListener("storage", this.handleStorageChange);
221
- }
222
- }
223
- var St = Object.defineProperty, Pt = Object.getOwnPropertyDescriptor, yt = (r, e, s, i) => {
224
- for (var t = i > 1 ? void 0 : i ? Pt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
225
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
226
- return i && t && St(e, s, t), t;
227
- };
228
- let it = class extends d {
229
- constructor() {
230
- super(...arguments), this.sx = {};
231
- }
232
- render() {
233
- return l`
234
- <div part="box" class="box" style=${m(this.sx)}>
235
- <slot></slot>
236
- </div>
237
- `;
238
- }
239
- };
240
- it.styles = c`
241
- :host {
242
- display: contents;
243
- }
244
-
245
- .box {
246
- display: block;
247
- }
248
- `;
249
- yt([
250
- n({ type: Object })
251
- ], it.prototype, "sx", 2);
252
- it = yt([
253
- p("tc-box")
254
- ], it);
255
- const jt = `/**
256
- * Do not edit directly, this file was auto-generated.
257
- */
258
-
259
- /* Animations */
260
- @keyframes fadeInUp {
261
- 0% {
262
- opacity: 0;
263
- transform: translateY(1rem);
264
- }
265
- 100% {
266
- opacity: 1;
267
- transform: translateY(0);
268
- }
269
- }
270
-
271
- @keyframes slideDown {
272
- 0% {
273
- opacity: 0;
274
- transform: translateY(-0.5rem);
275
- }
276
- 100% {
277
- opacity: 1;
278
- transform: translateY(0);
279
- }
280
- }
281
-
282
- @keyframes slideUp {
283
- 0% {
284
- opacity: 0;
285
- transform: translateY(0.5rem);
286
- }
287
- 100% {
288
- opacity: 1;
289
- transform: translateY(0);
290
- }
291
- }
292
-
293
- @keyframes spin {
294
- to {
295
- transform: rotate(360deg);
296
- }
297
- }
298
-
299
- @keyframes shake {
300
- 0%, 100% {
301
- transform: translateX(0);
302
- }
303
- 25% {
304
- transform: translateX(-0.25rem);
305
- }
306
- 75% {
307
- transform: translateX(0.25rem);
308
- }
309
- }
310
-
311
- @keyframes inkFloat {
312
- 0%, 100% {
313
- transform: translate(0, 0) scale(1);
314
- opacity: 0.5;
315
- }
316
- 50% {
317
- transform: translate(0.625rem, -0.625rem) scale(1.1);
318
- opacity: 0.7;
319
- }
320
- }
321
-
322
- @keyframes inkDrift {
323
- 0%, 100% {
324
- transform: translate(0, 0) rotate(0deg);
325
- opacity: 0.4;
326
- }
327
- 33% {
328
- transform: translate(-0.5rem, 0.5rem) rotate(-5deg);
329
- opacity: 0.6;
330
- }
331
- 66% {
332
- transform: translate(0.375rem, -0.375rem) rotate(3deg);
333
- opacity: 0.5;
334
- }
335
- }
336
-
337
- @keyframes inkSpread {
338
- 0% {
339
- transform: scale(0);
340
- opacity: 0.4;
341
- }
342
- 100% {
343
- transform: scale(var(--ink-effect-spread-scale, 2.5));
344
- opacity: 0;
345
- }
346
- }
347
-
348
- /* Page Layout */
349
- .page-container {
350
- position: relative;
351
- width: 100%;
352
- max-width: var(--page-container-max-width);
353
- margin: 0 auto;
354
- padding: 0 var(--page-container-padding);
355
- animation: fadeInUp 600ms var(--transition-smooth) both;
356
- }
357
-
358
- .page-container--wide {
359
- max-width: var(--page-container-max-width-wide);
360
- }
361
-
362
- .page-card {
363
- background: var(--paper-white);
364
- padding: var(--page-card-padding);
365
- border-radius: var(--page-card-radius);
366
- box-shadow: var(--shadow-card);
367
- position: relative;
368
- overflow: hidden;
369
- }
370
-
371
- .page-card::before {
372
- content: '';
373
- position: absolute;
374
- inset: 0;
375
- border-radius: inherit;
376
- padding: var(--space-fixed-2xs);
377
- background: linear-gradient(135deg, var(--alpha-primary08) 0%, transparent 50%, var(--alpha-primary04) 100%);
378
- -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
379
- -webkit-mask-composite: xor;
380
- mask-composite: exclude;
381
- pointer-events: none;
382
- }
383
-
384
- .page-card--centered {
385
- text-align: center;
386
- }
387
-
388
- /* Page Decoration - Ink effect backgrounds */
389
- .page-decoration {
390
- position: absolute;
391
- border-radius: 50%;
392
- filter: blur(3.75rem);
393
- pointer-events: none;
394
- z-index: 0;
395
- }
396
-
397
- .page-decoration--primary {
398
- background: var(--alpha-primary15);
399
- }
400
-
401
- .page-decoration--success {
402
- background: var(--alpha-success15);
403
- }
404
-
405
- .page-decoration--float {
406
- animation: inkFloat 4s ease-in-out infinite;
407
- }
408
-
409
- .page-decoration--drift {
410
- animation: inkDrift 5s ease-in-out infinite;
411
- }
412
-
413
- /* Buttons */
414
- .button {
415
- height: var(--button-height);
416
- padding: 0 var(--space-lg);
417
- font-family: var(--font-body);
418
- font-size: var(--button-font-size);
419
- font-weight: var(--button-font-weight);
420
- letter-spacing: var(--button-letter-spacing);
421
- border: var(--space-fixed-2xs) solid transparent;
422
- border-radius: var(--button-radius);
423
- cursor: pointer;
424
- transition: background var(--transition-fast), transform var(--transition-fast);
425
- }
426
-
427
- .button-primary {
428
- background: var(--accent-primary);
429
- color: var(--paper-white);
430
- }
431
-
432
- .button-primary:hover:not(:disabled) {
433
- background: var(--accent-primary-hover);
434
- box-shadow: var(--shadow-button-hover-primary);
435
- transform: translateY(calc(-1 * var(--space-fixed-2xs)));
436
- }
437
-
438
- .button-success {
439
- background: var(--accent-success);
440
- color: var(--paper-white);
441
- }
442
-
443
- .button-success:hover:not(:disabled) {
444
- background: var(--accent-success-hover);
445
- box-shadow: var(--shadow-button-hover-success);
446
- transform: translateY(calc(-1 * var(--space-fixed-2xs)));
447
- }
448
-
449
- .button-secondary {
450
- height: var(--button-height-secondary);
451
- background: transparent;
452
- color: var(--ink-dark);
453
- border: var(--space-fixed-2xs) solid var(--ink-faint);
454
- }
455
-
456
- .button-secondary:hover:not(:disabled) {
457
- color: var(--accent-primary);
458
- border-color: var(--accent-primary);
459
- background: var(--alpha-primary04);
460
- }
461
-
462
- .button:disabled {
463
- cursor: not-allowed;
464
- opacity: 0.7;
465
- }
466
-
467
- /* Text Button */
468
- .text-button {
469
- display: inline-flex;
470
- align-items: center;
471
- justify-content: center;
472
- height: var(--button-text-height);
473
- padding: var(--space-sm) var(--space-md);
474
- font-family: var(--font-body);
475
- font-size: var(--button-text-font-size);
476
- font-weight: 500;
477
- color: var(--ink-dark);
478
- background: transparent;
479
- border: none;
480
- border-radius: var(--radius-md);
481
- cursor: pointer;
482
- transition: background var(--transition-fast), color var(--transition-fast);
483
- }
484
-
485
- .text-button:hover {
486
- background: var(--paper-cream);
487
- color: var(--accent-primary);
488
- }
489
-
490
- .text-button-sm {
491
- height: auto;
492
- padding: var(--space-xs) var(--space-sm);
493
- font-size: 0.8125rem;
494
- }
495
-
496
- .text-button-md {
497
- height: auto;
498
- padding: var(--space-sm) var(--space-md);
499
- }
500
-
501
- /* Button Content Layout */
502
- .button-content {
503
- display: flex;
504
- align-items: center;
505
- justify-content: center;
506
- gap: var(--button-content-gap);
507
- }
508
-
509
- .button-icon {
510
- display: flex;
511
- align-items: center;
512
- justify-content: center;
513
- flex-shrink: 0;
514
- }
515
-
516
- .button-text {
517
- flex: 1;
518
- text-align: center;
519
- }
520
-
521
- /* Button Spinner */
522
- .button-spinner {
523
- width: var(--button-spinner-size);
524
- height: var(--button-spinner-size);
525
- border: var(--button-spinner-border-width) solid currentColor;
526
- border-top-color: transparent;
527
- border-radius: 50%;
528
- animation: spin 600ms linear infinite;
529
- }
530
-
531
- /* Button Ink Ripple Effect */
532
- .button-ink {
533
- position: relative;
534
- overflow: hidden;
535
- }
536
-
537
- .button-ink::after {
538
- content: '';
539
- position: absolute;
540
- top: 50%;
541
- left: 50%;
542
- width: 21.875rem;
543
- height: 21.875rem;
544
- background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
545
- transform: translate(-50%, -50%) scale(0);
546
- border-radius: 50%;
547
- pointer-events: none;
548
- transition: transform var(--ink-effect-ripple-duration, 600ms) var(--ink-effect-ripple-easing, cubic-bezier(0.4, 0, 0.2, 1)),
549
- opacity var(--ink-effect-fade-duration, 300ms) ease;
550
- opacity: 0;
551
- }
552
-
553
- .button-ink:hover::after {
554
- transform: translate(-50%, -50%) scale(1);
555
- opacity: 1;
556
- }
557
-
558
- .button-ink:active::after {
559
- transform: translate(-50%, -50%) scale(0.8);
560
- opacity: 0.8;
561
- }
562
-
563
- /* Card */
564
- .card {
565
- background: var(--paper-white);
566
- padding: var(--card-padding);
567
- border-radius: var(--card-radius);
568
- box-shadow: var(--shadow-card);
569
- position: relative;
570
- overflow: hidden;
571
- }
572
-
573
- /* Container */
574
- .container {
575
- position: relative;
576
- width: 100%;
577
- max-width: var(--container-max-width);
578
- }
579
-
580
- .container-wide {
581
- max-width: var(--container-max-width-wide);
582
- }
583
-
584
- /* Form Layout */
585
- .form-header {
586
- text-align: center;
587
- margin-bottom: var(--form-header-margin-bottom);
588
- }
589
-
590
- .form-title {
591
- font-family: var(--font-body);
592
- font-size: var(--title-font-size);
593
- font-weight: var(--title-font-weight);
594
- color: var(--ink-black);
595
- letter-spacing: var(--title-letter-spacing);
596
- animation: slideDown 400ms var(--transition-smooth) 200ms both;
597
- }
598
-
599
- .form-subtitle {
600
- font-size: var(--form-subtitle-font-size);
601
- color: var(--ink-medium);
602
- margin-top: var(--space-sm);
603
- animation: fadeInUp 400ms var(--transition-smooth) 400ms both;
604
- }
605
-
606
- .form-fields {
607
- display: flex;
608
- flex-direction: column;
609
- gap: var(--form-fields-gap);
610
- }
611
-
612
- .form-footer {
613
- margin-top: var(--form-footer-margin-top);
614
- text-align: center;
615
- animation: fadeInUp 400ms var(--transition-smooth) 600ms both;
616
- }
617
-
618
- /* Field Group */
619
- .field-group {
620
- display: flex;
621
- flex-direction: column;
622
- gap: var(--field-group-gap);
623
- }
624
-
625
- .field-label {
626
- display: block;
627
- font-size: var(--label-font-size);
628
- font-weight: var(--label-font-weight);
629
- text-transform: uppercase;
630
- letter-spacing: var(--label-letter-spacing);
631
- color: var(--ink-medium);
632
- transition: color var(--transition-fast);
633
- }
634
-
635
- .field-group.focused .field-label {
636
- color: var(--accent-primary);
637
- }
638
-
639
- .required-mark {
640
- color: var(--accent-primary);
641
- margin-left: var(--space-2xs);
642
- }
643
-
644
- /* Input */
645
- .input {
646
- width: 100%;
647
- padding: var(--input-padding-y) var(--input-padding-x);
648
- font-family: var(--font-body);
649
- font-size: var(--input-font-size);
650
- color: var(--ink-black);
651
- background: var(--paper-cream);
652
- border: var(--space-fixed-2xs) solid transparent;
653
- border-radius: var(--input-radius);
654
- transition: background var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
655
- }
656
-
657
- .input::placeholder {
658
- color: var(--ink-faint);
659
- }
660
-
661
- .input:hover {
662
- background: var(--paper-warm);
663
- }
664
-
665
- .input:focus {
666
- outline: none;
667
- background: var(--paper-white);
668
- border-color: var(--ink-faint);
669
- box-shadow: var(--shadow-input-focus);
670
- }
671
-
672
- /* Label */
673
- .label {
674
- display: block;
675
- font-size: var(--label-font-size);
676
- font-weight: var(--label-font-weight);
677
- text-transform: uppercase;
678
- letter-spacing: var(--label-letter-spacing);
679
- color: var(--ink-medium);
680
- margin-bottom: var(--space-sm);
681
- transition: color var(--transition-fast);
682
- }
683
-
684
- /* Title */
685
- .title {
686
- font-family: var(--font-body);
687
- font-size: var(--title-font-size);
688
- font-weight: var(--title-font-weight);
689
- color: var(--ink-black);
690
- letter-spacing: var(--title-letter-spacing);
691
- }
692
-
693
- /* Feedback */
694
- .error-message {
695
- display: flex;
696
- align-items: flex-start;
697
- gap: var(--feedback-error-gap);
698
- padding: var(--feedback-error-padding);
699
- background: var(--error-bg);
700
- border: var(--space-fixed-2xs) solid var(--error-border);
701
- border-radius: var(--feedback-error-radius);
702
- color: var(--error-base);
703
- animation: slideDown 300ms var(--transition-smooth) both;
704
- }
705
-
706
- .error-icon {
707
- display: flex;
708
- align-items: center;
709
- justify-content: center;
710
- flex-shrink: 0;
711
- width: var(--feedback-error-icon-size);
712
- height: var(--feedback-error-icon-size);
713
- color: var(--error-base);
714
- }
715
-
716
- .error-message.shake {
717
- animation: shake 400ms var(--transition-smooth);
718
- }
719
-
720
- /* Notice */
721
- .notice {
722
- display: flex;
723
- align-items: flex-start;
724
- gap: var(--feedback-notice-gap);
725
- padding: var(--feedback-notice-padding);
726
- border-radius: var(--feedback-notice-radius);
727
- animation: slideUp 400ms var(--transition-smooth) both;
728
- }
729
-
730
- .notice-icon {
731
- display: flex;
732
- align-items: center;
733
- justify-content: center;
734
- flex-shrink: 0;
735
- width: var(--feedback-notice-icon-size);
736
- height: var(--feedback-notice-icon-size);
737
- }
738
-
739
- .notice-success {
740
- background: rgba(53, 122, 70, 0.08);
741
- border: var(--space-fixed-2xs) solid rgba(53, 122, 70, 0.2);
742
- color: var(--accent-success);
743
- }
744
-
745
- .notice-warning {
746
- background: rgba(180, 83, 9, 0.08);
747
- border: var(--space-fixed-2xs) solid rgba(180, 83, 9, 0.2);
748
- color: var(--semantic-warning);
749
- }
750
-
751
- .notice-info {
752
- background: rgba(3, 105, 161, 0.08);
753
- border: var(--space-fixed-2xs) solid rgba(3, 105, 161, 0.2);
754
- color: var(--semantic-info);
755
- }
756
- `, u = kt(jt);
757
- var Et = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Z = (r, e, s, i) => {
758
- for (var t = i > 1 ? void 0 : i ? Bt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
759
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
760
- return i && t && Et(e, s, t), t;
761
- };
762
- let C = class extends d {
763
- constructor() {
764
- super(...arguments), this.disabled = !1, this.loading = !1, this.variant = "primary", this.sx = {};
765
- }
766
- render() {
767
- const r = {
768
- button: !0,
769
- "button-ink": this.variant !== "secondary",
770
- "button-primary": this.variant === "primary",
771
- "button-secondary": this.variant === "secondary",
772
- "button-success": this.variant === "success",
773
- "button--loading": this.loading
774
- };
775
- return l`
776
- <button
777
- part="button"
778
- class=${M(r)}
779
- style=${m(this.sx)}
780
- ?disabled=${this.disabled || this.loading}
781
- type="button"
782
- @click=${this.handleClick}
783
- >
784
- <span class="button-content">
785
- ${this.loading ? l`<div part="spinner" class="button-spinner"></div>` : ""}
786
- <slot></slot>
787
- </span>
788
- </button>
789
- `;
790
- }
791
- handleClick(r) {
792
- this.disabled || this.loading || this.dispatchEvent(
793
- new CustomEvent("tc-click", {
794
- bubbles: !0,
795
- composed: !0,
796
- detail: { originalEvent: r }
797
- })
798
- );
799
- }
800
- };
801
- C.styles = [
802
- u,
803
- c`
804
- :host {
805
- display: block;
806
- width: 100%;
807
- }
808
-
809
- /* Extend base .button from design-tokens */
810
- .button {
811
- position: relative;
812
- width: 100%;
813
- display: flex;
814
- align-items: center;
815
- justify-content: center;
816
- gap: var(--space-sm);
817
- overflow: hidden;
818
- }
819
-
820
- /* Radial gradient glow overlay for primary/success */
821
- .button-ink::before {
822
- content: '';
823
- position: absolute;
824
- inset: 0;
825
- border-radius: inherit;
826
- background: radial-gradient(
827
- circle at center,
828
- transparent 0%,
829
- var(--overlay-glow-white) 100%
830
- );
831
- opacity: var(--opacity-hidden);
832
- transition: opacity 600ms ease;
833
- pointer-events: none;
834
- }
835
-
836
- .button-ink:hover:not(:disabled)::before {
837
- opacity: 1;
838
- }
839
-
840
- /* Loading pulse animation */
841
- .button--loading {
842
- animation: pulse 1s ease-in-out infinite;
843
- }
844
-
845
- @keyframes pulse {
846
- 0%,
847
- 100% {
848
- opacity: var(--opacity-visible);
849
- }
850
- 50% {
851
- opacity: var(--opacity-loading);
852
- }
853
- }
854
-
855
- /* Active states - design-tokens doesn't include these */
856
- .button-primary:active:not(:disabled) {
857
- background: var(--accent-primary-pressed);
858
- transform: translateY(0);
859
- box-shadow: none;
860
- }
861
-
862
- .button-success:active:not(:disabled) {
863
- background: var(--accent-success-pressed);
864
- transform: translateY(0);
865
- box-shadow: none;
866
- }
867
-
868
- .button-secondary:active:not(:disabled) {
869
- background: var(--alpha-primary08);
870
- }
871
-
872
- /* Secondary spinner override */
873
- .button-secondary .button-spinner {
874
- border-color: var(--alpha-primary30);
875
- border-top-color: var(--accent-primary);
876
- }
877
-
878
- /* Focus visible state */
879
- .button:focus-visible {
880
- outline: var(--size-border-width-thick) solid var(--accent-primary);
881
- outline-offset: var(--size-border-width-thick);
882
- }
883
-
884
- /* Reduced motion */
885
- @media (prefers-reduced-motion: reduce) {
886
- .button,
887
- .button-ink::before {
888
- transition-duration: 0.01ms !important;
889
- }
890
-
891
- .button--loading {
892
- animation: none;
893
- }
894
-
895
- .button-spinner {
896
- animation-duration: 1.5s;
897
- }
898
- }
899
- `
900
- ];
901
- Z([
902
- n({ type: Boolean })
903
- ], C.prototype, "disabled", 2);
904
- Z([
905
- n({ type: Boolean })
906
- ], C.prototype, "loading", 2);
907
- Z([
908
- n({ type: String })
909
- ], C.prototype, "variant", 2);
910
- Z([
911
- n({ type: Object })
912
- ], C.prototype, "sx", 2);
913
- C = Z([
914
- p("tc-button")
915
- ], C);
916
- var Mt = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, wt = (r, e, s, i) => {
917
- for (var t = i > 1 ? void 0 : i ? Lt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
918
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
919
- return i && t && Mt(e, s, t), t;
920
- };
921
- let st = class extends d {
922
- constructor() {
923
- super(...arguments), this.variant = "info";
924
- }
925
- render() {
926
- const r = this.variant === "error", e = {
927
- notice: !r,
928
- "notice-info": this.variant === "info",
929
- "notice-success": this.variant === "success",
930
- "notice-warning": this.variant === "warning",
931
- "error-message": r
932
- };
933
- return l`
934
- <div part="callout" class=${M(e)} role="alert">
935
- <div class="callout-inner">
936
- <div part="icon" class="callout-icon">
937
- <slot name="icon"></slot>
938
- </div>
939
- <div part="content" class="callout-content">
940
- <slot></slot>
941
- </div>
942
- </div>
943
- </div>
944
- `;
945
- }
946
- };
947
- st.styles = [
948
- u,
949
- c`
950
- :host {
951
- display: block;
952
- width: 100%;
953
- }
954
-
955
- /* Override animation from design-tokens for immediate display */
956
- .notice {
957
- animation: none;
958
- }
959
-
960
- /* Error variant uses error-message class from design-tokens */
961
- .error-message {
962
- animation: none;
963
- }
964
-
965
- /* Icon + content layout */
966
- .callout-inner {
967
- display: flex;
968
- align-items: flex-start;
969
- gap: var(--space-sm);
970
- }
971
-
972
- .callout-icon {
973
- flex-shrink: 0;
974
- display: flex;
975
- align-items: center;
976
- }
977
-
978
- /* Hide icon container when empty */
979
- .callout-icon:empty {
980
- display: none;
981
- }
982
-
983
- .callout-content {
984
- flex: 1;
985
- min-width: 0;
986
- }
987
- `
988
- ];
989
- wt([
990
- n({ type: String })
991
- ], st.prototype, "variant", 2);
992
- st = wt([
993
- p("tc-callout")
994
- ], st);
995
- var Tt = Object.defineProperty, At = Object.getOwnPropertyDescriptor, pt = (r, e, s, i) => {
996
- for (var t = i > 1 ? void 0 : i ? At(e, s) : e, a = r.length - 1, o; a >= 0; a--)
997
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
998
- return i && t && Tt(e, s, t), t;
999
- };
1000
- let K = class extends d {
1001
- constructor() {
1002
- super(...arguments), this.noBorder = !1, this.sx = {};
1003
- }
1004
- render() {
1005
- const r = {
1006
- card: !0,
1007
- "card--no-border": this.noBorder
1008
- };
1009
- return l`
1010
- <div part="card" class=${M(r)} style=${m(this.sx)}>
1011
- <div class="card-content">
1012
- <slot></slot>
1013
- </div>
1014
- </div>
1015
- `;
1016
- }
1017
- };
1018
- K.styles = [
1019
- u,
1020
- c`
1021
- :host {
1022
- display: block;
1023
- }
1024
-
1025
- /* Inner border effect using mask - extends design-tokens .card */
1026
- .card::before {
1027
- content: '';
1028
- position: absolute;
1029
- inset: 0;
1030
- border-radius: inherit;
1031
- padding: 0.0625rem;
1032
- background: linear-gradient(
1033
- 180deg,
1034
- var(--alpha-white90) 0%,
1035
- var(--alpha-white30) 100%
1036
- );
1037
- mask:
1038
- linear-gradient(#fff 0 0) content-box,
1039
- linear-gradient(#fff 0 0);
1040
- mask-composite: exclude;
1041
- pointer-events: none;
1042
- }
1043
-
1044
- .card--no-border::before {
1045
- display: none;
1046
- }
1047
-
1048
- .card-content {
1049
- position: relative;
1050
- z-index: 1;
1051
- }
1052
- `
1053
- ];
1054
- pt([
1055
- n({ type: Boolean, attribute: "no-border" })
1056
- ], K.prototype, "noBorder", 2);
1057
- pt([
1058
- n({ type: Object })
1059
- ], K.prototype, "sx", 2);
1060
- K = pt([
1061
- p("tc-card")
1062
- ], K);
1063
- var It = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, ht = (r, e, s, i) => {
1064
- for (var t = i > 1 ? void 0 : i ? Ht(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1065
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1066
- return i && t && It(e, s, t), t;
1067
- };
1068
- let N = class extends d {
1069
- constructor() {
1070
- super(...arguments), this.variant = "default", this.size = "md";
1071
- }
1072
- render() {
1073
- return l`
1074
- <span part="chip" class="chip chip--${this.variant} chip--${this.size}">
1075
- <slot></slot>
1076
- </span>
1077
- `;
1078
- }
1079
- };
1080
- N.styles = [
1081
- u,
1082
- c`
1083
- :host {
1084
- display: inline-flex;
1085
- }
1086
-
1087
- .chip {
1088
- display: inline-flex;
1089
- align-items: center;
1090
- justify-content: center;
1091
- border-radius: var(--radius-full);
1092
- font-family: var(--font-body);
1093
- font-weight: 500;
1094
- }
1095
-
1096
- .chip--sm {
1097
- padding: var(--size-chip-padding-sm);
1098
- font-size: var(--font-size-xs);
1099
- }
1100
-
1101
- .chip--md {
1102
- padding: var(--size-chip-padding-md);
1103
- font-size: var(--font-size-sm);
1104
- }
1105
-
1106
- .chip--default {
1107
- background: var(--paper-cream);
1108
- color: var(--ink-dark);
1109
- }
1110
-
1111
- .chip--success {
1112
- background: var(--alpha-success15);
1113
- color: var(--accent-success);
1114
- }
1115
-
1116
- .chip--error {
1117
- background: var(--error-bg);
1118
- color: var(--error-base);
1119
- }
1120
-
1121
- .chip--info {
1122
- background: var(--alpha-primary10);
1123
- color: var(--accent-primary);
1124
- }
1125
- `
1126
- ];
1127
- ht([
1128
- n({ type: String })
1129
- ], N.prototype, "variant", 2);
1130
- ht([
1131
- n({ type: String })
1132
- ], N.prototype, "size", 2);
1133
- N = ht([
1134
- p("tc-chip")
1135
- ], N);
1136
- var Ft = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, ut = (r, e, s, i) => {
1137
- for (var t = i > 1 ? void 0 : i ? Vt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1138
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1139
- return i && t && Ft(e, s, t), t;
1140
- };
1141
- let W = class extends d {
1142
- constructor() {
1143
- super(...arguments), this.wide = !1, this.sx = {}, this.defaultStyles = {
1144
- display: "flex",
1145
- flexDirection: "column",
1146
- alignItems: "center",
1147
- justifyContent: "flex-start"
1148
- };
1149
- }
1150
- render() {
1151
- const r = {
1152
- ...this.defaultStyles,
1153
- ...this.sx
1154
- };
1155
- return l`
1156
- <div
1157
- part="container"
1158
- class="container ${this.wide ? "container--wide" : ""}"
1159
- style=${m(r)}
1160
- >
1161
- <slot></slot>
1162
- </div>
1163
- `;
1164
- }
1165
- };
1166
- W.styles = c`
1167
- :host {
1168
- display: block;
1169
- width: 100%;
1170
- }
1171
-
1172
- .container {
1173
- position: relative;
1174
- width: 100%;
1175
- max-width: var(--container-max-width);
1176
- margin: 0 auto;
1177
- }
1178
-
1179
- .container--wide {
1180
- max-width: var(--container-max-width-wide);
1181
- }
1182
- `;
1183
- ut([
1184
- n({ type: Boolean })
1185
- ], W.prototype, "wide", 2);
1186
- ut([
1187
- n({ type: Object })
1188
- ], W.prototype, "sx", 2);
1189
- W = ut([
1190
- p("tc-container")
1191
- ], W);
1192
- var qt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, ot = (r, e, s, i) => {
1193
- for (var t = i > 1 ? void 0 : i ? Yt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1194
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1195
- return i && t && qt(e, s, t), t;
1196
- };
1197
- let L = class extends d {
1198
- constructor() {
1199
- super(...arguments), this.color = "var(--ink-faint)", this.spacing = "var(--space-md)", this.text = "";
1200
- }
1201
- render() {
1202
- const r = `--divider-color: ${this.color}; --divider-spacing: ${this.spacing};`;
1203
- return this.text ? l`
1204
- <div part="container" class="divider-container" style=${r}>
1205
- <hr part="line" class="divider-line" />
1206
- <span part="text" class="divider-text">${this.text}</span>
1207
- <hr part="line" class="divider-line" />
1208
- </div>
1209
- ` : l`
1210
- <hr part="divider" class="divider" style=${r} />
1211
- `;
1212
- }
1213
- };
1214
- L.styles = c`
1215
- :host {
1216
- display: block;
1217
- width: 100%;
1218
- }
1219
-
1220
- /* Simple divider (no text) */
1221
- .divider {
1222
- border: none;
1223
- height: 1px;
1224
- background-color: var(--divider-color);
1225
- margin: var(--divider-spacing) 0;
1226
- }
1227
-
1228
- /* Divider with text */
1229
- .divider-container {
1230
- display: flex;
1231
- align-items: center;
1232
- gap: var(--space-md);
1233
- margin: var(--divider-spacing) 0;
1234
- }
1235
-
1236
- .divider-line {
1237
- flex: 1;
1238
- border: none;
1239
- height: 1px;
1240
- background-color: var(--divider-color);
1241
- margin: 0;
1242
- }
1243
-
1244
- .divider-text {
1245
- flex-shrink: 0;
1246
- font-size: var(--font-size-sm);
1247
- color: var(--ink-light);
1248
- font-family: var(--font-body);
1249
- }
1250
- `;
1251
- ot([
1252
- n({ type: String })
1253
- ], L.prototype, "color", 2);
1254
- ot([
1255
- n({ type: String })
1256
- ], L.prototype, "spacing", 2);
1257
- ot([
1258
- n({ type: String })
1259
- ], L.prototype, "text", 2);
1260
- L = ot([
1261
- p("tc-divider")
1262
- ], L);
1263
- var Ut = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, H = (r, e, s, i) => {
1264
- for (var t = i > 1 ? void 0 : i ? Rt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1265
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1266
- return i && t && Ut(e, s, t), t;
1267
- };
1268
- let b = class extends d {
1269
- constructor() {
1270
- super(...arguments), this.title = "", this.subtitle = "", this.notice = "", this.noAnimation = !1, this.sx = {};
1271
- }
1272
- render() {
1273
- const r = !this.noAnimation;
1274
- return l`
1275
- <header part="header" class="header" style=${m(this.sx)}>
1276
- ${this.title ? l`<h1 part="title" class="form-title ${r ? "form-title--animated" : ""}">
1277
- ${this.title}
1278
- </h1>` : ""}
1279
- ${this.subtitle ? l`<p part="subtitle" class="form-subtitle ${r ? "form-subtitle--animated" : ""}">
1280
- ${this.subtitle}
1281
- </p>` : ""}
1282
- ${this.notice ? l`<div part="notice" class="notice ${r ? "notice--animated" : ""}">
1283
- ${this.notice}
1284
- </div>` : ""}
1285
- </header>
1286
- `;
1287
- }
1288
- };
1289
- b.styles = [
1290
- u,
1291
- c`
1292
- :host {
1293
- display: block;
1294
- text-align: center;
1295
- }
1296
-
1297
- .header {
1298
- display: flex;
1299
- flex-direction: column;
1300
- align-items: center;
1301
- gap: var(--space-sm);
1302
- }
1303
-
1304
- /* Extend design-tokens .form-title */
1305
- .form-title {
1306
- margin: 0;
1307
- line-height: 1.2;
1308
- }
1309
-
1310
- .form-title--animated {
1311
- animation: slideDown var(--duration-fast) var(--easing-ease-in-out) backwards;
1312
- }
1313
-
1314
- /* Extend design-tokens .form-subtitle */
1315
- .form-subtitle {
1316
- margin: 0;
1317
- max-width: 28ch;
1318
- }
1319
-
1320
- .form-subtitle--animated {
1321
- animation: slideUp var(--duration-smooth) var(--easing-ease-in-out) 100ms backwards;
1322
- }
1323
-
1324
- .notice {
1325
- margin-top: var(--space-sm);
1326
- padding: var(--space-sm) var(--space-md);
1327
- background: var(--paper-warm);
1328
- border-radius: var(--radius-md);
1329
- font-size: var(--font-size-sm);
1330
- color: var(--ink-medium);
1331
- }
1332
-
1333
- .notice--animated {
1334
- animation: noticeReveal 500ms var(--easing-ease-in-out) 200ms backwards;
1335
- }
1336
-
1337
- @keyframes noticeReveal {
1338
- from {
1339
- opacity: 0;
1340
- transform: scale(0.95);
1341
- }
1342
- to {
1343
- opacity: 1;
1344
- transform: scale(1);
1345
- }
1346
- }
1347
-
1348
- /* Reduced motion */
1349
- @media (prefers-reduced-motion: reduce) {
1350
- .form-title--animated,
1351
- .form-subtitle--animated,
1352
- .notice--animated {
1353
- animation: none;
1354
- }
1355
- }
1356
- `
1357
- ];
1358
- H([
1359
- n({ type: String })
1360
- ], b.prototype, "title", 2);
1361
- H([
1362
- n({ type: String })
1363
- ], b.prototype, "subtitle", 2);
1364
- H([
1365
- n({ type: String })
1366
- ], b.prototype, "notice", 2);
1367
- H([
1368
- n({ type: Boolean, attribute: "no-animation" })
1369
- ], b.prototype, "noAnimation", 2);
1370
- H([
1371
- n({ type: Object })
1372
- ], b.prototype, "sx", 2);
1373
- b = H([
1374
- p("tc-form-header")
1375
- ], b);
1376
- var Kt = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, nt = (r, e, s, i) => {
1377
- for (var t = i > 1 ? void 0 : i ? Nt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1378
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1379
- return i && t && Kt(e, s, t), t;
1380
- };
1381
- const Wt = {
1382
- "arrow-left": l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>`,
1383
- "arrow-right": l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"/></svg>`,
1384
- check: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>`,
1385
- x: l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>`,
1386
- close: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>`,
1387
- "chevron-right": l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>`,
1388
- "chevron-left": l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>`,
1389
- error: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>`,
1390
- "alert-circle": l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>`,
1391
- info: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>`,
1392
- warning: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>`,
1393
- loading: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg>`,
1394
- loader: l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="2" x2="12" y2="6"></line><line x1="12" y1="18" x2="12" y2="22"></line><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line><line x1="2" y1="12" x2="6" y2="12"></line><line x1="18" y1="12" x2="22" y2="12"></line><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line></svg>`,
1395
- biometric: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12.01 2c2.13 0 3.99.47 6.03 1.52.25.13.34.43.21.67-.09.18-.26.28-.44.28zM3.5 9.72c-.1 0-.2-.03-.29-.09-.23-.16-.28-.47-.12-.7.99-1.4 2.25-2.5 3.75-3.27C9.98 4.04 14 4.03 17.15 5.65c1.5.77 2.76 1.86 3.75 3.25.16.22.11.54-.12.7-.23.16-.54.11-.7-.12-.9-1.26-2.04-2.25-3.39-2.94-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5 1.7-3.4 2.96-.08.14-.23.21-.39.21zm6.25 12.07c-.13 0-.26-.05-.35-.15-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34 0-2.97 2.54-5.39 5.66-5.39s5.66 2.42 5.66 5.39c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39-2.57 0-4.66 1.97-4.66 4.39 0 1.44.32 2.77.93 3.85.64 1.15 1.08 1.64 1.85 2.42.19.2.19.51 0 .71-.11.1-.24.15-.37.15zm7.17-1.85c-1.19 0-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39 0-.28.22-.5.5-.5s.5.22.5.5c0 1.41.72 2.74 1.94 3.56.71.48 1.54.71 2.54.71.24 0 .64-.03 1.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12zM14.91 22c-.04 0-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1-1.4-1.39-2.17-3.24-2.17-5.22 0-1.62 1.38-2.94 3.08-2.94 1.7 0 3.08 1.32 3.08 2.94 0 1.07.93 1.94 2.08 1.94s2.08-.87 2.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84 0-5.44 1.58-6.61 4.03-.39.81-.59 1.76-.59 2.8 0 .78.07 2.01.67 3.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29-.49-1.31-.73-2.61-.73-3.96 0-1.2.23-2.29.68-3.24 1.33-2.79 4.28-4.6 7.51-4.6 4.55 0 8.25 3.51 8.25 7.83 0 1.62-1.38 2.94-3.08 2.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08 1.94c0 1.71.66 3.31 1.87 4.51.95.94 1.86 1.46 3.27 1.85.27.07.42.35.35.61-.05.23-.26.38-.47.38z"/></svg>`,
1396
- email: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>`,
1397
- passkey: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 2-2.93-2-2.07zm-14 2c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/></svg>`,
1398
- bell: l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg>`,
1399
- download: l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>`,
1400
- "wifi-off": l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M16.72 11.06A10.94 10.94 0 0 1 19 12.55"></path><path d="M5 12.55a10.94 10.94 0 0 1 5.17-2.39"></path><path d="M10.71 5.05A16 16 0 0 1 22.58 9"></path><path d="M1.42 9a15.91 15.91 0 0 1 4.7-2.88"></path><path d="M8.53 16.11a6 6 0 0 1 6.95 0"></path><line x1="12" y1="20" x2="12.01" y2="20"></line></svg>`,
1401
- // Brand icons
1402
- apple: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>`,
1403
- google: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"/><path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/></svg>`,
1404
- windows: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M3 12V6.75l6-1.32v6.48L3 12zm17-9v8.75l-10 .15V5.21L20 3zM3 13l6 .09v6.81l-6-1.15V13zm17 .25V22l-10-1.91V13.1l10 .15z"/></svg>`,
1405
- samsung: l`<svg viewBox="0 0 24 24"><text x="12" y="17" font-size="18" font-weight="700" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" text-anchor="middle" fill="currentColor">S</text></svg>`,
1406
- // General icons
1407
- phone: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/></svg>`,
1408
- success: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>`,
1409
- lock: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>`,
1410
- person: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>`,
1411
- device: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M15 7v4h1v2h-3V5h2l-3-4-3 4h2v8H8v-2.07c.7-.37 1.2-1.08 1.2-1.93 0-1.21-.99-2.2-2.2-2.2-1.21 0-2.2.99-2.2 2.2 0 .85.5 1.56 1.2 1.93V13c0 1.11.89 2 2 2h3v3.05c-.71.37-1.2 1.1-1.2 1.95 0 1.22.99 2.2 2.2 2.2 1.21 0 2.2-.98 2.2-2.2 0-.85-.49-1.58-1.2-1.95V15h3c1.11 0 2-.89 2-2v-2h1V7h-4z"/></svg>`,
1412
- // Auth icons
1413
- totp: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg>`,
1414
- "email-otp": l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>`,
1415
- qrcode: l`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M3 11h8V3H3v8zm2-6h4v4H5V5zM3 21h8v-8H3v8zm2-6h4v4H5v-4zM13 3v8h8V3h-8zm6 6h-4V5h4v4zM13 13h2v2h-2zM15 15h2v2h-2zM13 17h2v2h-2zM15 19h2v2h-2zM17 17h2v2h-2zM17 13h2v2h-2zM19 15h2v2h-2zM19 19h2v2h-2z"/><path d="M6 6h2v2H6zM6 16h2v2H6zM16 6h2v2h-2z"/></svg>`,
1416
- key: l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"/></svg>`
1417
- };
1418
- let T = class extends d {
1419
- constructor() {
1420
- super(...arguments), this.name = "info", this.size = "1.5rem", this.color = "currentColor";
1421
- }
1422
- render() {
1423
- const r = Wt[this.name];
1424
- return r ? l`
1425
- <span
1426
- part="icon"
1427
- class="icon"
1428
- style="--icon-size: ${this.size}; --icon-color: ${this.color};"
1429
- >
1430
- ${r}
1431
- </span>
1432
- ` : (console.warn(`Icon "${this.name}" not found`), l``);
1433
- }
1434
- };
1435
- T.styles = c`
1436
- :host {
1437
- display: inline-flex;
1438
- align-items: center;
1439
- justify-content: center;
1440
- }
1441
-
1442
- .icon {
1443
- display: flex;
1444
- align-items: center;
1445
- justify-content: center;
1446
- }
1447
-
1448
- svg {
1449
- width: var(--icon-size);
1450
- height: var(--icon-size);
1451
- color: var(--icon-color);
1452
- }
1453
- `;
1454
- nt([
1455
- n({ type: String })
1456
- ], T.prototype, "name", 2);
1457
- nt([
1458
- n({ type: String })
1459
- ], T.prototype, "size", 2);
1460
- nt([
1461
- n({ type: String })
1462
- ], T.prototype, "color", 2);
1463
- T = nt([
1464
- p("tc-icon")
1465
- ], T);
1466
- var Xt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, v = (r, e, s, i) => {
1467
- for (var t = i > 1 ? void 0 : i ? Gt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1468
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1469
- return i && t && Xt(e, s, t), t;
1470
- };
1471
- let h = class extends d {
1472
- constructor() {
1473
- super(...arguments), this.label = "", this.type = "text", this.placeholder = "", this.value = "", this.error = "", this.disabled = !1, this.required = !1, this.name = "", this.autocomplete = "", this.inputmode = "", this.maxlength = 0, this.sx = {}, this.inputId = `tc-input-${Math.random().toString(36).slice(2)}`, this.isFocused = !1;
1474
- }
1475
- render() {
1476
- const r = this.error.length > 0, e = {
1477
- "field-group": !0,
1478
- focused: this.isFocused,
1479
- "has-error": r
1480
- }, s = {
1481
- "input-wrapper": !0,
1482
- focused: this.isFocused,
1483
- "has-error": r
1484
- }, i = {
1485
- input: !0,
1486
- "has-error": r
1487
- };
1488
- return l`
1489
- <div class=${M(e)}>
1490
- ${this.label ? l`<label part="label" class="field-label" for=${this.inputId}>${this.label}</label>` : ""}
1491
- <div part="wrapper" class=${M(s)}>
1492
- <input
1493
- part="input"
1494
- id=${this.inputId}
1495
- class=${M(i)}
1496
- type=${this.type}
1497
- name=${this.name}
1498
- placeholder=${this.placeholder}
1499
- .value=${this.value}
1500
- ?disabled=${this.disabled}
1501
- ?required=${this.required}
1502
- autocomplete=${this.autocomplete || "off"}
1503
- inputmode=${this.inputmode || ""}
1504
- maxlength=${this.maxlength || ""}
1505
- aria-invalid=${r ? "true" : "false"}
1506
- aria-describedby=${r ? `${this.inputId}-error` : ""}
1507
- style=${m(this.sx)}
1508
- @input=${this.handleInput}
1509
- @focus=${this.handleFocus}
1510
- @blur=${this.handleBlur}
1511
- @keydown=${this.handleKeydown}
1512
- @paste=${this.handlePaste}
1513
- />
1514
- <div part="ink-line" class="ink-line"></div>
1515
- </div>
1516
- ${r ? l`<p part="error" id="${this.inputId}-error" class="input-error-text" role="alert">
1517
- ${this.error}
1518
- </p>` : ""}
1519
- </div>
1520
- `;
1521
- }
1522
- handleInput(r) {
1523
- const e = r.target;
1524
- this.value = e.value, this.dispatchEvent(
1525
- new CustomEvent("tc-input", {
1526
- bubbles: !0,
1527
- composed: !0,
1528
- detail: { value: e.value }
1529
- })
1530
- );
1531
- }
1532
- handleFocus() {
1533
- this.isFocused = !0;
1534
- }
1535
- handleBlur(r) {
1536
- const e = r.target;
1537
- this.isFocused = !1, this.dispatchEvent(
1538
- new CustomEvent("tc-blur", {
1539
- bubbles: !0,
1540
- composed: !0,
1541
- detail: { value: e.value }
1542
- })
1543
- );
1544
- }
1545
- handleKeydown(r) {
1546
- this.dispatchEvent(
1547
- new CustomEvent("tc-keydown", {
1548
- bubbles: !0,
1549
- composed: !0,
1550
- detail: { key: r.key, value: this.value, originalEvent: r }
1551
- })
1552
- );
1553
- }
1554
- handlePaste(r) {
1555
- this.dispatchEvent(
1556
- new CustomEvent("tc-paste", {
1557
- bubbles: !0,
1558
- composed: !0,
1559
- detail: { data: r.clipboardData?.getData("text"), originalEvent: r }
1560
- })
1561
- );
1562
- }
1563
- focus() {
1564
- this.shadowRoot?.querySelector("input")?.focus();
1565
- }
1566
- };
1567
- h.styles = [
1568
- u,
1569
- c`
1570
- :host {
1571
- display: block;
1572
- }
1573
-
1574
- /* Extend design-tokens .field-group */
1575
- .field-group {
1576
- width: 100%;
1577
- }
1578
-
1579
- /* Label color change on focus - extends design-tokens .field-label */
1580
- .field-group.focused .field-label {
1581
- color: var(--accent-primary);
1582
- }
1583
-
1584
- .field-group.has-error .field-label {
1585
- color: var(--error-base);
1586
- }
1587
-
1588
- .input-wrapper {
1589
- position: relative;
1590
- width: 100%;
1591
- }
1592
-
1593
- /* Extend design-tokens .input */
1594
- .input {
1595
- width: 100%;
1596
- box-sizing: border-box;
1597
- }
1598
-
1599
- .input:disabled {
1600
- opacity: var(--opacity-disabled);
1601
- cursor: not-allowed;
1602
- }
1603
-
1604
- /* Ink line animation */
1605
- .ink-line {
1606
- position: absolute;
1607
- bottom: 0;
1608
- left: 50%;
1609
- transform: translateX(-50%);
1610
- width: 0;
1611
- height: 0.125rem;
1612
- background: linear-gradient(
1613
- 90deg,
1614
- var(--accent-primary) 0%,
1615
- var(--accent-primary-hover) 100%
1616
- );
1617
- border-radius: 0.0625rem;
1618
- transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
1619
- pointer-events: none;
1620
- }
1621
-
1622
- .input-wrapper.focused .ink-line {
1623
- width: 60%;
1624
- }
1625
-
1626
- /* Error states */
1627
- .input.has-error {
1628
- border-color: var(--error-base);
1629
- background: var(--error-bg);
1630
- }
1631
-
1632
- .input.has-error:focus {
1633
- border-color: var(--error-base);
1634
- box-shadow: 0 0 0 0.1875rem var(--error-border);
1635
- }
1636
-
1637
- .input-wrapper.has-error .ink-line {
1638
- background: linear-gradient(
1639
- 90deg,
1640
- var(--error-base) 0%,
1641
- var(--error-base) 100%
1642
- );
1643
- }
1644
-
1645
- .input-error-text {
1646
- font-size: var(--font-size-sm);
1647
- color: var(--error-base);
1648
- margin: 0;
1649
- animation: slideDown 300ms ease backwards;
1650
- }
1651
-
1652
- @keyframes slideDown {
1653
- from {
1654
- opacity: 0;
1655
- transform: translateY(-0.25rem);
1656
- }
1657
- to {
1658
- opacity: 1;
1659
- transform: translateY(0);
1660
- }
1661
- }
1662
-
1663
- /* Reduced motion */
1664
- @media (prefers-reduced-motion: reduce) {
1665
- .field-label,
1666
- .input,
1667
- .ink-line,
1668
- .input-error-text {
1669
- transition-duration: 0.01ms !important;
1670
- animation-duration: 0.01ms !important;
1671
- }
1672
- }
1673
- `
1674
- ];
1675
- v([
1676
- n({ type: String })
1677
- ], h.prototype, "label", 2);
1678
- v([
1679
- n({ type: String })
1680
- ], h.prototype, "type", 2);
1681
- v([
1682
- n({ type: String })
1683
- ], h.prototype, "placeholder", 2);
1684
- v([
1685
- n({ type: String })
1686
- ], h.prototype, "value", 2);
1687
- v([
1688
- n({ type: String })
1689
- ], h.prototype, "error", 2);
1690
- v([
1691
- n({ type: Boolean })
1692
- ], h.prototype, "disabled", 2);
1693
- v([
1694
- n({ type: Boolean })
1695
- ], h.prototype, "required", 2);
1696
- v([
1697
- n({ type: String })
1698
- ], h.prototype, "name", 2);
1699
- v([
1700
- n({ type: String })
1701
- ], h.prototype, "autocomplete", 2);
1702
- v([
1703
- n({ type: String })
1704
- ], h.prototype, "inputmode", 2);
1705
- v([
1706
- n({ type: Number })
1707
- ], h.prototype, "maxlength", 2);
1708
- v([
1709
- n({ type: Object })
1710
- ], h.prototype, "sx", 2);
1711
- v([
1712
- S()
1713
- ], h.prototype, "inputId", 2);
1714
- v([
1715
- S()
1716
- ], h.prototype, "isFocused", 2);
1717
- h = v([
1718
- p("tc-input")
1719
- ], h);
1720
- var Qt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, lt = (r, e, s, i) => {
1721
- for (var t = i > 1 ? void 0 : i ? Jt(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1722
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1723
- return i && t && Qt(e, s, t), t;
1724
- };
1725
- let A = class extends d {
1726
- constructor() {
1727
- super(...arguments), this.gap = "var(--space-md)", this.padding = "var(--space-md)", this.sx = {};
1728
- }
1729
- render() {
1730
- const r = {
1731
- "--item-padding": this.padding,
1732
- "--item-gap": this.gap,
1733
- ...this.sx
1734
- };
1735
- return l`
1736
- <div part="item" class="item" style=${m(r)}>
1737
- <div part="prefix" class="prefix">
1738
- <slot name="prefix"></slot>
1739
- </div>
1740
- <div part="content" class="content">
1741
- <slot></slot>
1742
- </div>
1743
- <div part="suffix" class="suffix">
1744
- <slot name="suffix"></slot>
1745
- </div>
1746
- </div>
1747
- `;
1748
- }
1749
- };
1750
- A.styles = c`
1751
- :host {
1752
- display: block;
1753
- width: 100%;
1754
- }
1755
-
1756
- .item {
1757
- display: flex;
1758
- align-items: center;
1759
- width: 100%;
1760
- padding: var(--item-padding);
1761
- gap: var(--item-gap);
1762
- background: var(--paper-cream);
1763
- border-radius: var(--radius-md);
1764
- box-sizing: border-box;
1765
- }
1766
-
1767
- .prefix {
1768
- flex-shrink: 0;
1769
- display: flex;
1770
- align-items: center;
1771
- justify-content: center;
1772
- }
1773
-
1774
- .content {
1775
- flex: 1;
1776
- min-width: 0;
1777
- font-family: var(--font-body);
1778
- font-size: var(--font-size-base);
1779
- color: var(--ink-dark);
1780
- }
1781
-
1782
- .suffix {
1783
- flex-shrink: 0;
1784
- display: flex;
1785
- align-items: center;
1786
- justify-content: center;
1787
- }
1788
-
1789
- /* Hide empty slots */
1790
- .prefix:not(:has(*)),
1791
- .suffix:not(:has(*)) {
1792
- display: none;
1793
- }
1794
- `;
1795
- lt([
1796
- n({ type: String })
1797
- ], A.prototype, "gap", 2);
1798
- lt([
1799
- n({ type: String })
1800
- ], A.prototype, "padding", 2);
1801
- lt([
1802
- n({ type: Object })
1803
- ], A.prototype, "sx", 2);
1804
- A = lt([
1805
- p("tc-item")
1806
- ], A);
1807
- var Zt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, F = (r, e, s, i) => {
1808
- for (var t = i > 1 ? void 0 : i ? te(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1809
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1810
- return i && t && Zt(e, s, t), t;
1811
- };
1812
- let y = class extends d {
1813
- constructor() {
1814
- super(...arguments), this.gap = "var(--space-md)", this.padding = "var(--space-md)", this.disabled = !1, this.showArrow = !0, this.sx = {};
1815
- }
1816
- handleClick() {
1817
- this.disabled || this.dispatchEvent(
1818
- new CustomEvent("tc-click", {
1819
- bubbles: !0,
1820
- composed: !0
1821
- })
1822
- );
1823
- }
1824
- render() {
1825
- const r = {
1826
- "--item-padding": this.padding,
1827
- "--item-gap": this.gap,
1828
- ...this.sx
1829
- };
1830
- return l`
1831
- <button
1832
- part="button"
1833
- class="button"
1834
- ?disabled=${this.disabled}
1835
- style=${m(r)}
1836
- @click=${this.handleClick}
1837
- >
1838
- <div part="prefix" class="prefix">
1839
- <slot name="prefix"></slot>
1840
- </div>
1841
- <div part="content" class="content">
1842
- <slot></slot>
1843
- </div>
1844
- <div part="suffix" class="suffix">
1845
- <slot name="suffix"></slot>
1846
- </div>
1847
- ${this.showArrow ? l`
1848
- <svg
1849
- part="arrow"
1850
- class="arrow"
1851
- viewBox="0 0 24 24"
1852
- fill="none"
1853
- stroke="currentColor"
1854
- stroke-width="2"
1855
- stroke-linecap="round"
1856
- stroke-linejoin="round"
1857
- >
1858
- <polyline points="9 18 15 12 9 6"></polyline>
1859
- </svg>
1860
- ` : ""}
1861
- </button>
1862
- `;
1863
- }
1864
- };
1865
- y.styles = c`
1866
- :host {
1867
- display: block;
1868
- width: 100%;
1869
- }
1870
-
1871
- .button {
1872
- display: flex;
1873
- align-items: center;
1874
- width: 100%;
1875
- padding: var(--item-padding);
1876
- gap: var(--item-gap);
1877
- background: var(--paper-cream);
1878
- border: none;
1879
- border-radius: var(--radius-md);
1880
- box-sizing: border-box;
1881
- cursor: pointer;
1882
- font-family: inherit;
1883
- text-align: left;
1884
- transition: var(--transition-fast);
1885
- }
1886
-
1887
- .button:hover:not(:disabled) {
1888
- background: var(--paper-warm);
1889
- }
1890
-
1891
- .button:active:not(:disabled) {
1892
- transform: scale(0.995);
1893
- }
1894
-
1895
- .button:focus-visible {
1896
- outline: 2px solid var(--accent-primary);
1897
- outline-offset: 2px;
1898
- }
1899
-
1900
- .button:disabled {
1901
- opacity: 0.6;
1902
- cursor: not-allowed;
1903
- }
1904
-
1905
- .prefix {
1906
- flex-shrink: 0;
1907
- display: flex;
1908
- align-items: center;
1909
- justify-content: center;
1910
- }
1911
-
1912
- .content {
1913
- flex: 1;
1914
- min-width: 0;
1915
- font-family: var(--font-body);
1916
- font-size: var(--font-size-base);
1917
- color: var(--ink-dark);
1918
- }
1919
-
1920
- .suffix {
1921
- flex-shrink: 0;
1922
- display: flex;
1923
- align-items: center;
1924
- justify-content: center;
1925
- }
1926
-
1927
- .arrow {
1928
- flex-shrink: 0;
1929
- width: 1.25rem;
1930
- height: 1.25rem;
1931
- color: var(--ink-light);
1932
- transition: var(--transition-fast);
1933
- }
1934
-
1935
- .button:hover:not(:disabled) .arrow {
1936
- color: var(--ink-medium);
1937
- transform: translateX(2px);
1938
- }
1939
-
1940
- /* Hide empty slots */
1941
- .prefix:not(:has(*)),
1942
- .suffix:not(:has(*)) {
1943
- display: none;
1944
- }
1945
-
1946
- /* Hide arrow when suffix has content */
1947
- .suffix:has(*) + .arrow {
1948
- display: none;
1949
- }
1950
- `;
1951
- F([
1952
- n({ type: String })
1953
- ], y.prototype, "gap", 2);
1954
- F([
1955
- n({ type: String })
1956
- ], y.prototype, "padding", 2);
1957
- F([
1958
- n({ type: Boolean })
1959
- ], y.prototype, "disabled", 2);
1960
- F([
1961
- n({ type: Boolean, attribute: "show-arrow" })
1962
- ], y.prototype, "showArrow", 2);
1963
- F([
1964
- n({ type: Object })
1965
- ], y.prototype, "sx", 2);
1966
- y = F([
1967
- p("tc-item-button")
1968
- ], y);
1969
- var ee = Object.defineProperty, re = Object.getOwnPropertyDescriptor, V = (r, e, s, i) => {
1970
- for (var t = i > 1 ? void 0 : i ? re(e, s) : e, a = r.length - 1, o; a >= 0; a--)
1971
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
1972
- return i && t && ee(e, s, t), t;
1973
- };
1974
- let w = class extends d {
1975
- constructor() {
1976
- super(...arguments), this.length = 6, this.error = !1, this.disabled = !1, this.showProgress = !0, this.values = [];
1977
- }
1978
- connectedCallback() {
1979
- super.connectedCallback(), this.values = new Array(this.length).fill("");
1980
- }
1981
- render() {
1982
- const e = this.values.filter((s) => s.length > 0).length / this.length * 100;
1983
- return l`
1984
- <div class="container">
1985
- <div part="cells" class="cells" role="group" aria-label="OTP input">
1986
- ${this.values.map((s, i) => {
1987
- const a = [
1988
- "cell",
1989
- s.length > 0 ? "cell--filled" : "",
1990
- this.error ? "cell--error" : ""
1991
- ].filter(Boolean).join(" ");
1992
- return l`
1993
- <input
1994
- part="cell"
1995
- class=${a}
1996
- type="text"
1997
- inputmode="numeric"
1998
- maxlength="1"
1999
- pattern="[0-9]"
2000
- .value=${s}
2001
- ?disabled=${this.disabled}
2002
- aria-label="Digit ${i + 1}"
2003
- @input=${(o) => this.handleInput(o, i)}
2004
- @keydown=${(o) => this.handleKeydown(o, i)}
2005
- @paste=${(o) => this.handlePaste(o)}
2006
- />
2007
- `;
2008
- })}
2009
- </div>
2010
- ${this.showProgress ? l`
2011
- <div part="progress" class="progress">
2012
- <div
2013
- part="progress-bar"
2014
- class="progress-bar"
2015
- style="width: ${e}%"
2016
- ></div>
2017
- </div>
2018
- ` : ""}
2019
- </div>
2020
- `;
2021
- }
2022
- handleInput(r, e) {
2023
- const i = r.target.value.replace(/\D/g, "").slice(0, 1);
2024
- this.values = [...this.values], this.values[e] = i, this.dispatchEvent(
2025
- new CustomEvent("tc-change", {
2026
- bubbles: !0,
2027
- composed: !0,
2028
- detail: { value: this.values.join(""), values: [...this.values] }
2029
- })
2030
- ), i && e < this.length - 1 && this.focusCell(e + 1), this.values.every((t) => t.length > 0) && this.dispatchEvent(
2031
- new CustomEvent("tc-complete", {
2032
- bubbles: !0,
2033
- composed: !0,
2034
- detail: { value: this.values.join("") }
2035
- })
2036
- );
2037
- }
2038
- handleKeydown(r, e) {
2039
- r.key === "Backspace" && !this.values[e] && e > 0 ? (r.preventDefault(), this.values = [...this.values], this.values[e - 1] = "", this.focusCell(e - 1)) : r.key === "ArrowLeft" && e > 0 ? (r.preventDefault(), this.focusCell(e - 1)) : r.key === "ArrowRight" && e < this.length - 1 && (r.preventDefault(), this.focusCell(e + 1));
2040
- }
2041
- handlePaste(r) {
2042
- r.preventDefault();
2043
- const s = (r.clipboardData?.getData("text") || "").replace(/\D/g, "").slice(0, this.length);
2044
- if (s) {
2045
- this.values = new Array(this.length).fill(""), s.split("").forEach((t, a) => {
2046
- this.values[a] = t;
2047
- }), this.values = [...this.values];
2048
- const i = Math.min(s.length, this.length - 1);
2049
- this.focusCell(i), this.dispatchEvent(
2050
- new CustomEvent("tc-change", {
2051
- bubbles: !0,
2052
- composed: !0,
2053
- detail: { value: this.values.join(""), values: [...this.values] }
2054
- })
2055
- ), s.length >= this.length && this.dispatchEvent(
2056
- new CustomEvent("tc-complete", {
2057
- bubbles: !0,
2058
- composed: !0,
2059
- detail: { value: this.values.join("") }
2060
- })
2061
- );
2062
- }
2063
- }
2064
- focusCell(r) {
2065
- requestAnimationFrame(() => {
2066
- this.shadowRoot?.querySelectorAll(
2067
- ".cell"
2068
- )?.[r]?.focus();
2069
- });
2070
- }
2071
- /** Focus the first empty cell or the last cell */
2072
- focus() {
2073
- const r = this.values.findIndex((s) => !s), e = r >= 0 ? r : this.length - 1;
2074
- this.focusCell(e);
2075
- }
2076
- /** Clear all values */
2077
- clear() {
2078
- this.values = new Array(this.length).fill(""), this.focusCell(0);
2079
- }
2080
- /** Get the current OTP value */
2081
- getValue() {
2082
- return this.values.join("");
2083
- }
2084
- };
2085
- w.styles = [
2086
- u,
2087
- c`
2088
- :host {
2089
- display: block;
2090
- }
2091
-
2092
- .container {
2093
- display: flex;
2094
- flex-direction: column;
2095
- align-items: center;
2096
- gap: var(--space-md);
2097
- }
2098
-
2099
- .cells {
2100
- display: flex;
2101
- gap: var(--space-sm);
2102
- justify-content: center;
2103
- }
2104
-
2105
- .cell {
2106
- width: clamp(2.625rem, 2.35rem + 1.36vw, 3rem);
2107
- height: clamp(3.125rem, 2.78rem + 1.74vw, 3.5rem);
2108
- border: var(--size-border-width-thick) solid transparent;
2109
- border-radius: var(--radius-md);
2110
- background: var(--paper-cream);
2111
- font-family: var(--font-body);
2112
- font-size: clamp(1.25rem, 1.14rem + 0.54vw, 1.5rem);
2113
- font-weight: 600;
2114
- text-align: center;
2115
- color: var(--ink-black);
2116
- transition: all var(--duration-instant) ease;
2117
- caret-color: var(--accent-primary);
2118
- }
2119
-
2120
- .cell:focus {
2121
- outline: none;
2122
- background: var(--paper-white);
2123
- border-color: var(--accent-primary);
2124
- box-shadow: var(--shadow-otp-cell-focus);
2125
- }
2126
-
2127
- .cell--filled {
2128
- background: var(--paper-white);
2129
- border-color: var(--ink-faint);
2130
- }
2131
-
2132
- .cell--error {
2133
- border-color: var(--error-base) !important;
2134
- animation: shake var(--duration-smooth) ease;
2135
- }
2136
-
2137
- .cell:disabled {
2138
- opacity: var(--opacity-disabled);
2139
- cursor: not-allowed;
2140
- }
2141
-
2142
- /* Progress bar */
2143
- .progress {
2144
- width: 100%;
2145
- max-width: 12rem;
2146
- height: var(--size-border-width-heavy);
2147
- background: var(--paper-warm);
2148
- border-radius: var(--radius-full);
2149
- overflow: hidden;
2150
- }
2151
-
2152
- .progress-bar {
2153
- height: 100%;
2154
- background: linear-gradient(
2155
- 90deg,
2156
- var(--accent-primary) 0%,
2157
- var(--accent-primary-hover) 100%
2158
- );
2159
- transition: width var(--duration-instant) ease;
2160
- }
2161
-
2162
- /* Reduced motion */
2163
- @media (prefers-reduced-motion: reduce) {
2164
- .cell,
2165
- .progress-bar {
2166
- transition-duration: 0.01ms !important;
2167
- }
2168
-
2169
- .cell--error {
2170
- animation: none;
2171
- }
2172
- }
2173
- `
2174
- ];
2175
- V([
2176
- n({ type: Number })
2177
- ], w.prototype, "length", 2);
2178
- V([
2179
- n({ type: Boolean })
2180
- ], w.prototype, "error", 2);
2181
- V([
2182
- n({ type: Boolean })
2183
- ], w.prototype, "disabled", 2);
2184
- V([
2185
- n({ type: Boolean, attribute: "show-progress" })
2186
- ], w.prototype, "showProgress", 2);
2187
- V([
2188
- S()
2189
- ], w.prototype, "values", 2);
2190
- w = V([
2191
- p("tc-otp-input")
2192
- ], w);
2193
- var ie = Object.defineProperty, se = Object.getOwnPropertyDescriptor, vt = (r, e, s, i) => {
2194
- for (var t = i > 1 ? void 0 : i ? se(e, s) : e, a = r.length - 1, o; a >= 0; a--)
2195
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
2196
- return i && t && ie(e, s, t), t;
2197
- };
2198
- let X = class extends d {
2199
- constructor() {
2200
- super(...arguments), this.gap = "var(--space-md)", this.sx = {};
2201
- }
2202
- render() {
2203
- const r = {
2204
- gap: this.gap,
2205
- ...this.sx
2206
- };
2207
- return l`
2208
- <section part="section" class="section" style=${m(r)}>
2209
- <slot></slot>
2210
- </section>
2211
- `;
2212
- }
2213
- };
2214
- X.styles = c`
2215
- :host {
2216
- display: block;
2217
- width: 100%;
2218
- }
2219
-
2220
- .section {
2221
- display: flex;
2222
- flex-direction: column;
2223
- width: 100%;
2224
- }
2225
- `;
2226
- vt([
2227
- n({ type: String })
2228
- ], X.prototype, "gap", 2);
2229
- vt([
2230
- n({ type: Object })
2231
- ], X.prototype, "sx", 2);
2232
- X = vt([
2233
- p("tc-section")
2234
- ], X);
2235
- var ae = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, mt = (r, e, s, i) => {
2236
- for (var t = i > 1 ? void 0 : i ? oe(e, s) : e, a = r.length - 1, o; a >= 0; a--)
2237
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
2238
- return i && t && ae(e, s, t), t;
2239
- };
2240
- let G = class extends d {
2241
- constructor() {
2242
- super(...arguments), this.mobile = new Dt(this, "(max-width: 768px)"), this.size = "auto", this.color = "var(--accent-primary)";
2243
- }
2244
- render() {
2245
- let r;
2246
- return this.size === "auto" ? r = this.mobile.matches ? "spinner--auto-mobile" : "spinner--auto-desktop" : r = `spinner--${this.size}`, l`
2247
- <div
2248
- part="spinner"
2249
- class="spinner ${r}"
2250
- style="--spinner-color: ${this.color};"
2251
- role="progressbar"
2252
- aria-label="Loading"
2253
- ></div>
2254
- `;
2255
- }
2256
- };
2257
- G.styles = [
2258
- u,
2259
- c`
2260
- :host {
2261
- display: inline-flex;
2262
- align-items: center;
2263
- justify-content: center;
2264
- }
2265
-
2266
- .spinner {
2267
- display: block;
2268
- border-radius: 50%;
2269
- border-style: solid;
2270
- border-color: var(--paper-cream);
2271
- border-top-color: var(--spinner-color);
2272
- animation: spin var(--duration-slow) linear infinite;
2273
- }
2274
-
2275
- .spinner--sm {
2276
- width: var(--size-spinner-sm);
2277
- height: var(--size-spinner-sm);
2278
- border-width: var(--size-border-width-thick);
2279
- }
2280
-
2281
- .spinner--md {
2282
- width: var(--size-spinner-md);
2283
- height: var(--size-spinner-md);
2284
- border-width: var(--size-border-width-heavy);
2285
- }
2286
-
2287
- .spinner--lg {
2288
- width: var(--size-spinner-lg);
2289
- height: var(--size-spinner-lg);
2290
- border-width: var(--size-border-width-bold);
2291
- }
2292
-
2293
- .spinner--auto-mobile {
2294
- width: var(--size-spinner-lg);
2295
- height: var(--size-spinner-lg);
2296
- border-width: var(--size-border-width-heavy);
2297
- }
2298
-
2299
- .spinner--auto-desktop {
2300
- width: 5rem;
2301
- height: 5rem;
2302
- border-width: var(--size-border-width-bold);
2303
- }
2304
- `
2305
- ];
2306
- mt([
2307
- n({ type: String })
2308
- ], G.prototype, "size", 2);
2309
- mt([
2310
- n({ type: String })
2311
- ], G.prototype, "color", 2);
2312
- G = mt([
2313
- p("tc-spinner")
2314
- ], G);
2315
- var ne = Object.defineProperty, le = Object.getOwnPropertyDescriptor, ct = (r, e, s, i) => {
2316
- for (var t = i > 1 ? void 0 : i ? le(e, s) : e, a = r.length - 1, o; a >= 0; a--)
2317
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
2318
- return i && t && ne(e, s, t), t;
2319
- };
2320
- let I = class extends d {
2321
- constructor() {
2322
- super(...arguments), this.size = "3rem", this.background = "var(--paper-cream)", this.color = "var(--ink-dark)";
2323
- }
2324
- render() {
2325
- return l`
2326
- <div
2327
- part="symbol"
2328
- class="symbol"
2329
- style="--symbol-size: ${this.size}; --symbol-bg: ${this.background}; --symbol-color: ${this.color};"
2330
- >
2331
- <slot></slot>
2332
- </div>
2333
- `;
2334
- }
2335
- };
2336
- I.styles = c`
2337
- :host {
2338
- display: inline-flex;
2339
- }
2340
-
2341
- .symbol {
2342
- display: flex;
2343
- align-items: center;
2344
- justify-content: center;
2345
- border-radius: var(--radius-full);
2346
- background: var(--symbol-bg);
2347
- color: var(--symbol-color);
2348
- width: var(--symbol-size);
2349
- height: var(--symbol-size);
2350
- font-family: var(--font-body);
2351
- font-weight: 600;
2352
- }
2353
- `;
2354
- ct([
2355
- n({ type: String })
2356
- ], I.prototype, "size", 2);
2357
- ct([
2358
- n({ type: String })
2359
- ], I.prototype, "background", 2);
2360
- ct([
2361
- n({ type: String })
2362
- ], I.prototype, "color", 2);
2363
- I = ct([
2364
- p("tc-symbol")
2365
- ], I);
2366
- var ce = Object.defineProperty, de = Object.getOwnPropertyDescriptor, q = (r, e, s, i) => {
2367
- for (var t = i > 1 ? void 0 : i ? de(e, s) : e, a = r.length - 1, o; a >= 0; a--)
2368
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
2369
- return i && t && ce(e, s, t), t;
2370
- };
2371
- let x = class extends d {
2372
- constructor() {
2373
- super(...arguments), this.tag = "p", this.sx = {};
2374
- }
2375
- getColorClass() {
2376
- return this.color && {
2377
- primary: "text--primary",
2378
- secondary: "text--secondary",
2379
- tertiary: "text--tertiary",
2380
- muted: "text--muted",
2381
- accent: "text--accent",
2382
- success: "text--success",
2383
- error: "text--error",
2384
- warning: "text--warning",
2385
- info: "text--info"
2386
- }[this.color] || "";
2387
- }
2388
- getColorStyle() {
2389
- if (this.color && (this.color.startsWith("var(") || this.color.startsWith("#") || this.color.startsWith("rgb")))
2390
- return this.color;
2391
- }
2392
- render() {
2393
- const r = $t(this.tag), e = [
2394
- "text",
2395
- this.size ? `text--${this.size}` : "",
2396
- this.weight ? `text--w${this.weight}` : "",
2397
- this.getColorClass()
2398
- ].filter(Boolean).join(" "), s = this.getColorStyle(), i = {
2399
- ...s ? { color: s } : {},
2400
- ...this.sx
2401
- };
2402
- return zt`
2403
- <${r} part="text" class=${e} style=${m(i)}>
2404
- <slot></slot>
2405
- </${r}>
2406
- `;
2407
- }
2408
- };
2409
- x.styles = [
2410
- u,
2411
- c`
2412
- :host {
2413
- display: contents;
2414
- }
2415
-
2416
- .text {
2417
- margin: 0;
2418
- padding: 0;
2419
- font-family: var(--font-body);
2420
- line-height: 1.4;
2421
- color: var(--ink-black);
2422
- }
2423
-
2424
- /* Size variants using design-tokens */
2425
- .text--sm {
2426
- font-size: var(--font-size-sm);
2427
- }
2428
- .text--base {
2429
- font-size: var(--font-size-base);
2430
- }
2431
- .text--lg {
2432
- font-size: var(--font-size-lg);
2433
- }
2434
- .text--xl {
2435
- font-size: var(--font-size-xl);
2436
- }
2437
- .text--2xl {
2438
- font-size: var(--font-size-2xl);
2439
- }
2440
-
2441
- /* Weight variants */
2442
- .text--w400 {
2443
- font-weight: 400;
2444
- }
2445
- .text--w500 {
2446
- font-weight: 500;
2447
- }
2448
- .text--w600 {
2449
- font-weight: 600;
2450
- }
2451
- .text--w700 {
2452
- font-weight: 700;
2453
- }
2454
-
2455
- /* Color variants using design-tokens - these will respond to theme changes */
2456
- .text--primary {
2457
- color: var(--ink-black);
2458
- }
2459
- .text--secondary {
2460
- color: var(--ink-dark);
2461
- }
2462
- .text--tertiary {
2463
- color: var(--ink-medium);
2464
- }
2465
- .text--muted {
2466
- color: var(--ink-light);
2467
- }
2468
- .text--accent {
2469
- color: var(--accent-primary);
2470
- }
2471
- .text--success {
2472
- color: var(--accent-success);
2473
- }
2474
- .text--error {
2475
- color: var(--error-base);
2476
- }
2477
- .text--warning {
2478
- color: var(--semantic-warning);
2479
- }
2480
- .text--info {
2481
- color: var(--semantic-info);
2482
- }
2483
- `
2484
- ];
2485
- q([
2486
- n({ type: String })
2487
- ], x.prototype, "tag", 2);
2488
- q([
2489
- n({ type: String })
2490
- ], x.prototype, "size", 2);
2491
- q([
2492
- n({ type: String })
2493
- ], x.prototype, "weight", 2);
2494
- q([
2495
- n({ type: String })
2496
- ], x.prototype, "color", 2);
2497
- q([
2498
- n({ type: Object })
2499
- ], x.prototype, "sx", 2);
2500
- x = q([
2501
- p("tc-text")
2502
- ], x);
2503
- var pe = Object.defineProperty, he = Object.getOwnPropertyDescriptor, tt = (r, e, s, i) => {
2504
- for (var t = i > 1 ? void 0 : i ? he(e, s) : e, a = r.length - 1, o; a >= 0; a--)
2505
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
2506
- return i && t && pe(e, s, t), t;
2507
- };
2508
- let _ = class extends d {
2509
- constructor() {
2510
- super(...arguments), this.variant = "info", this.duration = 5e3, this.autoDismiss = !0, this.dismissible = !0, this.animation = new j(this, {
2511
- showDuration: 300,
2512
- hideDuration: 200
2513
- });
2514
- }
2515
- connectedCallback() {
2516
- super.connectedCallback(), this.updateDataState();
2517
- }
2518
- disconnectedCallback() {
2519
- super.disconnectedCallback(), this.clearDismissTimer();
2520
- }
2521
- updateDataState() {
2522
- this.dataset.state = this.animation.state;
2523
- }
2524
- clearDismissTimer() {
2525
- this.dismissTimer && (clearTimeout(this.dismissTimer), this.dismissTimer = void 0);
2526
- }
2527
- startDismissTimer() {
2528
- this.autoDismiss && this.duration > 0 && (this.clearDismissTimer(), this.dismissTimer = setTimeout(() => {
2529
- this.hide();
2530
- }, this.duration));
2531
- }
2532
- async show() {
2533
- this.clearDismissTimer(), await this.animation.show(), this.updateDataState(), this.startDismissTimer();
2534
- }
2535
- async hide() {
2536
- this.clearDismissTimer(), await this.animation.hide(), this.updateDataState(), this.dispatchEvent(
2537
- new CustomEvent("tc-dismiss", {
2538
- bubbles: !0,
2539
- composed: !0
2540
- })
2541
- );
2542
- }
2543
- handleClose() {
2544
- this.hide();
2545
- }
2546
- render() {
2547
- return l`
2548
- <div part="toast" class="toast toast--${this.variant}" role="alert" aria-live="polite">
2549
- <div part="content" class="content">
2550
- <slot></slot>
2551
- </div>
2552
- ${this.dismissible ? l`
2553
- <button
2554
- part="close"
2555
- class="close"
2556
- @click=${this.handleClose}
2557
- aria-label="Dismiss"
2558
- >
2559
- <svg
2560
- viewBox="0 0 24 24"
2561
- fill="none"
2562
- stroke="currentColor"
2563
- stroke-width="2"
2564
- stroke-linecap="round"
2565
- stroke-linejoin="round"
2566
- >
2567
- <line x1="18" y1="6" x2="6" y2="18"></line>
2568
- <line x1="6" y1="6" x2="18" y2="18"></line>
2569
- </svg>
2570
- </button>
2571
- ` : ""}
2572
- </div>
2573
- `;
2574
- }
2575
- };
2576
- _.styles = [
2577
- u,
2578
- c`
2579
- :host {
2580
- display: block;
2581
- position: fixed;
2582
- bottom: var(--space-lg);
2583
- left: 50%;
2584
- transform: translateX(-50%);
2585
- z-index: 1000;
2586
- pointer-events: none;
2587
- }
2588
-
2589
- .toast {
2590
- display: flex;
2591
- align-items: center;
2592
- gap: var(--space-sm);
2593
- padding: var(--space-md) var(--space-lg);
2594
- border-radius: var(--radius-md);
2595
- font-family: var(--font-body);
2596
- font-size: var(--font-size-sm);
2597
- box-shadow: 0 4px 12px var(--overlay-shadow-subtle);
2598
- pointer-events: auto;
2599
- opacity: 0;
2600
- transform: translateY(100%);
2601
- transition: opacity var(--transition-smooth), transform var(--transition-smooth);
2602
- }
2603
-
2604
- :host([data-state='showing']) .toast,
2605
- :host([data-state='visible']) .toast {
2606
- opacity: 1;
2607
- transform: translateY(0);
2608
- }
2609
-
2610
- :host([data-state='hiding']) .toast {
2611
- opacity: 0;
2612
- transform: translateY(100%);
2613
- }
2614
-
2615
- :host([data-state='hidden']) {
2616
- display: none;
2617
- }
2618
-
2619
- .toast--info {
2620
- background: var(--ink-dark);
2621
- color: var(--paper-white);
2622
- }
2623
-
2624
- .toast--success {
2625
- background: var(--accent-success);
2626
- color: white;
2627
- }
2628
-
2629
- .toast--warning {
2630
- background: var(--semantic-warning);
2631
- color: white;
2632
- }
2633
-
2634
- .toast--error {
2635
- background: var(--error-base);
2636
- color: white;
2637
- }
2638
-
2639
- .content {
2640
- flex: 1;
2641
- line-height: 1.4;
2642
- }
2643
-
2644
- .close {
2645
- flex-shrink: 0;
2646
- display: flex;
2647
- align-items: center;
2648
- justify-content: center;
2649
- width: var(--size-icon-md);
2650
- height: var(--size-icon-md);
2651
- padding: 0;
2652
- border: none;
2653
- background: transparent;
2654
- color: inherit;
2655
- opacity: var(--opacity-hover);
2656
- cursor: pointer;
2657
- transition: opacity var(--transition-fast);
2658
- }
2659
-
2660
- .close:hover {
2661
- opacity: 1;
2662
- }
2663
-
2664
- .close svg {
2665
- width: var(--size-icon-sm);
2666
- height: var(--size-icon-sm);
2667
- }
2668
- `
2669
- ];
2670
- tt([
2671
- n({ type: String })
2672
- ], _.prototype, "variant", 2);
2673
- tt([
2674
- n({ type: Number })
2675
- ], _.prototype, "duration", 2);
2676
- tt([
2677
- n({ type: Boolean, attribute: "auto-dismiss" })
2678
- ], _.prototype, "autoDismiss", 2);
2679
- tt([
2680
- n({ type: Boolean })
2681
- ], _.prototype, "dismissible", 2);
2682
- _ = tt([
2683
- p("tc-toast")
2684
- ], _);
2685
- var ue = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, et = (r, e, s, i) => {
2686
- for (var t = i > 1 ? void 0 : i ? ve(e, s) : e, a = r.length - 1, o; a >= 0; a--)
2687
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
2688
- return i && t && ue(e, s, t), t;
2689
- };
2690
- let D = class extends d {
2691
- constructor() {
2692
- super(...arguments), this.title = "Something went wrong", this.message = "An unexpected error occurred. Please try again.", this.retryLabel = "Try Again", this.showRetry = !0;
2693
- }
2694
- handleRetry() {
2695
- this.dispatchEvent(
2696
- new CustomEvent("tc-retry", {
2697
- bubbles: !0,
2698
- composed: !0
2699
- })
2700
- );
2701
- }
2702
- render() {
2703
- return l`
2704
- <div part="screen" class="screen">
2705
- <tc-container>
2706
- <div part="content" class="content">
2707
- <div part="icon" class="icon-container">
2708
- <tc-icon name="alert-circle" size="2rem"></tc-icon>
2709
- </div>
2710
- <tc-section gap="var(--space-sm)">
2711
- <tc-text part="title" tag="h1" size="xl" weight="600" class="title">
2712
- ${this.title}
2713
- </tc-text>
2714
- <tc-text part="message" size="base" color="tertiary" class="message">
2715
- ${this.message}
2716
- </tc-text>
2717
- </tc-section>
2718
- ${this.showRetry ? l`
2719
- <div part="action" class="action">
2720
- <tc-button variant="primary" @tc-click=${this.handleRetry}>
2721
- ${this.retryLabel}
2722
- </tc-button>
2723
- </div>
2724
- ` : ""}
2725
- </div>
2726
- </tc-container>
2727
- </div>
2728
- `;
2729
- }
2730
- };
2731
- D.styles = c`
2732
- :host {
2733
- display: block;
2734
- width: 100%;
2735
- min-height: 100vh;
2736
- min-height: 100dvh;
2737
- }
2738
-
2739
- .screen {
2740
- display: flex;
2741
- align-items: center;
2742
- justify-content: center;
2743
- width: 100%;
2744
- min-height: 100vh;
2745
- min-height: 100dvh;
2746
- padding: var(--space-lg);
2747
- box-sizing: border-box;
2748
- background: var(--paper-white);
2749
- }
2750
-
2751
- .content {
2752
- display: flex;
2753
- flex-direction: column;
2754
- align-items: center;
2755
- gap: var(--space-lg);
2756
- text-align: center;
2757
- max-width: 20rem;
2758
- }
2759
-
2760
- .icon-container {
2761
- display: flex;
2762
- align-items: center;
2763
- justify-content: center;
2764
- width: 4rem;
2765
- height: 4rem;
2766
- background: var(--error-bg);
2767
- border-radius: var(--radius-full);
2768
- color: var(--error-base);
2769
- }
2770
-
2771
- .title {
2772
- margin: 0;
2773
- }
2774
-
2775
- .message {
2776
- color: var(--ink-medium);
2777
- }
2778
-
2779
- .action {
2780
- width: 100%;
2781
- margin-top: var(--space-md);
2782
- }
2783
- `;
2784
- et([
2785
- n({ type: String })
2786
- ], D.prototype, "title", 2);
2787
- et([
2788
- n({ type: String })
2789
- ], D.prototype, "message", 2);
2790
- et([
2791
- n({ type: String, attribute: "retry-label" })
2792
- ], D.prototype, "retryLabel", 2);
2793
- et([
2794
- n({ type: Boolean, attribute: "show-retry" })
2795
- ], D.prototype, "showRetry", 2);
2796
- D = et([
2797
- p("tc-error-screen")
2798
- ], D);
2799
- var me = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, gt = (r, e, s, i) => {
2800
- for (var t = i > 1 ? void 0 : i ? ge(e, s) : e, a = r.length - 1, o; a >= 0; a--)
2801
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
2802
- return i && t && me(e, s, t), t;
2803
- };
2804
- let Q = class extends d {
2805
- constructor() {
2806
- super(...arguments), this.message = "", this.spinnerSize = "3rem", this.loading = new _t(this);
2807
- }
2808
- connectedCallback() {
2809
- super.connectedCallback(), this.loading.start();
2810
- }
2811
- render() {
2812
- return l`
2813
- <div part="screen" class="screen">
2814
- <tc-container>
2815
- <div part="content" class="content">
2816
- <tc-spinner part="spinner" size=${this.spinnerSize}></tc-spinner>
2817
- ${this.message ? l`
2818
- <tc-text part="message" class="message" size="base" color="tertiary">
2819
- ${this.message}
2820
- </tc-text>
2821
- ` : ""}
2822
- </div>
2823
- </tc-container>
2824
- </div>
2825
- `;
2826
- }
2827
- };
2828
- Q.styles = c`
2829
- :host {
2830
- display: block;
2831
- width: 100%;
2832
- min-height: 100vh;
2833
- min-height: 100dvh;
2834
- }
2835
-
2836
- .screen {
2837
- display: flex;
2838
- align-items: center;
2839
- justify-content: center;
2840
- width: 100%;
2841
- min-height: 100vh;
2842
- min-height: 100dvh;
2843
- padding: var(--space-lg);
2844
- box-sizing: border-box;
2845
- background: var(--paper-white);
2846
- }
2847
-
2848
- .content {
2849
- display: flex;
2850
- flex-direction: column;
2851
- align-items: center;
2852
- gap: var(--space-lg);
2853
- text-align: center;
2854
- }
2855
-
2856
- .message {
2857
- color: var(--ink-medium);
2858
- max-width: 20rem;
2859
- }
2860
- `;
2861
- gt([
2862
- n({ type: String })
2863
- ], Q.prototype, "message", 2);
2864
- gt([
2865
- n({ type: String, attribute: "spinner-size" })
2866
- ], Q.prototype, "spinnerSize", 2);
2867
- Q = gt([
2868
- p("tc-loading-screen")
2869
- ], Q);
2870
- var fe = Object.defineProperty, be = Object.getOwnPropertyDescriptor, Y = (r, e, s, i) => {
2871
- for (var t = i > 1 ? void 0 : i ? be(e, s) : e, a = r.length - 1, o; a >= 0; a--)
2872
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
2873
- return i && t && fe(e, s, t), t;
2874
- };
2875
- let k = class extends d {
2876
- constructor() {
2877
- super(...arguments), this.title = "Success!", this.message = "Your action was completed successfully.", this.actionLabel = "", this.autoAnimate = !0, this.isAnimated = !1, this.animation = new j(this, {
2878
- showDuration: 600,
2879
- hideDuration: 300
2880
- });
2881
- }
2882
- connectedCallback() {
2883
- super.connectedCallback(), this.autoAnimate && requestAnimationFrame(() => {
2884
- this.playAnimation();
2885
- });
2886
- }
2887
- async playAnimation() {
2888
- await this.animation.show(), this.isAnimated = !0;
2889
- }
2890
- handleAction() {
2891
- this.dispatchEvent(
2892
- new CustomEvent("tc-action", {
2893
- bubbles: !0,
2894
- composed: !0
2895
- })
2896
- );
2897
- }
2898
- render() {
2899
- const r = this.isAnimated ? "animated" : "";
2900
- return l`
2901
- <div part="screen" class="screen">
2902
- <tc-container>
2903
- <div part="content" class="content">
2904
- <div part="icon" class="icon-container ${r}">
2905
- <svg
2906
- class="checkmark"
2907
- viewBox="0 0 24 24"
2908
- fill="none"
2909
- stroke="currentColor"
2910
- stroke-width="3"
2911
- stroke-linecap="round"
2912
- stroke-linejoin="round"
2913
- >
2914
- <polyline points="20 6 9 17 4 12"></polyline>
2915
- </svg>
2916
- </div>
2917
- <tc-section gap="var(--space-sm)" class="text-content ${r}">
2918
- <tc-text part="title" tag="h1" size="xl" weight="600" class="title">
2919
- ${this.title}
2920
- </tc-text>
2921
- <tc-text part="message" size="base" color="tertiary" class="message">
2922
- ${this.message}
2923
- </tc-text>
2924
- </tc-section>
2925
- ${this.actionLabel ? l`
2926
- <div part="action" class="action ${r}">
2927
- <tc-button variant="success" @tc-click=${this.handleAction}>
2928
- ${this.actionLabel}
2929
- </tc-button>
2930
- </div>
2931
- ` : ""}
2932
- </div>
2933
- </tc-container>
2934
- </div>
2935
- `;
2936
- }
2937
- };
2938
- k.styles = c`
2939
- :host {
2940
- display: block;
2941
- width: 100%;
2942
- min-height: 100vh;
2943
- min-height: 100dvh;
2944
- }
2945
-
2946
- .screen {
2947
- display: flex;
2948
- align-items: center;
2949
- justify-content: center;
2950
- width: 100%;
2951
- min-height: 100vh;
2952
- min-height: 100dvh;
2953
- padding: var(--space-lg);
2954
- box-sizing: border-box;
2955
- background: var(--paper-white);
2956
- }
2957
-
2958
- .content {
2959
- display: flex;
2960
- flex-direction: column;
2961
- align-items: center;
2962
- gap: var(--space-lg);
2963
- text-align: center;
2964
- max-width: 20rem;
2965
- }
2966
-
2967
- .icon-container {
2968
- display: flex;
2969
- align-items: center;
2970
- justify-content: center;
2971
- width: 5rem;
2972
- height: 5rem;
2973
- background: var(--alpha-success10);
2974
- border-radius: var(--radius-full);
2975
- color: var(--accent-success);
2976
- transform: scale(0);
2977
- opacity: 0;
2978
- transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
2979
- opacity 0.3s ease;
2980
- }
2981
-
2982
- .icon-container.animated {
2983
- transform: scale(1);
2984
- opacity: 1;
2985
- }
2986
-
2987
- .checkmark {
2988
- width: 2.5rem;
2989
- height: 2.5rem;
2990
- stroke-dasharray: 50;
2991
- stroke-dashoffset: 50;
2992
- }
2993
-
2994
- .icon-container.animated .checkmark {
2995
- animation: draw-check 0.5s ease-out 0.3s forwards;
2996
- }
2997
-
2998
- @keyframes draw-check {
2999
- to {
3000
- stroke-dashoffset: 0;
3001
- }
3002
- }
3003
-
3004
- .title {
3005
- margin: 0;
3006
- }
3007
-
3008
- .message {
3009
- color: var(--ink-medium);
3010
- }
3011
-
3012
- .text-content {
3013
- opacity: 0;
3014
- transform: translateY(10px);
3015
- transition: opacity 0.4s ease, transform 0.4s ease;
3016
- transition-delay: 0.4s;
3017
- }
3018
-
3019
- .text-content.animated {
3020
- opacity: 1;
3021
- transform: translateY(0);
3022
- }
3023
-
3024
- .action {
3025
- width: 100%;
3026
- margin-top: var(--space-md);
3027
- opacity: 0;
3028
- transform: translateY(10px);
3029
- transition: opacity 0.4s ease, transform 0.4s ease;
3030
- transition-delay: 0.6s;
3031
- }
3032
-
3033
- .action.animated {
3034
- opacity: 1;
3035
- transform: translateY(0);
3036
- }
3037
- `;
3038
- Y([
3039
- n({ type: String })
3040
- ], k.prototype, "title", 2);
3041
- Y([
3042
- n({ type: String })
3043
- ], k.prototype, "message", 2);
3044
- Y([
3045
- n({ type: String, attribute: "action-label" })
3046
- ], k.prototype, "actionLabel", 2);
3047
- Y([
3048
- n({ type: Boolean, attribute: "auto-animate" })
3049
- ], k.prototype, "autoAnimate", 2);
3050
- Y([
3051
- S()
3052
- ], k.prototype, "isAnimated", 2);
3053
- k = Y([
3054
- p("tc-success-screen")
3055
- ], k);
3056
- var ye = Object.defineProperty, we = Object.getOwnPropertyDescriptor, rt = (r, e, s, i) => {
3057
- for (var t = i > 1 ? void 0 : i ? we(e, s) : e, a = r.length - 1, o; a >= 0; a--)
3058
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
3059
- return i && t && ye(e, s, t), t;
3060
- };
3061
- let O = class extends d {
3062
- constructor() {
3063
- super(...arguments), this.position = "bottom-right", this.size = "3.5rem", this.disabled = !1, this.sx = {};
3064
- }
3065
- connectedCallback() {
3066
- super.connectedCallback(), this.setAttribute("position", this.position);
3067
- }
3068
- updated(r) {
3069
- r.has("position") && this.setAttribute("position", this.position);
3070
- }
3071
- handleClick() {
3072
- this.disabled || this.dispatchEvent(
3073
- new CustomEvent("tc-click", {
3074
- bubbles: !0,
3075
- composed: !0
3076
- })
3077
- );
3078
- }
3079
- render() {
3080
- const r = {
3081
- "--fab-size": this.size,
3082
- ...this.sx
3083
- };
3084
- return l`
3085
- <button
3086
- part="button"
3087
- class="button"
3088
- ?disabled=${this.disabled}
3089
- style=${m(r)}
3090
- @click=${this.handleClick}
3091
- aria-label="Floating action"
3092
- >
3093
- <slot></slot>
3094
- </button>
3095
- `;
3096
- }
3097
- };
3098
- O.styles = [
3099
- u,
3100
- c`
3101
- :host {
3102
- display: block;
3103
- position: fixed;
3104
- z-index: 100;
3105
- }
3106
-
3107
- :host([position='bottom-right']) {
3108
- bottom: var(--space-lg);
3109
- right: var(--space-lg);
3110
- }
3111
-
3112
- :host([position='bottom-left']) {
3113
- bottom: var(--space-lg);
3114
- left: var(--space-lg);
3115
- }
3116
-
3117
- :host([position='top-right']) {
3118
- top: var(--space-lg);
3119
- right: var(--space-lg);
3120
- }
3121
-
3122
- :host([position='top-left']) {
3123
- top: var(--space-lg);
3124
- left: var(--space-lg);
3125
- }
3126
-
3127
- .button {
3128
- display: flex;
3129
- align-items: center;
3130
- justify-content: center;
3131
- width: var(--fab-size);
3132
- height: var(--fab-size);
3133
- padding: 0;
3134
- border: none;
3135
- border-radius: var(--radius-full);
3136
- background: var(--accent-primary);
3137
- color: white;
3138
- cursor: pointer;
3139
- box-shadow: 0 4px 12px var(--alpha-primary40);
3140
- transition: var(--transition-smooth);
3141
- }
3142
-
3143
- .button:hover:not(:disabled) {
3144
- background: var(--accent-primary-hover);
3145
- transform: scale(1.05);
3146
- box-shadow: 0 6px 16px var(--alpha-primary50);
3147
- }
3148
-
3149
- .button:active:not(:disabled) {
3150
- background: var(--accent-primary-pressed);
3151
- transform: scale(0.98);
3152
- }
3153
-
3154
- .button:focus-visible {
3155
- outline: 2px solid var(--accent-primary);
3156
- outline-offset: 3px;
3157
- }
3158
-
3159
- .button:disabled {
3160
- opacity: var(--opacity-disabled);
3161
- cursor: not-allowed;
3162
- box-shadow: none;
3163
- }
3164
- `
3165
- ];
3166
- rt([
3167
- n({ type: String })
3168
- ], O.prototype, "position", 2);
3169
- rt([
3170
- n({ type: String })
3171
- ], O.prototype, "size", 2);
3172
- rt([
3173
- n({ type: Boolean })
3174
- ], O.prototype, "disabled", 2);
3175
- rt([
3176
- n({ type: Object })
3177
- ], O.prototype, "sx", 2);
3178
- O = rt([
3179
- p("tc-floating-button")
3180
- ], O);
3181
- var xe = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, E = (r, e, s, i) => {
3182
- for (var t = i > 1 ? void 0 : i ? ke(e, s) : e, a = r.length - 1, o; a >= 0; a--)
3183
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
3184
- return i && t && xe(e, s, t), t;
3185
- };
3186
- let g = class extends d {
3187
- constructor() {
3188
- super(...arguments), this.src = "", this.title = "", this.closeOnEscape = !0, this.closeOnOverlay = !0, this.useHistory = !0, this.isLoading = !0, this.animation = new j(this, {
3189
- showDuration: 300,
3190
- hideDuration: 200
3191
- }), this.history = new Ct(this), this.messageBus = new Ot(this), this.handleKeyDown = (r) => {
3192
- r.key === "Escape" && this.animation.state === "visible" && this.close();
3193
- };
3194
- }
3195
- connectedCallback() {
3196
- super.connectedCallback(), this.updateDataState(), this.closeOnEscape && document.addEventListener("keydown", this.handleKeyDown), this.messageBus.onMessage("*", (r, e) => {
3197
- this.dispatchEvent(
3198
- new CustomEvent("tc-message", {
3199
- bubbles: !0,
3200
- composed: !0,
3201
- detail: { type: r, payload: e }
3202
- })
3203
- );
3204
- }), this.useHistory && this.history.onPopState(() => {
3205
- this.animation.state === "visible" && this.close();
3206
- });
3207
- }
3208
- disconnectedCallback() {
3209
- super.disconnectedCallback(), document.removeEventListener("keydown", this.handleKeyDown);
3210
- }
3211
- updateDataState() {
3212
- this.dataset.state = this.animation.state;
3213
- }
3214
- async open() {
3215
- this.useHistory && this.history.push({ modal: "iframe" }), this.isLoading = !0, await this.animation.show(), this.updateDataState();
3216
- }
3217
- async close() {
3218
- this.useHistory && this.history.pop(), await this.animation.hide(), this.updateDataState(), this.dispatchEvent(
3219
- new CustomEvent("tc-close", {
3220
- bubbles: !0,
3221
- composed: !0
3222
- })
3223
- );
3224
- }
3225
- handleOverlayClick(r) {
3226
- this.closeOnOverlay && r.target === r.currentTarget && this.close();
3227
- }
3228
- handleIframeLoad() {
3229
- this.isLoading = !1, this.dispatchEvent(
3230
- new CustomEvent("tc-load", {
3231
- bubbles: !0,
3232
- composed: !0
3233
- })
3234
- );
3235
- }
3236
- sendMessage(r, e) {
3237
- const s = this.shadowRoot?.querySelector("iframe");
3238
- s?.contentWindow && this.messageBus.send(r, e, s.contentWindow);
3239
- }
3240
- render() {
3241
- return l`
3242
- <div part="overlay" class="overlay" @click=${this.handleOverlayClick}>
3243
- <div part="modal" class="modal" role="dialog" aria-modal="true" aria-labelledby="modal-title">
3244
- ${this.title ? l`
3245
- <div part="header" class="header">
3246
- <h2 id="modal-title" class="title">${this.title}</h2>
3247
- <button
3248
- part="close"
3249
- class="close"
3250
- @click=${this.close}
3251
- aria-label="Close modal"
3252
- >
3253
- <svg
3254
- viewBox="0 0 24 24"
3255
- fill="none"
3256
- stroke="currentColor"
3257
- stroke-width="2"
3258
- stroke-linecap="round"
3259
- stroke-linejoin="round"
3260
- >
3261
- <line x1="18" y1="6" x2="6" y2="18"></line>
3262
- <line x1="6" y1="6" x2="18" y2="18"></line>
3263
- </svg>
3264
- </button>
3265
- </div>
3266
- ` : ""}
3267
- <div part="content" class="content">
3268
- <iframe
3269
- part="iframe"
3270
- class="iframe"
3271
- src=${this.src}
3272
- @load=${this.handleIframeLoad}
3273
- title=${this.title || "Modal content"}
3274
- ></iframe>
3275
- <div part="loader" class="loader ${this.isLoading ? "" : "hidden"}">
3276
- <tc-spinner size="2rem"></tc-spinner>
3277
- </div>
3278
- </div>
3279
- </div>
3280
- </div>
3281
- `;
3282
- }
3283
- };
3284
- g.styles = [
3285
- u,
3286
- c`
3287
- :host {
3288
- display: contents;
3289
- }
3290
-
3291
- .overlay {
3292
- position: fixed;
3293
- inset: 0;
3294
- z-index: 1000;
3295
- display: flex;
3296
- align-items: center;
3297
- justify-content: center;
3298
- padding: var(--space-lg);
3299
- background: var(--overlay-dim);
3300
- opacity: 0;
3301
- visibility: hidden;
3302
- transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
3303
- }
3304
-
3305
- :host([data-state='showing']) .overlay,
3306
- :host([data-state='visible']) .overlay {
3307
- opacity: 1;
3308
- visibility: visible;
3309
- }
3310
-
3311
- :host([data-state='hiding']) .overlay {
3312
- opacity: 0;
3313
- }
3314
-
3315
- :host([data-state='hidden']) .overlay {
3316
- visibility: hidden;
3317
- }
3318
-
3319
- .modal {
3320
- display: flex;
3321
- flex-direction: column;
3322
- width: 100%;
3323
- max-width: 600px;
3324
- max-height: 90vh;
3325
- max-height: 90dvh;
3326
- background: var(--paper-white);
3327
- border-radius: var(--radius-lg);
3328
- box-shadow: 0 20px 60px var(--overlay-shadow-strong);
3329
- overflow: hidden;
3330
- transform: scale(0.95) translateY(20px);
3331
- transition: transform var(--transition-smooth);
3332
- }
3333
-
3334
- :host([data-state='showing']) .modal,
3335
- :host([data-state='visible']) .modal {
3336
- transform: scale(1) translateY(0);
3337
- }
3338
-
3339
- :host([data-state='hiding']) .modal {
3340
- transform: scale(0.95) translateY(20px);
3341
- }
3342
-
3343
- .header {
3344
- display: flex;
3345
- align-items: center;
3346
- justify-content: space-between;
3347
- padding: var(--space-md) var(--space-lg);
3348
- border-bottom: 1px solid var(--paper-warm);
3349
- }
3350
-
3351
- .title {
3352
- font-family: var(--font-body);
3353
- font-size: var(--font-size-lg);
3354
- font-weight: 600;
3355
- color: var(--ink-dark);
3356
- margin: 0;
3357
- }
3358
-
3359
- .close {
3360
- display: flex;
3361
- align-items: center;
3362
- justify-content: center;
3363
- width: var(--size-close-button);
3364
- height: var(--size-close-button);
3365
- padding: 0;
3366
- border: none;
3367
- background: transparent;
3368
- color: var(--ink-medium);
3369
- cursor: pointer;
3370
- border-radius: var(--radius-sm);
3371
- transition: var(--transition-fast);
3372
- }
3373
-
3374
- .close:hover {
3375
- background: var(--paper-warm);
3376
- color: var(--ink-dark);
3377
- }
3378
-
3379
- .close svg {
3380
- width: 1.25rem;
3381
- height: 1.25rem;
3382
- }
3383
-
3384
- .content {
3385
- position: relative;
3386
- flex: 1;
3387
- overflow: hidden;
3388
- }
3389
-
3390
- .iframe {
3391
- width: 100%;
3392
- height: 100%;
3393
- min-height: 400px;
3394
- border: none;
3395
- }
3396
-
3397
- .loader {
3398
- position: absolute;
3399
- inset: 0;
3400
- display: flex;
3401
- align-items: center;
3402
- justify-content: center;
3403
- background: var(--paper-white);
3404
- opacity: 1;
3405
- transition: opacity var(--transition-smooth);
3406
- }
3407
-
3408
- .loader.hidden {
3409
- opacity: 0;
3410
- pointer-events: none;
3411
- }
3412
- `
3413
- ];
3414
- E([
3415
- n({ type: String })
3416
- ], g.prototype, "src", 2);
3417
- E([
3418
- n({ type: String })
3419
- ], g.prototype, "title", 2);
3420
- E([
3421
- n({ type: Boolean, attribute: "close-on-escape" })
3422
- ], g.prototype, "closeOnEscape", 2);
3423
- E([
3424
- n({ type: Boolean, attribute: "close-on-overlay" })
3425
- ], g.prototype, "closeOnOverlay", 2);
3426
- E([
3427
- n({ type: Boolean, attribute: "use-history" })
3428
- ], g.prototype, "useHistory", 2);
3429
- E([
3430
- S()
3431
- ], g.prototype, "isLoading", 2);
3432
- g = E([
3433
- p("tc-iframe-modal")
3434
- ], g);
3435
- var $e = Object.defineProperty, ze = Object.getOwnPropertyDescriptor, B = (r, e, s, i) => {
3436
- for (var t = i > 1 ? void 0 : i ? ze(e, s) : e, a = r.length - 1, o; a >= 0; a--)
3437
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
3438
- return i && t && $e(e, s, t), t;
3439
- };
3440
- let f = class extends d {
3441
- constructor() {
3442
- super(...arguments), this.title = "Install App", this.description = "Add to your home screen for quick access", this.installLabel = "Install", this.storageKey = "tc-install-banner-dismissed", this.dismissDays = 7, this.isDismissed = !1, this.animation = new j(this, {
3443
- showDuration: 400,
3444
- hideDuration: 300
3445
- }), this.storage = new bt(
3446
- this,
3447
- this.storageKey
3448
- );
3449
- }
3450
- connectedCallback() {
3451
- super.connectedCallback(), this.updateDataState(), this.checkDismissState();
3452
- }
3453
- checkDismissState() {
3454
- const r = this.storage.value;
3455
- r?.dismissedAt && ((Date.now() - r.dismissedAt) / 864e5 < this.dismissDays ? this.isDismissed = !0 : this.storage.remove());
3456
- }
3457
- updateDataState() {
3458
- this.dataset.state = this.animation.state;
3459
- }
3460
- async show() {
3461
- this.isDismissed || (await this.animation.show(), this.updateDataState());
3462
- }
3463
- async dismiss() {
3464
- this.storage.set({ dismissedAt: Date.now() }), await this.animation.hide(), this.updateDataState(), this.dispatchEvent(
3465
- new CustomEvent("tc-dismiss", {
3466
- bubbles: !0,
3467
- composed: !0
3468
- })
3469
- );
3470
- }
3471
- handleInstall() {
3472
- this.dispatchEvent(
3473
- new CustomEvent("tc-install", {
3474
- bubbles: !0,
3475
- composed: !0
3476
- })
3477
- );
3478
- }
3479
- handleClose() {
3480
- this.dismiss();
3481
- }
3482
- render() {
3483
- return l`
3484
- <div part="banner" class="banner" role="banner">
3485
- <div part="icon" class="icon">
3486
- <tc-icon name="download" size="1.5rem"></tc-icon>
3487
- </div>
3488
- <div part="content" class="content">
3489
- <tc-text part="title" class="title" size="base" weight="600">
3490
- ${this.title}
3491
- </tc-text>
3492
- <tc-text part="description" class="description" size="sm" color="tertiary">
3493
- ${this.description}
3494
- </tc-text>
3495
- </div>
3496
- <div part="actions" class="actions">
3497
- <tc-button
3498
- part="install"
3499
- variant="primary"
3500
- size="small"
3501
- @tc-click=${this.handleInstall}
3502
- >
3503
- ${this.installLabel}
3504
- </tc-button>
3505
- <button part="close" class="close" @click=${this.handleClose} aria-label="Dismiss">
3506
- <svg
3507
- viewBox="0 0 24 24"
3508
- fill="none"
3509
- stroke="currentColor"
3510
- stroke-width="2"
3511
- stroke-linecap="round"
3512
- stroke-linejoin="round"
3513
- >
3514
- <line x1="18" y1="6" x2="6" y2="18"></line>
3515
- <line x1="6" y1="6" x2="18" y2="18"></line>
3516
- </svg>
3517
- </button>
3518
- </div>
3519
- </div>
3520
- `;
3521
- }
3522
- };
3523
- f.styles = [
3524
- u,
3525
- c`
3526
- :host {
3527
- display: block;
3528
- position: fixed;
3529
- bottom: 0;
3530
- left: 0;
3531
- right: 0;
3532
- z-index: 100;
3533
- padding: var(--space-md);
3534
- pointer-events: none;
3535
- }
3536
-
3537
- .banner {
3538
- display: flex;
3539
- align-items: center;
3540
- gap: var(--space-md);
3541
- padding: var(--space-md) var(--space-lg);
3542
- background: var(--paper-white);
3543
- border-radius: var(--radius-lg);
3544
- box-shadow: 0 -4px 20px var(--overlay-shadow-light);
3545
- pointer-events: auto;
3546
- opacity: 0;
3547
- transform: translateY(100%);
3548
- transition: opacity var(--transition-smooth), transform var(--transition-smooth);
3549
- }
3550
-
3551
- :host([data-state='showing']) .banner,
3552
- :host([data-state='visible']) .banner {
3553
- opacity: 1;
3554
- transform: translateY(0);
3555
- }
3556
-
3557
- :host([data-state='hiding']) .banner {
3558
- opacity: 0;
3559
- transform: translateY(100%);
3560
- }
3561
-
3562
- :host([data-state='hidden']) {
3563
- display: none;
3564
- }
3565
-
3566
- .icon {
3567
- flex-shrink: 0;
3568
- display: flex;
3569
- align-items: center;
3570
- justify-content: center;
3571
- width: 3rem;
3572
- height: 3rem;
3573
- background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
3574
- border-radius: var(--radius-md);
3575
- color: white;
3576
- }
3577
-
3578
- .content {
3579
- flex: 1;
3580
- min-width: 0;
3581
- }
3582
-
3583
- .title {
3584
- font-weight: 600;
3585
- color: var(--ink-dark);
3586
- }
3587
-
3588
- .description {
3589
- color: var(--ink-medium);
3590
- margin-top: 2px;
3591
- }
3592
-
3593
- .actions {
3594
- display: flex;
3595
- align-items: center;
3596
- gap: var(--space-sm);
3597
- }
3598
-
3599
- .close {
3600
- display: flex;
3601
- align-items: center;
3602
- justify-content: center;
3603
- width: var(--size-close-button);
3604
- height: var(--size-close-button);
3605
- padding: 0;
3606
- border: none;
3607
- background: transparent;
3608
- color: var(--ink-light);
3609
- cursor: pointer;
3610
- border-radius: var(--radius-sm);
3611
- transition: var(--transition-fast);
3612
- }
3613
-
3614
- .close:hover {
3615
- background: var(--paper-warm);
3616
- color: var(--ink-medium);
3617
- }
3618
-
3619
- .close svg {
3620
- width: 1.25rem;
3621
- height: 1.25rem;
3622
- }
3623
-
3624
- @media (max-width: 480px) {
3625
- .banner {
3626
- flex-wrap: wrap;
3627
- }
3628
-
3629
- .content {
3630
- flex-basis: calc(100% - 4rem);
3631
- }
3632
-
3633
- .actions {
3634
- flex-basis: 100%;
3635
- justify-content: flex-end;
3636
- }
3637
- }
3638
- `
3639
- ];
3640
- B([
3641
- n({ type: String })
3642
- ], f.prototype, "title", 2);
3643
- B([
3644
- n({ type: String })
3645
- ], f.prototype, "description", 2);
3646
- B([
3647
- n({ type: String, attribute: "install-label" })
3648
- ], f.prototype, "installLabel", 2);
3649
- B([
3650
- n({ type: String, attribute: "storage-key" })
3651
- ], f.prototype, "storageKey", 2);
3652
- B([
3653
- n({ type: Number, attribute: "dismiss-days" })
3654
- ], f.prototype, "dismissDays", 2);
3655
- B([
3656
- S()
3657
- ], f.prototype, "isDismissed", 2);
3658
- f = B([
3659
- p("tc-installation-banner")
3660
- ], f);
3661
- var Ce = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, ft = (r, e, s, i) => {
3662
- for (var t = i > 1 ? void 0 : i ? _e(e, s) : e, a = r.length - 1, o; a >= 0; a--)
3663
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
3664
- return i && t && Ce(e, s, t), t;
3665
- };
3666
- let J = class extends d {
3667
- constructor() {
3668
- super(...arguments), this.title = "Install on iOS", this.steps = [
3669
- "Tap the Share button in Safari",
3670
- 'Scroll down and tap "Add to Home Screen"',
3671
- 'Tap "Add" in the top right corner'
3672
- ], this.animation = new j(this, {
3673
- showDuration: 300,
3674
- hideDuration: 200
3675
- });
3676
- }
3677
- connectedCallback() {
3678
- super.connectedCallback(), this.updateDataState();
3679
- }
3680
- updateDataState() {
3681
- this.dataset.state = this.animation.state;
3682
- }
3683
- async show() {
3684
- await this.animation.show(), this.updateDataState();
3685
- }
3686
- async close() {
3687
- await this.animation.hide(), this.updateDataState(), this.dispatchEvent(
3688
- new CustomEvent("tc-close", {
3689
- bubbles: !0,
3690
- composed: !0
3691
- })
3692
- );
3693
- }
3694
- handleOverlayClick(r) {
3695
- r.target === r.currentTarget && this.close();
3696
- }
3697
- renderStep(r, e) {
3698
- const s = r.split("[share]"), i = s.length > 1 ? l`${s[0]}<svg class="share-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
3699
- <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path>
3700
- <polyline points="16 6 12 2 8 6"></polyline>
3701
- <line x1="12" y1="2" x2="12" y2="15"></line>
3702
- </svg>${s[1]}` : r;
3703
- return l`
3704
- <div part="step" class="step">
3705
- <span part="step-number" class="step-number">${e + 1}</span>
3706
- <tc-text part="step-text" class="step-text" size="base">${i}</tc-text>
3707
- </div>
3708
- `;
3709
- }
3710
- render() {
3711
- return l`
3712
- <div part="overlay" class="overlay" @click=${this.handleOverlayClick}>
3713
- <div part="modal" class="modal" role="dialog" aria-modal="true" aria-labelledby="guide-title">
3714
- <div part="header" class="header">
3715
- <h2 id="guide-title" class="title">${this.title}</h2>
3716
- <button part="close" class="close" @click=${this.close} aria-label="Close">
3717
- <svg
3718
- viewBox="0 0 24 24"
3719
- fill="none"
3720
- stroke="currentColor"
3721
- stroke-width="2"
3722
- stroke-linecap="round"
3723
- stroke-linejoin="round"
3724
- >
3725
- <line x1="18" y1="6" x2="6" y2="18"></line>
3726
- <line x1="6" y1="6" x2="18" y2="18"></line>
3727
- </svg>
3728
- </button>
3729
- </div>
3730
- <div part="content" class="content">
3731
- <div part="steps" class="steps">
3732
- ${this.steps.map((r, e) => this.renderStep(r, e))}
3733
- </div>
3734
- </div>
3735
- <div part="action" class="action">
3736
- <tc-button variant="primary" @tc-click=${this.close}>Got it</tc-button>
3737
- </div>
3738
- </div>
3739
- </div>
3740
- `;
3741
- }
3742
- };
3743
- J.styles = [
3744
- u,
3745
- c`
3746
- :host {
3747
- display: contents;
3748
- }
3749
-
3750
- .overlay {
3751
- position: fixed;
3752
- inset: 0;
3753
- z-index: 1000;
3754
- display: flex;
3755
- align-items: flex-end;
3756
- justify-content: center;
3757
- background: var(--overlay-dim);
3758
- opacity: 0;
3759
- visibility: hidden;
3760
- transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
3761
- }
3762
-
3763
- :host([data-state='showing']) .overlay,
3764
- :host([data-state='visible']) .overlay {
3765
- opacity: 1;
3766
- visibility: visible;
3767
- }
3768
-
3769
- :host([data-state='hiding']) .overlay {
3770
- opacity: 0;
3771
- }
3772
-
3773
- :host([data-state='hidden']) .overlay {
3774
- visibility: hidden;
3775
- }
3776
-
3777
- .modal {
3778
- width: 100%;
3779
- max-width: 400px;
3780
- margin: var(--space-md);
3781
- padding: var(--space-lg);
3782
- background: var(--paper-white);
3783
- border-radius: var(--radius-lg) var(--radius-lg) 0 0;
3784
- transform: translateY(100%);
3785
- transition: transform var(--transition-smooth);
3786
- }
3787
-
3788
- :host([data-state='showing']) .modal,
3789
- :host([data-state='visible']) .modal {
3790
- transform: translateY(0);
3791
- }
3792
-
3793
- :host([data-state='hiding']) .modal {
3794
- transform: translateY(100%);
3795
- }
3796
-
3797
- .header {
3798
- display: flex;
3799
- align-items: center;
3800
- justify-content: space-between;
3801
- margin-bottom: var(--space-lg);
3802
- }
3803
-
3804
- .title {
3805
- font-family: var(--font-body);
3806
- font-size: var(--font-size-lg);
3807
- font-weight: 600;
3808
- color: var(--ink-dark);
3809
- margin: 0;
3810
- }
3811
-
3812
- .close {
3813
- display: flex;
3814
- align-items: center;
3815
- justify-content: center;
3816
- width: var(--size-close-button);
3817
- height: var(--size-close-button);
3818
- padding: 0;
3819
- border: none;
3820
- background: transparent;
3821
- color: var(--ink-medium);
3822
- cursor: pointer;
3823
- border-radius: var(--radius-sm);
3824
- transition: var(--transition-fast);
3825
- }
3826
-
3827
- .close:hover {
3828
- background: var(--paper-warm);
3829
- color: var(--ink-dark);
3830
- }
3831
-
3832
- .close svg {
3833
- width: 1.25rem;
3834
- height: 1.25rem;
3835
- }
3836
-
3837
- .steps {
3838
- display: flex;
3839
- flex-direction: column;
3840
- gap: var(--space-md);
3841
- }
3842
-
3843
- .step {
3844
- display: flex;
3845
- align-items: flex-start;
3846
- gap: var(--space-md);
3847
- }
3848
-
3849
- .step-number {
3850
- flex-shrink: 0;
3851
- display: flex;
3852
- align-items: center;
3853
- justify-content: center;
3854
- width: 1.75rem;
3855
- height: 1.75rem;
3856
- background: var(--accent-primary);
3857
- color: white;
3858
- font-family: var(--font-body);
3859
- font-size: var(--font-size-sm);
3860
- font-weight: 600;
3861
- border-radius: var(--radius-full);
3862
- }
3863
-
3864
- .step-text {
3865
- flex: 1;
3866
- padding-top: 2px;
3867
- color: var(--ink-dark);
3868
- line-height: 1.5;
3869
- }
3870
-
3871
- .share-icon {
3872
- display: inline-flex;
3873
- vertical-align: middle;
3874
- width: 1.25rem;
3875
- height: 1.25rem;
3876
- margin: 0 2px;
3877
- color: var(--accent-primary);
3878
- }
3879
-
3880
- .action {
3881
- margin-top: var(--space-xl);
3882
- }
3883
- `
3884
- ];
3885
- ft([
3886
- n({ type: String })
3887
- ], J.prototype, "title", 2);
3888
- ft([
3889
- n({ type: Array })
3890
- ], J.prototype, "steps", 2);
3891
- J = ft([
3892
- p("tc-ios-installation-guide")
3893
- ], J);
3894
- var De = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, U = (r, e, s, i) => {
3895
- for (var t = i > 1 ? void 0 : i ? Oe(e, s) : e, a = r.length - 1, o; a >= 0; a--)
3896
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
3897
- return i && t && De(e, s, t), t;
3898
- };
3899
- let $ = class extends d {
3900
- constructor() {
3901
- super(...arguments), this.title = "Enable Notifications", this.description = "Stay updated with important alerts and messages.", this.allowLabel = "Allow", this.denyLabel = "Not Now", this.storageKey = "tc-notification-modal-state", this.animation = new j(this, {
3902
- showDuration: 300,
3903
- hideDuration: 200
3904
- }), this.storage = new bt(this, this.storageKey);
3905
- }
3906
- connectedCallback() {
3907
- super.connectedCallback(), this.updateDataState();
3908
- }
3909
- updateDataState() {
3910
- this.dataset.state = this.animation.state;
3911
- }
3912
- /**
3913
- * Check if the modal should be shown based on stored state.
3914
- */
3915
- shouldShow() {
3916
- const r = this.storage.value;
3917
- return !(r?.dismissed || r?.permission === "granted");
3918
- }
3919
- async show() {
3920
- this.shouldShow() && (await this.animation.show(), this.updateDataState());
3921
- }
3922
- async close() {
3923
- await this.animation.hide(), this.updateDataState(), this.dispatchEvent(
3924
- new CustomEvent("tc-close", {
3925
- bubbles: !0,
3926
- composed: !0
3927
- })
3928
- );
3929
- }
3930
- handleOverlayClick(r) {
3931
- r.target === r.currentTarget && this.handleDeny();
3932
- }
3933
- handleAllow() {
3934
- this.storage.set({ dismissed: !0, permission: "granted" }), this.close(), this.dispatchEvent(
3935
- new CustomEvent("tc-allow", {
3936
- bubbles: !0,
3937
- composed: !0
3938
- })
3939
- );
3940
- }
3941
- handleDeny() {
3942
- this.storage.set({ dismissed: !0, permission: "denied" }), this.close(), this.dispatchEvent(
3943
- new CustomEvent("tc-deny", {
3944
- bubbles: !0,
3945
- composed: !0
3946
- })
3947
- );
3948
- }
3949
- render() {
3950
- return l`
3951
- <div part="overlay" class="overlay" @click=${this.handleOverlayClick}>
3952
- <div
3953
- part="modal"
3954
- class="modal"
3955
- role="dialog"
3956
- aria-modal="true"
3957
- aria-labelledby="notification-title"
3958
- aria-describedby="notification-description"
3959
- >
3960
- <div part="icon" class="icon-container">
3961
- <tc-icon name="bell" size="2rem"></tc-icon>
3962
- </div>
3963
- <tc-section part="content" class="content" gap="var(--space-sm)">
3964
- <tc-text
3965
- id="notification-title"
3966
- part="title"
3967
- class="title"
3968
- tag="h2"
3969
- size="lg"
3970
- weight="600"
3971
- >
3972
- ${this.title}
3973
- </tc-text>
3974
- <tc-text
3975
- id="notification-description"
3976
- part="description"
3977
- size="base"
3978
- color="tertiary"
3979
- >
3980
- ${this.description}
3981
- </tc-text>
3982
- </tc-section>
3983
- <div part="actions" class="actions">
3984
- <tc-button variant="primary" @tc-click=${this.handleAllow}>
3985
- ${this.allowLabel}
3986
- </tc-button>
3987
- <button class="deny-button" @click=${this.handleDeny}>
3988
- ${this.denyLabel}
3989
- </button>
3990
- </div>
3991
- </div>
3992
- </div>
3993
- `;
3994
- }
3995
- };
3996
- $.styles = [
3997
- u,
3998
- c`
3999
- :host {
4000
- display: contents;
4001
- }
4002
-
4003
- .overlay {
4004
- position: fixed;
4005
- inset: 0;
4006
- z-index: 1000;
4007
- display: flex;
4008
- align-items: center;
4009
- justify-content: center;
4010
- padding: var(--space-lg);
4011
- background: var(--overlay-dim);
4012
- opacity: 0;
4013
- visibility: hidden;
4014
- transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
4015
- }
4016
-
4017
- :host([data-state='showing']) .overlay,
4018
- :host([data-state='visible']) .overlay {
4019
- opacity: 1;
4020
- visibility: visible;
4021
- }
4022
-
4023
- :host([data-state='hiding']) .overlay {
4024
- opacity: 0;
4025
- }
4026
-
4027
- :host([data-state='hidden']) .overlay {
4028
- visibility: hidden;
4029
- }
4030
-
4031
- .modal {
4032
- display: flex;
4033
- flex-direction: column;
4034
- align-items: center;
4035
- width: 100%;
4036
- max-width: 320px;
4037
- padding: var(--space-xl);
4038
- background: var(--paper-white);
4039
- border-radius: var(--radius-lg);
4040
- box-shadow: 0 20px 60px var(--overlay-shadow-strong);
4041
- text-align: center;
4042
- transform: scale(0.95);
4043
- transition: transform var(--transition-smooth);
4044
- }
4045
-
4046
- :host([data-state='showing']) .modal,
4047
- :host([data-state='visible']) .modal {
4048
- transform: scale(1);
4049
- }
4050
-
4051
- :host([data-state='hiding']) .modal {
4052
- transform: scale(0.95);
4053
- }
4054
-
4055
- .icon-container {
4056
- display: flex;
4057
- align-items: center;
4058
- justify-content: center;
4059
- width: 4rem;
4060
- height: 4rem;
4061
- margin-bottom: var(--space-lg);
4062
- background: var(--alpha-primary10);
4063
- border-radius: var(--radius-full);
4064
- color: var(--accent-primary);
4065
- }
4066
-
4067
- .content {
4068
- margin-bottom: var(--space-xl);
4069
- }
4070
-
4071
- .title {
4072
- margin-bottom: var(--space-sm);
4073
- }
4074
-
4075
- .actions {
4076
- display: flex;
4077
- flex-direction: column;
4078
- gap: var(--space-sm);
4079
- width: 100%;
4080
- }
4081
-
4082
- .deny-button {
4083
- background: transparent;
4084
- border: none;
4085
- padding: var(--space-sm);
4086
- font-family: var(--font-body);
4087
- font-size: var(--font-size-sm);
4088
- color: var(--ink-medium);
4089
- cursor: pointer;
4090
- transition: color var(--transition-fast);
4091
- }
4092
-
4093
- .deny-button:hover {
4094
- color: var(--ink-dark);
4095
- }
4096
- `
4097
- ];
4098
- U([
4099
- n({ type: String })
4100
- ], $.prototype, "title", 2);
4101
- U([
4102
- n({ type: String })
4103
- ], $.prototype, "description", 2);
4104
- U([
4105
- n({ type: String, attribute: "allow-label" })
4106
- ], $.prototype, "allowLabel", 2);
4107
- U([
4108
- n({ type: String, attribute: "deny-label" })
4109
- ], $.prototype, "denyLabel", 2);
4110
- U([
4111
- n({ type: String, attribute: "storage-key" })
4112
- ], $.prototype, "storageKey", 2);
4113
- $ = U([
4114
- p("tc-notification-modal")
4115
- ], $);
4116
- var Se = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, R = (r, e, s, i) => {
4117
- for (var t = i > 1 ? void 0 : i ? Pe(e, s) : e, a = r.length - 1, o; a >= 0; a--)
4118
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
4119
- return i && t && Se(e, s, t), t;
4120
- };
4121
- let z = class extends d {
4122
- constructor() {
4123
- super(...arguments), this.title = "No Connection", this.description = "Please check your internet connection and try again.", this.retryLabel = "Try Again", this.autoDetect = !0, this.isOffline = !1, this.animation = new j(this, {
4124
- showDuration: 300,
4125
- hideDuration: 200
4126
- }), this.handleOnline = () => {
4127
- this.isOffline = !1, this.hide(), this.dispatchEvent(
4128
- new CustomEvent("tc-online", {
4129
- bubbles: !0,
4130
- composed: !0
4131
- })
4132
- );
4133
- }, this.handleOffline = () => {
4134
- this.isOffline = !0, this.show(), this.dispatchEvent(
4135
- new CustomEvent("tc-offline", {
4136
- bubbles: !0,
4137
- composed: !0
4138
- })
4139
- );
4140
- };
4141
- }
4142
- connectedCallback() {
4143
- super.connectedCallback(), this.updateDataState(), this.autoDetect && (this.isOffline = !navigator.onLine, this.isOffline && this.show(), window.addEventListener("online", this.handleOnline), window.addEventListener("offline", this.handleOffline));
4144
- }
4145
- disconnectedCallback() {
4146
- super.disconnectedCallback(), window.removeEventListener("online", this.handleOnline), window.removeEventListener("offline", this.handleOffline);
4147
- }
4148
- updateDataState() {
4149
- this.dataset.state = this.animation.state;
4150
- }
4151
- async show() {
4152
- await this.animation.show(), this.updateDataState();
4153
- }
4154
- async hide() {
4155
- await this.animation.hide(), this.updateDataState();
4156
- }
4157
- handleRetry() {
4158
- this.dispatchEvent(
4159
- new CustomEvent("tc-retry", {
4160
- bubbles: !0,
4161
- composed: !0
4162
- })
4163
- ), navigator.onLine && this.handleOnline();
4164
- }
4165
- render() {
4166
- return l`
4167
- <div part="overlay" class="overlay">
4168
- <div
4169
- part="modal"
4170
- class="modal"
4171
- role="alertdialog"
4172
- aria-modal="true"
4173
- aria-labelledby="offline-title"
4174
- aria-describedby="offline-description"
4175
- >
4176
- <div part="icon" class="icon-container">
4177
- <tc-icon name="wifi-off" size="2rem"></tc-icon>
4178
- </div>
4179
- <tc-section part="content" class="content" gap="var(--space-sm)">
4180
- <tc-text
4181
- id="offline-title"
4182
- part="title"
4183
- class="title"
4184
- tag="h2"
4185
- size="lg"
4186
- weight="600"
4187
- >
4188
- ${this.title}
4189
- </tc-text>
4190
- <tc-text
4191
- id="offline-description"
4192
- part="description"
4193
- size="base"
4194
- color="tertiary"
4195
- >
4196
- ${this.description}
4197
- </tc-text>
4198
- </tc-section>
4199
- <div part="action" class="action">
4200
- <tc-button variant="primary" @tc-click=${this.handleRetry}>
4201
- ${this.retryLabel}
4202
- </tc-button>
4203
- </div>
4204
- </div>
4205
- </div>
4206
- `;
4207
- }
4208
- };
4209
- z.styles = [
4210
- u,
4211
- c`
4212
- :host {
4213
- display: contents;
4214
- }
4215
-
4216
- .overlay {
4217
- position: fixed;
4218
- inset: 0;
4219
- z-index: 1001;
4220
- display: flex;
4221
- align-items: center;
4222
- justify-content: center;
4223
- padding: var(--space-lg);
4224
- background: var(--overlay-dark);
4225
- opacity: 0;
4226
- visibility: hidden;
4227
- transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
4228
- }
4229
-
4230
- :host([data-state='showing']) .overlay,
4231
- :host([data-state='visible']) .overlay {
4232
- opacity: 1;
4233
- visibility: visible;
4234
- }
4235
-
4236
- :host([data-state='hiding']) .overlay {
4237
- opacity: 0;
4238
- }
4239
-
4240
- :host([data-state='hidden']) .overlay {
4241
- visibility: hidden;
4242
- }
4243
-
4244
- .modal {
4245
- display: flex;
4246
- flex-direction: column;
4247
- align-items: center;
4248
- width: 100%;
4249
- max-width: 320px;
4250
- padding: var(--space-xl);
4251
- background: var(--paper-white);
4252
- border-radius: var(--radius-lg);
4253
- box-shadow: 0 20px 60px var(--overlay-shadow-heavy);
4254
- text-align: center;
4255
- transform: scale(0.95);
4256
- transition: transform var(--transition-smooth);
4257
- }
4258
-
4259
- :host([data-state='showing']) .modal,
4260
- :host([data-state='visible']) .modal {
4261
- transform: scale(1);
4262
- }
4263
-
4264
- :host([data-state='hiding']) .modal {
4265
- transform: scale(0.95);
4266
- }
4267
-
4268
- .icon-container {
4269
- display: flex;
4270
- align-items: center;
4271
- justify-content: center;
4272
- width: 4rem;
4273
- height: 4rem;
4274
- margin-bottom: var(--space-lg);
4275
- background: var(--error-bg);
4276
- border-radius: var(--radius-full);
4277
- color: var(--error-base);
4278
- }
4279
-
4280
- .content {
4281
- margin-bottom: var(--space-xl);
4282
- }
4283
-
4284
- .title {
4285
- margin-bottom: var(--space-sm);
4286
- }
4287
-
4288
- .action {
4289
- width: 100%;
4290
- }
4291
- `
4292
- ];
4293
- R([
4294
- n({ type: String })
4295
- ], z.prototype, "title", 2);
4296
- R([
4297
- n({ type: String })
4298
- ], z.prototype, "description", 2);
4299
- R([
4300
- n({ type: String, attribute: "retry-label" })
4301
- ], z.prototype, "retryLabel", 2);
4302
- R([
4303
- n({ type: Boolean, attribute: "auto-detect" })
4304
- ], z.prototype, "autoDetect", 2);
4305
- R([
4306
- S()
4307
- ], z.prototype, "isOffline", 2);
4308
- z = R([
4309
- p("tc-offline-modal")
4310
- ], z);
4311
- var je = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, xt = (r, e, s, i) => {
4312
- for (var t = i > 1 ? void 0 : i ? Ee(e, s) : e, a = r.length - 1, o; a >= 0; a--)
4313
- (o = r[a]) && (t = (i ? o(e, s, t) : o(t)) || t);
4314
- return i && t && je(e, s, t), t;
4315
- };
4316
- let at = class extends d {
4317
- constructor() {
4318
- super(...arguments), this.variant = "primary";
4319
- }
4320
- render() {
4321
- return l`
4322
- <div part="decoration" class="decoration">
4323
- <div part="blob" class="blob blob-1"></div>
4324
- <div part="blob" class="blob blob-2"></div>
4325
- <div part="blob" class="blob blob-3"></div>
4326
- </div>
4327
- `;
4328
- }
4329
- };
4330
- at.styles = [
4331
- u,
4332
- c`
4333
- :host {
4334
- position: fixed;
4335
- inset: 0;
4336
- pointer-events: none;
4337
- z-index: 0;
4338
- overflow: hidden;
4339
- }
4340
-
4341
- .decoration {
4342
- position: absolute;
4343
- inset: 0;
4344
- }
4345
-
4346
- .blob {
4347
- position: absolute;
4348
- border-radius: 50%;
4349
- opacity: 0.35;
4350
- filter: blur(0.0625rem);
4351
- }
4352
-
4353
- /* Primary (purple) variant */
4354
- :host([variant='primary']) .blob {
4355
- background: radial-gradient(
4356
- circle,
4357
- var(--accent-primary) 0%,
4358
- transparent 70%
4359
- );
4360
- }
4361
-
4362
- /* Success (green) variant */
4363
- :host([variant='success']) .blob {
4364
- background: radial-gradient(
4365
- circle,
4366
- var(--accent-success) 0%,
4367
- transparent 70%
4368
- );
4369
- }
4370
-
4371
- /* Error (red) variant */
4372
- :host([variant='error']) .blob {
4373
- background: radial-gradient(
4374
- circle,
4375
- var(--error-base) 0%,
4376
- transparent 70%
4377
- );
4378
- }
4379
-
4380
- .blob-1 {
4381
- width: 18rem;
4382
- height: 18rem;
4383
- top: -6rem;
4384
- left: -5rem;
4385
- animation: decorFloat 12s ease-in-out infinite;
4386
- }
4387
-
4388
- .blob-2 {
4389
- width: 14rem;
4390
- height: 14rem;
4391
- top: 30%;
4392
- right: -6rem;
4393
- animation: decorFloat 10s ease-in-out infinite reverse;
4394
- }
4395
-
4396
- .blob-3 {
4397
- width: 20rem;
4398
- height: 20rem;
4399
- bottom: -8rem;
4400
- left: 20%;
4401
- animation: decorFloat 14s ease-in-out infinite 2s;
4402
- }
4403
-
4404
- @keyframes decorFloat {
4405
- 0%,
4406
- 100% {
4407
- transform: translate(0, 0) scale(1);
4408
- }
4409
- 33% {
4410
- transform: translate(0.375rem, -0.5rem) scale(1.08);
4411
- }
4412
- 66% {
4413
- transform: translate(-0.25rem, -0.25rem) scale(1.15);
4414
- }
4415
- }
4416
-
4417
- /* Reduced motion */
4418
- @media (prefers-reduced-motion: reduce) {
4419
- .blob {
4420
- animation: none;
4421
- }
4422
- }
4423
- `
4424
- ];
4425
- xt([
4426
- n({ type: String })
4427
- ], at.prototype, "variant", 2);
4428
- at = xt([
4429
- p("tc-page-decoration")
4430
- ], at);
4431
- export {
4432
- j as AnimationController,
4433
- P as BaseController,
4434
- He as FormValidationController,
4435
- Ct as HistoryController,
4436
- _t as LoadingController,
4437
- Dt as MatchMediaController,
4438
- Ot as MessageBusController,
4439
- bt as StorageController,
4440
- it as TcBox,
4441
- C as TcButton,
4442
- st as TcCallout,
4443
- K as TcCard,
4444
- N as TcChip,
4445
- W as TcContainer,
4446
- L as TcDivider,
4447
- D as TcErrorScreen,
4448
- O as TcFloatingButton,
4449
- b as TcFormHeader,
4450
- T as TcIcon,
4451
- g as TcIframeModal,
4452
- h as TcInput,
4453
- f as TcInstallationBanner,
4454
- J as TcIosInstallationGuide,
4455
- A as TcItem,
4456
- y as TcItemButton,
4457
- Q as TcLoadingScreen,
4458
- $ as TcNotificationModal,
4459
- z as TcOfflineModal,
4460
- w as TcOtpInput,
4461
- at as TcPageDecoration,
4462
- X as TcSection,
4463
- G as TcSpinner,
4464
- k as TcSuccessScreen,
4465
- I as TcSymbol,
4466
- x as TcText,
4467
- _ as TcToast
4468
- };