@transcodes/ui-components 0.3.0 → 0.3.2

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