@transcodes/ui-components 0.4.3 → 0.4.5

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 (112) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/controllers/animation.controller.d.ts +48 -0
  3. package/dist/controllers/animation.controller.d.ts.map +1 -0
  4. package/dist/controllers/animation.controller.js +32 -0
  5. package/dist/controllers/base.controller.d.ts +14 -0
  6. package/dist/controllers/base.controller.d.ts.map +1 -0
  7. package/dist/controllers/base.controller.js +8 -0
  8. package/dist/controllers/history.controller.d.ts +34 -0
  9. package/dist/controllers/history.controller.d.ts.map +1 -0
  10. package/dist/controllers/history.controller.js +26 -0
  11. package/dist/controllers/index.d.ts +9 -0
  12. package/dist/controllers/index.d.ts.map +1 -0
  13. package/dist/controllers/index.js +16 -0
  14. package/dist/controllers/loading.controller.d.ts +36 -0
  15. package/dist/controllers/loading.controller.d.ts.map +1 -0
  16. package/dist/controllers/loading.controller.js +27 -0
  17. package/dist/controllers/match-media.controller.d.ts +32 -0
  18. package/dist/controllers/match-media.controller.d.ts.map +1 -0
  19. package/dist/controllers/match-media.controller.js +20 -0
  20. package/dist/controllers/message-bus.controller.d.ts +45 -0
  21. package/dist/controllers/message-bus.controller.d.ts.map +1 -0
  22. package/dist/controllers/message-bus.controller.js +45 -0
  23. package/dist/controllers/storage.controller.d.ts +40 -0
  24. package/dist/controllers/storage.controller.d.ts.map +1 -0
  25. package/dist/controllers/storage.controller.js +40 -0
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +64 -0
  29. package/dist/primitives/index.d.ts +22 -0
  30. package/dist/primitives/index.d.ts.map +1 -0
  31. package/dist/primitives/index.js +44 -0
  32. package/dist/primitives/tc-box.d.ts +20 -0
  33. package/dist/primitives/tc-box.d.ts.map +1 -0
  34. package/dist/primitives/tc-box.js +38 -0
  35. package/dist/primitives/tc-button.d.ts +26 -0
  36. package/dist/primitives/tc-button.d.ts.map +1 -0
  37. package/dist/primitives/tc-button.js +168 -0
  38. package/dist/primitives/tc-callout.d.ts +24 -0
  39. package/dist/primitives/tc-callout.d.ts.map +1 -0
  40. package/dist/primitives/tc-callout.js +91 -0
  41. package/dist/primitives/tc-card.d.ts +21 -0
  42. package/dist/primitives/tc-card.d.ts.map +1 -0
  43. package/dist/primitives/tc-card.js +77 -0
  44. package/dist/primitives/tc-chip.d.ts +21 -0
  45. package/dist/primitives/tc-chip.d.ts.map +1 -0
  46. package/dist/primitives/tc-chip.js +90 -0
  47. package/dist/primitives/tc-container.d.ts +21 -0
  48. package/dist/primitives/tc-container.d.ts.map +1 -0
  49. package/dist/primitives/tc-container.js +64 -0
  50. package/dist/primitives/tc-divider.d.ts +22 -0
  51. package/dist/primitives/tc-divider.d.ts.map +1 -0
  52. package/dist/primitives/tc-divider.js +78 -0
  53. package/dist/primitives/tc-error-message.d.ts +25 -0
  54. package/dist/primitives/tc-error-message.d.ts.map +1 -0
  55. package/dist/primitives/tc-error-message.js +81 -0
  56. package/dist/primitives/tc-form-header.d.ts +26 -0
  57. package/dist/primitives/tc-form-header.d.ts.map +1 -0
  58. package/dist/primitives/tc-form-header.js +122 -0
  59. package/dist/primitives/tc-icon.d.ts +20 -0
  60. package/dist/primitives/tc-icon.d.ts.map +1 -0
  61. package/dist/primitives/tc-icon.js +95 -0
  62. package/dist/primitives/tc-input-with-chip.d.ts +40 -0
  63. package/dist/primitives/tc-input-with-chip.d.ts.map +1 -0
  64. package/dist/primitives/tc-input-with-chip.js +250 -0
  65. package/dist/primitives/tc-input.d.ts +46 -0
  66. package/dist/primitives/tc-input.d.ts.map +1 -0
  67. package/dist/primitives/tc-input.js +264 -0
  68. package/dist/primitives/tc-item-button.d.ts +29 -0
  69. package/dist/primitives/tc-item-button.d.ts.map +1 -0
  70. package/dist/primitives/tc-item-button.js +163 -0
  71. package/dist/primitives/tc-item.d.ts +24 -0
  72. package/dist/primitives/tc-item.d.ts.map +1 -0
  73. package/dist/primitives/tc-item.js +88 -0
  74. package/dist/primitives/tc-otp-input.d.ts +40 -0
  75. package/dist/primitives/tc-otp-input.d.ts.map +1 -0
  76. package/dist/primitives/tc-otp-input.js +236 -0
  77. package/dist/primitives/tc-page-decoration.d.ts +21 -0
  78. package/dist/primitives/tc-page-decoration.d.ts.map +1 -0
  79. package/dist/primitives/tc-page-decoration.js +130 -0
  80. package/dist/primitives/tc-section.d.ts +19 -0
  81. package/dist/primitives/tc-section.d.ts.map +1 -0
  82. package/dist/primitives/tc-section.js +47 -0
  83. package/dist/primitives/tc-spinner.d.ts +21 -0
  84. package/dist/primitives/tc-spinner.d.ts.map +1 -0
  85. package/dist/primitives/tc-spinner.js +90 -0
  86. package/dist/primitives/tc-symbol.d.ts +19 -0
  87. package/dist/primitives/tc-symbol.d.ts.map +1 -0
  88. package/dist/primitives/tc-symbol.js +54 -0
  89. package/dist/primitives/tc-text.d.ts +32 -0
  90. package/dist/primitives/tc-text.d.ts.map +1 -0
  91. package/dist/primitives/tc-text.js +145 -0
  92. package/dist/primitives/tc-toast.d.ts +36 -0
  93. package/dist/primitives/tc-toast.d.ts.map +1 -0
  94. package/dist/primitives/tc-toast.js +199 -0
  95. package/dist/screens/index.d.ts +4 -0
  96. package/dist/screens/index.d.ts.map +1 -0
  97. package/dist/screens/index.js +8 -0
  98. package/dist/screens/tc-error-screen.d.ts +34 -0
  99. package/dist/screens/tc-error-screen.d.ts.map +1 -0
  100. package/dist/screens/tc-error-screen.js +177 -0
  101. package/dist/screens/tc-loading-screen.d.ts +25 -0
  102. package/dist/screens/tc-loading-screen.d.ts.map +1 -0
  103. package/dist/screens/tc-loading-screen.js +85 -0
  104. package/dist/screens/tc-success-screen.d.ts +33 -0
  105. package/dist/screens/tc-success-screen.d.ts.map +1 -0
  106. package/dist/screens/tc-success-screen.js +201 -0
  107. package/dist/styles/shared.d.ts +20 -0
  108. package/dist/styles/shared.d.ts.map +1 -0
  109. package/dist/styles/shared.js +7 -0
  110. package/dist/types.d.ts +34 -0
  111. package/dist/types.d.ts.map +1 -0
  112. package/package.json +3 -2
