solid-ui 3.0.6 → 3.1.0
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 +128 -2
- package/dist/acl/access-groups.js +1 -1
- package/dist/components/footer/index.d.ts +1 -0
- package/dist/components/footer/index.esm.js +24364 -0
- package/dist/components/footer/index.esm.js.map +1 -0
- package/dist/components/footer/index.esm.min.js +137 -0
- package/dist/components/footer/index.esm.min.js.map +1 -0
- package/dist/components/footer/index.js +23252 -0
- package/dist/components/footer/index.js.map +1 -0
- package/dist/components/footer/index.min.js +125 -0
- package/dist/components/footer/index.min.js.map +1 -0
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/header/index.esm.js +1894 -0
- package/dist/components/header/index.esm.js.map +1 -0
- package/dist/components/header/index.esm.min.js +1083 -0
- package/dist/components/header/index.esm.min.js.map +1 -0
- package/dist/components/header/index.js +1855 -0
- package/dist/components/header/index.js.map +1 -0
- package/dist/components/header/index.min.js +1084 -0
- package/dist/components/header/index.min.js.map +1 -0
- package/dist/components/loginButton/index.d.ts +1 -0
- package/dist/components/loginButton/index.esm.js +719 -0
- package/dist/components/loginButton/index.esm.js.map +1 -0
- package/dist/components/loginButton/index.esm.min.js +402 -0
- package/dist/components/loginButton/index.esm.min.js.map +1 -0
- package/dist/components/loginButton/index.js +701 -0
- package/dist/components/loginButton/index.js.map +1 -0
- package/dist/components/loginButton/index.min.js +402 -0
- package/dist/components/loginButton/index.min.js.map +1 -0
- package/dist/components/signupButton/index.d.ts +1 -0
- package/dist/components/signupButton/index.esm.js +270 -0
- package/dist/components/signupButton/index.esm.js.map +1 -0
- package/dist/components/signupButton/index.esm.min.js +82 -0
- package/dist/components/signupButton/index.esm.min.js.map +1 -0
- package/dist/components/signupButton/index.js +264 -0
- package/dist/components/signupButton/index.js.map +1 -0
- package/dist/components/signupButton/index.min.js +82 -0
- package/dist/components/signupButton/index.min.js.map +1 -0
- package/dist/footer/index.d.ts.map +1 -1
- package/dist/footer/index.js +8 -4
- package/dist/footer/index.js.map +1 -1
- package/dist/icons/v2/icons-svg/contactIcons.d.ts +3 -0
- package/dist/icons/v2/icons-svg/contactIcons.d.ts.map +1 -0
- package/dist/icons/v2/icons-svg/contactIcons.js +27 -0
- package/dist/icons/v2/icons-svg/contactIcons.js.map +1 -0
- package/dist/icons/v2/icons-svg/headerIcons.d.ts +18 -0
- package/dist/icons/v2/icons-svg/headerIcons.d.ts.map +1 -0
- package/dist/icons/v2/icons-svg/headerIcons.js +245 -0
- package/dist/icons/v2/icons-svg/headerIcons.js.map +1 -0
- package/dist/icons/v2/icons-svg/pngIcons.d.ts +3 -0
- package/dist/icons/v2/icons-svg/pngIcons.d.ts.map +1 -0
- package/dist/icons/v2/icons-svg/pngIcons.js +4 -0
- package/dist/icons/v2/icons-svg/pngIcons.js.map +1 -0
- package/dist/icons/v2/icons-svg/profileIcons.d.ts +23 -0
- package/dist/icons/v2/icons-svg/profileIcons.d.ts.map +1 -0
- package/dist/icons/v2/icons-svg/profileIcons.js +317 -0
- package/dist/icons/v2/icons-svg/profileIcons.js.map +1 -0
- package/dist/pad.d.ts.map +1 -1
- package/dist/pad.js +13 -13
- package/dist/pad.js.map +1 -1
- package/dist/solid-ui.esm.js +9560 -12181
- package/dist/solid-ui.esm.js.map +1 -1
- package/dist/solid-ui.esm.min.js +15 -14
- package/dist/solid-ui.esm.min.js.map +1 -1
- package/dist/solid-ui.js +12531 -14794
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +23 -22
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/utils/headerFooterHelpers.d.ts.map +1 -1
- package/dist/utils/headerFooterHelpers.js +11 -2
- package/dist/utils/headerFooterHelpers.js.map +1 -1
- package/dist/v2/components/footer/Footer.d.ts +60 -0
- package/dist/v2/components/footer/Footer.d.ts.map +1 -0
- package/dist/v2/components/footer/Footer.js +148 -0
- package/dist/v2/components/footer/Footer.js.map +1 -0
- package/dist/v2/components/footer/Footer.test.d.ts +2 -0
- package/dist/v2/components/footer/Footer.test.d.ts.map +1 -0
- package/dist/v2/components/footer/Footer.test.js +53 -0
- package/dist/v2/components/footer/Footer.test.js.map +1 -0
- package/dist/v2/components/footer/index.d.ts +3 -0
- package/dist/v2/components/footer/index.d.ts.map +1 -0
- package/dist/v2/components/footer/index.js +7 -0
- package/dist/v2/components/footer/index.js.map +1 -0
- package/dist/v2/components/header/Header.d.ts +155 -0
- package/dist/v2/components/header/Header.d.ts.map +1 -0
- package/dist/v2/components/header/Header.js +845 -0
- package/dist/v2/components/header/Header.js.map +1 -0
- package/dist/v2/components/header/header.test.d.ts +2 -0
- package/dist/v2/components/header/header.test.d.ts.map +1 -0
- package/dist/v2/components/header/header.test.js +242 -0
- package/dist/v2/components/header/header.test.js.map +1 -0
- package/dist/v2/components/header/index.d.ts +4 -0
- package/dist/v2/components/header/index.d.ts.map +1 -0
- package/dist/v2/components/header/index.js +7 -0
- package/dist/v2/components/header/index.js.map +1 -0
- package/dist/v2/components/loginButton/LoginButton.d.ts +62 -0
- package/dist/v2/components/loginButton/LoginButton.d.ts.map +1 -0
- package/dist/v2/components/loginButton/LoginButton.js +497 -0
- package/dist/v2/components/loginButton/LoginButton.js.map +1 -0
- package/dist/v2/components/loginButton/LoginButton.test.d.ts +2 -0
- package/dist/v2/components/loginButton/LoginButton.test.d.ts.map +1 -0
- package/dist/v2/components/loginButton/LoginButton.test.js +53 -0
- package/dist/v2/components/loginButton/LoginButton.test.js.map +1 -0
- package/dist/v2/components/loginButton/downArrow.d.ts +2 -0
- package/dist/v2/components/loginButton/downArrow.d.ts.map +1 -0
- package/dist/v2/components/loginButton/downArrow.js +10 -0
- package/dist/v2/components/loginButton/downArrow.js.map +1 -0
- package/dist/v2/components/loginButton/index.d.ts +3 -0
- package/dist/v2/components/loginButton/index.d.ts.map +1 -0
- package/dist/v2/components/loginButton/index.js +7 -0
- package/dist/v2/components/loginButton/index.js.map +1 -0
- package/dist/v2/components/signupButton/SignupButton.d.ts +36 -0
- package/dist/v2/components/signupButton/SignupButton.d.ts.map +1 -0
- package/dist/v2/components/signupButton/SignupButton.js +84 -0
- package/dist/v2/components/signupButton/SignupButton.js.map +1 -0
- package/dist/v2/components/signupButton/SignupButton.test.d.ts +2 -0
- package/dist/v2/components/signupButton/SignupButton.test.d.ts.map +1 -0
- package/dist/v2/components/signupButton/SignupButton.test.js +49 -0
- package/dist/v2/components/signupButton/SignupButton.test.js.map +1 -0
- package/dist/v2/components/signupButton/index.d.ts +3 -0
- package/dist/v2/components/signupButton/index.d.ts.map +1 -0
- package/dist/v2/components/signupButton/index.js +7 -0
- package/dist/v2/components/signupButton/index.js.map +1 -0
- package/dist/versionInfo.js +7 -7
- package/dist/widgets/buttons.d.ts +9 -3
- package/dist/widgets/buttons.d.ts.map +1 -1
- package/dist/widgets/buttons.js +68 -7
- package/dist/widgets/buttons.js.map +1 -1
- package/package.json +34 -7
|
@@ -0,0 +1,1084 @@
|
|
|
1
|
+
(()=>{"use strict";var e={423(e,t,o){function r(...e){console.log(...e)}o.d(t,{Rm:()=>r})},378(e,t,o){o.d(t,{Pt:()=>i});var r=o(423);const n="https://solidos.github.io/solid-ui/src",i=(e=o.hmd(e)).scriptURI?{iconBase:e.scriptURI.slice(0,e.scriptURI.lastIndexOf("/"))+"/icons/",originalIconBase:e.scriptURI.slice(0,e.scriptURI.lastIndexOf("/"))+"/originalIcons/"}:"undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.iconBase?{iconBase:$SolidTestEnvironment.iconBase,originalIconBase:$SolidTestEnvironment.originalIconBase}:{iconBase:n+"/icons/",originalIconBase:n+"/originalIcons/"};(0,r.Rm)(" icons.iconBase is set to : "+i.iconBase);i.iconBase,i.originalIconBase},568(e,t,o){var r=o(161),n=o(892);const i=o(752).qy`
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
viewBox="0 0 12 7"
|
|
4
|
+
fill="none"
|
|
5
|
+
>
|
|
6
|
+
<path d="M0.679688 0.678955L5.50729 5.50656L10.3349 0.678955" stroke="#6A7282" stroke-width="1.35776" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
</svg>
|
|
8
|
+
`;class s extends r.WF{static properties={label:{type:String,reflect:!0},theme:{type:String,reflect:!0},issuerUrl:{type:String,attribute:"issuer-url",reflect:!0},icon:{type:String,reflect:!0},layout:{type:String,reflect:!0},_popupOpen:{state:!0},_issuerInputValue:{state:!0},_dropdownOpen:{state:!0}};static styles=r.AH`
|
|
9
|
+
:host { // default theme
|
|
10
|
+
display: inline-block;
|
|
11
|
+
position: relative;
|
|
12
|
+
z-index: 400;
|
|
13
|
+
--login-button-background: var(--lavender-900, #7c4cff);
|
|
14
|
+
--login-button-text: var(--color-header-text, #ffffff);
|
|
15
|
+
--popup-background: var(--color-background, #F8F9FB);
|
|
16
|
+
--popup-text: var(--color-text, #1A1A1A);
|
|
17
|
+
--popup-border: var(--color-border, #E5E7EB);
|
|
18
|
+
--popup-shadow: var(--box-shadow-sm, 0 1px 4px rgba(124,77,255,0.12));
|
|
19
|
+
--popup-overlay-background: rgba(0, 0, 0, 0.6);
|
|
20
|
+
--issuer-input-background: var(--color-background, #F8F9FB);
|
|
21
|
+
--issuer-input-text: var(--color-text, #1A1A1A);
|
|
22
|
+
--issuer-input-border: var(--color-text, #1A1A1A);
|
|
23
|
+
--issuer-button-background: var(--color-background, #F8F9FB);
|
|
24
|
+
--issuer-button-text: var(--color-text, #1A1A1A);
|
|
25
|
+
--issuer-button-border: var(--color-border, #E5E7EB);
|
|
26
|
+
--issuer-button-hover-background: var(--lavender-900, #7c4cff);
|
|
27
|
+
--issuer-label-color: var(--grey-purple-700, #1A1A1A);
|
|
28
|
+
--issuer-placeholder-color: var(--grey-purple-700, #5e546d);;
|
|
29
|
+
--error-text-color: var(--color-error, #B00020);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([theme='dark']) {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
position: relative;
|
|
35
|
+
z-index: 900;
|
|
36
|
+
--login-button-background: var(--lavender-900, #7c4cff);
|
|
37
|
+
--login-button-text: var(--color-header-text, #ffffff);
|
|
38
|
+
--popup-background: var(--color-background, #F8F9FB);
|
|
39
|
+
--popup-text: var(--color-text, #1A1A1A);
|
|
40
|
+
--popup-border: var(--color-border, #E5E7EB);
|
|
41
|
+
--popup-shadow: var(--box-shadow-sm, 0 1px 4px rgba(124,77,255,0.12));
|
|
42
|
+
--popup-overlay-background: rgba(0, 0, 0, 0.6);
|
|
43
|
+
--issuer-input-background: var(--color-background, #F8F9FB);
|
|
44
|
+
--issuer-input-text: var(--color-text, #1A1A1A);
|
|
45
|
+
--issuer-input-border: var(--color-text, #1A1A1A);
|
|
46
|
+
--issuer-button-background: var(--color-background, #F8F9FB);
|
|
47
|
+
--issuer-button-text: var(--color-text, #1A1A1A);
|
|
48
|
+
--issuer-button-border: var(--color-text, #1A1A1A);
|
|
49
|
+
--issuer-button-hover-background: var(--lavender-900, #7c4cff);
|
|
50
|
+
--issuer-label-color: var(--grey-purple-700, #1A1A1A);
|
|
51
|
+
--issuer-placeholder-color: var(--grey-purple-700, #5e546d);;
|
|
52
|
+
--error-text-color: var(--color-error, #B00020);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.login-button {
|
|
56
|
+
display: flex;
|
|
57
|
+
height: 35px;
|
|
58
|
+
padding: var(--spacing-xxs, 0.3125rem) var(--spacing-xs, 0.75rem);
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: var(--spacing-xxs, 0.3125rem);
|
|
61
|
+
border-radius: var(--border-radius-base, 0.3125rem);
|
|
62
|
+
background: var(--login-button-background);
|
|
63
|
+
border: none;
|
|
64
|
+
color: var(--login-button-text);
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
font: inherit;
|
|
67
|
+
line-height: 1;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
text-decoration: none;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
transition: transform 0.2s ease;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.login-button-icon {
|
|
75
|
+
width: 16px;
|
|
76
|
+
height: 16px;
|
|
77
|
+
display: inline-block;
|
|
78
|
+
object-fit: contain;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.login-button:active {
|
|
82
|
+
transform: translateY(1px);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.popup-dialog {
|
|
86
|
+
border: none;
|
|
87
|
+
padding: 0;
|
|
88
|
+
background: transparent;
|
|
89
|
+
outline: none;
|
|
90
|
+
overflow: visible;
|
|
91
|
+
max-height: none;
|
|
92
|
+
max-width: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.popup-dialog::backdrop {
|
|
96
|
+
background: var(--popup-overlay-background, rgba(0, 0, 0, 0.6));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.popup-box {
|
|
100
|
+
background: var(--popup-background);
|
|
101
|
+
color: var(--popup-text);
|
|
102
|
+
box-shadow: var(--popup-shadow);
|
|
103
|
+
border: 1px solid var(--popup-border);
|
|
104
|
+
border-radius: var(--border-radius-md, 0.5rem);
|
|
105
|
+
min-width: 480px;
|
|
106
|
+
z-index: 1001;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.popup-top-menu {
|
|
110
|
+
border-bottom: 1px solid #DDD;
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: row;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
padding-bottom: 8px;
|
|
116
|
+
margin-bottom: 8px;
|
|
117
|
+
padding: 1rem;
|
|
118
|
+
background: var(--gray-200, #E5E7EB);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.popup-title {
|
|
122
|
+
font-weight: 800;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.popup-close {
|
|
126
|
+
background: transparent;
|
|
127
|
+
border: none;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
font-size: 1.25rem;
|
|
130
|
+
line-height: 1;
|
|
131
|
+
padding: 0 0.25rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.issuer-text-section {
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
padding: 1rem 1rem 1.75rem;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.issuer-text-label {
|
|
141
|
+
color: var(--issuer-label-color);
|
|
142
|
+
margin-bottom: 6px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.issuer-text-row {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: row;
|
|
148
|
+
gap: 6px;
|
|
149
|
+
align-items: flex-start;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.issuer-input-wrapper {
|
|
153
|
+
flex: 1;
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
min-width: 0;
|
|
157
|
+
position: relative;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.issuer-input-field-row {
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: row;
|
|
163
|
+
position: relative;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.issuer-text-input {
|
|
167
|
+
flex: 1;
|
|
168
|
+
padding: 0.375rem 2.75rem 0.375rem 0.5rem;
|
|
169
|
+
border: 1px solid var(--issuer-input-border);
|
|
170
|
+
border-radius: var(--border-radius-base, 0.3125rem);
|
|
171
|
+
background: var(--issuer-input-background);
|
|
172
|
+
color: var(--issuer-input-text);
|
|
173
|
+
font: inherit;
|
|
174
|
+
min-width: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.issuer-text-input::placeholder {
|
|
178
|
+
color: var(--issuer-placeholder-color);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.issuer-dropdown-toggle {
|
|
182
|
+
position: absolute;
|
|
183
|
+
right: 6px;
|
|
184
|
+
top: 50%;
|
|
185
|
+
transform: translateY(-50%);
|
|
186
|
+
width: 26px;
|
|
187
|
+
height: 26px;
|
|
188
|
+
padding: 0;
|
|
189
|
+
border: none;
|
|
190
|
+
background: transparent;
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
flex-shrink: 0;
|
|
196
|
+
border-radius: var(--border-radius-base, 0.3125rem);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.issuer-dropdown-toggle:hover {
|
|
200
|
+
background: var(--color-header-menu-item-hover, #e6dcff);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.issuer-dropdown-toggle svg {
|
|
204
|
+
width: 14px;
|
|
205
|
+
height: 14px;
|
|
206
|
+
display: block;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.issuer-dropdown-list {
|
|
210
|
+
position: absolute;
|
|
211
|
+
top: calc(100% + 6px);
|
|
212
|
+
left: 0;
|
|
213
|
+
right: 0;
|
|
214
|
+
border: 1px solid var(--color-border, #E5E7EB);
|
|
215
|
+
border-top: none;
|
|
216
|
+
border-radius: 0 0 var(--border-radius-base, 0.3125rem) var(--border-radius-base, 0.3125rem);
|
|
217
|
+
background: var(--issuer-input-background);
|
|
218
|
+
overflow: visible;
|
|
219
|
+
z-index: 10;
|
|
220
|
+
box-shadow: 0 4px 12px rgba(124, 77, 255, 0.12);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.issuer-dropdown-item {
|
|
224
|
+
display: block;
|
|
225
|
+
width: 100%;
|
|
226
|
+
padding: 0.625rem 0.75rem;
|
|
227
|
+
border: none;
|
|
228
|
+
border-bottom: 1px solid var(--color-border, #E5E7EB);
|
|
229
|
+
background: transparent;
|
|
230
|
+
color: var(--issuer-button-text);
|
|
231
|
+
cursor: pointer;
|
|
232
|
+
font: inherit;
|
|
233
|
+
text-align: left;
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.issuer-dropdown-item:last-child {
|
|
238
|
+
border-bottom: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.issuer-dropdown-item:hover {
|
|
242
|
+
background: var(--color-header-menu-item-hover, #e6dcff);
|
|
243
|
+
border-radius: var(--border-radius-base-md, 0.5rem);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.popup-footer {
|
|
247
|
+
display: flex;
|
|
248
|
+
flex-direction: row;
|
|
249
|
+
justify-content: center;
|
|
250
|
+
gap: 8px;
|
|
251
|
+
padding: 0.75rem 1rem 1rem;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.popup-footer-hr {
|
|
255
|
+
margin: 0;
|
|
256
|
+
border: none;
|
|
257
|
+
border-top: 1px solid var(--popup-border, #E5E7EB);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.popup-cancel-button {
|
|
261
|
+
padding: 0.5rem 1.25rem;
|
|
262
|
+
border: 1px solid #C0BFC7;
|
|
263
|
+
border-radius: var(--border-radius-base, 0.3125rem);
|
|
264
|
+
background: var(--popup-background);
|
|
265
|
+
color: #314158;
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
font: inherit;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.popup-cancel-button:hover {
|
|
271
|
+
background: #D1D5DB;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.popup-login-button {
|
|
275
|
+
padding: 0.5rem 1.25rem;
|
|
276
|
+
border: none;
|
|
277
|
+
border-radius: var(--border-radius-base, 0.3125rem);
|
|
278
|
+
background: var(--lavender-900, #7c4cff);
|
|
279
|
+
color: #ffffff;
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
font: inherit;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.popup-login-button:hover {
|
|
285
|
+
background: #6a3de8;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.popup-login-button:disabled {
|
|
289
|
+
opacity: 0.5;
|
|
290
|
+
cursor: not-allowed;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.error-msg {
|
|
294
|
+
color: var(--error-text-color);
|
|
295
|
+
font-size: 0.875rem;
|
|
296
|
+
margin-top: 8px;
|
|
297
|
+
}
|
|
298
|
+
`;_issuerInputId=`issuer-url-input-${Math.random().toString(36).slice(2,10)}`;_errorMsg="";constructor(){super(),this.label="Log In",this.theme="light",this.issuerUrl="",this.icon="",this.layout="desktop",this._popupOpen=!1,this._issuerInputValue="",this._dropdownOpen=!1}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}_openPopup(){const e=(0,n.offlineTestID)();e?this._loginComplete(e.uri):(this._issuerInputValue="undefined"!=typeof localStorage&&localStorage.getItem("loginIssuer")||this.issuerUrl||"",this._errorMsg="",this._popupOpen=!0)}_closePopup(){this._popupOpen=!1}updated(){const e=this.shadowRoot?.querySelector("dialog");e&&(this._popupOpen&&!e.open?e.showModal():!this._popupOpen&&e.open&&e.close())}async _loginToIssuer(e){if(e)try{n.solidLogicSingleton.store.updater.flagAuthorizationMetadata();const t=new URL(window.location.href).hash;t&&window.localStorage.setItem("preLoginRedirectHash",t),window.localStorage.setItem("loginIssuer",e);const o=new URL(window.location.href);o.hash="",await n.authSession.login({redirectUrl:o.href,oidcIssuer:e})}catch(e){this._errorMsg=e.message||String(e),this.requestUpdate()}}_loginComplete(e){n.authn.saveUser(e),this.dispatchEvent(new CustomEvent("login-success",{detail:{webId:e},bubbles:!0,composed:!0}))}_handleGoClick(){this._dropdownOpen=!1,this._loginToIssuer(this._issuerInputValue)}_toggleDropdown(){this._dropdownOpen=!this._dropdownOpen}_selectIssuerFromDropdown(e){this._issuerInputValue=e,this._dropdownOpen=!1}_handleInputChange(e){this._issuerInputValue=e.target.value}_handleInputKeydown(e){"Enter"===e.key&&this._loginToIssuer(this._issuerInputValue),"Escape"===e.key&&this._closePopup()}_renderPopup(){const e=(0,n.getSuggestedIssuers)();return r.qy`
|
|
299
|
+
<div class="popup-box">
|
|
300
|
+
<div class="popup-top-menu">
|
|
301
|
+
<span class="popup-title">Select an identity provider</span>
|
|
302
|
+
<button class="popup-close" type="button" aria-label="Close" @click="${()=>this._closePopup()}">✕</button>
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
<div class="issuer-text-section">
|
|
306
|
+
<label class="issuer-text-label" for="${this._issuerInputId}">Solid Identity Provider</label>
|
|
307
|
+
<div class="issuer-text-row">
|
|
308
|
+
<div class="issuer-input-wrapper">
|
|
309
|
+
<div class="issuer-input-field-row">
|
|
310
|
+
<input
|
|
311
|
+
id="${this._issuerInputId}"
|
|
312
|
+
class="issuer-text-input"
|
|
313
|
+
type="text"
|
|
314
|
+
placeholder="https://example.com"
|
|
315
|
+
.value="${this._issuerInputValue}"
|
|
316
|
+
@input="${this._handleInputChange}"
|
|
317
|
+
@keydown="${this._handleInputKeydown}"
|
|
318
|
+
autocomplete="url"
|
|
319
|
+
/>
|
|
320
|
+
${e.length?r.qy`
|
|
321
|
+
<button
|
|
322
|
+
class="issuer-dropdown-toggle"
|
|
323
|
+
type="button"
|
|
324
|
+
aria-label="Show identity provider suggestions"
|
|
325
|
+
aria-expanded="${this._dropdownOpen}"
|
|
326
|
+
@click="${()=>this._toggleDropdown()}"
|
|
327
|
+
>${i}</button>
|
|
328
|
+
`:""}
|
|
329
|
+
</div>
|
|
330
|
+
${this._dropdownOpen&&e.length?r.qy`
|
|
331
|
+
<div class="issuer-dropdown-list" role="listbox">
|
|
332
|
+
${e.map(e=>r.qy`
|
|
333
|
+
<button
|
|
334
|
+
class="issuer-dropdown-item"
|
|
335
|
+
type="button"
|
|
336
|
+
role="option"
|
|
337
|
+
@click="${()=>this._selectIssuerFromDropdown(e.uri)}"
|
|
338
|
+
>${e.name}</button>
|
|
339
|
+
`)}
|
|
340
|
+
</div>
|
|
341
|
+
`:""}
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
${this._errorMsg?r.qy`<div class="error-msg">${this._errorMsg}</div>`:""}
|
|
345
|
+
</div>
|
|
346
|
+
<hr class="popup-footer-hr" />
|
|
347
|
+
<div class="popup-footer">
|
|
348
|
+
<button class="popup-cancel-button" type="button" @click="${()=>this._closePopup()}">Cancel</button>
|
|
349
|
+
<button
|
|
350
|
+
class="popup-login-button"
|
|
351
|
+
type="button"
|
|
352
|
+
?disabled="${!this._issuerInputValue}"
|
|
353
|
+
@click="${()=>this._handleGoClick()}"
|
|
354
|
+
>Log In</button>
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
`}render(){return r.qy`
|
|
358
|
+
<button
|
|
359
|
+
class="login-button"
|
|
360
|
+
type="button"
|
|
361
|
+
part="login-button"
|
|
362
|
+
@click="${()=>this._openPopup()}"
|
|
363
|
+
>
|
|
364
|
+
${this.icon?r.qy`<img class="login-button-icon" src="${this.icon}" alt="" aria-hidden="true" part="login-button-icon" />`:""}
|
|
365
|
+
<slot>${this.label}</slot>
|
|
366
|
+
</button>
|
|
367
|
+
|
|
368
|
+
<dialog
|
|
369
|
+
class="popup-dialog"
|
|
370
|
+
role="dialog"
|
|
371
|
+
aria-modal="true"
|
|
372
|
+
aria-label="Select an identity provider"
|
|
373
|
+
@cancel="${e=>{e.preventDefault(),this._closePopup()}}"
|
|
374
|
+
@click="${e=>{e.target===e.currentTarget&&this._closePopup()}}"
|
|
375
|
+
>
|
|
376
|
+
${this._popupOpen?this._renderPopup():""}
|
|
377
|
+
</dialog>
|
|
378
|
+
`}}const a="solid-ui-login-button";customElements.get(a)||customElements.define(a,s)},765(e,t,o){var r=o(161);class n extends r.WF{static properties={label:{type:String,reflect:!0},theme:{type:String,reflect:!0},signupUrl:{type:String,attribute:"signup-url",reflect:!0},icon:{type:String,reflect:!0},layout:{type:String,reflect:!0}};static styles=r.AH`
|
|
379
|
+
:host {
|
|
380
|
+
display: inline-block;
|
|
381
|
+
--signup-button-background: transparent;
|
|
382
|
+
--signup-button-border: var(--color-border, #E5E7EB);
|
|
383
|
+
--signup-button-text: var(--color-header-text, #ffffff);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
:host([theme='dark']) {
|
|
387
|
+
--signup-button-background: transparent;
|
|
388
|
+
--signup-button-border: var(--color-border, #E5E7EB);
|
|
389
|
+
--signup-button-text: var(--color-header-text, #ffffff);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.signup-button {
|
|
393
|
+
display: flex;
|
|
394
|
+
height: 35px;
|
|
395
|
+
padding: var(--spacing-xxs, 0.3125rem) var(--spacing-xs, 0.75rem);
|
|
396
|
+
align-items: center;
|
|
397
|
+
gap: var(--spacing-xxs, 0.3125rem);
|
|
398
|
+
border-radius: var(--border-radius-base, 0.3125rem);
|
|
399
|
+
background: var(--signup-button-background);
|
|
400
|
+
border: 1px solid var(--signup-button-border);
|
|
401
|
+
color: var(--signup-button-text);
|
|
402
|
+
cursor: pointer;
|
|
403
|
+
font: inherit;
|
|
404
|
+
line-height: 1;
|
|
405
|
+
white-space: nowrap;
|
|
406
|
+
text-decoration: none;
|
|
407
|
+
box-sizing: border-box;
|
|
408
|
+
transition: transform 0.2s ease;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
:host([layout='mobile']) .signup-button {
|
|
412
|
+
border: none;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.signup-button-icon {
|
|
416
|
+
width: 16px;
|
|
417
|
+
height: 16px;
|
|
418
|
+
display: inline-block;
|
|
419
|
+
object-fit: contain;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.signup-button:active {
|
|
423
|
+
transform: translateY(1px);
|
|
424
|
+
}
|
|
425
|
+
`;constructor(){super(),this.label="Sign Up",this.signupUrl="https://solidproject.org/get_a_pod",this.theme="light",this.icon="",this.layout="desktop"}_handleClick(){window.open(this.signupUrl,"_blank","noopener,noreferrer")}render(){return r.qy`
|
|
426
|
+
<button
|
|
427
|
+
class="signup-button"
|
|
428
|
+
type="button"
|
|
429
|
+
part="signup-button"
|
|
430
|
+
@click="${()=>this._handleClick()}"
|
|
431
|
+
>
|
|
432
|
+
${this.icon?r.qy`<img class="signup-button-icon" src="${this.icon}" alt="" aria-hidden="true" part="signup-button-icon" />`:""}
|
|
433
|
+
<slot>${this.label}</slot>
|
|
434
|
+
</button>
|
|
435
|
+
`}}const i="solid-ui-signup-button";customElements.get(i)||customElements.define(i,n)},892(e){e.exports=SolidLogic},826(e,t,o){o.d(t,{AH:()=>l,Rf:()=>c,sk:()=>d});
|
|
436
|
+
/**
|
|
437
|
+
* @license
|
|
438
|
+
* Copyright 2019 Google LLC
|
|
439
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
440
|
+
*/
|
|
441
|
+
const r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;class a{constructor(e,t,o){if(this._$cssResult$=!0,o!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(n&&void 0===e){const o=void 0!==t&&1===t.length;o&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&s.set(t,e))}return e}toString(){return this.cssText}}const l=(e,...t)=>{const o=1===e.length?e[0]:t.reduce((t,o,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[r+1],e[0]);return new a(o,e,i)},c=(e,t)=>{if(n)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const o of t){const t=document.createElement("style"),n=r.litNonce;void 0!==n&&t.setAttribute("nonce",n),t.textContent=o.cssText,e.appendChild(t)}},d=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const o of e.cssRules)t+=o.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,i))(t)})(e):e},760(e,t,o){o.d(t,{AH:()=>r.AH,mN:()=>v});var r=o(826);
|
|
442
|
+
/**
|
|
443
|
+
* @license
|
|
444
|
+
* Copyright 2017 Google LLC
|
|
445
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
446
|
+
*/const{is:n,defineProperty:i,getOwnPropertyDescriptor:s,getOwnPropertyNames:a,getOwnPropertySymbols:l,getPrototypeOf:c}=Object,d=globalThis,u=d.trustedTypes,h=u?u.emptyScript:"",p=d.reactiveElementPolyfillSupport,g=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?h:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let o=e;switch(t){case Boolean:o=null!==e;break;case Number:o=null===e?null:Number(e);break;case Object:case Array:try{o=JSON.parse(e)}catch(e){o=null}}return o}},m=(e,t)=>!n(e,t),f={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:m};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;class v extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=f){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const o=Symbol(),r=this.getPropertyDescriptor(e,o,t);void 0!==r&&i(this.prototype,e,r)}}static getPropertyDescriptor(e,t,o){const{get:r,set:n}=s(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);n?.call(this,t),this.requestUpdate(e,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??f}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const e=c(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const e=this.properties,t=[...a(e),...l(e)];for(const o of t)this.createProperty(o,e[o])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,o]of t)this.elementProperties.set(e,o)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const o=this._$Eu(e,t);void 0!==o&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const o=new Set(e.flat(1/0).reverse());for(const e of o)t.unshift((0,r.sk)(e))}else void 0!==e&&t.push((0,r.sk)(e));return t}static _$Eu(e,t){const o=t.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return(0,r.Rf)(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$ET(e,t){const o=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,o);if(void 0!==r&&!0===o.reflect){const n=(void 0!==o.converter?.toAttribute?o.converter:b).toAttribute(t,o.type);this._$Em=e,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(e,t){const o=this.constructor,r=o._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=o.getPropertyOptions(r),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:b;this._$Em=r;const i=n.fromAttribute(t,e.type);this[r]=i??this._$Ej?.get(r)??i,this._$Em=null}}requestUpdate(e,t,o,r=!1,n){if(void 0!==e){const i=this.constructor;if(!1===r&&(n=this[e]),o??=i.getPropertyOptions(e),!((o.hasChanged??m)(n,t)||o.useDefault&&o.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,o))))return;this.C(e,t,o)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:o,reflect:r,wrapped:n},i){o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),!0!==n||void 0!==i)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,o]of e){const{wrapped:e}=o,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,o,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[g("elementProperties")]=new Map,v[g("finalized")]=new Map,p?.({ReactiveElement:v}),(d.reactiveElementVersions??=[]).push("2.1.2")},228(e,t,o){o.d(t,{AH:()=>r.AH,WF:()=>s,qy:()=>n.qy});var r=o(760),n=o(752);
|
|
447
|
+
/**
|
|
448
|
+
* @license
|
|
449
|
+
* Copyright 2017 Google LLC
|
|
450
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
451
|
+
*/
|
|
452
|
+
const i=globalThis;class s extends r.mN{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=(0,n.XX)(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return n.c0}}s._$litElement$=!0,s.finalized=!0,i.litElementHydrateSupport?.({LitElement:s});const a=i.litElementPolyfillSupport;a?.({LitElement:s});(i.litElementVersions??=[]).push("4.2.2")},752(e,t,o){o.d(t,{XX:()=>D,c0:()=>E,qy:()=>k,s6:()=>S});
|
|
453
|
+
/**
|
|
454
|
+
* @license
|
|
455
|
+
* Copyright 2017 Google LLC
|
|
456
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
457
|
+
*/
|
|
458
|
+
const r=globalThis,n=e=>e,i=r.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:e=>e}):void 0,a="$lit$",l=`lit$${Math.random().toFixed(9).slice(2)}$`,c="?"+l,d=`<${c}>`,u=document,h=()=>u.createComment(""),p=e=>null===e||"object"!=typeof e&&"function"!=typeof e,g=Array.isArray,b=e=>g(e)||"function"==typeof e?.[Symbol.iterator],m="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,y=/>/g,x=RegExp(`>|${m}(?:([^\\s"'>=/]+)(${m}*=${m}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),$=/'/g,_=/"/g,A=/^(?:script|style|textarea|title)$/i,w=e=>(t,...o)=>({_$litType$:e,strings:t,values:o}),k=w(1),E=(w(2),w(3),Symbol.for("lit-noChange")),S=Symbol.for("lit-nothing"),M=new WeakMap,I=u.createTreeWalker(u,129);function C(e,t){if(!g(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(t):t}const O=(e,t)=>{const o=e.length-1,r=[];let n,i=2===t?"<svg>":3===t?"<math>":"",s=f;for(let t=0;t<o;t++){const o=e[t];let c,u,h=-1,p=0;for(;p<o.length&&(s.lastIndex=p,u=s.exec(o),null!==u);)p=s.lastIndex,s===f?"!--"===u[1]?s=v:void 0!==u[1]?s=y:void 0!==u[2]?(A.test(u[2])&&(n=RegExp("</"+u[2],"g")),s=x):void 0!==u[3]&&(s=x):s===x?">"===u[0]?(s=n??f,h=-1):void 0===u[1]?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=void 0===u[3]?x:'"'===u[3]?_:$):s===_||s===$?s=x:s===v||s===y?s=f:(s=x,n=void 0);const g=s===x&&e[t+1].startsWith("/>")?" ":"";i+=s===f?o+d:h>=0?(r.push(c),o.slice(0,h)+a+o.slice(h)+l+g):o+l+(-2===h?t:g)}return[C(e,i+(e[o]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]};class U{constructor({strings:e,_$litType$:t},o){let r;this.parts=[];let n=0,s=0;const d=e.length-1,u=this.parts,[p,g]=O(e,t);if(this.el=U.createElement(p,o),I.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=I.nextNode())&&u.length<d;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(a)){const t=g[s++],o=r.getAttribute(e).split(l),i=/([.?@])?(.*)/.exec(t);u.push({type:1,index:n,name:i[2],strings:o,ctor:"."===i[1]?R:"?"===i[1]?q:"@"===i[1]?T:B}),r.removeAttribute(e)}else e.startsWith(l)&&(u.push({type:6,index:n}),r.removeAttribute(e));if(A.test(r.tagName)){const e=r.textContent.split(l),t=e.length-1;if(t>0){r.textContent=i?i.emptyScript:"";for(let o=0;o<t;o++)r.append(e[o],h()),I.nextNode(),u.push({type:2,index:++n});r.append(e[t],h())}}}else if(8===r.nodeType)if(r.data===c)u.push({type:2,index:n});else{let e=-1;for(;-1!==(e=r.data.indexOf(l,e+1));)u.push({type:7,index:n}),e+=l.length-1}n++}}static createElement(e,t){const o=u.createElement("template");return o.innerHTML=e,o}}function H(e,t,o=e,r){if(t===E)return t;let n=void 0!==r?o._$Co?.[r]:o._$Cl;const i=p(t)?void 0:t._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),void 0===i?n=void 0:(n=new i(e),n._$AT(e,o,r)),void 0!==r?(o._$Co??=[])[r]=n:o._$Cl=n),void 0!==n&&(t=H(e,n._$AS(e,t.values),n,r)),t}class P{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:o}=this._$AD,r=(e?.creationScope??u).importNode(t,!0);I.currentNode=r;let n=I.nextNode(),i=0,s=0,a=o[0];for(;void 0!==a;){if(i===a.index){let t;2===a.type?t=new L(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new j(n,this,e)),this._$AV.push(t),a=o[++s]}i!==a?.index&&(n=I.nextNode(),i++)}return I.currentNode=u,r}p(e){let t=0;for(const o of this._$AV)void 0!==o&&(void 0!==o.strings?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}}class L{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,r){this.type=2,this._$AH=S,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=H(this,e,t),p(e)?e===S||null==e||""===e?(this._$AH!==S&&this._$AR(),this._$AH=S):e!==this._$AH&&e!==E&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):b(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==S&&p(this._$AH)?this._$AA.nextSibling.data=e:this.T(u.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:o}=e,r="number"==typeof o?this._$AC(e):(void 0===o.el&&(o.el=U.createElement(C(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new P(r,this),o=e.u(this.options);e.p(t),this.T(o),this._$AH=e}}_$AC(e){let t=M.get(e.strings);return void 0===t&&M.set(e.strings,t=new U(e)),t}k(e){g(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let o,r=0;for(const n of e)r===t.length?t.push(o=new L(this.O(h()),this.O(h()),this,this.options)):o=t[r],o._$AI(n),r++;r<t.length&&(this._$AR(o&&o._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=n(e).nextSibling;n(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class B{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,r,n){this.type=1,this._$AH=S,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=n,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=S}_$AI(e,t=this,o,r){const n=this.strings;let i=!1;if(void 0===n)e=H(this,e,t,0),i=!p(e)||e!==this._$AH&&e!==E,i&&(this._$AH=e);else{const r=e;let s,a;for(e=n[0],s=0;s<n.length-1;s++)a=H(this,r[o+s],t,s),a===E&&(a=this._$AH[s]),i||=!p(a)||a!==this._$AH[s],a===S?e=S:e!==S&&(e+=(a??"")+n[s+1]),this._$AH[s]=a}i&&!r&&this.j(e)}j(e){e===S?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class R extends B{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===S?void 0:e}}class q extends B{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==S)}}class T extends B{constructor(e,t,o,r,n){super(e,t,o,r,n),this.type=5}_$AI(e,t=this){if((e=H(this,e,t,0)??S)===E)return;const o=this._$AH,r=e===S&&o!==S||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,n=e!==S&&(o===S||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class j{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){H(this,e)}}const N=r.litHtmlPolyfillSupport;N?.(U,L),(r.litHtmlVersions??=[]).push("3.3.2");const D=(e,t,o)=>{const r=o?.renderBefore??t;let n=r._$litPart$;if(void 0===n){const e=o?.renderBefore??null;r._$litPart$=n=new L(t.insertBefore(h(),e),e,void 0,o??{})}return n._$AI(e),n}},161(e,t,o){o.d(t,{AH:()=>r.AH,WF:()=>r.WF,qy:()=>r.qy});o(760),o(752);var r=o(228)}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,o),i.loaded=!0,i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r=o(161),n=o(378),i=o(892),s=(o(568),o(765),o(752));
|
|
459
|
+
/**
|
|
460
|
+
* @license
|
|
461
|
+
* Copyright 2018 Google LLC
|
|
462
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
463
|
+
*/
|
|
464
|
+
const a=e=>e??s.s6,l=n.Pt.iconBase+"emptyProfileAvatar.png";class c extends r.WF{static properties={logo:{type:String,reflect:!0},helpIcon:{type:String,attribute:"help-icon",reflect:!0},layout:{type:String,reflect:!0},theme:{type:String,reflect:!0},brandLink:{type:String,attribute:"brand-link",reflect:!0},authState:{type:String,attribute:"auth-state",reflect:!0},loginAction:{type:Object,attribute:!1},signUpAction:{type:Object,attribute:!1},accountMenu:{type:Array,attribute:!1},logoutLabel:{type:String,attribute:"logout-label",reflect:!0},logoutIcon:{type:String,attribute:"logout-icon",reflect:!0},accountIcon:{type:String,attribute:"account-icon",reflect:!0},accountAvatar:{type:String,attribute:"account-avatar",reflect:!0},accountAvatarFallback:{type:String,attribute:"account-avatar-fallback",reflect:!0},loginIcon:{type:String,attribute:"login-icon",reflect:!0},signUpIcon:{type:String,attribute:"sign-up-icon",reflect:!0},helpMenuList:{type:Array},accountMenuOpen:{state:!0},helpMenuOpen:{state:!0},hasSlottedAccountMenu:{state:!0},hasSlottedHelpMenu:{state:!0}};static styles=r.AH`
|
|
465
|
+
:host { // default theme
|
|
466
|
+
display: block;
|
|
467
|
+
--header-bg: var(--color-header-row-bg, #332746);
|
|
468
|
+
--header-text: var(--color-header-text, #ffffff);
|
|
469
|
+
--header-border: var(--color-border, #efecf3);
|
|
470
|
+
--header-line: var(--color-header-menu-separator-line, #5e546d);
|
|
471
|
+
--header-link: var(--color-text-heading, #000000);
|
|
472
|
+
--header-menu-item-hover: var(--color-header-menu-item-hover, #e6dcff);
|
|
473
|
+
--header-menu-item-selected: var(--color-header-menu-item-selected, #cbb9ff);
|
|
474
|
+
--header-menu-bg: var(--color-menu-bg, #f6f5f9);
|
|
475
|
+
--header-menu-loggedin-bg: var(--color-header-menu-loggedin-bg, #5e546d);
|
|
476
|
+
--header-menu-text: var(--color-menu-item-text, #654d6c);
|
|
477
|
+
--header-border-radius: var(--border-radius-sm, 0.2rem);
|
|
478
|
+
--header-button-bg: var(--color-menu-bg, #ffffff);
|
|
479
|
+
--header-button-text: var(--color-header-button-text, #0F172B);
|
|
480
|
+
--header-button-detail-text: var(--color-header-button-detail-text, #99A1AF);
|
|
481
|
+
--header-shadow: var(--color-header-shadow, 2px 6px 10px 0 rgba(0, 0, 0, 0.4), 2px 8px 24px 0 rgba(0, 0, 0, 0.19));
|
|
482
|
+
font-family: var(--font-family-base, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// for now light and dark are the same
|
|
486
|
+
:host([theme='dark']) {
|
|
487
|
+
display: block;
|
|
488
|
+
--header-bg: var(--color-header-row-bg, #332746);
|
|
489
|
+
--header-text: var(--color-header-text, #ffffff);
|
|
490
|
+
--header-border: var(--color-border, #efecf3);
|
|
491
|
+
--header-line: var(--color-header-menu-separator-line, #5e546d);
|
|
492
|
+
--header-link: var(--color-text-heading, #000000);
|
|
493
|
+
--header-menu-item-hover: var(--color-header-menu-item-hover, #e6dcff);
|
|
494
|
+
--header-menu-item-selected: var(--color-header-menu-item-selected, #cbb9ff);
|
|
495
|
+
--header-menu-bg: var(--color-menu-bg, #f6f5f9);
|
|
496
|
+
--header-menu-loggedin-bg: var(--color-header-menu-loggedin-bg, #5e546d);
|
|
497
|
+
--header-menu-text: var(--color-menu-item-text, #654d6c);
|
|
498
|
+
--header-border-radius: var(--border-radius-sm, 0.2rem);
|
|
499
|
+
--header-button-bg: var(--color-menu-bg, #ffffff);
|
|
500
|
+
--header-button-text: var(--color-header-button-text, #0f172a);
|
|
501
|
+
--header-button-detail-text: var(--color-header-button-detail-text, #878192);
|
|
502
|
+
--header-icon-filter: invert(1) brightness(1.3); /* special way to invert SVG color of icons, from white to black */
|
|
503
|
+
--header-shadow: var(--color-header-shadow, 2px 6px 10px 0 rgba(0, 0, 0, 0.4), 2px 8px 24px 0 rgba(0, 0, 0, 0.19));
|
|
504
|
+
font-family: var(--font-family-base, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
:host([layout='mobile']) .headerInner {
|
|
508
|
+
flex-wrap: wrap;
|
|
509
|
+
text-align: center;
|
|
510
|
+
gap: 0.5rem;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.headerInner {
|
|
514
|
+
display: flex;
|
|
515
|
+
align-items: center;
|
|
516
|
+
justify-content: space-between;
|
|
517
|
+
background: var(--header-bg);
|
|
518
|
+
color: var(--header-text);
|
|
519
|
+
padding: 0 1.5rem;
|
|
520
|
+
height: 3.75rem;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
::slotted([slot='navigation-toggle']) {
|
|
524
|
+
display: inline-flex;
|
|
525
|
+
align-items: center;
|
|
526
|
+
justify-content: center;
|
|
527
|
+
flex-shrink: 0;
|
|
528
|
+
margin-right: 0.75rem;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
:host([layout='desktop']) ::slotted([slot='navigation-toggle']) {
|
|
532
|
+
display: none !important;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.brand {
|
|
536
|
+
display: flex;
|
|
537
|
+
align-items: center;
|
|
538
|
+
gap: 0.5rem;
|
|
539
|
+
text-decoration: none;
|
|
540
|
+
color: inherit;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.brand-not-displayed {
|
|
544
|
+
display: none;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.brand img {
|
|
548
|
+
height: 50px;
|
|
549
|
+
width: 55px;
|
|
550
|
+
object-fit: contain;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.menu {
|
|
554
|
+
display: flex;
|
|
555
|
+
align-items: center;
|
|
556
|
+
gap: 0.625rem;
|
|
557
|
+
margin-left: auto;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.auth-actions {
|
|
561
|
+
display: flex;
|
|
562
|
+
align-items: center;
|
|
563
|
+
gap: 0.625rem;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.auth-button {
|
|
567
|
+
display: inline-flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
justify-content: center;
|
|
570
|
+
gap: 0.5rem;
|
|
571
|
+
min-height: 2.25rem;
|
|
572
|
+
padding: 0.5rem 0.875rem;
|
|
573
|
+
border: 1px solid var(--header-border);
|
|
574
|
+
border-radius: 999px;
|
|
575
|
+
background: var(--header-menu-bg);
|
|
576
|
+
color: var(--header-button-text);
|
|
577
|
+
cursor: pointer;
|
|
578
|
+
font: inherit;
|
|
579
|
+
line-height: 1;
|
|
580
|
+
text-decoration: none;
|
|
581
|
+
box-sizing: border-box;
|
|
582
|
+
transition: border-color 0.2s ease, transform 0.2s ease;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.auth-button:hover {
|
|
586
|
+
border-color: var(--header-menu-item-hover);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.auth-button:active {
|
|
590
|
+
transform: translateY(1px);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.auth-button-sign-up {
|
|
594
|
+
background: color-mix(in srgb, var(--header-menu-bg) 78%, var(--header-menu-item-selected) 22%);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.header-menu-separator {
|
|
598
|
+
background: var(--header-line);
|
|
599
|
+
width: 1px;
|
|
600
|
+
height: 2.3rem;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.account-menu-container {
|
|
604
|
+
position: relative;
|
|
605
|
+
display: flex;
|
|
606
|
+
align-items: center;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.account-menu-trigger {
|
|
610
|
+
display: inline-flex;
|
|
611
|
+
align-items: center;
|
|
612
|
+
gap: 0.625rem;
|
|
613
|
+
min-height: 2.5rem;
|
|
614
|
+
border: 1px solid var(--header-menu-loggedin-bg);
|
|
615
|
+
border-radius: 999px;
|
|
616
|
+
background: var(--header-menu-loggedin-bg);
|
|
617
|
+
color: var(--header-button-text);
|
|
618
|
+
cursor: pointer;
|
|
619
|
+
font: inherit;
|
|
620
|
+
line-height: 1;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
:host([layout='mobile']) .account-menu-trigger {
|
|
624
|
+
gap: 0;
|
|
625
|
+
min-height: auto;
|
|
626
|
+
padding: 0;
|
|
627
|
+
border: 1.5px solid var(--header-border);
|
|
628
|
+
background: var(--header-menu-loggedin-bg);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
:host([layout='mobile']) .account-menu-trigger-label {
|
|
632
|
+
display: none;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.account-menu-trigger:disabled {
|
|
636
|
+
cursor: default;
|
|
637
|
+
opacity: 0.7;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.account-menu-trigger-icon {
|
|
641
|
+
width: 1rem;
|
|
642
|
+
height: 1rem;
|
|
643
|
+
object-fit: contain;
|
|
644
|
+
flex-shrink: 0;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.account-avatar,
|
|
648
|
+
.account-menu-avatar {
|
|
649
|
+
display: inline-flex;
|
|
650
|
+
align-items: center;
|
|
651
|
+
justify-content: center;
|
|
652
|
+
flex-shrink: 0;
|
|
653
|
+
overflow: hidden;
|
|
654
|
+
background: color-mix(in srgb, var(--header-bg) 18%, #ded8e7 82%);
|
|
655
|
+
color: var(--header-button-text);
|
|
656
|
+
font-size: 0.75rem;
|
|
657
|
+
font-weight: 600;
|
|
658
|
+
text-transform: uppercase;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.account-avatar {
|
|
662
|
+
width: 1.75rem;
|
|
663
|
+
height: 1.75rem;
|
|
664
|
+
border-radius: 999px;
|
|
665
|
+
border: 1.5px solid var(--header-border);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.account-menu-avatar {
|
|
669
|
+
width: 2rem;
|
|
670
|
+
height: 2rem;
|
|
671
|
+
border-radius: 0.5rem;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.account-avatar img,
|
|
675
|
+
.account-menu-avatar img {
|
|
676
|
+
width: 100%;
|
|
677
|
+
height: 100%;
|
|
678
|
+
object-fit: cover;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.account-avatar-img {
|
|
682
|
+
width: 1.75rem;
|
|
683
|
+
height: 1.75rem;
|
|
684
|
+
border-radius: 999px;
|
|
685
|
+
object-fit: cover;
|
|
686
|
+
background-color: var(--header-border);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
.account-dropdown {
|
|
690
|
+
position: absolute;
|
|
691
|
+
top: calc(100% + 0.9rem);
|
|
692
|
+
right: 0;
|
|
693
|
+
min-width: 15rem;
|
|
694
|
+
padding: 0.5rem;
|
|
695
|
+
background: var(--header-button-bg);
|
|
696
|
+
border: 1px solid var(--header-border);
|
|
697
|
+
border-radius: var(--header-border-radius);
|
|
698
|
+
box-shadow: var(--header-shadow);
|
|
699
|
+
z-index: 10;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.account-dropdown[hidden] {
|
|
703
|
+
display: none;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.account-menu-list {
|
|
707
|
+
list-style: none;
|
|
708
|
+
margin: 0;
|
|
709
|
+
padding: 0;
|
|
710
|
+
display: flex;
|
|
711
|
+
flex-direction: column;
|
|
712
|
+
gap: 0.25rem;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
.account-menu-item-link,
|
|
716
|
+
.account-menu-item-button,
|
|
717
|
+
::slotted([slot='account-menu']) {
|
|
718
|
+
display: flex;
|
|
719
|
+
align-items: center;
|
|
720
|
+
gap: 0.625rem;
|
|
721
|
+
width: 100%;
|
|
722
|
+
box-sizing: border-box;
|
|
723
|
+
color: var(--header-link);
|
|
724
|
+
text-decoration: none;
|
|
725
|
+
background: transparent;
|
|
726
|
+
border: 1px solid transparent;
|
|
727
|
+
border-radius: 10px;
|
|
728
|
+
padding: 0.5rem;
|
|
729
|
+
cursor: pointer;
|
|
730
|
+
font: inherit;
|
|
731
|
+
text-align: left;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.account-menu-item-link:hover,
|
|
735
|
+
.account-menu-item-button:hover {
|
|
736
|
+
color: var(--header-link);
|
|
737
|
+
background: var(--header-menu-item-hover);
|
|
738
|
+
border-color: var(--header-menu-item-hover);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.account-menu-item-link:active,
|
|
742
|
+
.account-menu-item-button:active {
|
|
743
|
+
color: var(--header-link);
|
|
744
|
+
background: var(--header-menu-item-selected);
|
|
745
|
+
border-color: var(--header-menu-item-selected);
|
|
746
|
+
transform: translateY(1px);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.account-switch {
|
|
750
|
+
display: block;
|
|
751
|
+
width: 100%;
|
|
752
|
+
color: var(--header-menu-text);
|
|
753
|
+
text-align: left;
|
|
754
|
+
text-transform: uppercase;
|
|
755
|
+
font-size: 80%;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.dropdown-menu-separator {
|
|
759
|
+
display: block;
|
|
760
|
+
width: calc(100% + 1rem);
|
|
761
|
+
margin: 0.5rem -0.5rem;
|
|
762
|
+
border: 0;
|
|
763
|
+
border-top: 1px solid var(--header-border);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.account-menu-copy {
|
|
767
|
+
display: flex;
|
|
768
|
+
flex-direction: column;
|
|
769
|
+
min-width: 0;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
.account-menu-label {
|
|
773
|
+
color: var(--header-button-text);
|
|
774
|
+
overflow: hidden;
|
|
775
|
+
text-overflow: ellipsis;
|
|
776
|
+
white-space: nowrap;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.account-menu-webid {
|
|
780
|
+
color: var(--header-button-detail-text);
|
|
781
|
+
font-size: 0.5rem;
|
|
782
|
+
overflow: hidden;
|
|
783
|
+
text-overflow: ellipsis;
|
|
784
|
+
white-space: nowrap;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.help-menu-container {
|
|
788
|
+
position: relative;
|
|
789
|
+
display: flex;
|
|
790
|
+
align-items: center;
|
|
791
|
+
background: transparent;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
.help-menu-trigger {
|
|
795
|
+
display: inline-flex;
|
|
796
|
+
align-items: center;
|
|
797
|
+
justify-content: center;
|
|
798
|
+
padding: 0;
|
|
799
|
+
border: 0;
|
|
800
|
+
background: transparent;
|
|
801
|
+
cursor: pointer;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.help-menu-trigger:disabled {
|
|
805
|
+
cursor: default;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.help-dropdown {
|
|
809
|
+
position: absolute;
|
|
810
|
+
top: calc(100% + 0.9rem);
|
|
811
|
+
right: 0;
|
|
812
|
+
min-width: 12rem;
|
|
813
|
+
padding: 0.5rem;
|
|
814
|
+
background: var(--header-button-bg);
|
|
815
|
+
border: 1px solid var(--header-border);
|
|
816
|
+
border-radius: var(--header-border-radius);
|
|
817
|
+
box-shadow: var(--header-shadow);
|
|
818
|
+
z-index: 10;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.help-dropdown[hidden] {
|
|
822
|
+
display: none;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.help-dropdown-content {
|
|
826
|
+
display: flex;
|
|
827
|
+
flex-direction: column;
|
|
828
|
+
gap: 0.25rem;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.help-menu-list {
|
|
832
|
+
list-style: none;
|
|
833
|
+
margin: 0;
|
|
834
|
+
padding: 0;
|
|
835
|
+
display: flex;
|
|
836
|
+
flex-direction: column;
|
|
837
|
+
gap: 0.25rem;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
.help-menu-list a,
|
|
841
|
+
.help-menu-list button,
|
|
842
|
+
::slotted([slot='help-menu']) {
|
|
843
|
+
display: block;
|
|
844
|
+
width: 100%;
|
|
845
|
+
box-sizing: border-box;
|
|
846
|
+
color: var(--header-link);
|
|
847
|
+
text-decoration: none;
|
|
848
|
+
background: transparent;
|
|
849
|
+
border: 1px solid transparent;
|
|
850
|
+
border-radius: 4px;
|
|
851
|
+
padding: 0.375rem 0.5rem;
|
|
852
|
+
cursor: pointer;
|
|
853
|
+
font: inherit;
|
|
854
|
+
text-align: left;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.help-menu-list a:hover,
|
|
858
|
+
.help-menu-list button:hover {
|
|
859
|
+
color: var(--header-link);
|
|
860
|
+
background: var(--header-menu-item-hover);
|
|
861
|
+
border-color: var(--header-menu-item-hover);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
.help-menu-list a:active,
|
|
865
|
+
.help-menu-list button:active {
|
|
866
|
+
color: var(--header-link);
|
|
867
|
+
background: var(--header-menu-item-selected);
|
|
868
|
+
border-color: var(--header-menu-item-selected);
|
|
869
|
+
transform: translateY(1px);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
::slotted(a), ::slotted(button) {
|
|
873
|
+
color: var(--header-link);
|
|
874
|
+
text-decoration: none;
|
|
875
|
+
background: var(--header-button-bg);
|
|
876
|
+
border: 1px solid var(--header-border);
|
|
877
|
+
border-radius: 4px;
|
|
878
|
+
padding: 0.25rem 0.5rem;
|
|
879
|
+
cursor: pointer;
|
|
880
|
+
font: inherit;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.help-icon {
|
|
884
|
+
width: 35px;
|
|
885
|
+
height: 35px;
|
|
886
|
+
cursor: pointer;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.help-text {
|
|
890
|
+
color: var(--header-text, #ffffff);
|
|
891
|
+
font: inherit;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.logout-action-icon {
|
|
895
|
+
width: 16px;
|
|
896
|
+
height: 16px;
|
|
897
|
+
display: inline-block;
|
|
898
|
+
object-fit: contain;
|
|
899
|
+
margin-right: 0.5rem;
|
|
900
|
+
}
|
|
901
|
+
`;constructor(){super(),this.logo="https://solidproject.org/assets/img/solid-emblem.svg",this.helpIcon="",this.layout="desktop",this.theme="light",this.brandLink="#",this.authState="logged-out",this.loginAction={label:"Log In",action:"login"},this.signUpAction={label:"Sign Up",action:"sign-up",url:"https://solidproject.org/get_a_pod"},this.accountMenu=[],this.logoutLabel="Log Out",this.logoutIcon="",this.accountIcon="▼",this.accountAvatar="",this.accountAvatarFallback="",this.loginIcon="",this.signUpIcon="",this.helpMenuList=[],this.accountMenuOpen=!1,this.helpMenuOpen=!1,this.hasSlottedAccountMenu=!1,this.hasSlottedHelpMenu=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleDocumentClick),window.addEventListener("keydown",this.handleWindowKeydown)}disconnectedCallback(){document.removeEventListener("click",this.handleDocumentClick),window.removeEventListener("keydown",this.handleWindowKeydown),super.disconnectedCallback()}handleHelpMenuClick(e,t){if(t.preventDefault(),this.helpMenuOpen=!1,this.dispatchEvent(new CustomEvent("help-menu-select",{detail:e,bubbles:!0,composed:!0})),e.url){const t=e.target||"_blank",o="_blank"===t?"noopener,noreferrer":void 0;window.open(e.url,t,o)}}handleAccountMenuClick(e){this.accountMenuOpen=!1,this.dispatchEvent(new CustomEvent("account-menu-select",{detail:e,bubbles:!0,composed:!0}))}handleDocumentClick=e=>{e.composedPath().includes(this)||(this.accountMenuOpen=!1,this.helpMenuOpen=!1)};handleWindowKeydown=e=>{"Escape"===e.key&&(this.accountMenuOpen||this.helpMenuOpen)&&(this.accountMenuOpen=!1,this.helpMenuOpen=!1)};handleAccountSlotChange(e){const t=e.target;this.hasSlottedAccountMenu=t.assignedElements({flatten:!0}).length>0}handleHelpSlotChange(e){const t=e.target;this.hasSlottedHelpMenu=t.assignedElements({flatten:!0}).length>0}toggleAccountMenu(e){e.preventDefault(),this.hasAccountMenuItems()&&(this.helpMenuOpen=!1,this.accountMenuOpen=!this.accountMenuOpen)}toggleHelpMenu(e){e.preventDefault(),this.hasHelpMenuItems()&&(this.accountMenuOpen=!1,this.helpMenuOpen=!this.helpMenuOpen)}hasAccountMenuItems(){return Boolean(this.accountMenu?.length||this.hasSlottedAccountMenu||this.logoutLabel)}hasHelpMenuItems(){return Boolean(this.helpMenuList?.length||this.hasSlottedHelpMenu)}shouldRenderHelpMenu(){return"mobile"!==this.layout&&this.hasHelpMenuItems()}renderLoggedInAvatar(e,t="account-avatar"){const o=Boolean(e),n=o?e:this.accountAvatarFallback||l,i=o?"Profile Avatar":"Default Avatar";return"mobile"===this.layout&&"account-avatar"===t?r.qy`<img class="account-avatar-img" src="${n}" alt="${i}" />`:r.qy`
|
|
902
|
+
<span class="${t}" aria-hidden="true">
|
|
903
|
+
<img src="${n}" alt="${i}" />
|
|
904
|
+
</span>
|
|
905
|
+
`}renderLoggedOutActions(){return r.qy`
|
|
906
|
+
<div class="auth-actions" part="auth-actions">
|
|
907
|
+
<slot name="login-action">
|
|
908
|
+
<solid-ui-login-button
|
|
909
|
+
label="${this.loginAction.label}"
|
|
910
|
+
icon=${a("mobile"!==this.layout?this.loginIcon||this.loginAction.icon:void 0)}
|
|
911
|
+
layout="${this.layout}"
|
|
912
|
+
theme="${this.theme}"
|
|
913
|
+
part="login-action"
|
|
914
|
+
@login-success="${()=>this.handleLoginSuccess()}"
|
|
915
|
+
></solid-ui-login-button>
|
|
916
|
+
</slot>
|
|
917
|
+
<slot name="sign-up-action">
|
|
918
|
+
<solid-ui-signup-button
|
|
919
|
+
label="${this.signUpAction.label}"
|
|
920
|
+
signup-url="${a(this.signUpAction.url)}"
|
|
921
|
+
layout="${this.layout}"
|
|
922
|
+
.icon=${a("mobile"!==this.layout?this.signUpIcon||this.signUpAction.icon:void 0)}
|
|
923
|
+
theme="${this.theme}"
|
|
924
|
+
part="sign-up-action"
|
|
925
|
+
></solid-ui-signup-button>
|
|
926
|
+
</slot>
|
|
927
|
+
</div>
|
|
928
|
+
`}handleLoginSuccess(){this.authState="logged-in",this.dispatchEvent(new CustomEvent("auth-action-select",{detail:{role:"login"},bubbles:!0,composed:!0}))}async handleLogout(){this.accountMenuOpen=!1;try{await i.authSession.logout()}catch(e){}this.authState="logged-out",this.dispatchEvent(new CustomEvent("logout-select",{detail:{role:"logout"},bubbles:!0,composed:!0}))}renderAccountMenuItem(e){const t=r.qy`
|
|
929
|
+
${this.renderLoggedInAvatar(e.avatar,"account-menu-avatar")}
|
|
930
|
+
<span class="account-menu-copy">
|
|
931
|
+
<span class="account-menu-label">${e.label}</span>
|
|
932
|
+
${e.webid&&"mobile"!==this.layout?r.qy`<span class="account-menu-webid">${e.webid}</span>`:""}
|
|
933
|
+
</span>
|
|
934
|
+
`;return e.url?r.qy`
|
|
935
|
+
<a
|
|
936
|
+
class="account-menu-item-link"
|
|
937
|
+
href="${e.url}"
|
|
938
|
+
@click="${()=>this.handleAccountMenuClick(e)}"
|
|
939
|
+
part="account-menu-item"
|
|
940
|
+
role="menuitem"
|
|
941
|
+
>
|
|
942
|
+
${t}
|
|
943
|
+
</a>
|
|
944
|
+
`:r.qy`
|
|
945
|
+
<button
|
|
946
|
+
class="account-menu-item-button"
|
|
947
|
+
type="button"
|
|
948
|
+
@click="${()=>this.handleAccountMenuClick(e)}"
|
|
949
|
+
part="account-menu-item"
|
|
950
|
+
role="menuitem"
|
|
951
|
+
>
|
|
952
|
+
${t}
|
|
953
|
+
</button>
|
|
954
|
+
`}renderLoggedInActions(){return r.qy`
|
|
955
|
+
<div class="account-menu-container" part="account-menu-container">
|
|
956
|
+
<slot name="account-trigger">
|
|
957
|
+
<button
|
|
958
|
+
id="accountMenuTrigger"
|
|
959
|
+
class="account-menu-trigger"
|
|
960
|
+
type="button"
|
|
961
|
+
aria-haspopup="menu"
|
|
962
|
+
aria-expanded="${this.accountMenuOpen?"true":"false"}"
|
|
963
|
+
?disabled="${!this.hasAccountMenuItems()}"
|
|
964
|
+
@click="${e=>this.toggleAccountMenu(e)}"
|
|
965
|
+
part="account-menu-trigger"
|
|
966
|
+
>
|
|
967
|
+
${this.renderLoggedInAvatar(this.accountAvatar)}
|
|
968
|
+
${"mobile"!==this.layout&&this.accountIcon?r.qy`
|
|
969
|
+
<img class="account-menu-trigger-icon" src="${this.accountIcon}" alt="" aria-hidden="true" />`:""}
|
|
970
|
+
</button>
|
|
971
|
+
</slot>
|
|
972
|
+
|
|
973
|
+
<nav
|
|
974
|
+
id="accountMenu"
|
|
975
|
+
class="account-dropdown"
|
|
976
|
+
role="menu"
|
|
977
|
+
?inert="${!this.accountMenuOpen||!this.hasAccountMenuItems()}"
|
|
978
|
+
?hidden="${!this.accountMenuOpen||!this.hasAccountMenuItems()}"
|
|
979
|
+
part="account-dropdown"
|
|
980
|
+
>
|
|
981
|
+
<slot name="account-switch" class="account-switch">Switch account</slot>
|
|
982
|
+
<hr class="dropdown-menu-separator" />
|
|
983
|
+
<slot name="account-menu" @slotchange="${e=>this.handleAccountSlotChange(e)}"></slot>
|
|
984
|
+
${this.accountMenu&&this.accountMenu.length?r.qy`
|
|
985
|
+
<ul class="account-menu-list">
|
|
986
|
+
${this.accountMenu.map(e=>r.qy`
|
|
987
|
+
<li>${this.renderAccountMenuItem(e)}</li>
|
|
988
|
+
`)}
|
|
989
|
+
</ul>
|
|
990
|
+
`:""}
|
|
991
|
+
${this.logoutLabel?r.qy`
|
|
992
|
+
<hr class="dropdown-menu-separator" />
|
|
993
|
+
<button
|
|
994
|
+
class="account-menu-item-button"
|
|
995
|
+
type="button"
|
|
996
|
+
@click="${()=>this.handleLogout()}"
|
|
997
|
+
part="logout-action"
|
|
998
|
+
role="menuitem"
|
|
999
|
+
>
|
|
1000
|
+
${this.logoutIcon&&"mobile"!==this.layout?r.qy`<img class="logout-action-icon" src="${this.logoutIcon}" alt="" aria-hidden="true" part="logout-action-icon" />`:""}
|
|
1001
|
+
${this.logoutLabel}
|
|
1002
|
+
</button>
|
|
1003
|
+
`:""}
|
|
1004
|
+
</nav>
|
|
1005
|
+
</div>
|
|
1006
|
+
`}renderUserArea(){return"logged-out"===this.authState?this.renderLoggedOutActions():this.renderLoggedInActions()}firstUpdated(){const e=this.shadowRoot?.getElementById("brandLink");e&&e.classList.toggle("brand-not-displayed","mobile"===this.layout)}updated(e){if(e.has("layout")){const e=this.shadowRoot?.getElementById("brandLink");e&&e.classList.toggle("brand-not-displayed","mobile"===this.layout)}}render(){return r.qy`
|
|
1007
|
+
<div class="headerInner">
|
|
1008
|
+
<slot name="navigation-toggle"></slot>
|
|
1009
|
+
<a
|
|
1010
|
+
id="brandLink"
|
|
1011
|
+
class="brand"
|
|
1012
|
+
href="${this.brandLink}"
|
|
1013
|
+
part="brand"
|
|
1014
|
+
>
|
|
1015
|
+
<img id="brandImg" src="${this.logo}" alt="Logo" part="logo" />
|
|
1016
|
+
</a>
|
|
1017
|
+
|
|
1018
|
+
<div class="menu" part="menu">
|
|
1019
|
+
${this.renderUserArea()}
|
|
1020
|
+
|
|
1021
|
+
${this.shouldRenderHelpMenu()?r.qy`
|
|
1022
|
+
<div class="header-menu-separator" />`:""}
|
|
1023
|
+
|
|
1024
|
+
${this.shouldRenderHelpMenu()?r.qy`
|
|
1025
|
+
<div class="help-menu-container" part="help-menu-container">
|
|
1026
|
+
<button
|
|
1027
|
+
id="helpMenuTrigger"
|
|
1028
|
+
class="help-menu-trigger"
|
|
1029
|
+
type="button"
|
|
1030
|
+
aria-haspopup="menu"
|
|
1031
|
+
aria-expanded="${this.helpMenuOpen?"true":"false"}"
|
|
1032
|
+
?disabled="${!this.hasHelpMenuItems()}"
|
|
1033
|
+
@click="${e=>this.toggleHelpMenu(e)}"
|
|
1034
|
+
part="help-menu-trigger"
|
|
1035
|
+
>
|
|
1036
|
+
${this.helpIcon?r.qy`<img id="helpIcon" class="help-icon" src="${this.helpIcon}" alt="Help" part="help-icon" />`:r.qy`<span class="help-text" part="help-text">Help</span>`}
|
|
1037
|
+
</button>
|
|
1038
|
+
|
|
1039
|
+
<nav
|
|
1040
|
+
id="helpMenu"
|
|
1041
|
+
class="help-dropdown"
|
|
1042
|
+
role="menu"
|
|
1043
|
+
?inert="${!this.helpMenuOpen||!this.hasHelpMenuItems()}"
|
|
1044
|
+
?hidden="${!this.helpMenuOpen||!this.hasHelpMenuItems()}"
|
|
1045
|
+
part="help-dropdown"
|
|
1046
|
+
>
|
|
1047
|
+
<div class="help-dropdown-content" @click="${()=>{this.helpMenuOpen=!1}}">
|
|
1048
|
+
<slot name="help-menu" @slotchange="${e=>this.handleHelpSlotChange(e)}"></slot>
|
|
1049
|
+
${this.helpMenuList&&this.helpMenuList.length?r.qy`
|
|
1050
|
+
<ul class="help-menu-list">
|
|
1051
|
+
${this.helpMenuList.map(e=>r.qy`
|
|
1052
|
+
<li>
|
|
1053
|
+
${e.url?r.qy`
|
|
1054
|
+
<a
|
|
1055
|
+
href="${e.url}"
|
|
1056
|
+
target="${e.target||"_blank"}"
|
|
1057
|
+
rel="${a("_blank"===(e.target||"_blank")?"noopener noreferrer":void 0)}"
|
|
1058
|
+
@click="${t=>this.handleHelpMenuClick(e,t)}"
|
|
1059
|
+
part="help-menu-item"
|
|
1060
|
+
role="menuitem"
|
|
1061
|
+
>
|
|
1062
|
+
${e.label}
|
|
1063
|
+
</a>
|
|
1064
|
+
`:r.qy`
|
|
1065
|
+
<button
|
|
1066
|
+
type="button"
|
|
1067
|
+
@click="${t=>this.handleHelpMenuClick(e,t)}"
|
|
1068
|
+
part="help-menu-item"
|
|
1069
|
+
role="menuitem"
|
|
1070
|
+
>
|
|
1071
|
+
${e.label}
|
|
1072
|
+
</button>
|
|
1073
|
+
`}
|
|
1074
|
+
</li>
|
|
1075
|
+
`)}
|
|
1076
|
+
</ul>
|
|
1077
|
+
`:""}
|
|
1078
|
+
</div>
|
|
1079
|
+
</nav>
|
|
1080
|
+
</div>`:""}
|
|
1081
|
+
</div>
|
|
1082
|
+
</div>
|
|
1083
|
+
`}}const d="solid-ui-header";customElements.get(d)||customElements.define(d,c)})();
|
|
1084
|
+
//# sourceMappingURL=index.min.js.map
|