@mhmo91/schmancy 0.2.40 → 0.2.41

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.
@@ -1,515 +0,0 @@
1
- import { css as g, html as a, nothing as ht } from "lit";
2
- import { customElement as l, property as c, state as m, queryAssignedElements as lt, query as V } from "lit/decorators.js";
3
- import { Subject as G, merge as J, fromEvent as b, startWith as pt, tap as w, map as p, debounceTime as _, distinctUntilChanged as F, takeUntil as d, from as st, of as q, Observable as ft, distinctUntilKeyChanged as wt, zip as ot, filter as dt, take as gt, timeout as vt, bufferTime as xt, concatMap as Dt, interval as Ot, throwIfEmpty as Ct } from "rxjs";
4
- import "./animated-text-D8LhwMLu.js";
5
- import { a as it, F as $t, H as Et } from "./area.component-FgfXnOUF.js";
6
- import "./autocomplete-C36FPrMT.js";
7
- import "./spinner-Dp-BlzFE.js";
8
- import "./icon-button-BFdAiGNP.js";
9
- import "lit/directives/class-map.js";
10
- import "lit/directives/style-map.js";
11
- import { T as N } from "./tailwind.mixin-BBKdEPAU.js";
12
- import { S as U } from "./theme.interface-C5Kj6WjD.js";
13
- import "./checkbox-Sf2HtMs9.js";
14
- import "./chips-CA-B5JGD.js";
15
- import "./payment-card-form-D2NiZkJM.js";
16
- import { SchmancyEvents as y } from "./types.js";
17
- import { n as C, e as O } from "./provide-kj6-udep.js";
18
- import { $ } from "./litElement.mixin-D9kneJpW.js";
19
- import { c as h } from "./consume-DSKPc5vj.js";
20
- import "./date-range-BFW0xGWz.js";
21
- import "./delay-DbaKftdS.js";
22
- import { c as S, f as jt } from "./ripple-BumgqsDT.js";
23
- import "./divider-Ba1jSOh5.js";
24
- import "./form-H0pfjyGl.js";
25
- import "./icon-pvbFfBbz.js";
26
- import "./input-CBjD2PL8.js";
27
- import "./scroll-BbqxMyDc.js";
28
- import "./list-BdN19pT0.js";
29
- import "./menu-DjWA-lYK.js";
30
- import { when as K } from "lit/directives/when.js";
31
- import "./outlet-oc58T2jq.js";
32
- import "./option-C4fWPkxl.js";
33
- import "./radio-group-BALwJIFj.js";
34
- import "./index-CuY8m6ta.js";
35
- import "./select-CaBI5TrW.js";
36
- import { s as Y } from "./sheet-CrFAERdT.js";
37
- import "./slider-BAQ6ue43.js";
38
- import "./surface-C-5hXuc0.js";
39
- import "./table-D5Y7TtBM.js";
40
- import "./tabs-group-DIv7H3ii.js";
41
- import "./textarea-DWBpogxd.js";
42
- import "./theme.component-DWRFe6NX.js";
43
- import "./theme-button-CdjTjQE-.js";
44
- import "./tree-COFA9Z7I.js";
45
- import "./typewriter-CKloAbr2.js";
46
- import "./typography-C0__6Aqk.js";
47
- import { map as Mt, distinctUntilChanged as Wt, take as kt } from "rxjs/operators";
48
- var Pt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor;
49
- let rt = class extends N(g`
50
- :host {
51
- display: block;
52
- }
53
- `) {
54
- render() {
55
- return a` <section class="pb-4 px-4"><slot> </slot></section> `;
56
- }
57
- };
58
- rt = ((t, e, o, i) => {
59
- for (var r, s = i > 1 ? void 0 : i ? zt(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
60
- return i && s && Pt(e, o, s), s;
61
- })([l("schmancy-card-action")], rt);
62
- var St = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, A = (t, e, o, i) => {
63
- for (var r, s = i > 1 ? void 0 : i ? Nt(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
64
- return i && s && St(e, o, s), s;
65
- };
66
- let I = class extends N() {
67
- constructor() {
68
- super(...arguments), this.type = "elevated", this.elevation = 0;
69
- }
70
- render() {
71
- const t = { "rounded-md": !0, "shadow-xs": this.elevation === 1, "shadow-sm": this.elevation === 2, "shadow-md": this.elevation === 3, "shadow-lg": this.elevation === 4, "shadow-5": this.elevation === 5, "hover:shadow-xs": ["outlined", "filled"].includes(this.type), "bg-surface-low shadow-xs hover:shadow-sm": this.type === "elevated", "bg-surface-highest": this.type === "filled", "bg-surface-default border border-solid border-1 border-outlineVariant": this.type === "outlined" };
72
- return a`<div class="${this.classMap(t)}">
73
- <slot> </slot>
74
- </div>`;
75
- }
76
- };
77
- A([c()], I.prototype, "type", 2), A([c({ type: Number })], I.prototype, "elevation", 2), I = A([l("schmancy-card")], I);
78
- var It = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor;
79
- let nt = class extends N() {
80
- render() {
81
- const t = U.sys.color.surface.on, e = U.sys.color.surface.onVariant;
82
- return a`<schmancy-grid gap="md" class="${this.classMap({ "px-[16px] py-[24px]": !0 })}">
83
- <schmancy-grid gap="xs">
84
- <schmancy-typography
85
- ${S({ color: t })}
86
- type="body"
87
- token="lg"
88
- ><slot name="headline"> </slot
89
- ></schmancy-typography>
90
- <schmancy-typography
91
- ${S({ color: e })}
92
- type="body"
93
- ><slot name="subhead"></slot>
94
- </schmancy-typography>
95
- </schmancy-grid>
96
- <schmancy-typography
97
- type="body"
98
- ${S({ color: e })}
99
- >
100
- <slot></slot>
101
- </schmancy-typography>
102
- </schmancy-grid>`;
103
- }
104
- };
105
- nt = ((t, e, o, i) => {
106
- for (var r, s = i > 1 ? void 0 : i ? Ht(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
107
- return i && s && It(e, o, s), s;
108
- })([l("schmancy-card-content")], nt);
109
- var Tt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, B = (t, e, o, i) => {
110
- for (var r, s = i > 1 ? void 0 : i ? Xt(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
111
- return i && s && Tt(e, o, s), s;
112
- };
113
- let H = class extends N(g`
114
- :host {
115
- display: block;
116
- }
117
- `) {
118
- constructor() {
119
- super(...arguments), this.src = "", this.fit = "contain";
120
- }
121
- render() {
122
- const t = { "object-center": !0, "object-contain": this.fit === "contain", "object-cover w-full": this.fit === "cover", "object-fill": this.fit === "fill", "object-none": this.fit === "none", "object-scale-down": this.fit === "scale-down" };
123
- return a`<schmancy-grid align="stretch" justify="stretch" gap="md">
124
- <img src="${this.src}" style=${this.styleMap({ height: "200px" })} class="${this.classMap(t)}" />
125
- </schmancy-grid>`;
126
- }
127
- };
128
- B([c({ type: String, reflect: !0 })], H.prototype, "src", 2), B([c({ type: String })], H.prototype, "fit", 2), H = B([l("schmancy-card-media")], H);
129
- const Ge = new class {
130
- constructor() {
131
- this.$drawer = new G(), this.$drawer.pipe().subscribe((t) => {
132
- t.action === "dismiss" ? t.ref.dispatchEvent(new CustomEvent(y.ContentDrawerToggle, { detail: { state: "close" }, bubbles: !0, composed: !0 })) : t.action === "render" && (t.ref.dispatchEvent(new CustomEvent(y.ContentDrawerToggle, { detail: { state: "open" }, bubbles: !0, composed: !0 })), t.ref.dispatchEvent(new CustomEvent("schmancy-content-drawer-render", { detail: { component: t.component, title: t.title }, bubbles: !0, composed: !0 })));
133
- });
134
- }
135
- dimiss(t) {
136
- this.$drawer.next({ action: "dismiss", ref: t });
137
- }
138
- render(t, e, o) {
139
- t.dispatchEvent(new CustomEvent("custom-event")), this.$drawer.next({ action: "render", ref: t, component: e, title: o });
140
- }
141
- }(), L = C("push"), mt = C("close"), yt = C(Math.floor(Math.random() * Date.now()).toString()), Q = C("100%"), Z = C({});
142
- var Rt = Object.defineProperty, _t = Object.getOwnPropertyDescriptor, x = (t, e, o, i) => {
143
- for (var r, s = i > 1 ? void 0 : i ? _t(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
144
- return i && s && Rt(e, o, s), s;
145
- };
146
- let v = class extends $(g`
147
- :host {
148
- position: relative;
149
- inset: 0;
150
- display: block;
151
- overflow: hidden;
152
- }
153
- `) {
154
- constructor() {
155
- super(...arguments), this.minWidth = { main: 360, sheet: 576 }, this.schmancyContentDrawerID = Math.floor(Math.random() * Date.now()).toString(), this.maxHeight = "100%";
156
- }
157
- firstUpdated() {
158
- J(b(window, "resize"), b(window, y.ContentDrawerResize)).pipe(pt(!0), w(() => {
159
- }), p(() => this.clientWidth ? this.clientWidth : window.innerWidth), p((t) => t >= this.minWidth.main + this.minWidth.sheet), _(100), w(() => {
160
- this.maxHeight = window.innerHeight - this.getOffsetTop(this) - 32 + "px", this.style.setProperty("max-height", this.maxHeight);
161
- }), F(), d(this.disconnecting)).subscribe((t) => {
162
- t ? (this.mode = "push", this.open = "open") : (this.mode = "overlay", this.open = "close");
163
- }), b(window, y.ContentDrawerToggle).pipe(w((t) => {
164
- t.stopPropagation();
165
- }), p((t) => t.detail.state), d(this.disconnecting)).subscribe((t) => {
166
- this.open = t;
167
- }), b(window, "schmancy-content-drawer-render").pipe(w((t) => {
168
- t.stopPropagation();
169
- }), p((t) => t.detail), d(this.disconnecting)).subscribe(({ component: t, title: e }) => {
170
- this.mode === "push" ? (it.push({ area: this.schmancyContentDrawerID, component: "empty", historyStrategy: "silent" }), it.push({ area: this.schmancyContentDrawerID, component: t, historyStrategy: "silent" })) : (this.mode = "overlay") && Y.open({ component: t, uid: this.schmancyContentDrawerID, title: e });
171
- });
172
- }
173
- getOffsetTop(t) {
174
- let e = 0;
175
- for (; t; ) e += t.offsetTop, t = t.offsetParent;
176
- return e;
177
- }
178
- render() {
179
- return this.mode && this.open ? a`
180
- <schmancy-grid
181
- cols=${this.mode === "overlay" ? "1fr" : "auto 1fr"}
182
- rows="1fr"
183
- flow="col"
184
- justify="stretch"
185
- align="stretch"
186
- >
187
- <slot></slot>
188
- </schmancy-grid>
189
- ` : ht;
190
- }
191
- };
192
- x([O({ context: Z })], v.prototype, "minWidth", 2), x([O({ context: mt }), c()], v.prototype, "open", 2), x([O({ context: L }), m()], v.prototype, "mode", 2), x([O({ context: yt })], v.prototype, "schmancyContentDrawerID", 2), x([O({ context: Q })], v.prototype, "maxHeight", 2), x([lt({ flatten: !0 })], v.prototype, "assignedElements", 2), v = x([l("schmancy-content-drawer")], v);
193
- var qt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, W = (t, e, o, i) => {
194
- for (var r, s = i > 1 ? void 0 : i ? Ut(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
195
- return i && s && qt(e, o, s), s;
196
- };
197
- let E = class extends $(g`
198
- :host {
199
- display: block;
200
- overflow: hidden;
201
- }
202
- `) {
203
- connectedCallback() {
204
- super.connectedCallback(), this.minWidth ? this.drawerMinWidth.main = this.minWidth : this.minWidth = this.drawerMinWidth.main;
205
- }
206
- update(t) {
207
- super.update(t), t.has("minWidth") && this.minWidth && (this.drawerMinWidth.main = this.minWidth, this.dispatchEvent(new CustomEvent(y.ContentDrawerResize, { bubbles: !0, composed: !0 })));
208
- }
209
- render() {
210
- const t = { minWidth: `${this.minWidth}px`, maxHeight: this.maxHeight };
211
- return a`
212
- <section class="relative inset-0 h-full">
213
- <schmancy-grid
214
- class="h-full relative overflow-scroll"
215
- cols="${this.mode === "push" ? "auto 1fr" : "1fr"}"
216
- rows="1fr"
217
- flow="col"
218
- align="stretch"
219
- justify="stretch"
220
- >
221
- <section style=${this.styleMap(t)}>
222
- <slot></slot>
223
- </section>
224
- </schmancy-grid>
225
- ${K(this.mode === "push", () => a` <schmancy-divider class="absolute right-0 top-0" orientation="vertical"></schmancy-divider>`)}
226
- </section>
227
- `;
228
- }
229
- };
230
- W([c({ type: Number })], E.prototype, "minWidth", 2), W([h({ context: Z, subscribe: !0 })], E.prototype, "drawerMinWidth", 2), W([h({ context: L, subscribe: !0 }), m()], E.prototype, "mode", 2), W([h({ context: Q, subscribe: !0 }), m()], E.prototype, "maxHeight", 2), E = W([l("schmancy-content-drawer-main")], E);
231
- var At = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, f = (t, e, o, i) => {
232
- for (var r, s = i > 1 ? void 0 : i ? Bt(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
233
- return i && s && At(e, o, s), s;
234
- };
235
- let u = class extends $(g`
236
- :host {
237
- overflow: scroll;
238
- }
239
- `) {
240
- connectedCallback() {
241
- super.connectedCallback(), this.minWidth ? this.drawerMinWidth.sheet = this.minWidth : this.minWidth = this.drawerMinWidth.sheet;
242
- }
243
- updated(t) {
244
- super.updated(t), t.has("minWidth") && this.minWidth ? (this.drawerMinWidth.sheet = this.minWidth, this.dispatchEvent(new CustomEvent(y.ContentDrawerResize, { bubbles: !0, composed: !0 }))) : (t.has("state") || t.has("mode")) && (this.mode === "overlay" ? this.state === "close" ? this.closeAll() : this.state : this.mode === "push" && (Y.dismiss(this.schmancyContentDrawerID), this.state === "close" ? this.closeAll() : this.state === "open" && this.open()));
245
- }
246
- open() {
247
- this.mode === "overlay" ? this.sheet.style.position = "fixed" : this.sheet.style.position = "relative", this.sheet.style.display = "block", this.sheet.animate([{ opacity: 0, transform: "translateX(100%)" }, { opacity: 1, transform: "translateX(0%)" }], { duration: 500, easing: "cubic-bezier(0.5, 0.01, 0.25, 1)" });
248
- }
249
- closeAll() {
250
- J(st(this.closeModalSheet()), st(this.closeSheet())).pipe(d(this.disconnecting)).subscribe();
251
- }
252
- closeModalSheet() {
253
- return q(!0).pipe(w(() => Y.dismiss(this.schmancyContentDrawerID)));
254
- }
255
- closeSheet() {
256
- return new ft((t) => {
257
- this.sheet.animate([{ opacity: 1, transform: "translateX(0%)" }, { opacity: 1, transform: "translateX(100%)" }], { duration: 500, easing: "cubic-bezier(0.5, 0.01, 0.25, 1)" }).onfinish = () => {
258
- this.sheet.style.display = "none", t.next(), t.complete();
259
- };
260
- });
261
- }
262
- render() {
263
- const t = { block: this.mode === "push", "absolute z-50": this.mode === "overlay", "opacity-1": this.mode === "overlay" && this.state === "open" }, e = { minWidth: `${this.minWidth}px`, maxHeight: this.maxHeight };
264
- return a`
265
- <section id="sheet" class="${this.classMap(t)}" style=${this.styleMap(e)}>
266
- <schmancy-area name="${this.schmancyContentDrawerID}">
267
- <slot name="placeholder"></slot>
268
- </schmancy-area>
269
- </section>
270
- `;
271
- }
272
- };
273
- f([c({ type: Number })], u.prototype, "minWidth", 2), f([h({ context: L, subscribe: !0 }), m()], u.prototype, "mode", 2), f([h({ context: mt, subscribe: !0 }), m()], u.prototype, "state", 2), f([h({ context: yt })], u.prototype, "schmancyContentDrawerID", 2), f([V("#sheet")], u.prototype, "sheet", 2), f([lt({ flatten: !0, slot: void 0 })], u.prototype, "defaultSlot", 2), f([h({ context: Z, subscribe: !0 })], u.prototype, "drawerMinWidth", 2), f([h({ context: Q, subscribe: !0 }), m()], u.prototype, "maxHeight", 2), u = f([l("schmancy-content-drawer-sheet")], u);
274
- const Vt = new class {
275
- constructor() {
276
- this.$drawer = new G(), this.$drawer.pipe(wt("state"), _(100)).subscribe((t) => {
277
- t.state ? window.dispatchEvent(new CustomEvent(y.NavDrawer_toggle, { detail: { state: "open" }, bubbles: !0, composed: !0 })) : window.dispatchEvent(new CustomEvent(y.NavDrawer_toggle, { detail: { state: "close" }, bubbles: !0, composed: !0 }));
278
- });
279
- }
280
- open(t) {
281
- this.$drawer.next({ self: t, state: !0 });
282
- }
283
- close(t) {
284
- this.$drawer.next({ self: t, state: !1 });
285
- }
286
- }(), Je = Vt, tt = C("push"), et = C("close");
287
- var Ft = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, T = (t, e, o, i) => {
288
- for (var r, s = i > 1 ? void 0 : i ? Kt(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
289
- return i && s && Ft(e, o, s), s;
290
- };
291
- let k = class extends N(g`
292
- :host {
293
- display: block;
294
- }
295
- `) {
296
- constructor() {
297
- super(...arguments), this.toggler = !0;
298
- }
299
- render() {
300
- const t = { "block left-3 z-50": this.sidebarMode === "overlay", hidden: this.sidebarMode === "push" };
301
- return a`
302
- <schmancy-grid
303
- cols=${this.sidebarMode === "overlay" && this.toggler ? "auto 1fr" : "1fr"}
304
- flow="col"
305
- class=${this.classMap({ "block z-50": !0 })}
306
- gap="sm"
307
- align="center"
308
- >
309
- ${K(this.sidebarMode === "overlay" && this.toggler, () => a`<slot name="toggler">
310
- <div class="${this.classMap(t)}">
311
- <schmancy-icon-button
312
- @click=${() => {
313
- this.dispatchEvent(new CustomEvent(y.NavDrawer_toggle, { detail: { state: this.sidebarOpen === "open" ? "close" : "open" }, bubbles: !0, composed: !0 }));
314
- }}
315
- >
316
- ${K(this.sidebarOpen === "close", () => a`menu`, () => a`menu_open`)}
317
- </schmancy-icon-button>
318
- </div>
319
- </slot>`)}
320
-
321
- <slot> </slot>
322
- </schmancy-grid>
323
- `;
324
- }
325
- };
326
- T([h({ context: tt, subscribe: !0 }), m()], k.prototype, "sidebarMode", 2), T([h({ context: et, subscribe: !0 }), m()], k.prototype, "sidebarOpen", 2), T([c({ type: Boolean })], k.prototype, "toggler", 2), k = T([l("schmancy-nav-drawer-appbar")], k);
327
- var Yt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor;
328
- let at = class extends $(g`
329
- :host {
330
- display: block;
331
- position: relative;
332
- inset: 0;
333
- overflow-y: auto;
334
- }
335
- `) {
336
- connectedCallback() {
337
- super.connectedCallback(), b(this, "scroll").pipe(d(this.disconnecting)).subscribe((t) => {
338
- this.parentElement.dispatchEvent(new CustomEvent("scroll", { detail: t, bubbles: !0, composed: !0 }));
339
- });
340
- }
341
- render() {
342
- return a` <slot></slot> `;
343
- }
344
- };
345
- at = ((t, e, o, i) => {
346
- for (var r, s = i > 1 ? void 0 : i ? Gt(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
347
- return i && s && Yt(e, o, s), s;
348
- })([l("schmancy-nav-drawer-content")], at);
349
- var Jt = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, P = (t, e, o, i) => {
350
- for (var r, s = i > 1 ? void 0 : i ? Lt(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
351
- return i && s && Jt(e, o, s), s;
352
- };
353
- let j = class extends $(g`
354
- :host {
355
- display: flex;
356
- flex-grow: 1;
357
- overflow: hidden;
358
- }
359
- `) {
360
- constructor() {
361
- super(...arguments), this.fullscreen = !1, this.breakpoint = 768;
362
- }
363
- connectedCallback() {
364
- super.connectedCallback(), b(window, "resize").pipe(p((t) => t.target), pt(window), p((t) => t.innerWidth), p((t) => t >= this.breakpoint), F(), d(this.disconnecting), _(100)).subscribe((t) => {
365
- t ? (this.mode = "push", this.open = "open") : (this.mode = "overlay", this.open = "close");
366
- }), b(window, y.NavDrawer_toggle).pipe(w((t) => {
367
- t.stopPropagation();
368
- }), p((t) => t.detail.state), F(), d(this.disconnecting), _(100)).subscribe((t) => {
369
- this.mode === "push" && t === "close" || (this.open = t);
370
- });
371
- }
372
- render() {
373
- return this.mode && this.open ? a`
374
- <schmancy-grid
375
- cols=${this.fullscreen ? "1fr" : "auto 1fr"}
376
- rows="1fr"
377
- flow="col"
378
- justify="stretch"
379
- align="stretch"
380
- ${jt()}
381
- >
382
- <slot></slot>
383
- </schmancy-grid>
384
- ` : ht;
385
- }
386
- };
387
- P([c({ type: Boolean })], j.prototype, "fullscreen", 2), P([c({ type: Number, attribute: "breakpoint" })], j.prototype, "breakpoint", 2), P([O({ context: tt }), m()], j.prototype, "mode", 2), P([O({ context: et }), c()], j.prototype, "open", 2), j = P([l("schmancy-nav-drawer")], j);
388
- var Qt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, M = (t, e, o, i) => {
389
- for (var r, s = i > 1 ? void 0 : i ? Zt(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
390
- return i && s && Qt(e, o, s), s;
391
- };
392
- let D = class extends $() {
393
- constructor() {
394
- super(...arguments), this.width = "320px";
395
- }
396
- updated(t) {
397
- t.has("state") && (this.mode === "overlay" ? this.state === "close" ? (this.hideNavDrawer(), this.closeOverlay()) : this.state === "open" && (this.openOverlay(), this.showNavDrawer()) : this.mode === "push" && (this.showNavDrawer(), this.closeOverlay()));
398
- }
399
- openOverlay() {
400
- this.overlay.style.display = "block", this.overlay.animate([{ opacity: 0 }, { opacity: 0.4 }], { duration: 200, easing: "cubic-bezier(0.5, 0.01, 0.25, 1)", fill: "forwards" });
401
- }
402
- closeOverlay() {
403
- this.overlay.animate([{ opacity: 0.4 }, { opacity: 0 }], { duration: 150, easing: "cubic-bezier(0.5, 0.01, 0.25, 1)", fill: "forwards" }).onfinish = () => {
404
- this.overlay.style.display = "none";
405
- };
406
- }
407
- showNavDrawer() {
408
- this.nav.style.transform !== "translateX(0)" && (this.nav.animate([{ transform: "translateX(-100%)" }, { transform: "translateX(0)" }], { duration: 200, easing: "cubic-bezier(0.5, 0.01, 0.25, 1)", fill: "forwards" }).onfinish = () => {
409
- this.state = "open";
410
- });
411
- }
412
- hideNavDrawer() {
413
- this.nav.style.transform !== "translateX(-100%)" && (this.nav.animate([{ transform: "translateX(0)" }, { transform: "translateX(-100%)" }], { duration: 200, easing: "cubic-bezier(0.5, 0.01, 0.25, 1)", fill: "forwards" }).onfinish = () => {
414
- this.state = "close";
415
- });
416
- }
417
- render() {
418
- const t = { "p-[16px] max-w-[360px] w-fit h-full overflow-auto": !0, block: this.mode === "push", "fixed inset-0 z-50": this.mode === "overlay" }, e = { width: this.width };
419
- return a`
420
- <nav
421
- style=${this.styleMap(e)}
422
- class="${this.classMap({ ...t })}"
423
- ${S({ bgColor: U.sys.color.surface.container })}
424
- >
425
- <slot></slot>
426
- </nav>
427
- <div
428
- id="overlay"
429
- ${S({ bgColor: U.sys.color.scrim })}
430
- @click=${() => {
431
- window.dispatchEvent(new CustomEvent(y.NavDrawer_toggle, { detail: { state: "close" }, bubbles: !0, composed: !0 }));
432
- }}
433
- class="${this.classMap({ "fixed inset-0 z-49 hidden": !0 })}"
434
- ></div>
435
- `;
436
- }
437
- };
438
- M([h({ context: tt, subscribe: !0 }), m()], D.prototype, "mode", 2), M([h({ context: et, subscribe: !0 }), m()], D.prototype, "state", 2), M([V("#overlay")], D.prototype, "overlay", 2), M([V("nav")], D.prototype, "nav", 2), M([c({ type: String })], D.prototype, "width", 2), D = M([l("schmancy-nav-drawer-navbar")], D);
439
- const ut = "whereAreYouRicky", bt = "hereMorty", X = new class {
440
- constructor() {
441
- this.activeTeleportations = /* @__PURE__ */ new Map(), this.flipRequests = new G(), this.find = (t) => ot([b(window, bt).pipe(dt((e) => !!e.detail.component.uuid && !!t.id && e.detail.component.id === t.id && e.detail.component.uuid !== t.uuid), p((e) => e.detail.component), gt(1)), q(t).pipe(w(() => {
442
- window.dispatchEvent(new CustomEvent(ut, { detail: { id: t.id, callerID: t.uuid } }));
443
- }))]).pipe(p(([e]) => e), vt(0)), this.flip = (t) => {
444
- const { from: e, to: o } = t, i = o.element.style.zIndex;
445
- o.element.style.transformOrigin = "top left", o.element.style.setProperty("visibility", "visible"), o.element.style.zIndex = "1000";
446
- const r = [{ transform: `translate(${e.rect.left - o.rect.left}px, ${e.rect.top - o.rect.top}px) scale(${e.rect.width / o.rect.width}, ${e.rect.height / o.rect.height})` }, { transform: "translate(0, 0) scale(1, 1)" }];
447
- o.element.animate(r, { duration: 250, delay: 10, easing: "cubic-bezier(0.455, 0.03, 0.515, 0.955)" }).onfinish = () => {
448
- o.element.style.zIndex = i, o.element.style.transformOrigin = "";
449
- };
450
- }, this.flipRequests.pipe(xt(1), p((t) => t.map(({ from: e, to: o, host: i }, r) => ({ from: e, to: o, host: i, i: r }))), Dt((t) => ot(t.map((e) => q(this.flip(e)))))).subscribe();
451
- }
452
- }();
453
- function ct(t) {
454
- return Ot(50).pipe(Mt(() => t.getBoundingClientRect()), Wt((e, o) => e.width === o.width && e.height === o.height && e.top === o.top && e.right === o.right && e.bottom === o.bottom && e.left === o.left), kt(1));
455
- }
456
- var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, R = (t, e, o, i) => {
457
- for (var r, s = i > 1 ? void 0 : i ? ee(e, o) : e, n = t.length - 1; n >= 0; n--) (r = t[n]) && (s = (i ? r(e, o, s) : r(s)) || s);
458
- return i && s && te(e, o, s), s;
459
- };
460
- let z = class extends $(g``) {
461
- constructor() {
462
- super(...arguments), this.uuid = Math.floor(Math.random() * Date.now()), this.delay = 0, this.debugging = !1;
463
- }
464
- get _slottedChildren() {
465
- return this.shadowRoot.querySelector("slot").assignedElements({ flatten: !0 });
466
- }
467
- connectedCallback() {
468
- if (this.id === void 0) throw new Error("id is required");
469
- super.connectedCallback(), J(b(window, $t).pipe(w({ next: () => {
470
- this.dispatchEvent(new CustomEvent(Et, { detail: { component: this }, bubbles: !0, composed: !0 }));
471
- } })), b(window, ut).pipe(w({ next: (t) => {
472
- t.detail.id === this.id && this.uuid && t.detail.callerID !== this.uuid && this.dispatchEvent(new CustomEvent(bt, { detail: { component: this }, bubbles: !0, composed: !0 }));
473
- } }))).pipe(d(this.disconnecting)).subscribe();
474
- }
475
- async firstUpdated() {
476
- q(X.activeTeleportations.get(this.id)).pipe(dt((t) => !!t), d(this.disconnecting), Ct()).subscribe({ next: (t) => {
477
- this.style.setProperty("visibility", "hidden"), ct(this).pipe(d(this.disconnecting)).subscribe({ next: (e) => {
478
- X.activeTeleportations.set(this.id, e), X.flipRequests.next({ from: { rect: t }, to: { rect: e, element: this._slottedChildren[0] }, host: this });
479
- } });
480
- }, error: () => {
481
- this.style.setProperty("visibility", "visible"), ct(this).pipe(d(this.disconnecting)).subscribe({ next: (t) => {
482
- X.activeTeleportations.set(this.id, t);
483
- } });
484
- }, complete: () => {
485
- } });
486
- }
487
- render() {
488
- return a`<slot></slot>`;
489
- }
490
- };
491
- R([c({ type: Number, reflect: !0 })], z.prototype, "uuid", 2), R([c({ type: String })], z.prototype, "id", 2), R([c({ type: Number })], z.prototype, "delay", 2), z = R([l("schmancy-teleport")], z);
492
- export {
493
- Je as $,
494
- bt as H,
495
- L as S,
496
- ut as W,
497
- mt as a,
498
- yt as b,
499
- Q as c,
500
- Z as d,
501
- v as e,
502
- E as f,
503
- u as g,
504
- Vt as h,
505
- k as i,
506
- at as j,
507
- tt as k,
508
- et as l,
509
- j as m,
510
- D as n,
511
- z as o,
512
- Ge as s,
513
- X as t
514
- };
515
- //# sourceMappingURL=teleport.component-DldJv9J6.js.map