@3r1s_s/erisui 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +81 -0
- package/dist/erisui.css +1 -0
- package/dist/erisui.js +1098 -0
- package/dist/erisui.mjs +1767 -0
- package/package.json +32 -0
package/dist/erisui.js
ADDED
|
@@ -0,0 +1,1098 @@
|
|
|
1
|
+
(function(p,m){typeof exports=="object"&&typeof module<"u"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(p=typeof globalThis<"u"?globalThis:p||self,m(p.eui={}))})(this,(function(p){"use strict";class m extends HTMLElement{static get observedAttributes(){return["size","border-radius","name","color"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
2
|
+
<style>
|
|
3
|
+
:host {
|
|
4
|
+
aspect-ratio: 1 / 1;
|
|
5
|
+
width: fit-content;
|
|
6
|
+
|
|
7
|
+
user-select: none;
|
|
8
|
+
-webkit-user-select: none;
|
|
9
|
+
-webkit-user-drag: none;
|
|
10
|
+
-webkit-user-modify: none;
|
|
11
|
+
-webkit-highlight: none;
|
|
12
|
+
-webkit-tap-highlight-color: transparent;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.avatar {
|
|
16
|
+
width: 32px;
|
|
17
|
+
height: 100%;
|
|
18
|
+
aspect-ratio: 1 / 1;
|
|
19
|
+
|
|
20
|
+
border-radius: var(--border-radius, 50%);
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
box-shadow: inset 0 0 0 1px #ffffff25;
|
|
23
|
+
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
background-color: #000;
|
|
28
|
+
color: #fff;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
font-size: 1.2rem;
|
|
31
|
+
text-transform: uppercase;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
::slotted(img) {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
border-radius: var(--border-radius, 50%);
|
|
38
|
+
object-fit: cover;
|
|
39
|
+
display: block;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
42
|
+
<div class="avatar">
|
|
43
|
+
<slot></slot>
|
|
44
|
+
<span id="initials"></span>
|
|
45
|
+
</div>
|
|
46
|
+
`}connectedCallback(){this.avatar=this.shadowRoot.querySelector(".avatar"),this.initials=this.shadowRoot.querySelector("#initials");const t=this.shadowRoot.querySelector("slot"),e=t&&t.assignedNodes().length>0;if(e){const i=t.assignedNodes()[0];i&&i.tagName==="IMG"&&(this.initials.style.display="none",this.avatar.style.backgroundColor="transparent")}else this.hasAttribute("color")&&(this.avatar.style.backgroundColor=this.getAttribute("color"));if(this.hasAttribute("color")&&(this.avatar.style.backgroundColor=this.getAttribute("color")),this.hasAttribute("size")){const i=this.getAttribute("size");this.avatar.style.width=i+"px",this.avatar.style.height=i+"px",this.initials.style.fontSize=i/2+"px"}if(this.hasAttribute("border-radius")&&(this.avatar.style.borderRadius=this.getAttribute("border-radius")+"px"),this.hasAttribute("name")&&(this.avatar.title=this.getAttribute("name")),!e&&this.hasAttribute("name")){const a=this.getAttribute("name").trim().split(/\s+/);let n="";a.length===1?n=a[0][0]||"":n=(a[0][0]||"")+(a[a.length-1][0]||""),this.initials.textContent=n.toUpperCase()}}}customElements.define("eui-avatar",m);const u=(()=>{let o={};return{register(t,e){o[t]=e},get(t){return o[t]||""}}})();u.register("menu",'<svg width="24" height="24" viewBox="0 0 24 24" focusable="false"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" fill="currentColor"></path></svg>'),u.register("home",'<svg width="22" height="21" viewBox="0 0 22 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.5258 0.204649C11.2291 -0.0682165 10.7709 -0.0682161 10.4742 0.204649L0.249923 9.68588C-0.266994 10.1612 0.0714693 11.0197 0.775759 11.0197L3.48971 11.0197V18.6923C3.48971 19.542 4.18295 20.2308 5.03811 20.2308H16.9619C17.8171 20.2308 18.5103 19.542 18.5103 18.6923V11.0197L21.2242 11.0197C21.9285 11.0197 22.267 10.1612 21.7501 9.68588L11.5258 0.204649Z" fill="currentColor"/></svg>'),u.register("kit",'<svg width="26" height="28" viewBox="0 0 26 28" xmlns="http://www.w3.org/2000/svg"><path d="m13.118 14.831c0.433 0 1.257-0.024 1.795-0.344l9.151-4.057c0.869-0.59 1.051-1.255 1.067-1.773 0.02-0.662-0.313-1.634-1.181-2.15l-8.515-3.921c-0.537-0.309-2.096-0.552-2.529-0.552-0.444 0-1.958 0.42-2.496 0.73l-8.643 4.034c-0.85 0.602-1.022 1.284-0.951 1.942 0.098 0.887 0.206 0.857 0.889 1.503l9.577 4.212c0.537 0.32 1.391 0.376 1.836 0.376zm-0.12 5.467c0.403 0 1.443-0.068 1.928-0.345l8.858-3.991c0.497-0.3 1.448-1.117 1.382-1.952-0.091-1.138-0.598-1.7-0.948-1.906l-9.22 3.888c-0.454 0.261-1.417 0.478-1.916 0.478-0.542 0-1.539-0.228-1.766-0.362l-9.395-4.012c-0.462 0.022-1.174 0.911-1.201 1.642-0.03 0.761 0.7 1.62 1.135 1.839l9.408 4.384c0.485 0.278 1.322 0.337 1.735 0.337zm0.09 5.344c0.403 0 1.296-0.053 1.781-0.342l9.147-4.299c0.485-0.289 1.129-0.789 1.053-1.879-0.056-0.794-0.071-1.123-0.918-1.765l-9.203 4.113c-0.228 0.134-0.948 0.39-1.853 0.39-0.939 0-1.603-0.224-1.831-0.359l-9.451-4.017c-0.979 0.247-1.005 1.45-1.005 1.947 0 0.455 0.403 1.279 0.9 1.568l9.465 4.262c0.486 0.29 1.502 0.381 1.915 0.381z" fill="currentColor"></path></svg>'),u.register("settings",'<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.644169 15.2044C0.751639 15.4175 0.866389 15.627 0.988219 15.8323C1.34503 16.445 1.76284 17.0223 2.23048 17.545C2.3967 17.7307 2.65856 17.7968 2.89375 17.7126L5.25826 16.8621C5.96645 16.608 6.74841 17.07 6.87902 17.8018L7.32018 20.2764C7.36418 20.5227 7.55119 20.7167 7.79454 20.7688C8.86201 20.9976 9.95753 21.057 11.0418 20.9452C11.427 20.9061 11.8095 20.8457 12.1863 20.7643C12.375 20.7232 12.5303 20.5969 12.6121 20.4275C12.6441 20.37 12.6671 20.3068 12.6794 20.2397L13.132 17.7739C13.1978 17.4162 13.4191 17.1252 13.7102 16.9498C13.7478 16.9275 13.7867 16.9072 13.8264 16.8889C14.1041 16.7654 14.426 16.7408 14.7301 16.8496L17.0889 17.6938C17.2068 17.7362 17.3318 17.7406 17.4482 17.7107C17.5805 17.6872 17.7044 17.6208 17.7983 17.5172C18.2857 16.9783 18.7189 16.3833 19.0875 15.7497C19.4503 15.1137 19.748 14.4403 19.9703 13.7471C20.0128 13.6142 20.0083 13.4742 19.9629 13.3481C19.9307 13.2315 19.8646 13.1245 19.7685 13.043L17.8596 11.4179C17.6114 11.2067 17.4714 10.912 17.4409 10.6065C17.4371 10.563 17.4355 10.5194 17.4361 10.4758C17.444 10.1379 17.5847 9.80337 17.8591 9.56905L19.7638 7.94348C19.8146 7.90007 19.857 7.84958 19.8904 7.7944C19.9978 7.63842 20.0299 7.43844 19.9706 7.25291C19.8534 6.88733 19.7151 6.52704 19.5572 6.17466C19.1114 5.17572 18.5115 4.2528 17.7787 3.43934C17.612 3.25429 17.3509 3.18886 17.1161 3.27382L14.7569 4.12827C14.0592 4.38082 13.2679 3.93321 13.1344 3.19155L12.6871 0.714256C12.6423 0.468053 12.4542 0.273849 12.2106 0.22246C11.5182 0.0764882 10.803 0.00250031 10.088 0.000608251C9.88769 -0.0015584 9.68739 0.002064 9.48735 0.0114648C8.92415 0.0369819 8.36389 0.107332 7.81778 0.222459C7.78135 0.230146 7.74615 0.241028 7.71249 0.2548C7.5098 0.328781 7.35888 0.505679 7.31996 0.723547L6.8788 3.19817C6.81394 3.56157 6.58834 3.85866 6.29097 4.03446C5.98991 4.2061 5.61923 4.25412 5.27153 4.12827L2.91237 3.27382C2.70694 3.1995 2.48138 3.24016 2.31657 3.37545C2.2857 3.39886 2.25676 3.42543 2.23026 3.45505C1.81793 3.91588 1.44433 4.4192 1.11714 4.95183C1.05788 5.04799 1.00019 5.14513 0.944072 5.24319C0.878302 5.35619 0.814661 5.4704 0.753186 5.58577C0.464267 6.12611 0.222113 6.69081 0.0338354 7.26739C0.0213426 7.30567 0.0127871 7.34455 0.00802709 7.38352C-0.0257478 7.59364 0.0518458 7.809 0.218337 7.94974L2.13633 9.56992C2.41146 9.80242 2.55518 10.1364 2.56469 10.4743C2.56917 10.8294 2.42529 11.1857 2.13611 11.4301L0.218115 13.0503C0.0484589 13.1937 -0.0289685 13.4145 0.00982709 13.6284C0.0147983 13.6634 0.0228404 13.6982 0.0340542 13.7326C0.198098 14.235 0.403035 14.7283 0.644169 15.2044ZM10 14.5C12.2091 14.5 14 12.7091 14 10.5C14 8.29086 12.2091 6.5 10 6.5C7.79086 6.5 6 8.29086 6 10.5C6 12.7091 7.79086 14.5 10 14.5Z" fill="currentColor"></path></svg>'),u.register("home",'<svg width="22" height="21" viewBox="0 0 22 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.5258 0.204649C11.2291 -0.0682165 10.7709 -0.0682161 10.4742 0.204649L0.249923 9.68588C-0.266994 10.1612 0.0714693 11.0197 0.775759 11.0197L3.48971 11.0197V18.6923C3.48971 19.542 4.18295 20.2308 5.03811 20.2308H16.9619C17.8171 20.2308 18.5103 19.542 18.5103 18.6923V11.0197L21.2242 11.0197C21.9285 11.0197 22.267 10.1612 21.7501 9.68588L11.5258 0.204649Z" fill="currentColor"/></svg>'),u.register("copy",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M2 11C2 11.7956 2.31607 12.5587 2.87868 13.1213C3.44129 13.6839 4.20435 14 5 14H11C11.7956 14 12.5587 13.6839 13.1213 13.1213C13.6839 12.5587 14 11.7956 14 11V8H11.75C10.7554 8 9.80161 7.60491 9.09835 6.90165C8.39509 6.19839 8 5.24456 8 4.25V2H5C4.20435 2 3.44129 2.31607 2.87868 2.87868C2.31607 3.44129 2 4.20435 2 5V11Z" fill="currentColor"/><path d="M13.7975 6.49965C13.6881 6.25457 13.5357 6.03105 13.3475 5.83965L10.16 2.65965C9.96921 2.4688 9.74565 2.31384 9.5 2.20215V4.24965C9.5 4.54512 9.5582 4.8377 9.67127 5.11069C9.78434 5.38367 9.95008 5.63171 10.159 5.84064C10.3679 6.04957 10.616 6.2153 10.889 6.32838C11.1619 6.44145 11.4545 6.49965 11.75 6.49965H13.7975Z" fill="currentColor"/></svg>'),u.register("arrow",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"></path></svg>'),u.register("back",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" style="transform: rotate(180deg)"><path d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"></path></svg>'),u.register("check",'<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.86368 9.12226C3.82463 9.16131 3.76131 9.16131 3.72226 9.12226L0.146522 5.54652C-0.0487403 5.35126 -0.0487401 5.03468 0.146522 4.83942L0.839416 4.14652C1.03468 3.95126 1.35126 3.95126 1.54652 4.14652L3.72226 6.32226C3.76131 6.36131 3.82463 6.36131 3.86368 6.32226L10.0394 0.146522C10.2347 -0.0487398 10.5513 -0.0487399 10.7465 0.146522L11.4394 0.839416C11.6347 1.03468 11.6347 1.35126 11.4394 1.54652L3.86368 9.12226Z" fill="currentColor"/></svg>');class A extends HTMLElement{static get observedAttributes(){return["name","width","height"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){const t=this.getAttribute("name"),e=u.get(t);if(!e){this.shadowRoot.innerHTML='<span style="color:red;">?</span>';return}const i=document.createElement("template");i.innerHTML=e.trim();const a=i.content.cloneNode(!0),n=a.firstElementChild;if(n&&n.style){const r=this.getAttribute("width"),l=this.getAttribute("height");r&&n.setAttribute("width",r),l&&n.setAttribute("height",l),n.style.display="block"}this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(a)}}customElements.define("eui-icon",A);class L extends HTMLElement{static get observedAttributes(){return["label","value","id","type","filled"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
47
|
+
<style>
|
|
48
|
+
.form {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 12px;
|
|
52
|
+
width: 100%;
|
|
53
|
+
max-width: 300px;
|
|
54
|
+
margin: 0.75rem 0;
|
|
55
|
+
position: relative;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.form-input {
|
|
59
|
+
padding: 5px 10px;
|
|
60
|
+
border-radius: 5px;
|
|
61
|
+
width: 100%;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
font-size: 1em;
|
|
64
|
+
font-family: inherit;
|
|
65
|
+
height: 52px;
|
|
66
|
+
background: var(--app-100, #111);
|
|
67
|
+
outline: none;
|
|
68
|
+
border: 1px solid var(--app-300, #2196F3);
|
|
69
|
+
caret-color: var(--app-text);
|
|
70
|
+
color: var(--app-text);
|
|
71
|
+
transition: border .15s ease-out;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.filled.form .form-input {
|
|
75
|
+
background: var(--app-200, #222);
|
|
76
|
+
padding-bottom: 0;
|
|
77
|
+
padding-top: 0.6rem;
|
|
78
|
+
border: none;
|
|
79
|
+
border-bottom-left-radius: 0;
|
|
80
|
+
border-bottom-right-radius: 0;
|
|
81
|
+
border-bottom: 1px solid var(--app-300, #333);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.form-input:focus {
|
|
85
|
+
border: 1px solid var(--app-blue, #2196F3);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.filled.form .form-input:focus {
|
|
89
|
+
border-bottom: 2.5px solid var(--app-blue, #2196F3);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.form {
|
|
93
|
+
--form-inactive-top: 14.5px;
|
|
94
|
+
--form-inactive-left: 6px;
|
|
95
|
+
|
|
96
|
+
--form-active-top: -10px;
|
|
97
|
+
--form-active-left: 5px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.filled.form {
|
|
101
|
+
--form-active-top: 3px;
|
|
102
|
+
--form-active-left: 6px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.form label {
|
|
106
|
+
transition: all .15s ease-out;
|
|
107
|
+
color: var(--app-400, #999);
|
|
108
|
+
background: var(--app-100, #111);
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
display: block;
|
|
111
|
+
padding: 0 .25rem;
|
|
112
|
+
position: absolute;
|
|
113
|
+
left: var(--form-inactive-left);
|
|
114
|
+
top: var(--form-inactive-top);
|
|
115
|
+
border-radius: 5px;
|
|
116
|
+
width: fit-content;
|
|
117
|
+
|
|
118
|
+
user-select: none;
|
|
119
|
+
-webkit-user-select: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.filled.form label {
|
|
123
|
+
background: transparent;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.form-input:focus+label,
|
|
127
|
+
.form-input:not(:placeholder-shown)+label,
|
|
128
|
+
.form-input.filled+label,
|
|
129
|
+
.form.always-active label {
|
|
130
|
+
top: var(--form-active-top);
|
|
131
|
+
left: var(--form-active-left);
|
|
132
|
+
font-size: .75em;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.form-input:focus+label {
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
color: var(--app-blue, #2196F3);
|
|
138
|
+
width: auto;
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
141
|
+
|
|
142
|
+
<div class="form">
|
|
143
|
+
<input class="form-input" placeholder=" ">
|
|
144
|
+
<label></label>
|
|
145
|
+
</div>
|
|
146
|
+
`}connectedCallback(){this.form=this.shadowRoot.querySelector(".form"),this.inputEl=this.shadowRoot.querySelector(".form-input"),this.labelEl=this.shadowRoot.querySelector("label"),this.hasAttribute("value")&&(this.inputEl.value=this.getAttribute("value")),this.hasAttribute("id")&&(this.inputEl.id=this.getAttribute("id")),this.hasAttribute("label")&&(this.labelEl.textContent=this.getAttribute("label")),this.hasAttribute("type")&&(this.inputEl.type=this.getAttribute("type")),this.hasAttribute("filled")&&this.form.classList.add("filled"),this.inputEl.addEventListener("input",t=>{this.setAttribute("value",this.inputEl.value),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}),this.inputEl.addEventListener("change",t=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}attributeChangedCallback(t,e,i){if(!(!this.inputEl||!this.labelEl))switch(t){case"value":this.inputEl.value!==i&&(this.inputEl.value=i);break;case"id":this.inputEl.id=i;break;case"label":this.labelEl.textContent=i;break}}get value(){return this.inputEl.value}set value(t){this.setAttribute("value",t)}}customElements.define("eui-input",L);class S extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
147
|
+
<style>
|
|
148
|
+
.loader {
|
|
149
|
+
width: 24px;
|
|
150
|
+
height: 24px;
|
|
151
|
+
display: inline-block;
|
|
152
|
+
position: relative;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.loader-icon {
|
|
156
|
+
stroke: var(--app-accent, #2196F3);
|
|
157
|
+
fill: none;
|
|
158
|
+
stroke-width: 2px;
|
|
159
|
+
stroke-linecap: round;
|
|
160
|
+
transform-origin: 50% 50%;
|
|
161
|
+
transform: rotate(-90deg);
|
|
162
|
+
transition: all 0.2s ease-in-out 0s;
|
|
163
|
+
animation: 2s linear 0s infinite normal none running loader-spin;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.loader-icon {
|
|
167
|
+
stroke: var(--app-text, #F2F3F6);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@keyframes loader-spin {
|
|
171
|
+
0% {
|
|
172
|
+
stroke-dasharray: 0.01px, 43.97px;
|
|
173
|
+
transform: rotate(0deg)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
50% {
|
|
177
|
+
stroke-dasharray: 21.99px, 21.99px;
|
|
178
|
+
transform: rotate(450deg)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
100% {
|
|
182
|
+
stroke-dasharray: 0.01px, 43.97px;
|
|
183
|
+
transform: rotate(1080deg)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
</style>
|
|
187
|
+
|
|
188
|
+
<span class="loader animate">
|
|
189
|
+
<svg viewBox="0 0 16 16"><circle class="loader-icon" cx="8px" cy="8px" r="7px"></circle></svg>
|
|
190
|
+
</span>
|
|
191
|
+
`}}customElements.define("eui-loader",S);class M extends HTMLElement{static get observedAttributes(){return["value","intermediate","id"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
192
|
+
<style>
|
|
193
|
+
.progressbar {
|
|
194
|
+
width: 100%;
|
|
195
|
+
height: 5px;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
position: relative;
|
|
198
|
+
background: var(--app-300, #333);
|
|
199
|
+
border-radius: 4px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.progress {
|
|
203
|
+
display: block;
|
|
204
|
+
height: 100%;
|
|
205
|
+
background: var(--app-accent, #2196F3);
|
|
206
|
+
border-radius: 4px;
|
|
207
|
+
transition: width 0.3s ease-in-out;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.progress.intermediate {
|
|
211
|
+
height: 100%;
|
|
212
|
+
transform-origin: 0% 50%;
|
|
213
|
+
transition-property: background;
|
|
214
|
+
animation: progressbar-indeterminate 1s infinite linear;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@keyframes progressbar-indeterminate {
|
|
218
|
+
0% {
|
|
219
|
+
transform: translateX(0) scaleX(0)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
40% {
|
|
223
|
+
transform: translateX(0) scaleX(0.5)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
100% {
|
|
227
|
+
transform: translateX(100%) scaleX(0.3)
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
</style>
|
|
231
|
+
|
|
232
|
+
<div class="progressbar">
|
|
233
|
+
<span class="progress"></span>
|
|
234
|
+
</div>
|
|
235
|
+
`}set value(t){this.setAttribute("value",t)}attributeChangedCallback(){this.connectedCallback()}connectedCallback(){const t=this.shadowRoot.querySelector(".progress");this.hasAttribute("id")&&(this.progress.id=this.getAttribute("id")),this.hasAttribute("intermediate")&&t.classList.add("intermediate"),this.hasAttribute("value")&&(t.style.width=this.getAttribute("value")+"%")}}customElements.define("eui-progressbar",M);const v={is:{iPhone:/iPhone/.test(navigator.userAgent),iPad:/iPad/.test(navigator.userAgent),iOS:/iPhone|iPad|iPod/.test(navigator.userAgent),android:/Android/.test(navigator.userAgent),mobile:/Mobi|Android/i.test(navigator.userAgent)},prefers:{language:navigator.language||navigator.userLanguage,reducedMotion:window.matchMedia("(prefers-reduced-motion: reduce)").matches,reducedTransparency:window.matchMedia("(prefers-reduced-transparency: reduce)").matches},supports:{share:typeof navigator.share=="function",directDownload:"download"in document.createElement("a"),haptics:"vibrate"in navigator||"Vibrate"in window||typeof window.navigator.vibrate=="function"},userAgent:navigator.userAgent},z=Object.freeze(Object.defineProperty({__proto__:null,device:v},Symbol.toStringTag,{value:"Module"}));function T(){try{const o=document.createElement("label");o.ariaHidden="true",o.style.display="none";const t=document.createElement("input");t.type="checkbox",t.setAttribute("switch",""),o.appendChild(t),document.head.appendChild(o),o.click(),document.head.removeChild(o)}catch{}}function x(o){v.supports.haptics?navigator.vibrate(o||50):v.is.iPhone&&T()}const $=Object.freeze(Object.defineProperty({__proto__:null,haptic:x},Symbol.toStringTag,{value:"Module"})),C=(()=>{let o={},t;try{o=JSON.parse(localStorage.getItem(t)||"{}")}catch(e){console.error(e)}return{get(e){return o[e]},set(e,i){o[e]=i,localStorage.setItem(t,JSON.stringify(o))},delete(e){delete o[e],localStorage.setItem(t,JSON.stringify(o))},all(){return o},clear(){o={},localStorage.setItem(t,JSON.stringify(o))},name(e){t=e;try{o=JSON.parse(localStorage.getItem(t)||"{}")}catch(i){console.error(i)}},settings:{get(e){return o&&o.settings&&o.settings[e]},set(e,i){o.settings||(o.settings={}),o.settings[e]=i,localStorage.setItem(t,JSON.stringify(o))},delete(e){o.settings&&(delete o.settings[e],localStorage.setItem(t,JSON.stringify(o)))},all(){return o.settings||{}},clear(){o.settings&&(o.settings={},localStorage.setItem(t,JSON.stringify(o)))}}}})(),R=C.settings,H=Object.freeze(Object.defineProperty({__proto__:null,settings:R,storage:C},Symbol.toStringTag,{value:"Module"}));class _ extends HTMLElement{static get observedAttributes(){return["selected"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
236
|
+
<style>
|
|
237
|
+
.switch {
|
|
238
|
+
background-color: var(--app-200);
|
|
239
|
+
border-radius: 16px;
|
|
240
|
+
|
|
241
|
+
box-shadow: inset 0px 0px 0px 2px var(--app-400);
|
|
242
|
+
width: 52px;
|
|
243
|
+
height: 32px;
|
|
244
|
+
display: flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
justify-content: center;
|
|
247
|
+
cursor: pointer;
|
|
248
|
+
position: relative;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.switch.selected {
|
|
252
|
+
background-color: #B8C4FF;
|
|
253
|
+
box-shadow: none;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.handle {
|
|
257
|
+
width: 16px;
|
|
258
|
+
height: 16px;
|
|
259
|
+
border-radius: 50%;
|
|
260
|
+
background-color: var(--app-900);
|
|
261
|
+
margin-inline-start: 0;
|
|
262
|
+
margin-inline-end: calc(52px - 32px);
|
|
263
|
+
|
|
264
|
+
transition: margin 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
|
|
265
|
+
width 250ms cubic-bezier(0.2, 0, 0, 1),
|
|
266
|
+
height 250ms cubic-bezier(0.2, 0, 0, 1);
|
|
267
|
+
|
|
268
|
+
pointer-events: none;
|
|
269
|
+
user-select: none;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.switch.selected .handle {
|
|
273
|
+
background-color: #5F7AFF;
|
|
274
|
+
margin-inline-start: calc(52px - 32px);
|
|
275
|
+
margin-inline-end: 0;
|
|
276
|
+
width: 24px;
|
|
277
|
+
height: 24px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.switch:active .handle {
|
|
281
|
+
width: 28px;
|
|
282
|
+
height: 28px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
input {
|
|
286
|
+
appearance: none;
|
|
287
|
+
opacity: 0;
|
|
288
|
+
height: max(100%, var(--eui-switch-touch-target-size, 48px));
|
|
289
|
+
width: max(100%, var(--eui-switch-touch-target-size, 48px));
|
|
290
|
+
position: absolute;
|
|
291
|
+
margin: 0;
|
|
292
|
+
cursor: inherit;
|
|
293
|
+
top: 50%;
|
|
294
|
+
left: 50%;
|
|
295
|
+
transform: translate(-50%, -50%);
|
|
296
|
+
z-index: 2;
|
|
297
|
+
}
|
|
298
|
+
</style>
|
|
299
|
+
|
|
300
|
+
<div class="switch">
|
|
301
|
+
<input type="checkbox" role="switch">
|
|
302
|
+
<span class="handle"></span>
|
|
303
|
+
</div>
|
|
304
|
+
`}connectedCallback(){this.inputEl=this.shadowRoot.querySelector("input"),this.switchEl=this.shadowRoot.querySelector(".switch"),this.updateFromAttribute(),this.switchEl.addEventListener("click",()=>this.toggle())}toggle(){this.selected=!this.selected,x(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}updateFromAttribute(){const t=this.hasAttribute("selected");this.inputEl.checked=t,this.switchEl.classList.toggle("selected",t)}attributeChangedCallback(t,e,i){t==="selected"&&this.inputEl&&this.updateFromAttribute()}get selected(){return this.hasAttribute("selected")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}}customElements.define("eui-switch",_);class F extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
305
|
+
<style>
|
|
306
|
+
:host {
|
|
307
|
+
display: inline-flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
gap: 4px;
|
|
310
|
+
padding: 4px 8px;
|
|
311
|
+
border-radius: 8px;
|
|
312
|
+
border: 2px solid var(--app-400);
|
|
313
|
+
font-weight: 500;
|
|
314
|
+
font-size: 1rem;
|
|
315
|
+
position: relative;
|
|
316
|
+
color: var(--app-text);
|
|
317
|
+
overflow: hidden;
|
|
318
|
+
z-index: 1;
|
|
319
|
+
|
|
320
|
+
user-select: none;
|
|
321
|
+
-webkit-user-select: none;
|
|
322
|
+
-webkit-user-drag: none;
|
|
323
|
+
-webkit-user-modify: none;
|
|
324
|
+
-webkit-highlight: none;
|
|
325
|
+
-webkit-tap-highlight-color: transparent;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.ripple {
|
|
329
|
+
position: absolute;
|
|
330
|
+
border-radius: 50%;
|
|
331
|
+
transform: scale(0);
|
|
332
|
+
filter: blur(4px);
|
|
333
|
+
opacity: 0.2;
|
|
334
|
+
animation: ripple 600ms linear;
|
|
335
|
+
background-color: var(--app-400);
|
|
336
|
+
pointer-events: none;
|
|
337
|
+
z-index: -1;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
@keyframes ripple {
|
|
341
|
+
to {
|
|
342
|
+
transform: scale(4);
|
|
343
|
+
opacity: 0;
|
|
344
|
+
filter: blur(10px);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
</style>
|
|
348
|
+
<slot></slot>
|
|
349
|
+
`,this.addEventListener("pointerdown",t=>{const e=document.createElement("span"),i=t.currentTarget,a=Math.max(i.offsetWidth,i.offsetHeight);e.classList.add("ripple"),e.style.left=t.clientX-i.getBoundingClientRect().left-a/2+"px",e.style.top=t.clientY-i.getBoundingClientRect().top-a/2+"px",e.style.width=a+"px",e.style.height=a+"px",this.shadowRoot.appendChild(e),setTimeout(()=>{e.remove()},600)})}}customElements.define("eui-chip",F);const f="",w=(()=>{const o=[];function t(s,d){const h=[],b=s.replace(/:([^/]+)/g,(y,k)=>(h.push(k),"([^/]+)")).replace(/\//g,"\\/"),g=new RegExp(`^${f}${b}$`);o.push({regex:g,paramNames:h,renderFn:d})}function e(s){for(const{regex:d,paramNames:h,renderFn:b}of o){const g=s.match(d);if(g){const y={};return h.forEach((k,K)=>{y[k]=decodeURIComponent(g[K+1])}),{renderFn:b,params:y}}}return null}function i(s,d=!0){s.startsWith(f)||(s=f+(s.startsWith("/")?"":"/")+s);const h=s.split(/[?#]/)[0];if(h===window.location.pathname&&s.includes("#")){d&&history.pushState({},"",s);const g="#"+s.split("#")[1];a(g);return}const b=e(h);if(b)if(d&&history.pushState({},"",s),b.renderFn(b.params),window.dispatchEvent(new CustomEvent("route-changed",{detail:{path:s}})),s.includes("#")){const g="#"+s.split("#")[1];setTimeout(()=>a(g),100)}else{const g=document.getElementById("main");g&&g.scrollTo(0,0)}else n?(d&&history.pushState({},"",s),n()):console.warn(`No route found for ${h}`)}function a(s){if(s)try{const d=document.querySelector(s);d&&d.scrollIntoView({behavior:"smooth"})}catch{console.warn("Invalid hash:",s)}}let n=null;function r(s){n=s}function l(){history.back()}function c(){return window.location.pathname.replace(f,"")||"/"}return window.addEventListener("popstate",()=>{const s=window.location.pathname+window.location.search+window.location.hash;i(s,!1)}),window.addEventListener("click",s=>{if(s.button!==0||s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)return;const d=s.target.closest("a");if(!d||d.hasAttribute("download")||d.getAttribute("target")==="_blank")return;const h=d.getAttribute("href");if(!(!h||h.startsWith("http")&&!h.startsWith(window.location.origin))){if(s.preventDefault(),h.startsWith("#")){history.pushState({},"",h),a(h);return}i(h)}}),{add:t,navigate:i,back:l,location:c,setNotFound:r}})();async function I(o){try{const t=document.getElementById("main");t.classList.add("fade-out"),await new Promise(i=>setTimeout(i,200));const e=await fetch(`/src/pages/${o}.html`).then(i=>i.text());t.innerHTML=e,t.classList.remove("fade-out"),t.classList.add("fade-in"),window.location.hash?setTimeout(()=>{try{const i=document.querySelector(window.location.hash);i&&i.scrollIntoView({behavior:"smooth"})}catch{}},100):t&&t.scrollTo(0,0),setTimeout(()=>{t.classList.remove("fade-in")},200)}catch(t){console.error("Page load failed:",t)}}class j extends HTMLElement{static get observedAttributes(){return["path","icon","label","badge","active","avatar-src","avatar-name"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.hasRendered||(this.render(),this.setupEventListeners(),this.hasRendered=!0),this.updateContent(),this.addEventListener("click",this.handleClick)}disconnectedCallback(){this.removeEventListener("click",this.handleClick)}attributeChangedCallback(t,e,i){if(e!==i&&this.hasRendered){if(t==="active")return;this.updateContent()}}handleClick=()=>{const t=this.getAttribute("path");t&&w.navigate(t)};setupEventListeners(){this.addEventListener("pointerdown",t=>{const e=document.createElement("span"),i=t.currentTarget,a=i.getBoundingClientRect(),n=Math.max(i.offsetWidth,i.offsetHeight),r=n/2;e.classList.add("ripple"),e.style.width=`${n}px`,e.style.height=`${n}px`,e.style.left=`${t.clientX-a.left-r}px`,e.style.top=`${t.clientY-a.top-r}px`,this.shadowRoot.appendChild(e),e.addEventListener("animationend",()=>{e.remove()})})}updateContent(){const t=this.getAttribute("icon"),e=this.getAttribute("avatar-src"),i=this.getAttribute("avatar-name"),a=this.getAttribute("label")||"",n=this.getAttribute("badge"),r=this.shadowRoot.querySelector(".badge");if(n)if(r)r.textContent=n;else{const s=document.createElement("span");s.className="badge",s.textContent=n,this.shadowRoot.appendChild(s)}else r&&r.remove();const l=this.shadowRoot.querySelector("slot[name='icon']");if(l)if(e||i){let s='<eui-avatar size="24"';i&&(s+=` name="${i}"`),s+=">",e&&(s+=`<img src="${e}" alt="${i||"Avatar"}" />`),s+="</eui-avatar>",l.innerHTML=s}else{const s=l.querySelector("eui-icon");t&&s?s.getAttribute("name")!==t&&s.setAttribute("name",t):t?l.innerHTML=`<eui-icon width="24" height="24" name="${t}"></eui-icon>`:l.innerHTML=""}const c=this.shadowRoot.querySelector(".label");c&&(c.textContent=a)}render(){this.shadowRoot.innerHTML=`
|
|
350
|
+
<style>
|
|
351
|
+
:host {
|
|
352
|
+
position: relative;
|
|
353
|
+
overflow: hidden;
|
|
354
|
+
z-index: 1;
|
|
355
|
+
display: flex;
|
|
356
|
+
align-items: center;
|
|
357
|
+
height: 50px;
|
|
358
|
+
width: 100%;
|
|
359
|
+
cursor: pointer;
|
|
360
|
+
border-radius: 100px;
|
|
361
|
+
justify-content: flex-start;
|
|
362
|
+
padding: 0 1rem;
|
|
363
|
+
box-sizing: border-box;
|
|
364
|
+
transition: background-color 0.2s cubic-bezier(.4, 0, .2, 1), transform 0.2s cubic-bezier(.4, 0, .2, 1);
|
|
365
|
+
user-select: none;
|
|
366
|
+
-webkit-user-select: none;
|
|
367
|
+
color: var(--app-text);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
:host(:hover) {
|
|
371
|
+
background-color: var(--app-300);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
:host(:focus-visible) {
|
|
375
|
+
outline: 2px solid var(--app-link);
|
|
376
|
+
outline-offset: 2px;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
:host([active]) {
|
|
380
|
+
background-color: color-mix(in srgb, var(--app-link) 25%, transparent 100%);
|
|
381
|
+
color: var(--app-link);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
:host([active]) .label {
|
|
385
|
+
font-weight: 600;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.icon-container {
|
|
389
|
+
display: flex;
|
|
390
|
+
align-items: center;
|
|
391
|
+
justify-content: center;
|
|
392
|
+
width: 28px;
|
|
393
|
+
height: 28px;
|
|
394
|
+
flex-shrink: 0;
|
|
395
|
+
border-radius: 100px;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
:host([active]) .icon-container eui-avatar {
|
|
399
|
+
outline: 2px solid var(--app-link);
|
|
400
|
+
outline-offset: 1px;
|
|
401
|
+
border-radius: 50%;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.label {
|
|
405
|
+
opacity: var(--nav-item-label-opacity, 0);
|
|
406
|
+
margin-left: 1rem;
|
|
407
|
+
display: block;
|
|
408
|
+
transition: opacity 0.1s ease;
|
|
409
|
+
white-space: nowrap;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.badge {
|
|
413
|
+
position: absolute;
|
|
414
|
+
top: 4px;
|
|
415
|
+
left: calc(32px + 2px);
|
|
416
|
+
width: 20px;
|
|
417
|
+
height: 20px;
|
|
418
|
+
border-radius: 50%;
|
|
419
|
+
background-color: var(--app-red);
|
|
420
|
+
color: var(--app-white);
|
|
421
|
+
display: flex;
|
|
422
|
+
align-items: center;
|
|
423
|
+
justify-content: center;
|
|
424
|
+
font-size: 14px;
|
|
425
|
+
font-weight: 600;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.ripple {
|
|
429
|
+
position: absolute;
|
|
430
|
+
border-radius: 50%;
|
|
431
|
+
transform: scale(0);
|
|
432
|
+
opacity: 0.2;
|
|
433
|
+
animation: ripple 600ms linear forwards;
|
|
434
|
+
background-color: currentColor;
|
|
435
|
+
pointer-events: none;
|
|
436
|
+
z-index: -1;
|
|
437
|
+
will-change: transform, opacity;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
@keyframes ripple {
|
|
441
|
+
to {
|
|
442
|
+
transform: scale(4);
|
|
443
|
+
opacity: 0;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
</style>
|
|
447
|
+
|
|
448
|
+
<div class="icon-container">
|
|
449
|
+
<slot name="icon">
|
|
450
|
+
<eui-icon width="24" height="24" name=""></eui-icon>
|
|
451
|
+
</slot>
|
|
452
|
+
</div>
|
|
453
|
+
<span class="label"></span>
|
|
454
|
+
`}}customElements.define("eui-nav-item",j);class B extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.updateActiveState(),window.addEventListener("popstate",()=>this.updateActiveState()),window.addEventListener("route-changed",()=>this.updateActiveState()),window.addEventListener("toggle-nav",()=>this.classList.toggle("expanded"))}render(){this.shadowRoot.innerHTML=`
|
|
455
|
+
<style>
|
|
456
|
+
:host {
|
|
457
|
+
position: fixed;
|
|
458
|
+
top: var(--titlebar-height, 65px);
|
|
459
|
+
left: 0;
|
|
460
|
+
height: calc(100% - var(--titlebar-height, 65px));
|
|
461
|
+
z-index: 100;
|
|
462
|
+
|
|
463
|
+
width: var(--nav-width, 75px);
|
|
464
|
+
transition: width 0.2s cubic-bezier(0.2, 0, 0, 1);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
:host(.expanded) {
|
|
468
|
+
width: var(--nav-expanded-width, 250px);
|
|
469
|
+
--nav-item-label-opacity: 1;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.app-nav-container {
|
|
473
|
+
width: 100%;
|
|
474
|
+
min-width: var(--nav-width, 75px);
|
|
475
|
+
height: 100%;
|
|
476
|
+
box-sizing: border-box;
|
|
477
|
+
background-color: var(--app-200);
|
|
478
|
+
overflow-x: hidden;
|
|
479
|
+
display: flex;
|
|
480
|
+
flex-direction: column;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.nav-items {
|
|
484
|
+
display: flex;
|
|
485
|
+
flex-direction: column;
|
|
486
|
+
gap: 0.5rem;
|
|
487
|
+
padding: 0.5rem;
|
|
488
|
+
box-sizing: border-box;
|
|
489
|
+
overflow-y: auto;
|
|
490
|
+
overflow-x: hidden;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.menu-button {
|
|
494
|
+
border: none;
|
|
495
|
+
background-color: transparent;
|
|
496
|
+
cursor: pointer;
|
|
497
|
+
width: 42px;
|
|
498
|
+
height: 42px;
|
|
499
|
+
display: flex;
|
|
500
|
+
align-items: center;
|
|
501
|
+
justify-content: center;
|
|
502
|
+
box-sizing: border-box;
|
|
503
|
+
border-radius: 50%;
|
|
504
|
+
color: inherit;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.menu-button:hover {
|
|
508
|
+
background-color: var(--app-300);
|
|
509
|
+
box-shadow: 0 0 2px 0 #00000011;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.menu-button:active {
|
|
513
|
+
transform: scale(0.95);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.menu-button:focus-visible {
|
|
517
|
+
outline: 2px solid var(--app-link);
|
|
518
|
+
outline-offset: 2px;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
#skip_navigation_link {
|
|
522
|
+
position: fixed;
|
|
523
|
+
top: -100px;
|
|
524
|
+
left: -100px;
|
|
525
|
+
z-index: 1001;
|
|
526
|
+
width: 1px;
|
|
527
|
+
height: 1px;
|
|
528
|
+
overflow: hidden;
|
|
529
|
+
clip: rect(0, 0, 0, 0);
|
|
530
|
+
border: 0;
|
|
531
|
+
padding: 0;
|
|
532
|
+
margin: 0;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
#skip_navigation_link:focus {
|
|
536
|
+
top: 0;
|
|
537
|
+
left: 0;
|
|
538
|
+
overflow: visible;
|
|
539
|
+
clip: auto;
|
|
540
|
+
border: 1px dotted;
|
|
541
|
+
padding: 4px 8px;
|
|
542
|
+
margin: 4px;
|
|
543
|
+
width: 80px;
|
|
544
|
+
height: auto;
|
|
545
|
+
background-color: var(--app-link);
|
|
546
|
+
color: var(--app-white);
|
|
547
|
+
text-align: center;
|
|
548
|
+
}
|
|
549
|
+
</style>
|
|
550
|
+
|
|
551
|
+
<div class="app-nav-container">
|
|
552
|
+
<a href="#content" id="skip_navigation_link">Skip To Content</a>
|
|
553
|
+
<div class="nav-items">
|
|
554
|
+
${this.navItems.map(t=>{if(t.type==="divider")return'<div style="height: 1px; background: var(--app-300); margin: 0.5rem 0;"></div>';const e=t.avatar?.src||"",i=t.avatar?.name||"";return`<eui-nav-item path="${t.path}" icon="${t.icon}" avatar-src="${e}" avatar-name="${i}" label="${t.label}"></eui-nav-item>`}).join("")}
|
|
555
|
+
</div>
|
|
556
|
+
</div>
|
|
557
|
+
`}set navItems(t){this._navItems=t,this.render(),this.updateActiveState()}get navItems(){return this._navItems||[]}updateActiveState(t){t||(t=w.location()),t.startsWith("/")||(t="/"+t),this.shadowRoot.querySelectorAll("eui-nav-item").forEach(i=>{i.getAttribute("path")===t?i.setAttribute("active",""):i.removeAttribute("active")})}}customElements.define("eui-app-nav",B);class q extends HTMLElement{static get observedAttributes(){return["type","title","subtitle","img"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
558
|
+
<style>
|
|
559
|
+
:host {
|
|
560
|
+
border-radius: 24px;
|
|
561
|
+
background: var(--app-200, #111);
|
|
562
|
+
color: var(--app-text, #FFF);
|
|
563
|
+
overflow: hidden;
|
|
564
|
+
display: block;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.header {
|
|
568
|
+
min-height: 180px;
|
|
569
|
+
display: flex;
|
|
570
|
+
flex-direction: column;
|
|
571
|
+
justify-content: center;
|
|
572
|
+
padding: 48px;
|
|
573
|
+
box-sizing: border-box;
|
|
574
|
+
position: relative;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.hero {
|
|
578
|
+
min-height: 280px;
|
|
579
|
+
display: flex;
|
|
580
|
+
flex-direction: column;
|
|
581
|
+
justify-content: flex-end;
|
|
582
|
+
color: #fff;
|
|
583
|
+
background: #333;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.img {
|
|
587
|
+
position: absolute;
|
|
588
|
+
inset: 0;
|
|
589
|
+
background-size: cover;
|
|
590
|
+
background-position: center;
|
|
591
|
+
z-index: 0;
|
|
592
|
+
opacity: .5;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.content {
|
|
596
|
+
position: relative;
|
|
597
|
+
z-index: 1;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
h1 {
|
|
601
|
+
margin: 0 0 8px;
|
|
602
|
+
font-size: 3rem;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.large h1, .hero h1 {
|
|
606
|
+
font-size: 5.5rem;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.small h1 {
|
|
610
|
+
font-size: 2rem;
|
|
611
|
+
margin: 0;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.small p {
|
|
615
|
+
margin: 0;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
@media (max-width: 768px) {
|
|
619
|
+
.header {
|
|
620
|
+
padding: 1rem;
|
|
621
|
+
align-items: center;
|
|
622
|
+
justify-content: center;
|
|
623
|
+
text-align: center;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.hero h1 {
|
|
627
|
+
font-size: 4rem;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.large h1 {
|
|
631
|
+
font-size: 2.5rem;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
</style>
|
|
635
|
+
|
|
636
|
+
<div class="header">
|
|
637
|
+
<div class="img"></div>
|
|
638
|
+
<div class="content">
|
|
639
|
+
<h1></h1>
|
|
640
|
+
<p></p>
|
|
641
|
+
</div>
|
|
642
|
+
</div>
|
|
643
|
+
`}connectedCallback(){this.hd=this.shadowRoot.querySelector(".header"),this.hasAttribute("type")&&this.hd.classList.add(this.getAttribute("type"))}attributeChangedCallback(t,e,i){const a=this.shadowRoot.querySelector("h1"),n=this.shadowRoot.querySelector("p"),r=this.shadowRoot.querySelector(".img");t==="title"&&(a.textContent=i),t==="subtitle"&&(n.textContent=i),t==="img"&&(r.style.backgroundImage=i?`url(${i})`:"")}}customElements.define("eui-header",q);class N extends HTMLElement{static get observedAttributes(){return["selected"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
644
|
+
<style>
|
|
645
|
+
:host {
|
|
646
|
+
display: inline-block;
|
|
647
|
+
vertical-align: bottom;
|
|
648
|
+
position: relative;
|
|
649
|
+
cursor: pointer;
|
|
650
|
+
width: 24px;
|
|
651
|
+
height: 24px;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.checkbox {
|
|
655
|
+
position: relative;
|
|
656
|
+
width: 24px;
|
|
657
|
+
height: 24px;
|
|
658
|
+
display: flex;
|
|
659
|
+
align-items: center;
|
|
660
|
+
justify-content: center;
|
|
661
|
+
border-radius: 4px;
|
|
662
|
+
box-shadow: inset 0px 0px 0px 2px var(--app-400);
|
|
663
|
+
|
|
664
|
+
color: #fff;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.checkbox.selected, .checkbox.indeterminate {
|
|
668
|
+
background-color: var(--app-accent);
|
|
669
|
+
box-shadow: none;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
input {
|
|
673
|
+
appearance: none;
|
|
674
|
+
opacity: 0;
|
|
675
|
+
height: max(100%, var(--eui-switch-touch-target-size, 48px));
|
|
676
|
+
width: max(100%, var(--eui-switch-touch-target-size, 48px));
|
|
677
|
+
position: absolute;
|
|
678
|
+
margin: 0;
|
|
679
|
+
cursor: inherit;
|
|
680
|
+
top: 50%;
|
|
681
|
+
left: 50%;
|
|
682
|
+
transform: translate(-50%, -50%);
|
|
683
|
+
z-index: 2;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.mark.long {
|
|
687
|
+
height:2px;
|
|
688
|
+
transition-property:transform,width;
|
|
689
|
+
width:0px;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.mark.short {
|
|
693
|
+
height: 2px;
|
|
694
|
+
transition-property: transform,height;
|
|
695
|
+
width: 0px;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.mark {
|
|
699
|
+
fill: #fff;
|
|
700
|
+
transform: scaleY(-1) translate(7px, -14px) rotate(45deg);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
.selected .mark.long {
|
|
704
|
+
animation-duration: 350ms;
|
|
705
|
+
animation-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
|
|
706
|
+
transition-duration: 350ms;
|
|
707
|
+
transition-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.selected .mark.short {
|
|
711
|
+
width: 2px;
|
|
712
|
+
height: 5.6568542495px;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
.selected .mark.long{
|
|
716
|
+
width: 11.313708499px;
|
|
717
|
+
}
|
|
718
|
+
</style>
|
|
719
|
+
|
|
720
|
+
<div class="checkbox">
|
|
721
|
+
<input type="checkbox" role="checkbox">
|
|
722
|
+
<svg class="icon" viewBox="0 0 18 18" aria-hidden="true">
|
|
723
|
+
<rect class="mark short"></rect>
|
|
724
|
+
<rect class="mark long"></rect>
|
|
725
|
+
</svg>
|
|
726
|
+
</div>
|
|
727
|
+
`}connectedCallback(){this.inputEl=this.shadowRoot.querySelector("input"),this.checkEl=this.shadowRoot.querySelector(".checkbox"),this.updateFromAttribute(),this.checkEl.addEventListener("click",()=>this.toggle())}toggle(){this.selected=!this.selected,x(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}updateFromAttribute(){const t=this.hasAttribute("selected");this.inputEl.checked=t,this.checkEl.classList.toggle("selected",t)}attributeChangedCallback(t,e,i){t==="selected"&&this.inputEl&&this.updateFromAttribute()}get selected(){return this.hasAttribute("selected")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}}customElements.define("eui-checkbox",N);class O extends HTMLElement{static observedAttributes=["type","width","height","border-radius","icon","link","href"];constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){const t=this.getAttribute("href"),e=t?"a":"button";this.shadowRoot.innerHTML=`
|
|
728
|
+
<style>
|
|
729
|
+
button, a {
|
|
730
|
+
display: flex;
|
|
731
|
+
justify-content: center;
|
|
732
|
+
align-items: center;
|
|
733
|
+
gap: 0.25rem;
|
|
734
|
+
padding: 0.5rem 1rem;
|
|
735
|
+
font-size: 1rem;
|
|
736
|
+
font-weight: 600;
|
|
737
|
+
font-family: inherit;
|
|
738
|
+
border-radius: 0.6rem;
|
|
739
|
+
border: none;
|
|
740
|
+
background: var(--app-300);
|
|
741
|
+
color: var(--app-text, #FFF);
|
|
742
|
+
cursor: pointer;
|
|
743
|
+
box-sizing: border-box;
|
|
744
|
+
text-decoration: none;
|
|
745
|
+
|
|
746
|
+
width: fit-content;
|
|
747
|
+
|
|
748
|
+
user-select: none;
|
|
749
|
+
-webkit-user-select: none;
|
|
750
|
+
-moz-user-select: none;
|
|
751
|
+
-ms-user-select: none;
|
|
752
|
+
|
|
753
|
+
transition: background 0.2s cubic-bezier(.2,0,0,1);
|
|
754
|
+
|
|
755
|
+
position: relative;
|
|
756
|
+
overflow: hidden;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
button:hover, a:hover {
|
|
760
|
+
background: var(--app-400);
|
|
761
|
+
text-decoration: none;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.light button, .light a {
|
|
765
|
+
background: var(--app-500);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
button.filled, a.filled {
|
|
769
|
+
background: var(--app-accent-100);
|
|
770
|
+
color: #fff;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
button.filled:hover, a.filled:hover {
|
|
774
|
+
background: var(--app-accent-50);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
button.outlined, a.outlined {
|
|
778
|
+
background: transparent;
|
|
779
|
+
box-shadow: inset 0 0 0 2px var(--app-400);
|
|
780
|
+
color: var(--app-accent-100);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
button.outlined:hover, a.outlined:hover {
|
|
784
|
+
background: var(--app-300);
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
button.icon, a.icon {
|
|
788
|
+
padding: 0.5rem;
|
|
789
|
+
border-radius: 50%;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
button.transparent, a.transparent {
|
|
793
|
+
background: transparent;
|
|
794
|
+
color: var(--app-text);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
button.transparent:hover, a.transparent:hover {
|
|
798
|
+
background: var(--app-300);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
button:disabled, a[disabled] {
|
|
802
|
+
opacity: 0.5;
|
|
803
|
+
cursor: not-allowed;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
button.link, a.link {
|
|
807
|
+
text-decoration: none;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.ripple {
|
|
811
|
+
position: absolute;
|
|
812
|
+
border-radius: 50%;
|
|
813
|
+
transform: scale(0);
|
|
814
|
+
opacity: 0.2;
|
|
815
|
+
animation: ripple 600ms linear forwards;
|
|
816
|
+
background-color: currentColor;
|
|
817
|
+
pointer-events: none;
|
|
818
|
+
z-index: 10;
|
|
819
|
+
will-change: transform, opacity;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
@keyframes ripple {
|
|
823
|
+
to {
|
|
824
|
+
transform: scale(4);
|
|
825
|
+
opacity: 0;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
</style>
|
|
830
|
+
<${e}>
|
|
831
|
+
<slot></slot>
|
|
832
|
+
</${e}>
|
|
833
|
+
`;const i=this.shadowRoot.querySelector(e);t&&i.setAttribute("href",t),this.hasAttribute("type")&&i.classList.add(this.getAttribute("type")),this.hasAttribute("icon")&&i.classList.add("icon"),this.hasAttribute("width")&&(i.style.width=this.getAttribute("width")+"px"),this.hasAttribute("height")&&(i.style.height=this.getAttribute("height")+"px"),this.hasAttribute("border-radius")&&(i.style.borderRadius=this.getAttribute("border-radius")+"px"),i.addEventListener("pointerdown",a=>{const n=document.createElement("span"),r=a.currentTarget,l=r.getBoundingClientRect(),c=Math.max(r.offsetWidth,r.offsetHeight),s=c/2;n.classList.add("ripple"),n.style.width=`${c}px`,n.style.height=`${c}px`,n.style.left=`${a.clientX-l.left-s}px`,n.style.top=`${a.clientY-l.top-s}px`,i.appendChild(n),n.addEventListener("animationend",()=>{n.remove()})})}}customElements.define("eui-button",O);class P extends HTMLElement{static get observedAttributes(){return["type","anchor"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),this.hd=this.shadowRoot.querySelector(".hd"),this.hasAttribute("type")&&this.hd.classList.add(this.getAttribute("type"))}render(){this.shadowRoot.innerHTML=`
|
|
834
|
+
<style>
|
|
835
|
+
:host {
|
|
836
|
+
display: block;
|
|
837
|
+
position: relative;
|
|
838
|
+
margin: 16px 0;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.hd {
|
|
842
|
+
font-size: 2.5rem;
|
|
843
|
+
font-weight: 600;
|
|
844
|
+
margin: 0;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.h2 {
|
|
848
|
+
font-size: 2rem;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.h3 {
|
|
852
|
+
font-size: 1.5rem;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.anchor {
|
|
856
|
+
position: absolute;
|
|
857
|
+
width: 100%;
|
|
858
|
+
height: 100%;
|
|
859
|
+
|
|
860
|
+
inset: 0;
|
|
861
|
+
inset-inline-start: -24px;
|
|
862
|
+
opacity: 0;
|
|
863
|
+
transition: opacity .25s var(--transition-function);
|
|
864
|
+
|
|
865
|
+
display: flex;
|
|
866
|
+
align-items: center;
|
|
867
|
+
|
|
868
|
+
text-decoration: none;
|
|
869
|
+
color: var(--app-accent);
|
|
870
|
+
font-size: 1.5rem;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.anchor:hover {
|
|
874
|
+
opacity: 1;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
.anchor-hash {
|
|
878
|
+
margin-inline-end: 8px;
|
|
879
|
+
font-weight: 700;
|
|
880
|
+
}
|
|
881
|
+
</style>
|
|
882
|
+
|
|
883
|
+
<span class="hd">
|
|
884
|
+
<slot></slot>
|
|
885
|
+
</span>
|
|
886
|
+
${this.getAttribute("anchor")?`
|
|
887
|
+
<a class="anchor" href="#${this.getAttribute("anchor")}" id="${this.getAttribute("anchor")}">
|
|
888
|
+
<span class="anchor-hash">#</span>
|
|
889
|
+
</a>
|
|
890
|
+
`:""}
|
|
891
|
+
`}}customElements.define("eui-heading",P);function V(o){const i=Date.now()-o,a=Math.floor(i/1e3),n=Math.floor(a/60),r=Math.floor(n/60),l=Math.floor(r/24),c=Math.floor(l/30),s=Math.floor(c/12);return s>0?`${s}y`:c>0?`${c}mo`:l>0?`${l}d`:r>0?`${r}h`:n>0?`${n}m`:`${a}s`}function D(o){const i=Date.now()-o,a=Math.floor(i/1e3),n=Math.floor(a/60),r=Math.floor(n/60),l=Math.floor(r/24),c=Math.floor(l/30),s=Math.floor(c/12);return s>0?`${s} year${s>1?"s":""} ago`:c>0?`${c} month${c>1?"s":""} ago`:l>0?`${l} day${l>1?"s":""} ago`:r>0?`${r} hour${r>1?"s":""} ago`:n>0?`${n} minute${n>1?"s":""} ago`:`${a} second${a>1?"s":""} ago`}function U(o){return o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`").replace(/'/g,"'")}function E(o){const t=document.createElement("input");t.value=o,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}const Z=Object.freeze(Object.defineProperty({__proto__:null,copystr:E,joinedAgo:D,sanitize:U,timeAgo:V},Symbol.toStringTag,{value:"Module"}));class X extends HTMLElement{static get observedAttributes(){return["copy","id","type","language"]}constructor(){super(),this.attachShadow({mode:"open"}),this._boundCopy=this._onCopy.bind(this),this._isRendered=!1}connectedCallback(){this._isRendered||(this.render(),this._isRendered=!0)}attributeChangedCallback(t,e,i){this._isRendered&&e!==i&&this.render()}render(){const t=this.hasAttribute("copy"),e=this.getAttribute("language")||"text";this.shadowRoot.innerHTML=`
|
|
892
|
+
<style>
|
|
893
|
+
:host {
|
|
894
|
+
position: relative;
|
|
895
|
+
display: block;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
pre {
|
|
899
|
+
padding: 20px;
|
|
900
|
+
background: var(--app-100);
|
|
901
|
+
border: 1px solid var(--app-300);
|
|
902
|
+
border-radius: 20px;
|
|
903
|
+
font-family: 'Reddit Mono', monospace;
|
|
904
|
+
font-size: 14px;
|
|
905
|
+
overflow-x: auto;
|
|
906
|
+
line-height: 1.5;
|
|
907
|
+
white-space: pre;
|
|
908
|
+
color: var(--app-text);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
.copy {
|
|
912
|
+
position: absolute;
|
|
913
|
+
top: 8px;
|
|
914
|
+
right: 8px;
|
|
915
|
+
opacity: 0;
|
|
916
|
+
transition: opacity 0.2s;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
:host(:hover) .copy {
|
|
920
|
+
opacity: 1;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
pre.g {
|
|
924
|
+
padding-right: 60px;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.token.comment { color: var(--app-700); font-style: italic; }
|
|
928
|
+
.token.string { color: #9ECE6A; }
|
|
929
|
+
.token.number { color: #F97C5F; }
|
|
930
|
+
.token.keyword { color: #7DCFFF; }
|
|
931
|
+
.token.function { color: #7DCFFF; }
|
|
932
|
+
.token.tag { color: #DE5971; }
|
|
933
|
+
.token.attr-name { color: #BB9AF7; }
|
|
934
|
+
.token.attr-value { color: #9ECE6A; }
|
|
935
|
+
.token.boolean { color: #F97C5F; }
|
|
936
|
+
</style>
|
|
937
|
+
|
|
938
|
+
<eui-button class="copy" width="36" height="36" border-radius="100">
|
|
939
|
+
<eui-icon name="copy" width="18" height="18"></eui-icon>
|
|
940
|
+
</eui-button>
|
|
941
|
+
|
|
942
|
+
<pre class="${t?"g":""}"><code></code></pre>
|
|
943
|
+
`,this.copyBtn=this.shadowRoot.querySelector(".copy"),this.codeEl=this.shadowRoot.querySelector("code");const i=this._getFormattedText();this.codeEl.innerHTML=this._highlight(i,e),t?this.copyBtn.addEventListener("click",this._boundCopy):this.copyBtn.style.display="none"}_getFormattedText(){let e=(this.querySelector("code")||this).innerHTML||"";e=this._unescapeHtml(e),e=e.replace(/^\s*\n/,"").replace(/\n\s*$/,"");const i=e.split(`
|
|
944
|
+
`),a=i.filter(r=>r.trim()).map(r=>r.match(/^\s*/)[0].length),n=a.length?Math.min(...a):0;return i.map(r=>r.slice(n)).join(`
|
|
945
|
+
`)}_unescapeHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}_highlight(t,e){t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");const i={};let a=0;function n(r,l){const c=`__TOKEN_${l}_${a++}__`;return i[c]=`<span class="token ${l}">${r}</span>`,c}return["javascript","js","json","bash","sh","css"].includes(e)?(t=t.replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g,r=>n(r,"string")),e==="bash"||e==="sh"?t=t.replace(/(#.*$)/gm,r=>n(r,"comment")):e==="css"?t=t.replace(/(\/\*[\s\S]*?\*\/)/g,r=>n(r,"comment")):t=t.replace(/(\/\/.*$|\/\*[\s\S]*?\*\/)/gm,r=>n(r,"comment"))):["html","xml"].includes(e)&&(t=t.replace(/(<!--[\s\S]*?-->)/g,r=>n(r,"comment")),t=t.replace(/(<\/?[a-z0-9:-]+)/gi,r=>n(r,"tag"))),e==="javascript"||e==="js"||e==="json"?(t=t.replace(/\b(const|let|var|if|else|for|while|return|function|class|import|export|from|default|switch|case|break|continue|new|this|async|await)\b/g,'<span class="token keyword">$1</span>'),t=t.replace(/\b(true|false|null|undefined)\b/g,'<span class="token boolean">$1</span>'),t=t.replace(/\b([a-zA-Z0-9_]+)\s*(?=\()/g,'<span class="token function">$1</span>')):e==="bash"||e==="sh"?(t=t.replace(/\b(npm|npx|node|git|cd|ls|mkdir|rm|mv|cp|echo|cat|sudo|docker|brew|grep|curl|wget|chmod|chown|touch)\b/g,'<span class="token keyword">$1</span>'),t=t.replace(/\b(install|run|build|start|test|dev|init|clone|pull|push|commit|add|checkout|branch|merge)\b/g,'<span class="token function">$1</span>'),t=t.replace(/(\s-+[a-zA-Z0-9-]+)/g,'<span class="token attr-name">$1</span>'),t=t.replace(/(\$[A-Z0-9_]+)/g,'<span class="token number">$1</span>')):e==="html"||e==="xml"?(t=t.replace(/\s([a-z0-9:-]+)=/gi,(r,l)=>" "+n(l,"attr-name")+"="),t=t.replace(/(".*?")/g,r=>n(r,"attr-value")),t=t.replace(/>/g,'<span class="token tag">></span>')):e==="css"&&(t=t.replace(/([a-z-]+)(?=:)/g,'<span class="token keyword">$1</span>')),Object.keys(i).reverse().forEach(r=>{t=t.replace(r,i[r])}),t}_onCopy(){E(this._getFormattedText());const t=this.copyBtn.querySelector("eui-icon");if(t){const e=t.getAttribute("name");t.setAttribute("name","check"),setTimeout(()=>t.setAttribute("name",e),2e3)}}disconnectedCallback(){this.copyBtn&&this.copyBtn.removeEventListener("click",this._boundCopy)}}customElements.define("eui-code",X);class W extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),this.setupEventListeners()}static get observedAttributes(){return["name"]}attributeChangedCallback(t,e,i){t==="name"&&(this.render(),this.setupEventListeners())}setupEventListeners(){const t=this.shadowRoot.querySelector("#nav-toggle");t&&t.addEventListener("click",()=>{window.dispatchEvent(new CustomEvent("toggle-nav"))})}render(){const t=this.getAttribute("name")||"Title";this.shadowRoot.innerHTML=`
|
|
946
|
+
<style>
|
|
947
|
+
:host {
|
|
948
|
+
display: block;
|
|
949
|
+
width: 100%;
|
|
950
|
+
height: var(--titlebar-height, 65px);
|
|
951
|
+
background-color: var(--app-200);
|
|
952
|
+
flex-shrink: 0;
|
|
953
|
+
position: fixed;
|
|
954
|
+
top: 0;
|
|
955
|
+
left: 0;
|
|
956
|
+
z-index: 200;
|
|
957
|
+
box-sizing: border-box;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.titlebar {
|
|
961
|
+
height: 100%;
|
|
962
|
+
display: flex;
|
|
963
|
+
align-items: center;
|
|
964
|
+
justify-content: space-between;
|
|
965
|
+
box-sizing: border-box;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.left-section {
|
|
969
|
+
display: flex;
|
|
970
|
+
align-items: center;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
.title {
|
|
974
|
+
font-size: 1.25rem;
|
|
975
|
+
font-weight: 400;
|
|
976
|
+
color: var(--app-text);
|
|
977
|
+
margin: 0;
|
|
978
|
+
user-select: none;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.menu-button {
|
|
982
|
+
border: none;
|
|
983
|
+
background-color: transparent;
|
|
984
|
+
cursor: pointer;
|
|
985
|
+
width: 42px;
|
|
986
|
+
height: 42px;
|
|
987
|
+
display: flex;
|
|
988
|
+
align-items: center;
|
|
989
|
+
justify-content: center;
|
|
990
|
+
box-sizing: border-box;
|
|
991
|
+
border-radius: 50%;
|
|
992
|
+
color: inherit;
|
|
993
|
+
padding: 0;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.menu-button:hover {
|
|
997
|
+
background-color: var(--app-300);
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.menu-button:active {
|
|
1001
|
+
transform: scale(0.95);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.menu-button:focus-visible {
|
|
1005
|
+
outline: 2px solid var(--app-link);
|
|
1006
|
+
outline-offset: 2px;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.right-section {
|
|
1010
|
+
display: flex;
|
|
1011
|
+
align-items: center;
|
|
1012
|
+
padding-right: 1rem;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
.nav-section {
|
|
1016
|
+
width: var(--nav-width, 75px);
|
|
1017
|
+
|
|
1018
|
+
display: flex;
|
|
1019
|
+
align-items: center;
|
|
1020
|
+
justify-content: center;
|
|
1021
|
+
}
|
|
1022
|
+
</style>
|
|
1023
|
+
|
|
1024
|
+
<div class="titlebar">
|
|
1025
|
+
<div class="left-section">
|
|
1026
|
+
<div class="nav-section">
|
|
1027
|
+
<eui-button class="menu-button" id="nav-toggle" aria-label="Toggle Navigation" aria-expanded="false" aria-controls="nav-items" tabindex="0" type="transparent" border-radius="100">
|
|
1028
|
+
<eui-icon width="24" height="24" name="menu"></eui-icon>
|
|
1029
|
+
</eui-button>
|
|
1030
|
+
</div>
|
|
1031
|
+
<h2 class="title">${t}</h2>
|
|
1032
|
+
</div>
|
|
1033
|
+
<div class="right-section">
|
|
1034
|
+
<slot></slot>
|
|
1035
|
+
</div>
|
|
1036
|
+
</div>
|
|
1037
|
+
`}}customElements.define("eui-app-titlebar",W);class J extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._handleMouseDown=this._addRipple.bind(this)}connectedCallback(){this.render(),this.setupEventListeners()}static get observedAttributes(){return["elevated","interactive","ripple"]}attributeChangedCallback(t,e,i){e!==i&&t==="ripple"&&this.setupEventListeners()}setupEventListeners(){this.removeEventListener("mousedown",this._handleMouseDown),this.hasAttribute("ripple")&&this.addEventListener("mousedown",this._handleMouseDown)}_addRipple(t){const e=this.getBoundingClientRect(),i=document.createElement("span"),a=Math.max(e.width,e.height),n=a/2;i.style.width=i.style.height=`${a}px`,i.style.left=`${t.clientX-e.left-n}px`,i.style.top=`${t.clientY-e.top-n}px`,i.classList.add("ripple"),this.shadowRoot.querySelector(".surface").appendChild(i),i.addEventListener("animationend",()=>{i.remove()})}render(){this.shadowRoot.innerHTML=`
|
|
1038
|
+
<style>
|
|
1039
|
+
:host {
|
|
1040
|
+
display: block;
|
|
1041
|
+
border-radius: 12px;
|
|
1042
|
+
background-color: var(--app-200);
|
|
1043
|
+
transition: background-color 0.2s cubic-bezier(.4, 0, .2, 1),
|
|
1044
|
+
box-shadow 0.2s cubic-bezier(.4, 0, .2, 1);
|
|
1045
|
+
overflow: hidden;
|
|
1046
|
+
position: relative;
|
|
1047
|
+
height: auto;
|
|
1048
|
+
z-index: 1;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
:host([elevated]) {
|
|
1052
|
+
background-color: var(--app-100);
|
|
1053
|
+
box-shadow: inset 0 0 0 1px var(--app-300);
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
:host([interactive]) {
|
|
1057
|
+
cursor: pointer;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
:host([interactive]:hover) {
|
|
1061
|
+
background-color: var(--app-300);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
:host([interactive][elevated]:hover) {
|
|
1065
|
+
background-color: var(--app-100);
|
|
1066
|
+
box-shadow: inset 0 0 0 1px var(--app-300), 0 4px 12px rgba(0,0,0,0.1);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
.surface {
|
|
1070
|
+
position: relative;
|
|
1071
|
+
z-index: 2;
|
|
1072
|
+
width: 100%;
|
|
1073
|
+
height: 100%;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.ripple {
|
|
1077
|
+
position: absolute;
|
|
1078
|
+
border-radius: 50%;
|
|
1079
|
+
transform: scale(0);
|
|
1080
|
+
opacity: 0.2;
|
|
1081
|
+
animation: ripple 600ms linear forwards;
|
|
1082
|
+
background-color: currentColor;
|
|
1083
|
+
pointer-events: none;
|
|
1084
|
+
z-index: -1;
|
|
1085
|
+
will-change: transform, opacity;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
@keyframes ripple {
|
|
1089
|
+
to {
|
|
1090
|
+
transform: scale(4);
|
|
1091
|
+
opacity: 0;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
</style>
|
|
1095
|
+
<div class="surface">
|
|
1096
|
+
<slot></slot>
|
|
1097
|
+
</div>
|
|
1098
|
+
`}}customElements.define("eui-surface",J),typeof window<"u"&&console.log("ErisUI loaded successfully"),p.device=z,p.haptics=$,p.icons=u,p.loadPage=I,p.router=w,p.storage=H,p.utils=Z,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
|