@transcodes/ui-components 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/controllers/index.d.ts +0 -2
- package/dist/controllers/index.d.ts.map +1 -1
- package/dist/controllers/index.js +10 -12
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -64
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +18 -16
- package/dist/primitives/tc-box.js +4 -4
- package/dist/primitives/tc-button.d.ts.map +1 -1
- package/dist/primitives/tc-button.js +21 -20
- package/dist/primitives/tc-callout.d.ts.map +1 -1
- package/dist/primitives/tc-callout.js +5 -4
- package/dist/primitives/tc-card.d.ts.map +1 -1
- package/dist/primitives/tc-card.js +11 -10
- package/dist/primitives/tc-chip.d.ts.map +1 -1
- package/dist/primitives/tc-chip.js +18 -16
- package/dist/primitives/tc-container.d.ts.map +1 -1
- package/dist/primitives/tc-container.js +12 -10
- package/dist/primitives/tc-divider.d.ts.map +1 -1
- package/dist/primitives/tc-divider.js +4 -3
- package/dist/primitives/tc-error-message.d.ts.map +1 -1
- package/dist/primitives/tc-error-message.js +13 -9
- package/dist/primitives/tc-form-header.d.ts.map +1 -1
- package/dist/primitives/tc-form-header.js +9 -7
- package/dist/primitives/tc-icon.js +3 -3
- package/dist/primitives/tc-input-with-chip.d.ts.map +1 -1
- package/dist/primitives/tc-input-with-chip.js +12 -8
- package/dist/primitives/tc-input.d.ts.map +1 -1
- package/dist/primitives/tc-input.js +11 -9
- package/dist/primitives/tc-item-button.d.ts.map +1 -1
- package/dist/primitives/tc-item-button.js +18 -17
- package/dist/primitives/tc-item.d.ts.map +1 -1
- package/dist/primitives/tc-item.js +13 -12
- package/dist/primitives/tc-otp-input.d.ts.map +1 -1
- package/dist/primitives/tc-otp-input.js +6 -4
- package/dist/primitives/tc-page-decoration.d.ts.map +1 -0
- package/dist/{widgets → primitives}/tc-page-decoration.js +8 -8
- package/dist/primitives/tc-section.d.ts.map +1 -1
- package/dist/primitives/tc-section.js +15 -13
- package/dist/primitives/tc-spinner.js +17 -17
- package/dist/primitives/tc-symbol.d.ts.map +1 -1
- package/dist/primitives/tc-symbol.js +15 -13
- package/dist/primitives/tc-text.js +3 -3
- package/dist/primitives/tc-toast.js +3 -3
- package/dist/screens/tc-error-screen.d.ts +6 -1
- package/dist/screens/tc-error-screen.d.ts.map +1 -1
- package/dist/screens/tc-error-screen.js +84 -29
- package/dist/screens/tc-loading-screen.d.ts +1 -1
- package/dist/screens/tc-loading-screen.d.ts.map +1 -1
- package/dist/screens/tc-loading-screen.js +16 -11
- package/dist/screens/tc-success-screen.d.ts.map +1 -1
- package/dist/screens/tc-success-screen.js +19 -13
- package/package.json +13 -13
- package/dist/controllers/form-validation.controller.d.ts +0 -48
- package/dist/controllers/form-validation.controller.d.ts.map +0 -1
- package/dist/controllers/form-validation.controller.js +0 -49
- package/dist/widgets/index.d.ts +0 -9
- package/dist/widgets/index.d.ts.map +0 -1
- package/dist/widgets/index.js +0 -18
- package/dist/widgets/tc-authenticator-card.d.ts +0 -35
- package/dist/widgets/tc-authenticator-card.d.ts.map +0 -1
- package/dist/widgets/tc-authenticator-card.js +0 -213
- package/dist/widgets/tc-floating-button.d.ts +0 -25
- package/dist/widgets/tc-floating-button.d.ts.map +0 -1
- package/dist/widgets/tc-floating-button.js +0 -132
- package/dist/widgets/tc-iframe-modal.d.ts +0 -43
- package/dist/widgets/tc-iframe-modal.d.ts.map +0 -1
- package/dist/widgets/tc-iframe-modal.js +0 -263
- package/dist/widgets/tc-installation-banner.d.ts +0 -42
- package/dist/widgets/tc-installation-banner.d.ts.map +0 -1
- package/dist/widgets/tc-installation-banner.js +0 -234
- package/dist/widgets/tc-ios-installation-guide.d.ts +0 -34
- package/dist/widgets/tc-ios-installation-guide.d.ts.map +0 -1
- package/dist/widgets/tc-ios-installation-guide.js +0 -240
- package/dist/widgets/tc-notification-modal.d.ts +0 -42
- package/dist/widgets/tc-notification-modal.d.ts.map +0 -1
- package/dist/widgets/tc-notification-modal.js +0 -230
- package/dist/widgets/tc-offline-modal.d.ts +0 -39
- package/dist/widgets/tc-offline-modal.d.ts.map +0 -1
- package/dist/widgets/tc-offline-modal.js +0 -202
- package/dist/widgets/tc-page-decoration.d.ts.map +0 -1
- /package/dist/{widgets → primitives}/tc-page-decoration.d.ts +0 -0
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { LitElement as c, html as h, css as p } from "lit";
|
|
2
|
-
import { property as r, state as m, customElement as v } from "lit/decorators.js";
|
|
3
|
-
import { AnimationController as y } from "../controllers/animation.controller.js";
|
|
4
|
-
import { HistoryController as u } from "../controllers/history.controller.js";
|
|
5
|
-
import { MessageBusController as f } from "../controllers/message-bus.controller.js";
|
|
6
|
-
import { sharedStyles as g } from "../styles/shared.js";
|
|
7
|
-
var b = Object.defineProperty, w = Object.getOwnPropertyDescriptor, s = (t, i, o, n) => {
|
|
8
|
-
for (var a = n > 1 ? void 0 : n ? w(i, o) : i, l = t.length - 1, d; l >= 0; l--)
|
|
9
|
-
(d = t[l]) && (a = (n ? d(i, o, a) : d(a)) || a);
|
|
10
|
-
return n && a && b(i, o, a), a;
|
|
11
|
-
};
|
|
12
|
-
let e = class extends c {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments), this.src = "", this.title = "", this.closeOnEscape = !0, this.closeOnOverlay = !0, this.useHistory = !0, this.isLoading = !0, this.animation = new y(this, {
|
|
15
|
-
showDuration: 300,
|
|
16
|
-
hideDuration: 200
|
|
17
|
-
}), this.history = new u(this), this.messageBus = new f(this), this.handleKeyDown = (t) => {
|
|
18
|
-
t.key === "Escape" && this.animation.state === "visible" && this.close();
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
connectedCallback() {
|
|
22
|
-
super.connectedCallback(), this.updateDataState(), this.closeOnEscape && document.addEventListener("keydown", this.handleKeyDown), this.messageBus.onMessage("*", (t, i) => {
|
|
23
|
-
this.dispatchEvent(
|
|
24
|
-
new CustomEvent("tc-message", {
|
|
25
|
-
bubbles: !0,
|
|
26
|
-
composed: !0,
|
|
27
|
-
detail: { type: t, payload: i }
|
|
28
|
-
})
|
|
29
|
-
);
|
|
30
|
-
}), this.useHistory && this.history.onPopState(() => {
|
|
31
|
-
this.animation.state === "visible" && this.close();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
disconnectedCallback() {
|
|
35
|
-
super.disconnectedCallback(), document.removeEventListener("keydown", this.handleKeyDown);
|
|
36
|
-
}
|
|
37
|
-
updateDataState() {
|
|
38
|
-
this.dataset.state = this.animation.state;
|
|
39
|
-
}
|
|
40
|
-
async open() {
|
|
41
|
-
this.useHistory && this.history.push({ modal: "iframe" }), this.isLoading = !0, await this.animation.show(), this.updateDataState();
|
|
42
|
-
}
|
|
43
|
-
async close() {
|
|
44
|
-
this.useHistory && this.history.pop(), await this.animation.hide(), this.updateDataState(), this.dispatchEvent(
|
|
45
|
-
new CustomEvent("tc-close", {
|
|
46
|
-
bubbles: !0,
|
|
47
|
-
composed: !0
|
|
48
|
-
})
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
handleOverlayClick(t) {
|
|
52
|
-
this.closeOnOverlay && t.target === t.currentTarget && this.close();
|
|
53
|
-
}
|
|
54
|
-
handleIframeLoad() {
|
|
55
|
-
this.isLoading = !1, this.dispatchEvent(
|
|
56
|
-
new CustomEvent("tc-load", {
|
|
57
|
-
bubbles: !0,
|
|
58
|
-
composed: !0
|
|
59
|
-
})
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
sendMessage(t, i) {
|
|
63
|
-
const o = this.shadowRoot?.querySelector("iframe");
|
|
64
|
-
o?.contentWindow && this.messageBus.send(t, i, o.contentWindow);
|
|
65
|
-
}
|
|
66
|
-
render() {
|
|
67
|
-
return h`
|
|
68
|
-
<div part="overlay" class="overlay" @click=${this.handleOverlayClick}>
|
|
69
|
-
<div part="modal" class="modal" role="dialog" aria-modal="true" aria-labelledby="modal-title">
|
|
70
|
-
${this.title ? h`
|
|
71
|
-
<div part="header" class="header">
|
|
72
|
-
<h2 id="modal-title" class="title">${this.title}</h2>
|
|
73
|
-
<button
|
|
74
|
-
part="close"
|
|
75
|
-
class="close"
|
|
76
|
-
@click=${this.close}
|
|
77
|
-
aria-label="Close modal"
|
|
78
|
-
>
|
|
79
|
-
<svg
|
|
80
|
-
viewBox="0 0 24 24"
|
|
81
|
-
fill="none"
|
|
82
|
-
stroke="currentColor"
|
|
83
|
-
stroke-width="2"
|
|
84
|
-
stroke-linecap="round"
|
|
85
|
-
stroke-linejoin="round"
|
|
86
|
-
>
|
|
87
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
88
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
89
|
-
</svg>
|
|
90
|
-
</button>
|
|
91
|
-
</div>
|
|
92
|
-
` : ""}
|
|
93
|
-
<div part="content" class="content">
|
|
94
|
-
<iframe
|
|
95
|
-
part="iframe"
|
|
96
|
-
class="iframe"
|
|
97
|
-
src=${this.src}
|
|
98
|
-
@load=${this.handleIframeLoad}
|
|
99
|
-
title=${this.title || "Modal content"}
|
|
100
|
-
></iframe>
|
|
101
|
-
<div part="loader" class="loader ${this.isLoading ? "" : "hidden"}">
|
|
102
|
-
<tc-spinner size="2rem"></tc-spinner>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
`;
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
e.styles = [
|
|
111
|
-
g,
|
|
112
|
-
p`
|
|
113
|
-
:host {
|
|
114
|
-
display: contents;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.overlay {
|
|
118
|
-
position: fixed;
|
|
119
|
-
inset: 0;
|
|
120
|
-
z-index: 1000;
|
|
121
|
-
display: flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
justify-content: center;
|
|
124
|
-
padding: var(--space-lg);
|
|
125
|
-
background: var(--overlay-dim);
|
|
126
|
-
opacity: 0;
|
|
127
|
-
visibility: hidden;
|
|
128
|
-
transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
:host([data-state='showing']) .overlay,
|
|
132
|
-
:host([data-state='visible']) .overlay {
|
|
133
|
-
opacity: 1;
|
|
134
|
-
visibility: visible;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
:host([data-state='hiding']) .overlay {
|
|
138
|
-
opacity: 0;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
:host([data-state='hidden']) .overlay {
|
|
142
|
-
visibility: hidden;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.modal {
|
|
146
|
-
display: flex;
|
|
147
|
-
flex-direction: column;
|
|
148
|
-
width: 100%;
|
|
149
|
-
max-width: 600px;
|
|
150
|
-
max-height: 90vh;
|
|
151
|
-
max-height: 90dvh;
|
|
152
|
-
background: var(--paper-white);
|
|
153
|
-
border-radius: var(--radius-lg);
|
|
154
|
-
box-shadow: 0 20px 60px var(--overlay-shadow-strong);
|
|
155
|
-
overflow: hidden;
|
|
156
|
-
transform: scale(0.95) translateY(20px);
|
|
157
|
-
transition: transform var(--transition-smooth);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
:host([data-state='showing']) .modal,
|
|
161
|
-
:host([data-state='visible']) .modal {
|
|
162
|
-
transform: scale(1) translateY(0);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
:host([data-state='hiding']) .modal {
|
|
166
|
-
transform: scale(0.95) translateY(20px);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.header {
|
|
170
|
-
display: flex;
|
|
171
|
-
align-items: center;
|
|
172
|
-
justify-content: space-between;
|
|
173
|
-
padding: var(--space-md) var(--space-lg);
|
|
174
|
-
border-bottom: 1px solid var(--paper-warm);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.title {
|
|
178
|
-
font-family: var(--font-body);
|
|
179
|
-
font-size: var(--font-size-lg);
|
|
180
|
-
font-weight: 600;
|
|
181
|
-
color: var(--ink-dark);
|
|
182
|
-
margin: 0;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.close {
|
|
186
|
-
display: flex;
|
|
187
|
-
align-items: center;
|
|
188
|
-
justify-content: center;
|
|
189
|
-
width: var(--size-close-button);
|
|
190
|
-
height: var(--size-close-button);
|
|
191
|
-
padding: 0;
|
|
192
|
-
border: none;
|
|
193
|
-
background: transparent;
|
|
194
|
-
color: var(--ink-medium);
|
|
195
|
-
cursor: pointer;
|
|
196
|
-
border-radius: var(--radius-sm);
|
|
197
|
-
transition: var(--transition-fast);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.close:hover {
|
|
201
|
-
background: var(--paper-warm);
|
|
202
|
-
color: var(--ink-dark);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.close svg {
|
|
206
|
-
width: 1.25rem;
|
|
207
|
-
height: 1.25rem;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.content {
|
|
211
|
-
position: relative;
|
|
212
|
-
flex: 1;
|
|
213
|
-
overflow: hidden;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.iframe {
|
|
217
|
-
width: 100%;
|
|
218
|
-
height: 100%;
|
|
219
|
-
min-height: 400px;
|
|
220
|
-
border: none;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.loader {
|
|
224
|
-
position: absolute;
|
|
225
|
-
inset: 0;
|
|
226
|
-
display: flex;
|
|
227
|
-
align-items: center;
|
|
228
|
-
justify-content: center;
|
|
229
|
-
background: var(--paper-white);
|
|
230
|
-
opacity: 1;
|
|
231
|
-
transition: opacity var(--transition-smooth);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.loader.hidden {
|
|
235
|
-
opacity: 0;
|
|
236
|
-
pointer-events: none;
|
|
237
|
-
}
|
|
238
|
-
`
|
|
239
|
-
];
|
|
240
|
-
s([
|
|
241
|
-
r({ type: String })
|
|
242
|
-
], e.prototype, "src", 2);
|
|
243
|
-
s([
|
|
244
|
-
r({ type: String })
|
|
245
|
-
], e.prototype, "title", 2);
|
|
246
|
-
s([
|
|
247
|
-
r({ type: Boolean, attribute: "close-on-escape" })
|
|
248
|
-
], e.prototype, "closeOnEscape", 2);
|
|
249
|
-
s([
|
|
250
|
-
r({ type: Boolean, attribute: "close-on-overlay" })
|
|
251
|
-
], e.prototype, "closeOnOverlay", 2);
|
|
252
|
-
s([
|
|
253
|
-
r({ type: Boolean, attribute: "use-history" })
|
|
254
|
-
], e.prototype, "useHistory", 2);
|
|
255
|
-
s([
|
|
256
|
-
m()
|
|
257
|
-
], e.prototype, "isLoading", 2);
|
|
258
|
-
e = s([
|
|
259
|
-
v("tc-iframe-modal")
|
|
260
|
-
], e);
|
|
261
|
-
export {
|
|
262
|
-
e as TcIframeModal
|
|
263
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
/**
|
|
3
|
-
* A banner prompting users to install the PWA.
|
|
4
|
-
* Remembers dismissal state via localStorage.
|
|
5
|
-
*
|
|
6
|
-
* @fires tc-install - Fired when the install button is clicked
|
|
7
|
-
* @fires tc-dismiss - Fired when the banner is dismissed
|
|
8
|
-
* @csspart banner - The banner container
|
|
9
|
-
* @csspart content - The content area
|
|
10
|
-
* @csspart icon - The app icon
|
|
11
|
-
* @csspart text - The text container
|
|
12
|
-
* @csspart title - The banner title
|
|
13
|
-
* @csspart description - The banner description
|
|
14
|
-
* @csspart actions - The actions container
|
|
15
|
-
* @csspart install - The install button
|
|
16
|
-
* @csspart close - The close button
|
|
17
|
-
*/
|
|
18
|
-
export declare class TcInstallationBanner extends LitElement {
|
|
19
|
-
title: string;
|
|
20
|
-
description: string;
|
|
21
|
-
installLabel: string;
|
|
22
|
-
storageKey: string;
|
|
23
|
-
dismissDays: number;
|
|
24
|
-
private isDismissed;
|
|
25
|
-
private animation;
|
|
26
|
-
private storage;
|
|
27
|
-
static styles: import('lit').CSSResult[];
|
|
28
|
-
connectedCallback(): void;
|
|
29
|
-
private checkDismissState;
|
|
30
|
-
private updateDataState;
|
|
31
|
-
show(): Promise<void>;
|
|
32
|
-
dismiss(): Promise<void>;
|
|
33
|
-
private handleInstall;
|
|
34
|
-
private handleClose;
|
|
35
|
-
render(): import('lit').TemplateResult<1>;
|
|
36
|
-
}
|
|
37
|
-
declare global {
|
|
38
|
-
interface HTMLElementTagNameMap {
|
|
39
|
-
'tc-installation-banner': TcInstallationBanner;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=tc-installation-banner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tc-installation-banner.d.ts","sourceRoot":"","sources":["../../src/widgets/tc-installation-banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAK5C,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,qBACa,oBAAqB,SAAQ,UAAU;IACtB,KAAK,SAAiB;IACtB,WAAW,SACM;IACW,YAAY,SACxD;IAC0C,UAAU,SAChC;IACuB,WAAW,SAAK;IAE9D,OAAO,CAAC,WAAW,CAAS;IAErC,OAAO,CAAC,SAAS,CAGd;IAEH,OAAO,CAAC,OAAO,CAGb;IAEF,OAAgB,MAAM,4BAoHpB;IAEO,iBAAiB;IAM1B,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,eAAe;IAIjB,IAAI;IAMJ,OAAO;IAab,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,WAAW;IAIV,MAAM;CAwChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,oBAAoB,CAAC;KAChD;CACF"}
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { LitElement as d, html as p, css as m } from "lit";
|
|
2
|
-
import { property as r, state as h, customElement as u } from "lit/decorators.js";
|
|
3
|
-
import { AnimationController as v } from "../controllers/animation.controller.js";
|
|
4
|
-
import { StorageController as b } from "../controllers/storage.controller.js";
|
|
5
|
-
import { sharedStyles as y } from "../styles/shared.js";
|
|
6
|
-
var g = Object.defineProperty, f = Object.getOwnPropertyDescriptor, s = (i, a, o, n) => {
|
|
7
|
-
for (var e = n > 1 ? void 0 : n ? f(a, o) : a, l = i.length - 1, c; l >= 0; l--)
|
|
8
|
-
(c = i[l]) && (e = (n ? c(a, o, e) : c(e)) || e);
|
|
9
|
-
return n && e && g(a, o, e), e;
|
|
10
|
-
};
|
|
11
|
-
let t = class extends d {
|
|
12
|
-
constructor() {
|
|
13
|
-
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 v(this, {
|
|
14
|
-
showDuration: 400,
|
|
15
|
-
hideDuration: 300
|
|
16
|
-
}), this.storage = new b(
|
|
17
|
-
this,
|
|
18
|
-
this.storageKey
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
connectedCallback() {
|
|
22
|
-
super.connectedCallback(), this.updateDataState(), this.checkDismissState();
|
|
23
|
-
}
|
|
24
|
-
checkDismissState() {
|
|
25
|
-
const i = this.storage.value;
|
|
26
|
-
i?.dismissedAt && ((Date.now() - i.dismissedAt) / 864e5 < this.dismissDays ? this.isDismissed = !0 : this.storage.remove());
|
|
27
|
-
}
|
|
28
|
-
updateDataState() {
|
|
29
|
-
this.dataset.state = this.animation.state;
|
|
30
|
-
}
|
|
31
|
-
async show() {
|
|
32
|
-
this.isDismissed || (await this.animation.show(), this.updateDataState());
|
|
33
|
-
}
|
|
34
|
-
async dismiss() {
|
|
35
|
-
this.storage.set({ dismissedAt: Date.now() }), await this.animation.hide(), this.updateDataState(), this.dispatchEvent(
|
|
36
|
-
new CustomEvent("tc-dismiss", {
|
|
37
|
-
bubbles: !0,
|
|
38
|
-
composed: !0
|
|
39
|
-
})
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
handleInstall() {
|
|
43
|
-
this.dispatchEvent(
|
|
44
|
-
new CustomEvent("tc-install", {
|
|
45
|
-
bubbles: !0,
|
|
46
|
-
composed: !0
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
handleClose() {
|
|
51
|
-
this.dismiss();
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
return p`
|
|
55
|
-
<div part="banner" class="banner" role="banner">
|
|
56
|
-
<div part="icon" class="icon">
|
|
57
|
-
<tc-icon name="download" size="1.5rem"></tc-icon>
|
|
58
|
-
</div>
|
|
59
|
-
<div part="content" class="content">
|
|
60
|
-
<tc-text part="title" class="title" size="base" weight="600">
|
|
61
|
-
${this.title}
|
|
62
|
-
</tc-text>
|
|
63
|
-
<tc-text part="description" class="description" size="sm" color="tertiary">
|
|
64
|
-
${this.description}
|
|
65
|
-
</tc-text>
|
|
66
|
-
</div>
|
|
67
|
-
<div part="actions" class="actions">
|
|
68
|
-
<tc-button
|
|
69
|
-
part="install"
|
|
70
|
-
variant="primary"
|
|
71
|
-
size="small"
|
|
72
|
-
@tc-click=${this.handleInstall}
|
|
73
|
-
>
|
|
74
|
-
${this.installLabel}
|
|
75
|
-
</tc-button>
|
|
76
|
-
<button part="close" class="close" @click=${this.handleClose} aria-label="Dismiss">
|
|
77
|
-
<svg
|
|
78
|
-
viewBox="0 0 24 24"
|
|
79
|
-
fill="none"
|
|
80
|
-
stroke="currentColor"
|
|
81
|
-
stroke-width="2"
|
|
82
|
-
stroke-linecap="round"
|
|
83
|
-
stroke-linejoin="round"
|
|
84
|
-
>
|
|
85
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
86
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
87
|
-
</svg>
|
|
88
|
-
</button>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
`;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
t.styles = [
|
|
95
|
-
y,
|
|
96
|
-
m`
|
|
97
|
-
:host {
|
|
98
|
-
display: block;
|
|
99
|
-
position: fixed;
|
|
100
|
-
bottom: 0;
|
|
101
|
-
left: 0;
|
|
102
|
-
right: 0;
|
|
103
|
-
z-index: 100;
|
|
104
|
-
padding: var(--space-md);
|
|
105
|
-
pointer-events: none;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.banner {
|
|
109
|
-
display: flex;
|
|
110
|
-
align-items: center;
|
|
111
|
-
gap: var(--space-md);
|
|
112
|
-
padding: var(--space-md) var(--space-lg);
|
|
113
|
-
background: var(--paper-white);
|
|
114
|
-
border-radius: var(--radius-lg);
|
|
115
|
-
box-shadow: 0 -4px 20px var(--overlay-shadow-light);
|
|
116
|
-
pointer-events: auto;
|
|
117
|
-
opacity: 0;
|
|
118
|
-
transform: translateY(100%);
|
|
119
|
-
transition: opacity var(--transition-smooth), transform var(--transition-smooth);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:host([data-state='showing']) .banner,
|
|
123
|
-
:host([data-state='visible']) .banner {
|
|
124
|
-
opacity: 1;
|
|
125
|
-
transform: translateY(0);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
:host([data-state='hiding']) .banner {
|
|
129
|
-
opacity: 0;
|
|
130
|
-
transform: translateY(100%);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
:host([data-state='hidden']) {
|
|
134
|
-
display: none;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.icon {
|
|
138
|
-
flex-shrink: 0;
|
|
139
|
-
display: flex;
|
|
140
|
-
align-items: center;
|
|
141
|
-
justify-content: center;
|
|
142
|
-
width: 3rem;
|
|
143
|
-
height: 3rem;
|
|
144
|
-
background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
|
|
145
|
-
border-radius: var(--radius-md);
|
|
146
|
-
color: white;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.content {
|
|
150
|
-
flex: 1;
|
|
151
|
-
min-width: 0;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.title {
|
|
155
|
-
font-weight: 600;
|
|
156
|
-
color: var(--ink-dark);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.description {
|
|
160
|
-
color: var(--ink-medium);
|
|
161
|
-
margin-top: 2px;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.actions {
|
|
165
|
-
display: flex;
|
|
166
|
-
align-items: center;
|
|
167
|
-
gap: var(--space-sm);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.close {
|
|
171
|
-
display: flex;
|
|
172
|
-
align-items: center;
|
|
173
|
-
justify-content: center;
|
|
174
|
-
width: var(--size-close-button);
|
|
175
|
-
height: var(--size-close-button);
|
|
176
|
-
padding: 0;
|
|
177
|
-
border: none;
|
|
178
|
-
background: transparent;
|
|
179
|
-
color: var(--ink-light);
|
|
180
|
-
cursor: pointer;
|
|
181
|
-
border-radius: var(--radius-sm);
|
|
182
|
-
transition: var(--transition-fast);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.close:hover {
|
|
186
|
-
background: var(--paper-warm);
|
|
187
|
-
color: var(--ink-medium);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.close svg {
|
|
191
|
-
width: 1.25rem;
|
|
192
|
-
height: 1.25rem;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
@media (max-width: 480px) {
|
|
196
|
-
.banner {
|
|
197
|
-
flex-wrap: wrap;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.content {
|
|
201
|
-
flex-basis: calc(100% - 4rem);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.actions {
|
|
205
|
-
flex-basis: 100%;
|
|
206
|
-
justify-content: flex-end;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
`
|
|
210
|
-
];
|
|
211
|
-
s([
|
|
212
|
-
r({ type: String })
|
|
213
|
-
], t.prototype, "title", 2);
|
|
214
|
-
s([
|
|
215
|
-
r({ type: String })
|
|
216
|
-
], t.prototype, "description", 2);
|
|
217
|
-
s([
|
|
218
|
-
r({ type: String, attribute: "install-label" })
|
|
219
|
-
], t.prototype, "installLabel", 2);
|
|
220
|
-
s([
|
|
221
|
-
r({ type: String, attribute: "storage-key" })
|
|
222
|
-
], t.prototype, "storageKey", 2);
|
|
223
|
-
s([
|
|
224
|
-
r({ type: Number, attribute: "dismiss-days" })
|
|
225
|
-
], t.prototype, "dismissDays", 2);
|
|
226
|
-
s([
|
|
227
|
-
h()
|
|
228
|
-
], t.prototype, "isDismissed", 2);
|
|
229
|
-
t = s([
|
|
230
|
-
u("tc-installation-banner")
|
|
231
|
-
], t);
|
|
232
|
-
export {
|
|
233
|
-
t as TcInstallationBanner
|
|
234
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
/**
|
|
3
|
-
* A guide modal for iOS PWA installation steps.
|
|
4
|
-
*
|
|
5
|
-
* @fires tc-close - Fired when the guide is closed
|
|
6
|
-
* @csspart overlay - The backdrop overlay
|
|
7
|
-
* @csspart modal - The modal container
|
|
8
|
-
* @csspart header - The modal header
|
|
9
|
-
* @csspart close - The close button
|
|
10
|
-
* @csspart content - The content area
|
|
11
|
-
* @csspart steps - The steps container
|
|
12
|
-
* @csspart step - Individual step
|
|
13
|
-
* @csspart step-number - Step number indicator
|
|
14
|
-
* @csspart step-text - Step text
|
|
15
|
-
*/
|
|
16
|
-
export declare class TcIosInstallationGuide extends LitElement {
|
|
17
|
-
title: string;
|
|
18
|
-
steps: string[];
|
|
19
|
-
private animation;
|
|
20
|
-
static styles: import('lit').CSSResult[];
|
|
21
|
-
connectedCallback(): void;
|
|
22
|
-
private updateDataState;
|
|
23
|
-
show(): Promise<void>;
|
|
24
|
-
close(): Promise<void>;
|
|
25
|
-
private handleOverlayClick;
|
|
26
|
-
private renderStep;
|
|
27
|
-
render(): import('lit').TemplateResult<1>;
|
|
28
|
-
}
|
|
29
|
-
declare global {
|
|
30
|
-
interface HTMLElementTagNameMap {
|
|
31
|
-
'tc-ios-installation-guide': TcIosInstallationGuide;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=tc-ios-installation-guide.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tc-ios-installation-guide.d.ts","sourceRoot":"","sources":["../../src/widgets/tc-ios-installation-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAI5C,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;GAaG;AACH,qBACa,sBAAuB,SAAQ,UAAU;IACxB,KAAK,SAAoB;IAC1B,KAAK,WAI9B;IAEF,OAAO,CAAC,SAAS,CAGd;IAEH,OAAgB,MAAM,4BA6IpB;IAEO,iBAAiB;IAK1B,OAAO,CAAC,eAAe;IAIjB,IAAI;IAKJ,KAAK;IAYX,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,UAAU;IAoBT,MAAM;CAgChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,2BAA2B,EAAE,sBAAsB,CAAC;KACrD;CACF"}
|