@fluid-topics/ft-dialog 0.0.88

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/README.md ADDED
@@ -0,0 +1,30 @@
1
+ A simple dialog component
2
+
3
+ ## Install
4
+
5
+ ```shell
6
+ npm install @fluid-topics/ft-dialog
7
+ yarn add @fluid-topics/ft-dialog
8
+ ```
9
+
10
+ ## Usage
11
+
12
+ ```typescript
13
+ import { html } from "lit"
14
+ import "@fluid-topics/ft-button"
15
+ import "@fluid-topics/ft-dialog"
16
+
17
+ function render() {
18
+ return html`
19
+ <ft-button @click=${ () => document.querySelector<FtDialog>("ft-dialog")?.open() }> Open dialog </ft-button>
20
+ <ft-dialog
21
+ heading="Dialog Title"
22
+ closeOnEsc
23
+ closeOnClickOutside
24
+ @opened-changed=${ (e: CustomEvent<{ opened: boolean }>) => console.log("opened changed ", e.detail) }
25
+ >
26
+ Dialog Content
27
+ </ft-dialog>
28
+ `
29
+ }
30
+ ```
@@ -0,0 +1,32 @@
1
+ import { PropertyValues } from "lit";
2
+ import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
3
+ export interface FtDialogProperties {
4
+ opened: boolean;
5
+ closeOnEsc: boolean;
6
+ closeOnClickOutside: boolean;
7
+ heading: string;
8
+ }
9
+ export interface FtDialogCssVariables {
10
+ "--ft-dialog-z-index": any;
11
+ "--ft-dialog-overlay-background-color": string;
12
+ "--ft-dialog-width": string;
13
+ "--ft-dialog-height": string;
14
+ "--ft-dialog-padding": string;
15
+ }
16
+ export default class FtDialog extends FtLitElement implements FtDialogProperties {
17
+ static elementDefinitions: ElementDefinitionsMap;
18
+ opened: boolean;
19
+ closeOnEsc: boolean;
20
+ closeOnClickOutside: boolean;
21
+ heading: string;
22
+ getStyles(): import("lit").CSSResult;
23
+ protected getTemplate(): import("lit-html").TemplateResult<1> | null;
24
+ updated(properties: PropertyValues<FtDialog>): void;
25
+ connectedCallback(): void;
26
+ disconnectedCallback(): void;
27
+ close(): void;
28
+ open(): void;
29
+ private watchEscapeKey;
30
+ private watchClickOutside;
31
+ }
32
+ //# sourceMappingURL=ft-dialog.d.ts.map
@@ -0,0 +1,167 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { css, html } from "lit";
8
+ import { property, } from "lit/decorators.js";
9
+ import { customElement, FtLitElement } from "@fluid-topics/ft-wc-utils";
10
+ import { FtTypography } from "@fluid-topics/ft-typography";
11
+ let FtDialog = class FtDialog extends FtLitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.opened = false;
15
+ this.closeOnEsc = false;
16
+ this.closeOnClickOutside = false;
17
+ this.heading = "";
18
+ }
19
+ getStyles() {
20
+ //language=css
21
+ return css `
22
+ .ft-dialog {
23
+ position: fixed;
24
+ top: 0;
25
+ right: 0;
26
+ bottom: 0;
27
+ left: 0;
28
+ z-index: var(--ft-dialog-z-index, 2);
29
+
30
+ display: flex;
31
+ flex-direction: column;
32
+ justify-content: center;
33
+ align-items: center;
34
+
35
+ margin: auto;
36
+ }
37
+
38
+ .ft-dialog_overlay {
39
+ position: fixed;
40
+ top: 0;
41
+ right: 0;
42
+ bottom: 0;
43
+ left: 0;
44
+
45
+ height: 100%;
46
+ width: 100%;
47
+
48
+ background-color: var(--ft-dialog-overlay-background-color, rgba(0, 0, 0, 0.3));
49
+
50
+ }
51
+
52
+ .ft-dialog_wrapper {
53
+ position: fixed;
54
+ display: flex;
55
+ flex-direction: column;
56
+
57
+ width: var(--ft-dialog-width, unset);
58
+ height: var(--ft-dialog-height, unset);
59
+ max-width: 95vw;
60
+ max-height: 95vh;
61
+
62
+ padding: var(--ft-dialog-padding, 24px);
63
+ background-color: var(--ft-color-surface, #ffffff);
64
+
65
+ border-radius: var(--ft-border-radius-S, 12px);
66
+ box-shadow: var(--ft-elevation-24, 0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06));
67
+ }
68
+
69
+ .ft-dialog_content {
70
+ flex-grow: 2;
71
+ overflow: auto;
72
+ }
73
+
74
+ .ft-dialog_heading {
75
+ display: block;
76
+ margin-bottom: 12px;
77
+ }
78
+
79
+ .ft-dialog_buttons {
80
+ margin-top: 12px;
81
+ }
82
+
83
+ slot[name=buttons] {
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: flex-end;
87
+ }
88
+ `;
89
+ }
90
+ getTemplate() {
91
+ if (!this.opened) {
92
+ return null;
93
+ }
94
+ return html `
95
+ <div class="ft-dialog">
96
+ <div class="ft-dialog_overlay" @click="${() => this.watchClickOutside()}"></div>
97
+ <div class="ft-dialog_wrapper">
98
+ ${this.heading ? html `
99
+ <ft-typography class="ft-dialog_heading" variant="title">${this.heading}</ft-typography>
100
+ ` : null}
101
+ <div class="ft-dialog_content">
102
+ <slot></slot>
103
+ </div>
104
+ <div class="ft-dialog_buttons">
105
+ <slot name="buttons"></slot>
106
+ </div>
107
+ </div>
108
+ </div>
109
+ `;
110
+ }
111
+ updated(properties) {
112
+ if (properties.has("opened")) {
113
+ const event = new CustomEvent("opened-changed", { detail: { opened: this.opened } });
114
+ this.dispatchEvent(event);
115
+ }
116
+ }
117
+ connectedCallback() {
118
+ super.connectedCallback();
119
+ document.addEventListener("keydown", this.watchEscapeKey.bind(this));
120
+ }
121
+ disconnectedCallback() {
122
+ super.disconnectedCallback();
123
+ document.removeEventListener("keydown", this.watchEscapeKey.bind(this));
124
+ }
125
+ close() {
126
+ this.opened = false;
127
+ }
128
+ open() {
129
+ this.opened = true;
130
+ }
131
+ watchEscapeKey(event) {
132
+ if (event.key === "Escape" && this.closeOnEsc) {
133
+ this.close();
134
+ }
135
+ }
136
+ watchClickOutside() {
137
+ if (this.closeOnClickOutside) {
138
+ this.close();
139
+ }
140
+ }
141
+ };
142
+ FtDialog.elementDefinitions = {
143
+ "ft-typography": FtTypography,
144
+ };
145
+ __decorate([
146
+ property({
147
+ type: Boolean,
148
+ hasChanged(newVal, oldVal) {
149
+ return ((oldVal === false && newVal === true) ||
150
+ (oldVal === true && newVal === false));
151
+ },
152
+ })
153
+ ], FtDialog.prototype, "opened", void 0);
154
+ __decorate([
155
+ property({ type: Boolean })
156
+ ], FtDialog.prototype, "closeOnEsc", void 0);
157
+ __decorate([
158
+ property({ type: Boolean })
159
+ ], FtDialog.prototype, "closeOnClickOutside", void 0);
160
+ __decorate([
161
+ property({ type: String })
162
+ ], FtDialog.prototype, "heading", void 0);
163
+ FtDialog = __decorate([
164
+ customElement("ft-dialog")
165
+ ], FtDialog);
166
+ export default FtDialog;
167
+ //# sourceMappingURL=ft-dialog.js.map
@@ -0,0 +1,155 @@
1
+ !function(){
2
+ /**
3
+ * @license
4
+ * Copyright 2019 Google LLC
5
+ * SPDX-License-Identifier: BSD-3-Clause
6
+ */
7
+ const t=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),e=new Map;class n{constructor(t,e){if(this._$cssResult$=!0,e!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let i=e.get(this.cssText);return t&&void 0===i&&(e.set(this.cssText,i=new CSSStyleSheet),i.replaceSync(this.cssText)),i}toString(){return this.cssText}}const o=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((i,e,n)=>i+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+t[n+1]),t[0]);return new n(o,i)},r=(i,e)=>{t?i.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((t=>{const e=document.createElement("style"),n=window.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=t.cssText,i.appendChild(e)}))},s=t?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new n("string"==typeof t?t:t+"",i))(e)})(t):t
8
+ /**
9
+ * @license
10
+ * Copyright 2017 Google LLC
11
+ * SPDX-License-Identifier: BSD-3-Clause
12
+ */;var a;const h=window.trustedTypes,l=h?h.emptyScript:"",f=window.reactiveElementPolyfillSupport,p={toAttribute(t,i){switch(i){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let e=t;switch(i){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},c=(t,i)=>i!==t&&(i==i||t==t),u={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:c};class y extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var i;null!==(i=this.l)&&void 0!==i||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,e)=>{const n=this._$Eh(e,i);void 0!==n&&(this._$Eu.set(n,e),t.push(n))})),t}static createProperty(t,i=u){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const e="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,e,i);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,i,e){return{get(){return this[i]},set(n){const o=this[t];this[i]=n,this.requestUpdate(t,o,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||u}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const e of i)this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)i.unshift(s(t))}else void 0!==t&&i.push(s(t));return i}static _$Eh(t,i){const e=i.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,e;(null!==(i=this._$Eg)&&void 0!==i?i:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.call(t))}removeController(t){var i;null===(i=this._$Eg)||void 0===i||i.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Et.set(i,this[i]),delete this[i])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return r(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,e){this._$AK(t,e)}_$ES(t,i,e=u){var n,o;const r=this.constructor._$Eh(t,e);if(void 0!==r&&!0===e.reflect){const s=(null!==(o=null===(n=e.converter)||void 0===n?void 0:n.toAttribute)&&void 0!==o?o:p.toAttribute)(i,e.type);this._$Ei=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Ei=null}}_$AK(t,i){var e,n,o;const r=this.constructor,s=r._$Eu.get(t);if(void 0!==s&&this._$Ei!==s){const t=r.getPropertyOptions(s),a=t.converter,h=null!==(o=null!==(n=null===(e=a)||void 0===e?void 0:e.fromAttribute)&&void 0!==n?n:"function"==typeof a?a:null)&&void 0!==o?o:p.fromAttribute;this._$Ei=s,this[s]=h(i,t.type),this._$Ei=null}}requestUpdate(t,i,e){let n=!0;void 0!==t&&(((e=e||this.constructor.getPropertyOptions(t)).hasChanged||c)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===e.reflect&&this._$Ei!==t&&(void 0===this._$E_&&(this._$E_=new Map),this._$E_.set(t,e))):n=!1),!this.isUpdatePending&&n&&(this._$Ep=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,i)=>this[i]=t)),this._$Et=void 0);let i=!1;const e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(e)):this._$EU()}catch(t){throw i=!1,this._$EU(),t}i&&this._$AE(e)}willUpdate(t){}_$AE(t){var i;null===(i=this._$Eg)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$E_&&(this._$E_.forEach(((t,i)=>this._$ES(i,this[i],t))),this._$E_=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
13
+ /**
14
+ * @license
15
+ * Copyright 2017 Google LLC
16
+ * SPDX-License-Identifier: BSD-3-Clause
17
+ */
18
+ var v;y.finalized=!0,y.elementProperties=new Map,y.elementStyles=[],y.shadowRootOptions={mode:"open"},null==f||f({ReactiveElement:y}),(null!==(a=globalThis.reactiveElementVersions)&&void 0!==a?a:globalThis.reactiveElementVersions=[]).push("1.2.2");const d=globalThis.trustedTypes,g=d?d.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,w="?"+m,b=`<${w}>`,x=document,S=(t="")=>x.createComment(t),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,E=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,k=/>/g,j=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,z=/'/g,A=/"/g,M=/^(?:script|style|textarea|title)$/i,_=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),T=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),U=new WeakMap,L=x.createTreeWalker(x,129,null,!1),H=(t,i)=>{const e=t.length-1,n=[];let o,r=2===i?"<svg>":"",s=E;for(let i=0;i<e;i++){const e=t[i];let a,h,l=-1,f=0;for(;f<e.length&&(s.lastIndex=f,h=s.exec(e),null!==h);)f=s.lastIndex,s===E?"!--"===h[1]?s=C:void 0!==h[1]?s=k:void 0!==h[2]?(M.test(h[2])&&(o=RegExp("</"+h[2],"g")),s=j):void 0!==h[3]&&(s=j):s===j?">"===h[0]?(s=null!=o?o:E,l=-1):void 0===h[1]?l=-2:(l=s.lastIndex-h[2].length,a=h[1],s=void 0===h[3]?j:'"'===h[3]?A:z):s===A||s===z?s=j:s===C||s===k?s=E:(s=j,o=void 0);const p=s===j&&t[i+1].startsWith("/>")?" ":"";r+=s===E?e+b:l>=0?(n.push(a),e.slice(0,l)+"$lit$"+e.slice(l)+m+p):e+m+(-2===l?(n.push(void 0),i):p)}const a=r+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==g?g.createHTML(a):a,n]};class N{constructor({strings:t,_$litType$:i},e){let n;this.parts=[];let o=0,r=0;const s=t.length-1,a=this.parts,[h,l]=H(t,i);if(this.el=N.createElement(h,e),L.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(n=L.nextNode())&&a.length<s;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const i of n.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(m)){const e=l[r++];if(t.push(i),void 0!==e){const t=n.getAttribute(e.toLowerCase()+"$lit$").split(m),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?W:"?"===i[1]?V:"@"===i[1]?K:P})}else a.push({type:6,index:o})}for(const i of t)n.removeAttribute(i)}if(M.test(n.tagName)){const t=n.textContent.split(m),i=t.length-1;if(i>0){n.textContent=d?d.emptyScript:"";for(let e=0;e<i;e++)n.append(t[e],S()),L.nextNode(),a.push({type:2,index:++o});n.append(t[i],S())}}}else if(8===n.nodeType)if(n.data===w)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(m,t+1));)a.push({type:7,index:o}),t+=m.length-1}o++}}static createElement(t,i){const e=x.createElement("template");return e.innerHTML=t,e}}function D(t,i,e=t,n){var o,r,s,a;if(i===T)return i;let h=void 0!==n?null===(o=e._$Cl)||void 0===o?void 0:o[n]:e._$Cu;const l=$(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==l&&(null===(r=null==h?void 0:h._$AO)||void 0===r||r.call(h,!1),void 0===l?h=void 0:(h=new l(t),h._$AT(t,e,n)),void 0!==n?(null!==(s=(a=e)._$Cl)&&void 0!==s?s:a._$Cl=[])[n]=h:e._$Cu=h),void 0!==h&&(i=D(t,h._$AS(t,i.values),h,n)),i}class F{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:n}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:x).importNode(e,!0);L.currentNode=o;let r=L.nextNode(),s=0,a=0,h=n[0];for(;void 0!==h;){if(s===h.index){let i;2===h.type?i=new I(r,r.nextSibling,this,t):1===h.type?i=new h.ctor(r,h.name,h.strings,this,t):6===h.type&&(i=new J(r,this,t)),this.v.push(i),h=n[++a]}s!==(null==h?void 0:h.index)&&(r=L.nextNode(),s++)}return o}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class I{constructor(t,i,e,n){var o;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=n,this._$Cg=null===(o=null==n?void 0:n.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=D(this,t,i),$(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==T&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var i;return O(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==R&&$(this._$AH)?this._$AA.nextSibling.data=t:this.S(x.createTextNode(t)),this._$AH=t}T(t){var i;const{values:e,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=N.createElement(n.h,this.options)),n);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(e);else{const t=new F(o,this),i=t.p(this.options);t.m(e),this.S(i),this._$AH=t}}_$AC(t){let i=U.get(t.strings);return void 0===i&&U.set(t.strings,i=new N(t)),i}A(t){O(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,n=0;for(const o of t)n===i.length?i.push(e=new I(this.M(S()),this.M(S()),this,this.options)):e=i[n],e._$AI(o),n++;n<i.length&&(this._$AR(e&&e._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class P{constructor(t,i,e,n,o){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=o,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,n){const o=this.strings;let r=!1;if(void 0===o)t=D(this,t,i,0),r=!$(t)||t!==this._$AH&&t!==T,r&&(this._$AH=t);else{const n=t;let s,a;for(t=o[0],s=0;s<o.length-1;s++)a=D(this,n[e+s],i,s),a===T&&(a=this._$AH[s]),r||(r=!$(a)||a!==this._$AH[s]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+o[s+1]),this._$AH[s]=a}r&&!n&&this.k(t)}k(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends P{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===R?void 0:t}}const B=d?d.emptyScript:"";class V extends P{constructor(){super(...arguments),this.type=4}k(t){t&&t!==R?this.element.setAttribute(this.name,B):this.element.removeAttribute(this.name)}}class K extends P{constructor(t,i,e,n,o){super(t,i,e,n,o),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=D(this,t,i,0))&&void 0!==e?e:R)===T)return;const n=this._$AH,o=t===R&&n!==R||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==R&&(n===R||o);o&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){D(this,t)}}const Z=window.litHtmlPolyfillSupport;
19
+ /**
20
+ * @license
21
+ * Copyright 2017 Google LLC
22
+ * SPDX-License-Identifier: BSD-3-Clause
23
+ */
24
+ var q,G;null==Z||Z(N,I),(null!==(v=globalThis.litHtmlVersions)&&void 0!==v?v:globalThis.litHtmlVersions=[]).push("2.1.3");class Q extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,i;const e=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=e.firstChild),e}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,i,e)=>{var n,o;const r=null!==(n=null==e?void 0:e.renderBefore)&&void 0!==n?n:i;let s=r._$litPart$;if(void 0===s){const t=null!==(o=null==e?void 0:e.renderBefore)&&void 0!==o?o:null;r._$litPart$=s=new I(i.insertBefore(S(),t),t,void 0,null!=e?e:{})}return s._$AI(t),s})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return T}}Q.finalized=!0,Q._$litElement$=!0,null===(q=globalThis.litElementHydrateSupport)||void 0===q||q.call(globalThis,{LitElement:Q});const X=globalThis.litElementPolyfillSupport;null==X||X({LitElement:Q}),(null!==(G=globalThis.litElementVersions)&&void 0!==G?G:globalThis.litElementVersions=[]).push("3.1.2");
25
+ /**
26
+ * @license
27
+ * Copyright 2017 Google LLC
28
+ * SPDX-License-Identifier: BSD-3-Clause
29
+ */
30
+ const Y=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(e){e.createProperty(i.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(e){e.createProperty(i.key,t)}};function tt(t){return(i,e)=>void 0!==e?((t,i,e)=>{i.constructor.createProperty(e,t)})(t,i,e):Y(t,i)
31
+ /**
32
+ * @license
33
+ * Copyright 2021 Google LLC
34
+ * SPDX-License-Identifier: BSD-3-Clause
35
+ */}var it;null===(it=window.HTMLSlotElement)||void 0===it||it.prototype.assignedElements,function(){function t(t){var i=0;return function(){return i<t.length?{done:!1,value:t[i++]}:{done:!0}}}function i(i){var e="undefined"!=typeof Symbol&&Symbol.iterator&&i[Symbol.iterator];return e?e.call(i):{next:t(i)}}function e(t){if(!(t instanceof Array)){t=i(t);for(var e,n=[];!(e=t.next()).done;)n.push(e.value);t=n}return t}var n="function"==typeof Object.create?Object.create:function(t){function i(){}return i.prototype=t,new i};var o,r=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var i=0;i<t.length;++i){var e=t[i];if(e&&e.Math==Math)return e}throw Error("Cannot find global object")}(this),s=function(){if("undefined"!=typeof Reflect&&Reflect.construct){if(function(){function t(){}return Reflect.construct(t,[],(function(){})),new t instanceof t}())return Reflect.construct;var t=Reflect.construct;return function(i,e,n){return i=t(i,e),n&&Reflect.setPrototypeOf(i,n.prototype),i}}return function(t,i,e){return void 0===e&&(e=t),e=n(e.prototype||Object.prototype),Function.prototype.apply.call(t,e,i)||e}}();if("function"==typeof Object.setPrototypeOf)o=Object.setPrototypeOf;else{var a;t:{var h={};try{h.__proto__={a:!0},a=h.a;break t}catch(t){}a=!1}o=a?function(t,i){if(t.__proto__=i,t.__proto__!==i)throw new TypeError(t+" is not extensible");return t}:null}var l=o;if(!ShadowRoot.prototype.createElement){var f,p=window.HTMLElement,c=window.customElements.define,u=window.customElements.get,y=window.customElements,v=new WeakMap,d=new WeakMap,g=new WeakMap,m=new WeakMap;window.CustomElementRegistry=function(){this.l=new Map,this.o=new Map,this.i=new Map,this.h=new Map},window.CustomElementRegistry.prototype.define=function(t,e){if(t=t.toLowerCase(),void 0!==this.j(t))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': the name \""+t+'" has already been used with this registry');if(void 0!==this.o.get(e))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");var n=e.prototype.attributeChangedCallback,o=new Set(e.observedAttributes||[]);if(b(e,o,n),n={g:e,connectedCallback:e.prototype.connectedCallback,disconnectedCallback:e.prototype.disconnectedCallback,adoptedCallback:e.prototype.adoptedCallback,attributeChangedCallback:n,formAssociated:e.formAssociated,formAssociatedCallback:e.prototype.formAssociatedCallback,formDisabledCallback:e.prototype.formDisabledCallback,formResetCallback:e.prototype.formResetCallback,formStateRestoreCallback:e.prototype.formStateRestoreCallback,observedAttributes:o},this.l.set(t,n),this.o.set(e,n),(o=u.call(y,t))||(o=w(t),c.call(y,t,o)),this===window.customElements&&(g.set(e,n),n.s=o),o=this.h.get(t)){this.h.delete(t);for(var r=(o=i(o)).next();!r.done;r=o.next())r=r.value,d.delete(r),S(r,n,!0)}return void 0!==(n=this.i.get(t))&&(n.resolve(e),this.i.delete(t)),e},window.CustomElementRegistry.prototype.upgrade=function(){O.push(this),y.upgrade.apply(y,arguments),O.pop()},window.CustomElementRegistry.prototype.get=function(t){var i;return null==(i=this.l.get(t))?void 0:i.g},window.CustomElementRegistry.prototype.j=function(t){return this.l.get(t)},window.CustomElementRegistry.prototype.whenDefined=function(t){var i=this.j(t);if(void 0!==i)return Promise.resolve(i.g);var e=this.i.get(t);return void 0===e&&((e={}).promise=new Promise((function(t){return e.resolve=t})),this.i.set(t,e)),e.promise},window.CustomElementRegistry.prototype.m=function(t,i,e){var n=this.h.get(i);n||this.h.set(i,n=new Set),e?n.add(t):n.delete(t)},window.HTMLElement=function(){var t=f;if(t)return f=void 0,t;var i=g.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return t=Reflect.construct(p,[],i.s),Object.setPrototypeOf(t,this.constructor.prototype),v.set(t,i),t},window.HTMLElement.prototype=p.prototype;var w=function(t){function i(){var i=Reflect.construct(p,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);t:{var e=i.getRootNode();if(!(e===document||e instanceof ShadowRoot)){if((e=O[O.length-1])instanceof CustomElementRegistry){var n=e;break t}(e=e.getRootNode())===document||e instanceof ShadowRoot||(e=(null==(n=m.get(e))?void 0:n.getRootNode())||document)}n=e.customElements}return(e=(n=n||window.customElements).j(t))?S(i,e):d.set(i,n),i}return r.Object.defineProperty(i,"formAssociated",{configurable:!0,enumerable:!0,get:function(){return!0}}),i.prototype.connectedCallback=function(){var i=v.get(this);i?i.connectedCallback&&i.connectedCallback.apply(this,arguments):d.get(this).m(this,t,!0)},i.prototype.disconnectedCallback=function(){var i=v.get(this);i?i.disconnectedCallback&&i.disconnectedCallback.apply(this,arguments):d.get(this).m(this,t,!1)},i.prototype.adoptedCallback=function(){var t,i;null==(t=v.get(this))||null==(i=t.adoptedCallback)||i.apply(this,arguments)},i.prototype.formAssociatedCallback=function(){var t,i=v.get(this);i&&i.formAssociated&&(null==i||null==(t=i.formAssociatedCallback)||t.apply(this,arguments))},i.prototype.formDisabledCallback=function(){var t,i=v.get(this);null!=i&&i.formAssociated&&(null==i||null==(t=i.formDisabledCallback)||t.apply(this,arguments))},i.prototype.formResetCallback=function(){var t,i=v.get(this);null!=i&&i.formAssociated&&(null==i||null==(t=i.formResetCallback)||t.apply(this,arguments))},i.prototype.formStateRestoreCallback=function(){var t,i=v.get(this);null!=i&&i.formAssociated&&(null==i||null==(t=i.formStateRestoreCallback)||t.apply(this,arguments))},i},b=function(t,i,e){if(0!==i.size&&void 0!==e){var n=t.prototype.setAttribute;n&&(t.prototype.setAttribute=function(t,o){if(t=t.toLowerCase(),i.has(t)){var r=this.getAttribute(t);n.call(this,t,o),e.call(this,t,r,o)}else n.call(this,t,o)});var o=t.prototype.removeAttribute;o&&(t.prototype.removeAttribute=function(t){if(t=t.toLowerCase(),i.has(t)){var n=this.getAttribute(t);o.call(this,t),e.call(this,t,n,null)}else o.call(this,t)})}},x=function(t){var i=Object.getPrototypeOf(t);if(i!==window.HTMLElement)return i===p?Object.setPrototypeOf(t,window.HTMLElement):x(i)},S=function(t,i,e){e=void 0!==e&&e,Object.setPrototypeOf(t,i.g.prototype),v.set(t,i),f=t;try{new i.g}catch(t){x(i.g),new i.g}i.observedAttributes.forEach((function(e){t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},$=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){var i=$.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};var O=[document],E=function(t,i,e){var n=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){O.push(this);var t=n.apply(e||this,arguments);return void 0!==t&&m.set(t,this),O.pop(),t}};E(ShadowRoot,"createElement",document),E(ShadowRoot,"importNode",document),E(Element,"insertAdjacentHTML");var C=function(t){var i=Object.getOwnPropertyDescriptor(t.prototype,"innerHTML");Object.defineProperty(t.prototype,"innerHTML",Object.assign({},i,{set:function(t){O.push(this),i.set.call(this,t),O.pop()}}))};if(C(Element),C(ShadowRoot),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){var k=new WeakMap,j=HTMLElement.prototype.attachInternals;HTMLElement.prototype.attachInternals=function(t){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];return i=j.call.apply(j,[this].concat(e(i))),k.set(i,this),i},["setFormValue","setValidity","checkValidity","reportValidity"].forEach((function(t){var i=window.ElementInternals.prototype,n=i[t];i[t]=function(t){for(var i=[],o=0;o<arguments.length;++o)i[o]=arguments[o];if(o=k.get(this),!0!==v.get(o).formAssociated)throw new DOMException("Failed to execute "+n+" on 'ElementInternals': The target element is not a form-associated custom element.");null==n||n.call.apply(n,[this].concat(e(i)))}}));var z=function(t){var i=s(Array,[].concat(e(t)),this.constructor);return i.h=t,i},A=z,M=Array;if(A.prototype=n(M.prototype),A.prototype.constructor=A,l)l(A,M);else for(var _ in M)if("prototype"!=_)if(Object.defineProperties){var T=Object.getOwnPropertyDescriptor(M,_);T&&Object.defineProperty(A,_,T)}else A[_]=M[_];A.u=M.prototype,r.Object.defineProperty(z.prototype,"value",{configurable:!0,enumerable:!0,get:function(){var t;return(null==(t=this.h.find((function(t){return!0===t.checked})))?void 0:t.value)||""}});var R=function(t){var i=this,e=new Map;t.forEach((function(t,n){var o=t.getAttribute("name"),r=e.get(o)||[];i[+n]=t,r.push(t),e.set(o,r)})),this.length=t.length,e.forEach((function(t,e){t&&(i[e]=1===t.length?t[0]:new z(t))}))};R.prototype.namedItem=function(t){return this[t]};var U=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){for(var t=U.get.call(this,[]),e=[],n=(t=i(t)).next();!n.done;n=t.next()){n=n.value;var o=v.get(n);o&&!0!==o.formAssociated||e.push(n)}return new R(e)}})}}}.call(self);try{window.customElements.define("custom-element",null)}catch(rt){const t=window.customElements.define;window.customElements.define=(i,e,n)=>{try{t.bind(window.customElements)(i,e,n)}catch(t){console.warn(i,e,n,t)}}}const et=t=>i=>{window.customElements.get(t)||window.customElements.define(t,i)}
36
+ /**
37
+ * @license
38
+ * Copyright 2021 Google LLC
39
+ * SPDX-License-Identifier: BSD-3-Clause
40
+ */;class nt extends(function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:i,elementDefinitions:e,shadowRootOptions:n}=t;e&&!i&&(t.registry=new CustomElementRegistry,Object.entries(e).forEach((([i,e])=>t.registry.define(i,e))));const o=this.renderOptions.creationScope=this.attachShadow({...n,customElements:t.registry});return r(o,this.constructor.elementStyles),o}}}(Q)){constructor(){super(),this.constructorName=this.constructor.name,this.proto=this.constructor.prototype}getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),_`${t.map((t=>_`<style>${t}</style>`))} ${this.getTemplate()}`}adoptedCallback(){Object.getPrototypeOf(this)!==this.constructorName&&Object.setPrototypeOf(this,this.proto)}updated(t){super.updated(t),setTimeout((()=>this.contentAvailableCallback(t)),0)}contentAvailableCallback(t){}}
41
+ /**
42
+ * @license
43
+ * Copyright 2017 Google LLC
44
+ * SPDX-License-Identifier: BSD-3-Clause
45
+ */const ot=2;
46
+ /**
47
+ * @license
48
+ * Copyright 2017 Google LLC
49
+ * SPDX-License-Identifier: BSD-3-Clause
50
+ */
51
+ class rt extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){if(super(t),this.it=R,t.type!==ot)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===R||null==t)return this.vt=void 0,this.it=t;if(t===T)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.vt;this.it=t;const i=[t];return i.raw=i,this.vt={_$litType$:this.constructor.resultType,strings:i,values:[]}}}var st,at;rt.directiveName="unsafeHTML",rt.resultType=1,navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(at=null===(st=window.safari)||void 0===st?void 0:st.pushNotification)||void 0===at||at.toString());
52
+ /**
53
+ * @license
54
+ * Copyright 2020 Google LLC
55
+ * SPDX-License-Identifier: BSD-3-Clause
56
+ */
57
+ const ht=t=>({_$litStatic$:t}),lt=new Map,ft=(t=>(i,...e)=>{var n;const o=e.length;let r,s;const a=[],h=[];let l,f=0,p=!1;for(;f<o;){for(l=i[f];f<o&&void 0!==(s=e[f],r=null===(n=s)||void 0===n?void 0:n._$litStatic$);)l+=r+i[++f],p=!0;h.push(s),a.push(l),f++}if(f===o&&a.push(i[o]),p){const t=a.join("$$lit$$");void 0===(i=lt.get(t))&&(a.raw=a,lt.set(t,i=a)),e=h}return t(i,...e)})(_);var pt,ct=function(t,i,e,n){for(var o,r=arguments.length,s=r<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,e):n,a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(i,e,s):o(i,e))||s);return r>3&&s&&Object.defineProperty(i,e,s),s};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(pt||(pt={}));const ut=o`
58
+ .ft-typography--title {
59
+ font-family: var(--ft-typography-title-font-family, var(--ft-typography-font-family, var(--ft-title-font, Ubuntu))), system-ui, sans-serif;
60
+ font-size: var(--ft-typography-title-font-size, var(--ft-typography-font-size, 20px));
61
+ font-weight: var(--ft-typography-title-font-weight, var(--ft-typography-font-weight, normal));
62
+ letter-spacing: var(--ft-typography-title-letter-spacing, var(--ft-typography-letter-spacing, 0.15px));
63
+ line-height: var(--ft-typography-title-line-height, var(--ft-typography-line-height, 24px));
64
+ text-transform: var(--ft-typography-title-text-transform, var(--ft-typography-text-transform, inherit));
65
+ }
66
+ `,yt=o`
67
+ .ft-typography--title-dense {
68
+ font-family: var(--ft-typography-title-dense-font-family, var(--ft-typography-font-family, var(--ft-title-font, Ubuntu))), system-ui, sans-serif;
69
+ font-size: var(--ft-typography-title-dense-font-size, var(--ft-typography-font-size, 14px));
70
+ font-weight: var(--ft-typography-title-dense-font-weight, var(--ft-typography-font-weight, normal));
71
+ letter-spacing: var(--ft-typography-title-dense-letter-spacing, var(--ft-typography-letter-spacing, 0.105px));
72
+ line-height: var(--ft-typography-title-dense-line-height, var(--ft-typography-line-height, 24px));
73
+ text-transform: var(--ft-typography-title-dense-text-transform, var(--ft-typography-text-transform, inherit));
74
+ }
75
+ `,vt=o`
76
+ .ft-typography--subtitle1 {
77
+ font-family: var(--ft-typography-subtitle1-font-family, var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans'))), system-ui, sans-serif;
78
+ font-size: var(--ft-typography-subtitle1-font-size, var(--ft-typography-font-size, 16px));
79
+ font-weight: var(--ft-typography-subtitle1-font-weight, var(--ft-typography-font-weight, 600));
80
+ letter-spacing: var(--ft-typography-subtitle1-letter-spacing, var(--ft-typography-letter-spacing, 0.144px));
81
+ line-height: var(--ft-typography-subtitle1-line-height, var(--ft-typography-line-height, 24px));
82
+ text-transform: var(--ft-typography-subtitle1-text-transform, var(--ft-typography-text-transform, inherit));
83
+ }
84
+ `,dt=o`
85
+ .ft-typography--subtitle2 {
86
+ font-family: var(--ft-typography-subtitle2-font-family, var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans'))), system-ui, sans-serif;
87
+ font-size: var(--ft-typography-subtitle2-font-size, var(--ft-typography-font-size, 14px));
88
+ font-weight: var(--ft-typography-subtitle2-font-weight, var(--ft-typography-font-weight, normal));
89
+ letter-spacing: var(--ft-typography-subtitle2-letter-spacing, var(--ft-typography-letter-spacing, 0.098px));
90
+ line-height: var(--ft-typography-subtitle2-line-height, var(--ft-typography-line-height, 24px));
91
+ text-transform: var(--ft-typography-subtitle2-text-transform, var(--ft-typography-text-transform, inherit));
92
+ }
93
+
94
+ `,gt=o`
95
+ .ft-typography--body1 {
96
+ font-family: var(--ft-typography-body1-font-family, var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans'))), system-ui, sans-serif;
97
+ font-size: var(--ft-typography-body1-font-size, var(--ft-typography-font-size, 16px));
98
+ font-weight: var(--ft-typography-body1-font-weight, var(--ft-typography-font-weight, normal));
99
+ letter-spacing: var(--ft-typography-body1-letter-spacing, var(--ft-typography-letter-spacing, 0.496px));
100
+ line-height: var(--ft-typography-body1-line-height, var(--ft-typography-line-height, 24px));
101
+ text-transform: var(--ft-typography-body1-text-transform, var(--ft-typography-text-transform, inherit));
102
+ }
103
+ `,mt=o`
104
+ .ft-typography--body2 {
105
+ font-family: var(--ft-typography-body2-font-family, var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans'))), system-ui, sans-serif;
106
+ font-size: var(--ft-typography-body2-font-size, var(--ft-typography-font-size, 14px));
107
+ font-weight: var(--ft-typography-body2-font-weight, var(--ft-typography-font-weight, normal));
108
+ letter-spacing: var(--ft-typography-body2-letter-spacing, var(--ft-typography-letter-spacing, 0.252px));
109
+ line-height: var(--ft-typography-body2-line-height, var(--ft-typography-line-height, 20px));
110
+ text-transform: var(--ft-typography-body2-text-transform, var(--ft-typography-text-transform, inherit));
111
+ }
112
+ `,wt=o`
113
+ .ft-typography--caption {
114
+ font-family: var(--ft-typography-caption-font-family, var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans'))), system-ui, sans-serif;
115
+ font-size: var(--ft-typography-caption-font-size, var(--ft-typography-font-size, 12px));
116
+ font-weight: var(--ft-typography-caption-font-weight, var(--ft-typography-font-weight, normal));
117
+ letter-spacing: var(--ft-typography-caption-letter-spacing, var(--ft-typography-letter-spacing, 0.396px));
118
+ line-height: var(--ft-typography-caption-line-height, var(--ft-typography-line-height, 16px));
119
+ text-transform: var(--ft-typography-caption-text-transform, var(--ft-typography-text-transform, inherit));
120
+ }
121
+ `,bt=o`
122
+ .ft-typography--breadcrumb {
123
+ font-family: var(--ft-typography-breadcrumb-font-family, var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans'))), system-ui, sans-serif;
124
+ font-size: var(--ft-typography-breadcrumb-font-size, var(--ft-typography-font-size, 10px));
125
+ font-weight: var(--ft-typography-breadcrumb-font-weight, var(--ft-typography-font-weight, normal));
126
+ letter-spacing: var(--ft-typography-breadcrumb-letter-spacing, var(--ft-typography-letter-spacing, 0.33px));
127
+ line-height: var(--ft-typography-breadcrumb-line-height, var(--ft-typography-line-height, 16px));
128
+ text-transform: var(--ft-typography-breadcrumb-text-transform, var(--ft-typography-text-transform, inherit));
129
+ }
130
+ `,xt=o`
131
+ .ft-typography--overline {
132
+ font-family: var(--ft-typography-overline-font-family, var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans'))), system-ui, sans-serif;
133
+ font-size: var(--ft-typography-overline-font-size, var(--ft-typography-font-size, 10px));
134
+ font-weight: var(--ft-typography-overline-font-weight, var(--ft-typography-font-weight, normal));
135
+ letter-spacing: var(--ft-typography-overline-letter-spacing, var(--ft-typography-letter-spacing, 1.5px));
136
+ line-height: var(--ft-typography-overline-line-height, var(--ft-typography-line-height, 16px));
137
+ text-transform: var(--ft-typography-overline-text-transform, var(--ft-typography-text-transform, uppercase));
138
+ }
139
+ `,St=o`
140
+ .ft-typography--button {
141
+ font-family: var(--ft-typography-button-font-family, var(--ft-typography-font-family, var(--ft-content-font, 'Open Sans'))), system-ui, sans-serif;
142
+ font-size: var(--ft-typography-button-font-size, var(--ft-typography-font-size, 14px));
143
+ font-weight: var(--ft-typography-button-font-weight, var(--ft-typography-font-weight, 600));
144
+ letter-spacing: var(--ft-typography-button-letter-spacing, var(--ft-typography-letter-spacing, 1.246px));
145
+ line-height: var(--ft-typography-button-line-height, var(--ft-typography-line-height, 16px));
146
+ text-transform: var(--ft-typography-button-text-transform, var(--ft-typography-text-transform, uppercase));
147
+ }
148
+ `;let $t=class extends nt{constructor(){super(...arguments),this.variant=pt.body1}getStyles(){return[ut,yt,vt,dt,gt,mt,wt,bt,xt,St]}getTemplate(){return this.element?ft`
149
+ <${ht(this.element)}
150
+ class="ft-typography ft-typography--${this.variant}">
151
+ <slot></slot>
152
+ </${ht(this.element)}>
153
+ `:ft`
154
+ <slot class="ft-typography ft-typography--${this.variant}"></slot>
155
+ `}};ct([tt()],$t.prototype,"element",void 0),ct([tt()],$t.prototype,"variant",void 0),$t=ct([et("ft-typography")],$t);var Ot=function(t,i,e,n){for(var o,r=arguments.length,s=r<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,e):n,a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(i,e,s):o(i,e))||s);return r>3&&s&&Object.defineProperty(i,e,s),s};let Et=class extends nt{constructor(){super(...arguments),this.opened=!1,this.closeOnEsc=!1,this.closeOnClickOutside=!1,this.heading=""}getStyles(){return o`.ft-dialog{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--ft-dialog-z-index,2);display:flex;flex-direction:column;justify-content:center;align-items:center;margin:auto}.ft-dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0;height:100%;width:100%;background-color:var(--ft-dialog-overlay-background-color,rgba(0,0,0,.3))}.ft-dialog_wrapper{position:fixed;display:flex;flex-direction:column;width:var(--ft-dialog-width,unset);height:var(--ft-dialog-height,unset);max-width:95vw;max-height:95vh;padding:var(--ft-dialog-padding,24px);background-color:var(--ft-color-surface,#fff);border-radius:var(--ft-border-radius-S,12px);box-shadow:var(--ft-elevation-24,0 40px 76px 0 rgba(0,0,0,.06),0 24px 41px 0 rgba(0,0,0,.14),0 22px 23px 0 rgba(0,0,0,.06))}.ft-dialog_content{flex-grow:2;overflow:auto}.ft-dialog_heading{display:block;margin-bottom:12px}.ft-dialog_buttons{margin-top:12px}slot[name=buttons]{display:flex;align-items:center;justify-content:flex-end}`}getTemplate(){return this.opened?_`<div class="ft-dialog"><div class="ft-dialog_overlay" @click="${()=>this.watchClickOutside()}"></div><div class="ft-dialog_wrapper">${this.heading?_`<ft-typography class="ft-dialog_heading" variant="title">${this.heading}</ft-typography>`:null}<div class="ft-dialog_content"><slot></slot></div><div class="ft-dialog_buttons"><slot name="buttons"></slot></div></div></div>`:null}updated(t){if(t.has("opened")){const t=new CustomEvent("opened-changed",{detail:{opened:this.opened}});this.dispatchEvent(t)}}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.watchEscapeKey.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.watchEscapeKey.bind(this))}close(){this.opened=!1}open(){this.opened=!0}watchEscapeKey(t){"Escape"===t.key&&this.closeOnEsc&&this.close()}watchClickOutside(){this.closeOnClickOutside&&this.close()}};Et.elementDefinitions={"ft-typography":$t},Ot([tt({type:Boolean,hasChanged:(t,i)=>!1===i&&!0===t||!0===i&&!1===t})],Et.prototype,"opened",void 0),Ot([tt({type:Boolean})],Et.prototype,"closeOnEsc",void 0),Ot([tt({type:Boolean})],Et.prototype,"closeOnClickOutside",void 0),Ot([tt({type:String})],Et.prototype,"heading",void 0),Et=Ot([et("ft-dialog")],Et)}();
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@fluid-topics/ft-dialog",
3
+ "version": "0.0.88",
4
+ "description": "A simple dialog component",
5
+ "keywords": [
6
+ "Lit"
7
+ ],
8
+ "author": "Fluid Topics <devtopics@antidot.net>",
9
+ "license": "ISC",
10
+ "main": "build/ft-dialog.js",
11
+ "web": "build/ft-dialog.min.js",
12
+ "typings": "build/ft-dialog",
13
+ "files": [
14
+ "build/*.ts",
15
+ "build/*.js"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
+ },
21
+ "dependencies": {
22
+ "@fluid-topics/ft-wc-utils": "^0.0.88",
23
+ "lit": "^2.0.2"
24
+ },
25
+ "gitHead": "220e53dba55dfa1de1560abbc30067555f72198c"
26
+ }