@appscode/design-system 2.0.41-alpha.8 → 2.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.scss CHANGED
@@ -18,7 +18,8 @@
18
18
 
19
19
  // COMPONENTS
20
20
  // @import "@/components/vue-components/styles/components/all";
21
+ @import "@/components/vue-components/styles/components/button";
21
22
  @import "@/components/vue-components/styles/components/form-fields/input";
22
23
  @import "@/components/vue-components/styles/components/ui-builder/vue-open-api";
23
24
  @import "@/components/vue-components/styles/components/ui-builder/ui-builder";
24
- @import "@/components/vue-components/styles/theme/appscode.scss";
25
+ // @import "@/components/vue-components/styles/theme/appscode.scss";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.0.41-alpha.8",
3
+ "version": "2.0.41",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
package/plugins/theme.js CHANGED
@@ -93,15 +93,13 @@ export function HexToHSL(H) {
93
93
  };
94
94
  }
95
95
  export function getThemeHSL() {
96
- const hue = getComputedStyle(document.documentElement).getPropertyValue(
97
- "--hsl-hue"
98
- );
99
- const saturation = getComputedStyle(
100
- document.documentElement
101
- ).getPropertyValue("--hsl-saturation");
102
- const lightness = getComputedStyle(document.documentElement).getPropertyValue(
103
- "--hsl-lightness"
96
+ const themeElement = document.querySelector(":root");
97
+ const hue = getComputedStyle(themeElement).getPropertyValue("--primary-hue");
98
+ const saturation = getComputedStyle(themeElement).getPropertyValue(
99
+ "--primary-saturation"
104
100
  );
101
+ const lightness =
102
+ getComputedStyle(themeElement).getPropertyValue("--primary-light");
105
103
 
106
104
  return {
107
105
  hue,
@@ -110,32 +108,12 @@ export function getThemeHSL() {
110
108
  };
111
109
  }
112
110
  export function setThemeHSL(h, s, l) {
113
- document.documentElement.style.setProperty("--hsl-hue", h);
114
- document.documentElement.style.setProperty("--hsl-saturation", s);
115
- document.documentElement.style.setProperty("--hsl-lightness", l);
116
- }
117
- export function setFontHSL(h, s, l) {
118
- document.documentElement.style.setProperty("--font-hsl-hue", h);
119
- document.documentElement.style.setProperty("--font-hsl-saturation", s);
120
- document.documentElement.style.setProperty("--font-hsl-lightness", l);
111
+ const themeElement = document.querySelector(":root");
112
+ themeElement.style.setProperty("--primary-hue", h);
113
+ themeElement.style.setProperty("--primary-saturation", s);
114
+ themeElement.style.setProperty("--primary-light", l);
121
115
  }
122
- export function getFontHSL() {
123
- const hue = getComputedStyle(document.documentElement).getPropertyValue(
124
- "--font-hsl-hue"
125
- );
126
- const saturation = getComputedStyle(
127
- document.documentElement
128
- ).getPropertyValue("--font-hsl-saturation");
129
- const lightness = getComputedStyle(document.documentElement).getPropertyValue(
130
- "--font-hsl-lightness"
131
- );
132
116
 
133
- return {
134
- hue,
135
- saturation,
136
- lightness,
137
- };
138
- }
139
117
  export const loaderLightThemePrimaryColor = "#f5f7f9";
140
118
  export const loaderDarkThemePrimaryColor = "#2e323c";
141
119
  export const loaderLightThemeSecondaryColor = "#ecebeb";
@@ -1,4 +1,6 @@
1
1
  // @import "colors";
2
+ @import "root-variables";
3
+ @import "generate-color-classes";
2
4
  @import "typography";
3
5
  @import "mixin";
4
6
  @import "extended";
@@ -6,4 +8,4 @@
6
8
  @import "grid";
7
9
  @import "spacing";
8
10
  @import "layouts";
9
- // @import "dark-theme";
11
+ // @import "dark-theme";
@@ -1,11 +1,6 @@
1
- :root {
2
- --primary-hue: 208;
3
- --primary-saturation: 77%;
4
- --primary-light: 40%;
5
- }
6
- :root {
7
- --theme-mode: light;
8
- }
1
+ // :root {
2
+ // --theme-mode: light;
3
+ // }
9
4
 
10
5
  // white and black
11
6
  $white-100: hsl(0, 0%, 100%);
@@ -15,7 +10,7 @@ $black-100: hsl(0, 0%, 0%);
15
10
  $primary-hue: var(--primary-hue);
16
11
  $primary-saturation: var(--primary-saturation);
17
12
  $primary-light: var(--primary-light);
18
- $theme-mode: var(--theme-mode);
13
+ // $theme-mode: var(--theme-mode);
19
14
 
20
15
  $primary-5: hsl($primary-hue, $primary-saturation, 5%);
21
16
  $primary-10: hsl($primary-hue, $primary-saturation, 10%);
@@ -152,260 +147,6 @@ $black-93: hsl($black-hue, $black-saturation, 93%);
152
147
  $black-95: hsl($black-hue, $black-saturation, 95%);
153
148
  $black-97: hsl($black-hue, $black-saturation, 97%);
154
149
 
155
- // classes
156
- @mixin generate-color-classes($type, $color, $h, $s, $from, $to, $step) {
157
- $i: $from;
158
-
159
- @while $i <=$to {
160
- .#{$type}-#{$color}-#{$i} {
161
- #{if($type == "text", "color", "background-color")}: hsl($h, $s, $i * 1%);
162
- }
163
-
164
- $i: $i + $step;
165
- }
166
- }
167
-
168
- // for primary classes
169
- @include generate-color-classes(
170
- "text",
171
- "primary",
172
- $primary-hue,
173
- $primary-saturation,
174
- 10,
175
- 90,
176
- 10
177
- );
178
-
179
- @include generate-color-classes(
180
- "bg",
181
- "primary",
182
- $primary-hue,
183
- $primary-saturation,
184
- 10,
185
- 90,
186
- 10
187
- );
188
-
189
- @include generate-color-classes(
190
- "text",
191
- "primary",
192
- $primary-hue,
193
- $primary-saturation,
194
- 5,
195
- 5,
196
- 1
197
- );
198
-
199
- @include generate-color-classes(
200
- "bg",
201
- "primary",
202
- $primary-hue,
203
- $primary-saturation,
204
- 5,
205
- 5,
206
- 1
207
- );
208
-
209
- @include generate-color-classes(
210
- "text",
211
- "primary",
212
- $primary-hue,
213
- $primary-saturation,
214
- 93,
215
- 97,
216
- 2
217
- );
218
-
219
- @include generate-color-classes(
220
- "bg",
221
- "primary",
222
- $primary-hue,
223
- $primary-saturation,
224
- 93,
225
- 97,
226
- 2
227
- );
228
-
229
- // for green classes
230
- @include generate-color-classes(
231
- "text",
232
- "green",
233
- $green-hue,
234
- $green-saturation,
235
- 10,
236
- 90,
237
- 10
238
- );
239
- @include generate-color-classes(
240
- "bg",
241
- "green",
242
- $green-hue,
243
- $green-saturation,
244
- 10,
245
- 90,
246
- 10
247
- );
248
-
249
- @include generate-color-classes(
250
- "text",
251
- "green",
252
- $green-hue,
253
- $green-saturation,
254
- 5,
255
- 5,
256
- 1
257
- );
258
-
259
- @include generate-color-classes(
260
- "bg",
261
- "green",
262
- $green-hue,
263
- $green-saturation,
264
- 5,
265
- 5,
266
- 1
267
- );
268
-
269
- @include generate-color-classes(
270
- "text",
271
- "green",
272
- $green-hue,
273
- $green-saturation,
274
- 93,
275
- 97,
276
- 2
277
- );
278
-
279
- @include generate-color-classes(
280
- "bg",
281
- "green",
282
- $green-hue,
283
- $green-saturation,
284
- 93,
285
- 97,
286
- 2
287
- );
288
-
289
- // for yellow classes
290
- @include generate-color-classes(
291
- "text",
292
- "yellow",
293
- $yellow-hue,
294
- $yellow-saturation,
295
- 10,
296
- 90,
297
- 10
298
- );
299
- @include generate-color-classes(
300
- "bg",
301
- "yellow",
302
- $yellow-hue,
303
- $yellow-saturation,
304
- 10,
305
- 90,
306
- 10
307
- );
308
-
309
- @include generate-color-classes(
310
- "text",
311
- "yellow",
312
- $yellow-hue,
313
- $yellow-saturation,
314
- 5,
315
- 5,
316
- 1
317
- );
318
-
319
- @include generate-color-classes(
320
- "bg",
321
- "yellow",
322
- $yellow-hue,
323
- $yellow-saturation,
324
- 5,
325
- 5,
326
- 1
327
- );
328
-
329
- @include generate-color-classes(
330
- "text",
331
- "yellow",
332
- $yellow-hue,
333
- $yellow-saturation,
334
- 93,
335
- 97,
336
- 2
337
- );
338
-
339
- @include generate-color-classes(
340
- "bg",
341
- "yellow",
342
- $yellow-hue,
343
- $yellow-saturation,
344
- 93,
345
- 97,
346
- 2
347
- );
348
-
349
- // for purple classes
350
- @include generate-color-classes(
351
- "text",
352
- "purple",
353
- $purple-hue,
354
- $purple-saturation,
355
- 10,
356
- 90,
357
- 10
358
- );
359
- @include generate-color-classes(
360
- "bg",
361
- "purple",
362
- $purple-hue,
363
- $purple-saturation,
364
- 10,
365
- 90,
366
- 10
367
- );
368
-
369
- @include generate-color-classes(
370
- "text",
371
- "purple",
372
- $purple-hue,
373
- $purple-saturation,
374
- 5,
375
- 5,
376
- 1
377
- );
378
-
379
- @include generate-color-classes(
380
- "bg",
381
- "purple",
382
- $purple-hue,
383
- $purple-saturation,
384
- 5,
385
- 5,
386
- 1
387
- );
388
-
389
- @include generate-color-classes(
390
- "text",
391
- "purple",
392
- $purple-hue,
393
- $purple-saturation,
394
- 93,
395
- 97,
396
- 2
397
- );
398
-
399
- @include generate-color-classes(
400
- "bg",
401
- "purple",
402
- $purple-hue,
403
- $purple-saturation,
404
- 93,
405
- 97,
406
- 2
407
- );
408
-
409
150
  // Box Shadow
410
151
  $ac-shadow-1: 0 1px 4px rgba(26, 80, 151, 0.16);
411
152
  $ac-shadow-2: 0px 8px 57px rgba(0, 0, 0, 0.16);
@@ -0,0 +1,253 @@
1
+ // classes
2
+ @mixin generate-color-classes($type, $color, $h, $s, $from, $to, $step) {
3
+ $i: $from;
4
+
5
+ @while $i <=$to {
6
+ .#{$type}-#{$color}-#{$i} {
7
+ #{if($type == "text", "color", "background-color")}: hsl($h, $s, $i * 1%);
8
+ }
9
+
10
+ $i: $i + $step;
11
+ }
12
+ }
13
+
14
+ // for primary classes
15
+ @include generate-color-classes(
16
+ "text",
17
+ "primary",
18
+ $primary-hue,
19
+ $primary-saturation,
20
+ 10,
21
+ 90,
22
+ 10
23
+ );
24
+
25
+ @include generate-color-classes(
26
+ "bg",
27
+ "primary",
28
+ $primary-hue,
29
+ $primary-saturation,
30
+ 10,
31
+ 90,
32
+ 10
33
+ );
34
+
35
+ @include generate-color-classes(
36
+ "text",
37
+ "primary",
38
+ $primary-hue,
39
+ $primary-saturation,
40
+ 5,
41
+ 5,
42
+ 1
43
+ );
44
+
45
+ @include generate-color-classes(
46
+ "bg",
47
+ "primary",
48
+ $primary-hue,
49
+ $primary-saturation,
50
+ 5,
51
+ 5,
52
+ 1
53
+ );
54
+
55
+ @include generate-color-classes(
56
+ "text",
57
+ "primary",
58
+ $primary-hue,
59
+ $primary-saturation,
60
+ 93,
61
+ 97,
62
+ 2
63
+ );
64
+
65
+ @include generate-color-classes(
66
+ "bg",
67
+ "primary",
68
+ $primary-hue,
69
+ $primary-saturation,
70
+ 93,
71
+ 97,
72
+ 2
73
+ );
74
+
75
+ // for green classes
76
+ @include generate-color-classes(
77
+ "text",
78
+ "green",
79
+ $green-hue,
80
+ $green-saturation,
81
+ 10,
82
+ 90,
83
+ 10
84
+ );
85
+ @include generate-color-classes(
86
+ "bg",
87
+ "green",
88
+ $green-hue,
89
+ $green-saturation,
90
+ 10,
91
+ 90,
92
+ 10
93
+ );
94
+
95
+ @include generate-color-classes(
96
+ "text",
97
+ "green",
98
+ $green-hue,
99
+ $green-saturation,
100
+ 5,
101
+ 5,
102
+ 1
103
+ );
104
+
105
+ @include generate-color-classes(
106
+ "bg",
107
+ "green",
108
+ $green-hue,
109
+ $green-saturation,
110
+ 5,
111
+ 5,
112
+ 1
113
+ );
114
+
115
+ @include generate-color-classes(
116
+ "text",
117
+ "green",
118
+ $green-hue,
119
+ $green-saturation,
120
+ 93,
121
+ 97,
122
+ 2
123
+ );
124
+
125
+ @include generate-color-classes(
126
+ "bg",
127
+ "green",
128
+ $green-hue,
129
+ $green-saturation,
130
+ 93,
131
+ 97,
132
+ 2
133
+ );
134
+
135
+ // for yellow classes
136
+ @include generate-color-classes(
137
+ "text",
138
+ "yellow",
139
+ $yellow-hue,
140
+ $yellow-saturation,
141
+ 10,
142
+ 90,
143
+ 10
144
+ );
145
+ @include generate-color-classes(
146
+ "bg",
147
+ "yellow",
148
+ $yellow-hue,
149
+ $yellow-saturation,
150
+ 10,
151
+ 90,
152
+ 10
153
+ );
154
+
155
+ @include generate-color-classes(
156
+ "text",
157
+ "yellow",
158
+ $yellow-hue,
159
+ $yellow-saturation,
160
+ 5,
161
+ 5,
162
+ 1
163
+ );
164
+
165
+ @include generate-color-classes(
166
+ "bg",
167
+ "yellow",
168
+ $yellow-hue,
169
+ $yellow-saturation,
170
+ 5,
171
+ 5,
172
+ 1
173
+ );
174
+
175
+ @include generate-color-classes(
176
+ "text",
177
+ "yellow",
178
+ $yellow-hue,
179
+ $yellow-saturation,
180
+ 93,
181
+ 97,
182
+ 2
183
+ );
184
+
185
+ @include generate-color-classes(
186
+ "bg",
187
+ "yellow",
188
+ $yellow-hue,
189
+ $yellow-saturation,
190
+ 93,
191
+ 97,
192
+ 2
193
+ );
194
+
195
+ // for purple classes
196
+ @include generate-color-classes(
197
+ "text",
198
+ "purple",
199
+ $purple-hue,
200
+ $purple-saturation,
201
+ 10,
202
+ 90,
203
+ 10
204
+ );
205
+ @include generate-color-classes(
206
+ "bg",
207
+ "purple",
208
+ $purple-hue,
209
+ $purple-saturation,
210
+ 10,
211
+ 90,
212
+ 10
213
+ );
214
+
215
+ @include generate-color-classes(
216
+ "text",
217
+ "purple",
218
+ $purple-hue,
219
+ $purple-saturation,
220
+ 5,
221
+ 5,
222
+ 1
223
+ );
224
+
225
+ @include generate-color-classes(
226
+ "bg",
227
+ "purple",
228
+ $purple-hue,
229
+ $purple-saturation,
230
+ 5,
231
+ 5,
232
+ 1
233
+ );
234
+
235
+ @include generate-color-classes(
236
+ "text",
237
+ "purple",
238
+ $purple-hue,
239
+ $purple-saturation,
240
+ 93,
241
+ 97,
242
+ 2
243
+ );
244
+
245
+ @include generate-color-classes(
246
+ "bg",
247
+ "purple",
248
+ $purple-hue,
249
+ $purple-saturation,
250
+ 93,
251
+ 97,
252
+ 2
253
+ );
@@ -0,0 +1,5 @@
1
+ :root {
2
+ --primary-hue: 208;
3
+ --primary-saturation: 77%;
4
+ --primary-light: 40%;
5
+ }
@@ -1,4 +1,11 @@
1
1
  .message {
2
+ &.is-primary {
3
+ background-color: $primary-95;
4
+ .message-body {
5
+ color: $ac-primary;
6
+ border-color: $ac-primary;
7
+ }
8
+ }
2
9
  .message-body {
3
10
  display: flex;
4
11
  padding: 16px;
@@ -42,5 +42,5 @@ withDefaults(defineProps<Props>(), {
42
42
  </template>
43
43
 
44
44
  <style lang="scss" scoped>
45
- @import "../../../vue-components/styles/components/alert/alert-message";
45
+ @import "../../../vue-components/styles/components/alert/_alert-message.scss";
46
46
  </style>
@@ -85,7 +85,8 @@ const setTheme = (val: string) => {
85
85
  emit("set:theme", val);
86
86
  };
87
87
 
88
- const pathName = window.location.origin;
88
+ const locationOrigin = window.location.origin;
89
+ const isDocsUi = window.location.pathname.startsWith("/docs/");
89
90
 
90
91
  watch(dropDownStatus, (n) => {
91
92
  if (n === "open") {
@@ -116,19 +117,11 @@ watch(dropDownStatus, (n) => {
116
117
  <template #navbar-content>
117
118
  <navbar-item-content class="navbar-dropdown-wrapper">
118
119
  <div v-if="user.username" class="user-profile-wrapper">
119
- <a
120
- :href="`${serverDomain}/${user.username}`"
121
- :title="user.username.toUpperCase()"
122
- data-testid="user-profile-link"
123
- class="line-break-anywhere is-ellipsis-1 has-text-weight-medium"
124
- >
120
+ <a :href="`${serverDomain}/${user.username}`" :title="user.username.toUpperCase()"
121
+ data-testid="user-profile-link" class="line-break-anywhere is-ellipsis-1 has-text-weight-medium">
125
122
  <div class="profile-area">
126
123
  <div class="profile-photo">
127
- <img
128
- :src="user.avatar_url"
129
- alt="User Photo"
130
- class="width-32 height-32"
131
- />
124
+ <img :src="user.avatar_url" alt="User Photo" class="width-32 height-32" />
132
125
  <button class="camera-icon"></button>
133
126
  </div>
134
127
  <div class="profile-info" style="width: calc(100% - 60px)">
@@ -136,142 +129,92 @@ watch(dropDownStatus, (n) => {
136
129
  <p>
137
130
  {{
138
131
  user.isPersonalAccount || user.is_admin
139
- ? "Personal Account"
140
- : "Organization"
132
+ ? "Personal Account"
133
+ : "Organization"
141
134
  }}
142
135
  </p>
143
136
  </div>
144
137
  </div>
145
138
  </a>
146
- <transition-group
147
- name="list"
148
- tag="ul"
149
- class="list-items ac-scrollbar py-2"
150
- >
151
- <li key="settings" v-if="serverDomain !== pathName">
152
- <a
153
- v-if="user.isPersonalAccount"
154
- data-testid="user-settings-link"
155
- :href="`${serverDomain}/user/settings/`"
156
- >
157
- <span class="icon"><HeroiconsCog6Tooth /></span>
139
+ <transition-group name="list" tag="ul" class="list-items ac-scrollbar py-2">
140
+ <li key="settings" v-if="serverDomain !== locationOrigin || isDocsUi">
141
+ <a v-if="user.isPersonalAccount" data-testid="user-settings-link" :href="`${serverDomain}/user/settings/`">
142
+ <span class="icon">
143
+ <HeroiconsCog6Tooth />
144
+ </span>
158
145
  <span>Settings</span>
159
146
  </a>
160
- <a
161
- v-else
162
- data-testid="user-settings-link"
163
- :href="`${serverDomain}/${user.username}/settings`"
164
- >
165
- <span class="icon"><HeroiconsCog6Tooth /></span
166
- ><span>Settings</span>
147
+ <a v-else data-testid="user-settings-link" :href="`${serverDomain}/${user.username}/settings`">
148
+ <span class="icon">
149
+ <HeroiconsCog6Tooth />
150
+ </span><span>Settings</span>
167
151
  </a>
168
152
  </li>
169
153
  <li key="settings-platform" v-else>
170
- <NuxtLink
171
- v-if="user.isPersonalAccount"
172
- data-testid="user-settings-link"
173
- :to="`/user/settings/`"
174
- >
175
- <span class="icon"><HeroiconsCog6Tooth /></span>
154
+ <NuxtLink v-if="user.isPersonalAccount" data-testid="user-settings-link" :to="`/user/settings/`">
155
+ <span class="icon">
156
+ <HeroiconsCog6Tooth />
157
+ </span>
176
158
  <span>Settings</span>
177
159
  </NuxtLink>
178
- <NuxtLink
179
- v-else
180
- data-testid="user-settings-link"
181
- :to="`/${user.username}/settings`"
182
- >
183
- <span class="icon"><HeroiconsCog6Tooth /></span
184
- ><span>Settings</span>
160
+ <NuxtLink v-else data-testid="user-settings-link" :to="`/${user.username}/settings`">
161
+ <span class="icon">
162
+ <HeroiconsCog6Tooth />
163
+ </span><span>Settings</span>
185
164
  </NuxtLink>
186
165
  </li>
187
166
 
188
- <li
189
- v-if="showAccountSwitcher"
190
- :class="`is-${dropDownStatus}`"
191
- key="switcher"
192
- >
193
- <a
194
- class="ac-dropdown-button is-fullwidth is-flex is-justify-content-space-between is-align-items-center"
195
- @click="toggleList()"
196
- >
167
+ <li v-if="showAccountSwitcher" :class="`is-${dropDownStatus}`" key="switcher">
168
+ <a class="ac-dropdown-button is-fullwidth is-flex is-justify-content-space-between is-align-items-center"
169
+ @click="toggleList()">
197
170
  <div class="is-flex gap-8">
198
- <span class="icon"><HeroiconsUserGroup /></span
199
- ><span>Switch Account</span>
171
+ <span class="icon">
172
+ <HeroiconsUserGroup />
173
+ </span><span>Switch Account</span>
200
174
  </div>
201
- <span
202
- ><i
203
- :class="`fa fa-angle-${
204
- dropDownStatus === 'open' ? 'up' : 'down'
205
- }`"
206
- ></i
207
- ></span>
175
+ <span><i :class="`fa fa-angle-${dropDownStatus === 'open' ? 'up' : 'down'
176
+ }`"></i></span>
208
177
  </a>
209
- <transition-group
210
- name="list"
211
- tag="ul"
212
- class="ac-vscrollbar"
213
- ref="dropdownItems"
214
- :style="{ maxHeight: dropDownSectionHeight }"
215
- >
216
- <li
217
- v-for="(org, idx) in formattedOrganizations"
218
- :key="org.username"
219
- >
220
- <a
221
- class="is-flex is-align-items-center"
222
- @click="onOrganizationClick(org.username)"
223
- >
224
- <div class="width-30 height-30 image">
225
- <img
226
- :src="org.avatar_url"
227
- class="ac-user-profile is-rounded"
228
- alt="icon"
229
- />
230
- </div>
231
- <div
232
- class="is-flex is-align-items-center is-justify-content-space-between is-fullwidth ml-10"
233
- >
234
- <div class="org-info">
235
- <strong
236
- :title="org.username"
237
- class="line-break-anywhere is-ellipsis-1"
238
- >{{ org.username }}</strong
239
- >
240
- <p>
241
- {{
242
- org.isPersonalAccount
243
- ? "Personal Account"
244
- : "Organization"
245
- }}
246
- </p>
247
- </div>
248
- <span
249
- v-if="idx === 0"
250
- class="material-icons font-size-18 ml-10 is-pulled-right"
251
- >
252
- <HeroiconsCheck />
253
- </span>
254
- </div>
255
- </a>
256
- </li>
257
- </transition-group>
258
- </li>
259
- <li v-if="isLoggedinUserAdmin || user.is_admin" key="site-admin">
260
- <a data-testid="site-admin-link" :href="`${accountsDomain}/admin`"
261
- ><span class="icon"><HeroiconsWrenchScrewdriver /></span
262
- ><span>Site Administration</span></a
263
- >
264
- </li>
265
- <li key="signout" @click="$emit('on-logout')">
266
- <a
267
- data-testid="user-logout-link"
268
- :href="`${accountsDomain}/user/logout`"
269
- >
270
- <span class="icon"><HeroiconsPower /></span>
271
- <span>Sign out</span>
178
+ <transition-group name="list" tag="ul" class="ac-vscrollbar" ref="dropdownItems"
179
+ :style="{ maxHeight: dropDownSectionHeight }">
180
+ <li v-for="(org, idx) in formattedOrganizations" :key="org.username">
181
+ <a class="is-flex is-align-items-center" @click="onOrganizationClick(org.username)">
182
+ <div class="width-30 height-30 image">
183
+ <img :src="org.avatar_url" class="ac-user-profile is-rounded" alt="icon" />
184
+ </div>
185
+ <div class="is-flex is-align-items-center is-justify-content-space-between is-fullwidth ml-10">
186
+ <div class="org-info">
187
+ <strong :title="org.username" class="line-break-anywhere is-ellipsis-1">{{ org.username }}</strong>
188
+ <p>
189
+ {{
190
+ org.isPersonalAccount
191
+ ? "Personal Account"
192
+ : "Organization"
193
+ }}
194
+ </p>
195
+ </div>
196
+ <span v-if="idx === 0" class="material-icons font-size-18 ml-10 is-pulled-right">
197
+ <HeroiconsCheck />
198
+ </span>
199
+ </div>
272
200
  </a>
273
201
  </li>
274
- <!-- <li key="theme" v-if="showThemeMode">
202
+ </transition-group>
203
+ </li>
204
+ <li v-if="isLoggedinUserAdmin || user.is_admin" key="site-admin">
205
+ <a data-testid="site-admin-link" :href="`${accountsDomain}/admin`"><span class="icon">
206
+ <HeroiconsWrenchScrewdriver />
207
+ </span><span>Site Administration</span></a>
208
+ </li>
209
+ <li key="signout" @click="$emit('on-logout')">
210
+ <a data-testid="user-logout-link" :href="`${accountsDomain}/user/logout`">
211
+ <span class="icon">
212
+ <HeroiconsPower />
213
+ </span>
214
+ <span>Sign out</span>
215
+ </a>
216
+ </li>
217
+ <!-- <li key="theme" v-if="showThemeMode">
275
218
  <theme-mode @set:theme="setTheme" />
276
219
  </li> -->
277
220
  </transition-group>