@@ -0,0 +1,199 @@
1
+ import { css as h, LitElement as m, html as d } from "lit";
2
+ import { property as e, customElement as p } from "lit/decorators.js";
3
+ import { styleMap as u } from "lit/directives/style-map.js";
4
+ import { AnimationController as v } from "../controllers/animation.controller.js";
5
+ import { sharedStyles as y } from "../styles/shared.js";
6
+ var f = Object.defineProperty, b = Object.getOwnPropertyDescriptor, i = (c, a, r, o) => {
7
+ for (var s = o > 1 ? void 0 : o ? b(a, r) : a, n = c.length - 1, l; n >= 0; n--)
8
+ (l = c[n]) && (s = (o ? l(a, r, s) : l(s)) || s);
9
+ return o && s && f(a, r, s), s;
10
+ };
11
+ let t = class extends m {
12
+ constructor() {
13
+ super(...arguments), this.variant = "info", this.duration = 5e3, this.autoDismiss = !0, this.dismissible = !0, this.sx = {}, this.animation = new v(this, {
14
+ showDuration: 300,
15
+ hideDuration: 200
16
+ });
17
+ }
18
+ connectedCallback() {
19
+ super.connectedCallback(), this.updateDataState();
20
+ }
21
+ disconnectedCallback() {
22
+ super.disconnectedCallback(), this.clearDismissTimer();
23
+ }
24
+ updateDataState() {
25
+ this.dataset.state = this.animation.state;
26
+ }
27
+ clearDismissTimer() {
28
+ this.dismissTimer && (clearTimeout(this.dismissTimer), this.dismissTimer = void 0);
29
+ }
30
+ startDismissTimer() {
31
+ this.autoDismiss && this.duration > 0 && (this.clearDismissTimer(), this.dismissTimer = setTimeout(() => {
32
+ this.hide();
33
+ }, this.duration));
34
+ }
35
+ async show() {
36
+ this.clearDismissTimer(), await this.animation.show(), this.updateDataState(), this.startDismissTimer();
37
+ }
38
+ async hide() {
39
+ this.clearDismissTimer(), await this.animation.hide(), this.updateDataState(), this.dispatchEvent(
40
+ new CustomEvent("tc-dismiss", {
41
+ bubbles: !0,
42
+ composed: !0
43
+ })
44
+ );
45
+ }
46
+ handleClose() {
47
+ this.hide();
48
+ }
49
+ render() {
50
+ return d`
51
+ <div
52
+ part="toast"
53
+ class="toast toast--${this.variant}"
54
+ role="alert"
55
+ aria-live="polite"
56
+ style=${u(this.sx)}
57
+ >
58
+ <div part="content" class="content">
59
+ <slot></slot>
60
+ </div>
61
+ ${this.dismissible ? d`
62
+ <button
63
+ part="close"
64
+ class="close"
65
+ @click=${this.handleClose}
66
+ aria-label="Dismiss"
67
+ >
68
+ <svg
69
+ viewBox="0 0 24 24"
70
+ fill="none"
71
+ stroke="currentColor"
72
+ stroke-width="2"
73
+ stroke-linecap="round"
74
+ stroke-linejoin="round"
75
+ >
76
+ <line x1="18" y1="6" x2="6" y2="18"></line>
77
+ <line x1="6" y1="6" x2="18" y2="18"></line>
78
+ </svg>
79
+ </button>
80
+ ` : ""}
81
+ </div>
82
+ `;
83
+ }
84
+ };
85
+ t.styles = [
86
+ y,
87
+ h`
88
+ :host {
89
+ display: block;
90
+ position: fixed;
91
+ bottom: var(--space-lg);
92
+ left: 50%;
93
+ transform: translateX(-50%);
94
+ z-index: 1000;
95
+ pointer-events: none;
96
+ }
97
+
98
+ .toast {
99
+ display: flex;
100
+ align-items: center;
101
+ gap: var(--space-sm);
102
+ padding: var(--space-md) var(--space-lg);
103
+ border-radius: var(--radius-md);
104
+ font-family: var(--font-body);
105
+ font-size: var(--font-size-sm);
106
+ box-shadow: 0 4px 12px var(--overlay-shadow-subtle);
107
+ pointer-events: auto;
108
+ opacity: 0;
109
+ transform: translateY(100%);
110
+ transition: opacity var(--transition-smooth), transform var(--transition-smooth);
111
+ }
112
+
113
+ :host([data-state='showing']) .toast,
114
+ :host([data-state='visible']) .toast {
115
+ opacity: 1;
116
+ transform: translateY(0);
117
+ }
118
+
119
+ :host([data-state='hiding']) .toast {
120
+ opacity: 0;
121
+ transform: translateY(100%);
122
+ }
123
+
124
+ :host([data-state='hidden']) {
125
+ display: none;
126
+ }
127
+
128
+ .toast--info {
129
+ background: var(--ink-dark);
130
+ color: var(--paper-white);
131
+ }
132
+
133
+ .toast--success {
134
+ background: var(--accent-success);
135
+ color: white;
136
+ }
137
+
138
+ .toast--warning {
139
+ background: var(--semantic-warning);
140
+ color: white;
141
+ }
142
+
143
+ .toast--error {
144
+ background: var(--error-base);
145
+ color: white;
146
+ }
147
+
148
+ .content {
149
+ flex: 1;
150
+ line-height: 1.4;
151
+ }
152
+
153
+ .close {
154
+ flex-shrink: 0;
155
+ display: flex;
156
+ align-items: center;
157
+ justify-content: center;
158
+ width: var(--size-icon-md);
159
+ height: var(--size-icon-md);
160
+ padding: 0;
161
+ border: none;
162
+ background: transparent;
163
+ color: inherit;
164
+ opacity: var(--opacity-hover);
165
+ cursor: pointer;
166
+ transition: opacity var(--transition-fast);
167
+ }
168
+
169
+ .close:hover {
170
+ opacity: 1;
171
+ }
172
+
173
+ .close svg {
174
+ width: var(--size-icon-sm);
175
+ height: var(--size-icon-sm);
176
+ }
177
+ `
178
+ ];
179
+ i([
180
+ e({ type: String })
181
+ ], t.prototype, "variant", 2);
182
+ i([
183
+ e({ type: Number })
184
+ ], t.prototype, "duration", 2);
185
+ i([
186
+ e({ type: Boolean, attribute: "auto-dismiss" })
187
+ ], t.prototype, "autoDismiss", 2);
188
+ i([
189
+ e({ type: Boolean })
190
+ ], t.prototype, "dismissible", 2);
191
+ i([
192
+ e({ type: Object })
193
+ ], t.prototype, "sx", 2);
194
+ t = i([
195
+ p("tc-toast")
196
+ ], t);
197
+ export {
198
+ t as TcToast
199
+ };
@@ -0,0 +1,4 @@
1
+ export { TcErrorScreen } from './tc-error-screen.js';
2
+ export { TcLoadingScreen } from './tc-loading-screen.js';
3
+ export { TcSuccessScreen } from './tc-success-screen.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/screens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { TcErrorScreen as c } from "./tc-error-screen.js";
2
+ import { TcLoadingScreen as n } from "./tc-loading-screen.js";
3
+ import { TcSuccessScreen as f } from "./tc-success-screen.js";
4
+ export {
5
+ c as TcErrorScreen,
6
+ n as TcLoadingScreen,
7
+ f as TcSuccessScreen
8
+ };
@@ -0,0 +1,34 @@
1
+ import { LitElement } from 'lit';
2
+ import { SxProps } from '../types.js';
3
+ /**
4
+ * A full-screen error state with animated icon, message, and retry action.
5
+ *
6
+ * @fires tc-retry - Fired when the retry button is clicked
7
+ * @csspart screen - The screen container
8
+ * @csspart content - The content wrapper
9
+ * @csspart icon - The error icon
10
+ * @csspart title - The error title
11
+ * @csspart message - The error message
12
+ * @csspart action - The action button container
13
+ */
14
+ export declare class TcErrorScreen extends LitElement {
15
+ title: string;
16
+ message: string;
17
+ retryLabel: string;
18
+ showRetry: boolean;
19
+ autoAnimate: boolean;
20
+ sx: SxProps;
21
+ private isAnimated;
22
+ private animation;
23
+ static styles: import('lit').CSSResult;
24
+ connectedCallback(): void;
25
+ playAnimation(): Promise<void>;
26
+ private handleRetry;
27
+ render(): import('lit').TemplateResult<1>;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'tc-error-screen': TcErrorScreen;
32
+ }
33
+ }
34
+ //# sourceMappingURL=tc-error-screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tc-error-screen.d.ts","sourceRoot":"","sources":["../../src/screens/tc-error-screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAI5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AAErC;;;;;;;;;;GAUG;AACH,qBACa,aAAc,SAAQ,UAAU;IACf,KAAK,SAA0B;IAC/B,OAAO,SACiB;IACE,UAAU,SAClD;IACwC,SAAS,UAAQ;IACf,WAAW,UAAQ;IAC/C,EAAE,EAAE,OAAO,CAAM;IAEpC,OAAO,CAAC,UAAU,CAAS;IAEpC,OAAO,CAAC,SAAS,CAGd;IAEH,OAAgB,MAAM,0BAkFpB;IAEO,iBAAiB;IASpB,aAAa;IAKnB,OAAO,CAAC,WAAW;IASV,MAAM;CAkChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
@@ -0,0 +1,177 @@
1
+ import { css as m, LitElement as d, html as p } from "lit";
2
+ import { property as a, state as y, customElement as h } from "lit/decorators.js";
3
+ import { styleMap as u } from "lit/directives/style-map.js";
4
+ import { AnimationController as g } from "../controllers/animation.controller.js";
5
+ import "../primitives/tc-icon.js";
6
+ import "../primitives/tc-text.js";
7
+ import "../primitives/tc-button.js";
8
+ import "../primitives/tc-container.js";
9
+ import "../primitives/tc-section.js";
10
+ var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, e = (r, s, o, n) => {
11
+ for (var i = n > 1 ? void 0 : n ? v(s, o) : s, c = r.length - 1, l; c >= 0; c--)
12
+ (l = r[c]) && (i = (n ? l(s, o, i) : l(i)) || i);
13
+ return n && i && f(s, o, i), i;
14
+ };
15
+ let t = class extends d {
16
+ constructor() {
17
+ super(...arguments), this.title = "Something went wrong", this.message = "An unexpected error occurred. Please try again.", this.retryLabel = "Try Again", this.showRetry = !0, this.autoAnimate = !0, this.sx = {}, this.isAnimated = !1, this.animation = new g(this, {
18
+ showDuration: 600,
19
+ hideDuration: 300
20
+ });
21
+ }
22
+ connectedCallback() {
23
+ super.connectedCallback(), this.autoAnimate && requestAnimationFrame(() => {
24
+ this.playAnimation();
25
+ });
26
+ }
27
+ async playAnimation() {
28
+ await this.animation.show(), this.isAnimated = !0;
29
+ }
30
+ handleRetry() {
31
+ this.dispatchEvent(
32
+ new CustomEvent("tc-retry", {
33
+ bubbles: !0,
34
+ composed: !0
35
+ })
36
+ );
37
+ }
38
+ render() {
39
+ const r = this.isAnimated ? "animated" : "";
40
+ return p`
41
+ <div part="screen" class="screen" style=${u(this.sx)}>
42
+ <tc-container>
43
+ <div part="content" class="content">
44
+ <div part="icon" class="icon-container ${r}">
45
+ <tc-icon name="alert-circle" .sx=${{ "--icon-size": "var(--size-icon-xl)" }}></tc-icon>
46
+ </div>
47
+ <tc-section .sx=${{ gap: "var(--space-sm)" }} class="text-content ${r}">
48
+ <tc-text part="title" tag="h1" size="xl" weight="600" class="title">
49
+ ${this.title}
50
+ </tc-text>
51
+ <tc-text part="message" size="base" color="tertiary" class="message">
52
+ ${this.message}
53
+ </tc-text>
54
+ </tc-section>
55
+ ${this.showRetry ? p`
56
+ <div part="action" class="action ${r}">
57
+ <tc-button variant="primary" @tc-click=${this.handleRetry}>
58
+ ${this.retryLabel}
59
+ </tc-button>
60
+ </div>
61
+ ` : ""}
62
+ </div>
63
+ </tc-container>
64
+ </div>
65
+ `;
66
+ }
67
+ };
68
+ t.styles = m`
69
+ :host {
70
+ display: flex;
71
+ align-items: center;
72
+ justify-content: center;
73
+ width: 100%;
74
+ height: 100%;
75
+ min-height: inherit;
76
+ }
77
+
78
+ .screen {
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: center;
82
+ width: 100%;
83
+ height: 100%;
84
+ min-height: inherit;
85
+ padding: var(--space-lg);
86
+ box-sizing: border-box;
87
+ }
88
+
89
+ .content {
90
+ display: flex;
91
+ flex-direction: column;
92
+ align-items: center;
93
+ gap: var(--space-lg);
94
+ text-align: center;
95
+ max-width: 20rem;
96
+ }
97
+
98
+ .icon-container {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ padding: var(--space-md);
103
+ background: var(--error-bg);
104
+ border-radius: var(--radius-full);
105
+ color: var(--error-base);
106
+ transform: scale(0);
107
+ opacity: 0;
108
+ transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
109
+ opacity 0.3s ease;
110
+ }
111
+
112
+ .icon-container.animated {
113
+ transform: scale(1);
114
+ opacity: 1;
115
+ }
116
+
117
+ .title {
118
+ margin: 0;
119
+ }
120
+
121
+ .message {
122
+ color: var(--ink-medium);
123
+ }
124
+
125
+ .text-content {
126
+ opacity: 0;
127
+ transform: translateY(var(--offset-slide-up-md));
128
+ transition: opacity 0.4s ease, transform 0.4s ease;
129
+ transition-delay: 0.4s;
130
+ }
131
+
132
+ .text-content.animated {
133
+ opacity: 1;
134
+ transform: translateY(0);
135
+ }
136
+
137
+ .action {
138
+ width: 100%;
139
+ margin-top: var(--space-md);
140
+ opacity: 0;
141
+ transform: translateY(var(--offset-slide-up-md));
142
+ transition: opacity 0.4s ease, transform 0.4s ease;
143
+ transition-delay: 0.6s;
144
+ }
145
+
146
+ .action.animated {
147
+ opacity: 1;
148
+ transform: translateY(0);
149
+ }
150
+ `;
151
+ e([
152
+ a({ type: String })
153
+ ], t.prototype, "title", 2);
154
+ e([
155
+ a({ type: String })
156
+ ], t.prototype, "message", 2);
157
+ e([
158
+ a({ type: String, attribute: "retry-label" })
159
+ ], t.prototype, "retryLabel", 2);
160
+ e([
161
+ a({ type: Boolean, attribute: "show-retry" })
162
+ ], t.prototype, "showRetry", 2);
163
+ e([
164
+ a({ type: Boolean, attribute: "auto-animate" })
165
+ ], t.prototype, "autoAnimate", 2);
166
+ e([
167
+ a({ type: Object })
168
+ ], t.prototype, "sx", 2);
169
+ e([
170
+ y()
171
+ ], t.prototype, "isAnimated", 2);
172
+ t = e([
173
+ h("tc-error-screen")
174
+ ], t);
175
+ export {
176
+ t as TcErrorScreen
177
+ };
@@ -0,0 +1,25 @@
1
+ import { LitElement } from 'lit';
2
+ import { SxProps } from '../types.js';
3
+ /**
4
+ * A full-screen loading state with spinner and optional message.
5
+ *
6
+ * @csspart screen - The screen container
7
+ * @csspart content - The content wrapper
8
+ * @csspart spinner - The spinner element
9
+ * @csspart message - The message text
10
+ */
11
+ export declare class TcLoadingScreen extends LitElement {
12
+ message: string;
13
+ spinnerSize: 'sm' | 'md' | 'lg' | 'auto';
14
+ sx: SxProps;
15
+ private loading;
16
+ static styles: import('lit').CSSResult;
17
+ connectedCallback(): void;
18
+ render(): import('lit').TemplateResult<1>;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ 'tc-loading-screen': TcLoadingScreen;
23
+ }
24
+ }
25
+ //# sourceMappingURL=tc-loading-screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tc-loading-screen.d.ts","sourceRoot":"","sources":["../../src/screens/tc-loading-screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAI5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AAEvC;;;;;;;GAOG;AACH,qBACa,eAAgB,SAAQ,UAAU;IACjB,OAAO,SAAM;IACc,WAAW,EAC9D,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,MAAM,CAAQ;IACU,EAAE,EAAE,OAAO,CAAM;IAE7C,OAAO,CAAC,OAAO,CAA+B;IAE9C,OAAgB,MAAM,0BAiCpB;IAEO,iBAAiB;IAKjB,MAAM;CAoBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
@@ -0,0 +1,85 @@
1
+ import { css as m, LitElement as g, html as l } from "lit";
2
+ import { property as a, customElement as h } from "lit/decorators.js";
3
+ import { styleMap as d } from "lit/directives/style-map.js";
4
+ import { LoadingController as y } from "../controllers/loading.controller.js";
5
+ import "../primitives/tc-spinner.js";
6
+ import "../primitives/tc-text.js";
7
+ import "../primitives/tc-container.js";
8
+ var f = Object.defineProperty, x = Object.getOwnPropertyDescriptor, r = (p, s, n, i) => {
9
+ for (var e = i > 1 ? void 0 : i ? x(s, n) : s, o = p.length - 1, c; o >= 0; o--)
10
+ (c = p[o]) && (e = (i ? c(s, n, e) : c(e)) || e);
11
+ return i && e && f(s, n, e), e;
12
+ };
13
+ let t = class extends g {
14
+ constructor() {
15
+ super(...arguments), this.message = "", this.spinnerSize = "md", this.sx = {}, this.loading = new y(this);
16
+ }
17
+ connectedCallback() {
18
+ super.connectedCallback(), this.loading.start();
19
+ }
20
+ render() {
21
+ return l`
22
+ <div part="screen" class="screen" style=${d(this.sx)}>
23
+ <tc-container>
24
+ <div part="content" class="content">
25
+ <tc-spinner part="spinner" size=${this.spinnerSize}></tc-spinner>
26
+ ${this.message ? l`
27
+ <tc-text part="message" class="message" size="base" color="tertiary">
28
+ ${this.message}
29
+ </tc-text>
30
+ ` : ""}
31
+ </div>
32
+ </tc-container>
33
+ </div>
34
+ `;
35
+ }
36
+ };
37
+ t.styles = m`
38
+ :host {
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ width: 100%;
43
+ height: 100%;
44
+ min-height: inherit;
45
+ }
46
+
47
+ .screen {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ width: 100%;
52
+ height: 100%;
53
+ min-height: inherit;
54
+ padding: var(--space-lg);
55
+ box-sizing: border-box;
56
+ }
57
+
58
+ .content {
59
+ display: flex;
60
+ flex-direction: column;
61
+ align-items: center;
62
+ gap: var(--space-lg);
63
+ text-align: center;
64
+ }
65
+
66
+ .message {
67
+ color: var(--ink-medium);
68
+ max-width: 20rem;
69
+ }
70
+ `;
71
+ r([
72
+ a({ type: String })
73
+ ], t.prototype, "message", 2);
74
+ r([
75
+ a({ type: String, attribute: "spinner-size" })
76
+ ], t.prototype, "spinnerSize", 2);
77
+ r([
78
+ a({ type: Object })
79
+ ], t.prototype, "sx", 2);
80
+ t = r([
81
+ h("tc-loading-screen")
82
+ ], t);
83
+ export {
84
+ t as TcLoadingScreen
85
+ };
@@ -0,0 +1,33 @@
1
+ import { LitElement } from 'lit';
2
+ import { SxProps } from '../types.js';
3
+ /**
4
+ * A full-screen success state with animated checkmark and message.
5
+ *
6
+ * @fires tc-action - Fired when the action button is clicked
7
+ * @csspart screen - The screen container
8
+ * @csspart content - The content wrapper
9
+ * @csspart icon - The success icon container
10
+ * @csspart title - The success title
11
+ * @csspart message - The success message
12
+ * @csspart action - The action button container
13
+ */
14
+ export declare class TcSuccessScreen extends LitElement {
15
+ title: string;
16
+ message: string;
17
+ actionLabel: string;
18
+ autoAnimate: boolean;
19
+ sx: SxProps;
20
+ private isAnimated;
21
+ private animation;
22
+ static styles: import('lit').CSSResult;
23
+ connectedCallback(): void;
24
+ playAnimation(): Promise<void>;
25
+ private handleAction;
26
+ render(): import('lit').TemplateResult<1>;
27
+ }
28
+ declare global {
29
+ interface HTMLElementTagNameMap {
30
+ 'tc-success-screen': TcSuccessScreen;
31
+ }
32
+ }
33
+ //# sourceMappingURL=tc-success-screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tc-success-screen.d.ts","sourceRoot":"","sources":["../../src/screens/tc-success-screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAI5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AAErC;;;;;;;;;;GAUG;AACH,qBACa,eAAgB,SAAQ,UAAU;IACjB,KAAK,SAAc;IACnB,OAAO,SACS;IACW,WAAW,SAAM;IAChB,WAAW,UAAQ;IAC/C,EAAE,EAAE,OAAO,CAAM;IAEpC,OAAO,CAAC,UAAU,CAAS;IAEpC,OAAO,CAAC,SAAS,CAGd;IAEH,OAAgB,MAAM,0BAmGpB;IAEO,iBAAiB;IASpB,aAAa;IAKnB,OAAO,CAAC,YAAY;IASX,MAAM;CA4ChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}