@appscode/design-system 1.1.0 → 2.0.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.
Files changed (215) hide show
  1. package/base/_video-player.scss +65 -0
  2. package/base/utilities/_all.scss +7 -5
  3. package/base/utilities/_colors.scss +377 -0
  4. package/base/utilities/_customize-bulma.scss +23 -27
  5. package/base/utilities/_extended.scss +39 -0
  6. package/base/utilities/{_default.scss → _global.scss} +192 -333
  7. package/base/utilities/_layouts.scss +19 -0
  8. package/base/utilities/_mixin.scss +11 -11
  9. package/base/utilities/_spacing.scss +96 -0
  10. package/base/utilities/_typography.scss +56 -24
  11. package/components/_ac-alert-box.scss +205 -263
  12. package/components/_ac-calendar.scss +4 -4
  13. package/components/_ac-code-highlight.scss +13 -16
  14. package/components/_ac-content-layout.scss +165 -165
  15. package/components/_ac-drag.scss +13 -13
  16. package/components/_ac-modal.scss +212 -212
  17. package/components/_ac-options.scss +122 -123
  18. package/components/_ac-select-box.scss +10 -10
  19. package/components/_ac-table.scss +503 -502
  20. package/components/_ac-tabs.scss +65 -61
  21. package/components/_ac-tags.scss +116 -116
  22. package/components/_accordion.scss +117 -0
  23. package/components/_add-card.scss +3 -3
  24. package/components/_all.scss +35 -28
  25. package/components/_app-drawer.scss +0 -134
  26. package/components/_breadcumb.scss +0 -71
  27. package/components/_buttons.scss +779 -779
  28. package/components/_card-body-wrapper.scss +5 -5
  29. package/components/_dashboard-header.scss +0 -115
  30. package/components/_direct-deploy.scss +8 -8
  31. package/components/_getkeeper.scss +110 -0
  32. package/components/_go-to-top.scss +1 -1
  33. package/components/_graph.scss +10 -10
  34. package/components/_image-upload.scss +9 -9
  35. package/components/_input-card.scss +232 -0
  36. package/components/_input.scss +573 -0
  37. package/components/_left-sidebar-menu.scss +452 -587
  38. package/components/_monaco-editor.scss +2 -2
  39. package/components/{_ac-multi-select.scss → _multi-select.scss} +89 -251
  40. package/components/_navbar.scss +786 -752
  41. package/components/_nested-list.scss +3 -3
  42. package/components/_overview-info.scss +10 -10
  43. package/components/_overview-page.scss +4 -4
  44. package/components/_pagination.scss +106 -124
  45. package/components/_payment-card.scss +21 -21
  46. package/components/_preloader.scss +1 -1
  47. package/components/_preview-modal.scss +18 -18
  48. package/components/_pricing-table.scss +14 -14
  49. package/components/_progress-bar.scss +73 -86
  50. package/components/_subscription-card.scss +22 -24
  51. package/components/_table-of-content.scss +8 -8
  52. package/components/{_ac-terminal.scss → _terminal.scss} +114 -81
  53. package/components/_tfa.scss +9 -9
  54. package/components/_transitions.scss +35 -0
  55. package/components/_widget-menu.scss +252 -257
  56. package/components/_wizard.scss +518 -793
  57. package/components/ac-toaster/_ac-toasted.scss +11 -16
  58. package/components/bbum/_activities-header.scss +1 -1
  59. package/components/bbum/_card-team.scss +12 -12
  60. package/components/bbum/_information-center.scss +21 -23
  61. package/components/bbum/_left-sidebar.scss +8 -8
  62. package/components/bbum/_mobile-desktop.scss +16 -21
  63. package/components/bbum/_post.scss +5 -5
  64. package/components/bbum/_sign-up-notification.scss +10 -10
  65. package/components/bbum/_single-post-preview.scss +29 -29
  66. package/components/bbum/_user-profile.scss +10 -10
  67. package/components/ui-builder/_ui-builder.scss +221 -31
  68. package/components/ui-builder/_vue-open-api.scss +565 -7
  69. package/icons/close-icon.svg +3 -0
  70. package/layouts/_code-preview.scss +17 -18
  71. package/main.scss +26 -10
  72. package/package.json +1 -1
  73. package/plugins/theme.js +11 -9
  74. package/plugins/vue-toaster.js +1 -1
  75. package/vue-components/images/icons/cluster-icon.svg +10 -0
  76. package/vue-components/images/icons/org-icon.svg +10 -0
  77. package/vue-components/plugins/time-convert.js +49 -0
  78. package/vue-components/types/cluster.ts +6 -0
  79. package/vue-components/types/importFlow.ts +16 -0
  80. package/vue-components/types/notification.ts +6 -0
  81. package/vue-components/types/previewYaml.ts +8 -0
  82. package/vue-components/types/table.ts +55 -0
  83. package/vue-components/types/theme.ts +10 -0
  84. package/vue-components/types/user.ts +22 -0
  85. package/vue-components/v2/banner/Banner.vue +1 -1
  86. package/vue-components/v2/button/Buttons.vue +1 -1
  87. package/vue-components/v2/card/Card.vue +1 -1
  88. package/vue-components/v2/card/OverviewCards.vue +17 -2
  89. package/vue-components/v2/content/ContentTable.vue +14 -9
  90. package/vue-components/v2/editor/FilteredFileEditor.vue +2 -2
  91. package/vue-components/v2/editor/ResourceKeyValueEditor.vue +21 -21
  92. package/vue-components/v2/icons/Ellipsis.vue +2 -1
  93. package/vue-components/v2/modal/Modal.vue +2 -6
  94. package/vue-components/v2/navbar/Appdrawer.vue +37 -12
  95. package/vue-components/v2/navbar/Navbar.vue +3 -3
  96. package/vue-components/v2/navbar/NavbarItem.vue +3 -1
  97. package/vue-components/v2/navbar/NavbarItemContent.vue +1 -1
  98. package/vue-components/v2/navbar/User.vue +5 -22
  99. package/vue-components/v2/pagination/Pagination.vue +66 -0
  100. package/vue-components/v2/sidebar/SidebarItem.vue +10 -7
  101. package/{components/_ac-accordion.scss → vue-components/v3/accordion/Accordion.vue} +40 -6
  102. package/vue-components/v3/alert/Alert.vue +238 -0
  103. package/vue-components/v3/alert/Toast.vue +79 -0
  104. package/vue-components/v3/banner/Banner.vue +10 -0
  105. package/vue-components/v3/breadcrumbs/Breadcrumb.vue +166 -0
  106. package/vue-components/v3/button/Button.vue +110 -57
  107. package/vue-components/v3/button/Buttons.vue +22 -0
  108. package/vue-components/v3/button/DownloadBtn.vue +31 -0
  109. package/vue-components/v3/cards/Card.vue +32 -0
  110. package/vue-components/v3/cards/CardContent.vue +7 -0
  111. package/vue-components/v3/cards/CardHeader.vue +14 -0
  112. package/vue-components/v3/cards/Cards.vue +7 -0
  113. package/vue-components/v3/cards/Cluster.vue +159 -0
  114. package/vue-components/v3/cards/Counter.vue +39 -0
  115. package/vue-components/v3/cards/FeatureCard.vue +67 -0
  116. package/vue-components/v3/cards/FeatureCards.vue +6 -0
  117. package/vue-components/v3/cards/InfoCard.vue +242 -0
  118. package/vue-components/v3/cards/Monitoring.vue +90 -0
  119. package/vue-components/v3/cards/OrgClusterCard.vue +86 -0
  120. package/vue-components/v3/cards/OverviewCard.vue +28 -0
  121. package/vue-components/v3/cards/OverviewCards.vue +39 -0
  122. package/vue-components/v3/cards/Payment.vue +62 -0
  123. package/vue-components/v3/cards/Vendor.vue +89 -0
  124. package/vue-components/v3/content/ContentHeader.vue +39 -30
  125. package/vue-components/v3/content/ContentLayout.vue +20 -0
  126. package/vue-components/v3/content/ContentTable.vue +44 -58
  127. package/vue-components/v3/dropdown/DropdownAction.vue +95 -0
  128. package/vue-components/v3/dropdown/DropdownDivider.vue +2 -0
  129. package/vue-components/v3/dropdown/DropdownItem.vue +2 -0
  130. package/vue-components/v3/dropdown/DropdownMenu.vue +85 -91
  131. package/vue-components/v3/editor/Editor.vue +117 -115
  132. package/vue-components/v3/editor/FilteredFileEditor.vue +325 -128
  133. package/vue-components/v3/editor/ResourceKeyValueEditor.vue +73 -94
  134. package/vue-components/v3/footer/FooterArea.vue +40 -0
  135. package/vue-components/v3/footer/FooterItem.vue +32 -0
  136. package/vue-components/v3/footer/FooterItems.vue +15 -0
  137. package/vue-components/v3/footer/Info.vue +25 -0
  138. package/vue-components/v3/footer/Status.vue +43 -0
  139. package/vue-components/v3/footer/Usage.vue +34 -0
  140. package/vue-components/v3/form/Form.vue +24 -36
  141. package/vue-components/v3/form/FormFooter.vue +24 -0
  142. package/vue-components/v3/form/FormFooterControl.vue +7 -0
  143. package/vue-components/v3/form/FormFooterControls.vue +7 -0
  144. package/vue-components/v3/form-fields/AcSingleInput.vue +21 -0
  145. package/vue-components/v3/form-fields/FileUpload.vue +89 -0
  146. package/vue-components/v3/form-fields/Input.vue +19 -15
  147. package/vue-components/v3/header/Header.vue +120 -26
  148. package/vue-components/v3/header/HeaderItem.vue +18 -0
  149. package/vue-components/v3/header/HeaderItems.vue +4 -0
  150. package/vue-components/v3/icons/Ellipsis.vue +2 -0
  151. package/vue-components/v3/loaders/ClusterSwitcherLoader.vue +13 -0
  152. package/vue-components/v3/loaders/InfoCardLoader.vue +19 -0
  153. package/vue-components/v3/loaders/ResourceLoader.vue +4 -12
  154. package/vue-components/v3/loaders/SidebarLoader.vue +4 -12
  155. package/vue-components/v3/loaders/SingleInfoCardLoader.vue +24 -0
  156. package/vue-components/v3/modal/Modal.vue +294 -95
  157. package/vue-components/v3/modals/DeleteConfirmationModal.vue +37 -50
  158. package/vue-components/v3/modals/JsonShowModal.vue +63 -68
  159. package/vue-components/v3/navbar/Appdrawer.vue +198 -51
  160. package/vue-components/v3/navbar/Navbar.vue +139 -0
  161. package/vue-components/v3/navbar/NavbarItem.vue +103 -0
  162. package/vue-components/v3/navbar/NavbarItemContent.vue +282 -0
  163. package/vue-components/v3/navbar/Notification.vue +207 -0
  164. package/vue-components/v3/navbar/ThemeMode.vue +128 -112
  165. package/vue-components/v3/navbar/User.vue +394 -267
  166. package/vue-components/v3/notification/AlertBox.vue +266 -39
  167. package/vue-components/v3/notification/Notification.vue +50 -44
  168. package/vue-components/v3/notification/NotificationItem.vue +51 -19
  169. package/vue-components/v3/option-dots/Options.vue +197 -0
  170. package/vue-components/v3/pagination/Pagination.vue +216 -102
  171. package/vue-components/v3/preloader/Preloader.vue +23 -0
  172. package/vue-components/v3/searchbars/SearchBar.vue +50 -34
  173. package/vue-components/v3/sidebar/AccentColorPicker.vue +97 -0
  174. package/vue-components/v3/sidebar/ClusterSwitcher.vue +71 -86
  175. package/vue-components/v3/sidebar/Sidebar.vue +239 -0
  176. package/vue-components/v3/sidebar/SidebarBody.vue +14 -0
  177. package/vue-components/v3/sidebar/SidebarFooter.vue +89 -0
  178. package/vue-components/v3/sidebar/SidebarHeader.vue +131 -0
  179. package/vue-components/v3/sidebar/SidebarItem.vue +62 -0
  180. package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +101 -104
  181. package/vue-components/v3/sidebar/SidebarMenuList.vue +9 -0
  182. package/vue-components/v3/sidebar/Steps.vue +152 -0
  183. package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabs.vue +204 -0
  184. package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabsLayout.vue +44 -0
  185. package/vue-components/v3/sidebar/sidebar-tabs/TabsContent.vue +99 -0
  186. package/vue-components/v3/tab/TabItem.vue +10 -12
  187. package/vue-components/v3/tab/Tabs.vue +36 -0
  188. package/vue-components/v3/tab/TabsBody.vue +7 -0
  189. package/vue-components/v3/table/EmptyTableInfo.vue +8 -0
  190. package/vue-components/v3/table/FakeTableCell.vue +22 -31
  191. package/vue-components/v3/table/InfoTable.vue +89 -61
  192. package/vue-components/v3/table/MultiInfoTable.vue +72 -95
  193. package/vue-components/v3/table/Table.vue +596 -157
  194. package/vue-components/v3/table/TableCell.vue +13 -24
  195. package/vue-components/v3/table/TableContainer.vue +50 -28
  196. package/vue-components/v3/table/TableRow.vue +65 -87
  197. package/vue-components/v3/table/table-cell/ArrayCell.vue +94 -103
  198. package/vue-components/v3/table/table-cell/CellValue.vue +74 -106
  199. package/vue-components/v3/table/table-cell/GenericCell.vue +43 -42
  200. package/vue-components/v3/table/table-cell/ObjectCell.vue +91 -101
  201. package/vue-components/v3/table/table-cell/ValueWithModal.vue +22 -31
  202. package/vue-components/v3/tabs/EditorTabs.vue +18 -24
  203. package/vue-components/v3/tag/Tag.vue +16 -12
  204. package/vue-components/v3/tag/Tags.vue +7 -0
  205. package/base/utilities/_derived-variables.scss +0 -25
  206. package/base/utilities/_initial-variables.scss +0 -215
  207. package/base/utilities/dark-theme.scss +0 -26
  208. package/components/_ac-card.scss +0 -597
  209. package/components/_ac-input.scss +0 -876
  210. package/mixins/stickyContent.js +0 -141
  211. package/plugins/caching.ts +0 -243
  212. package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +0 -92
  213. package/vue-components/v3/modals/LongRunningTasksModal.vue +0 -400
  214. package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +0 -148
  215. /package/components/{_ac-report.scss → _report.scss} +0 -0
@@ -1,283 +1,250 @@
1
+ <script setup lang="ts">
2
+ import { defineAsyncComponent, ref, watch, computed, nextTick } from "vue";
3
+ import HeroiconsCog6Tooth from "~icons/heroicons/cog-6-tooth";
4
+ import HeroiconsWrenchScrewdriver from "~icons/heroicons/wrench-screwdriver";
5
+ import HeroiconsUserGroup from "~icons/heroicons/user-group";
6
+ import HeroiconsChartPie from "~icons/heroicons/chart-pie";
7
+ import HeroiconsPower from "~icons/heroicons/power";
8
+ import HeroiconsCheck from "~icons/heroicons/check";
9
+
10
+ import type { User } from "../../types/user";
11
+
12
+ interface FormatedOrgs extends User {
13
+ isPersonalAccount?: boolean;
14
+ }
15
+
16
+ interface Props {
17
+ user: User;
18
+ serverDomain?: string;
19
+ accountsDomain?: string;
20
+ showAccountSwitcher?: boolean;
21
+ organizations?: Array<FormatedOrgs>;
22
+ showThemeMode?: boolean;
23
+ isPlatformDomain?: boolean;
24
+ }
25
+
26
+ const props = withDefaults(defineProps<Props>(), {
27
+ serverDomain: "",
28
+ accountsDomain: "",
29
+ showAccountSwitcher: false,
30
+ organizations: () => [],
31
+ showThemeMode: false,
32
+ isPlatformDomain: false,
33
+ });
34
+
35
+ const emit = defineEmits(["set:theme", "on-logout", "activeorg$set"]);
36
+
37
+ const NavbarItem = defineAsyncComponent(
38
+ () => import("../navbar/NavbarItem.vue")
39
+ );
40
+ const NavbarItemContent = defineAsyncComponent(
41
+ () => import("../navbar/NavbarItemContent.vue")
42
+ );
43
+
44
+ const ThemeMode = defineAsyncComponent(() => import("../navbar/ThemeMode.vue"));
45
+
46
+ const dropDownStatus = ref("close");
47
+ const dropDownSectionHeight = ref<string | null>(null);
48
+ const dropdownItems = ref(null as { $el: HTMLElement } | null);
49
+
50
+ const formattedOrganizations = computed(() => {
51
+ let activeUser: User | undefined = undefined;
52
+ const filteredList = props.organizations.filter((item) => {
53
+ if (item.username === props.user.username) {
54
+ activeUser = item;
55
+ } else {
56
+ return true;
57
+ }
58
+ return false;
59
+ });
60
+
61
+ if (activeUser) filteredList.unshift(activeUser);
62
+
63
+ return filteredList || [];
64
+ });
65
+
66
+ const toggleList = () => {
67
+ dropDownStatus.value = dropDownStatus.value === "open" ? "close" : "open";
68
+ nextTick(() => {
69
+ dropdownItems.value?.$el.scrollTo(0, 0);
70
+ });
71
+ };
72
+
73
+ const onOrganizationClick = (orgName: string) => {
74
+ dropdownItems.value?.$el.scrollTo(0, 0);
75
+ emit("activeorg$set", orgName);
76
+ };
77
+
78
+ const onMouseLeave = () => {
79
+ dropDownStatus.value = "close";
80
+ };
81
+
82
+ const setTheme = (val: string) => {
83
+ emit("set:theme", val);
84
+ };
85
+
86
+ watch(dropDownStatus, (n) => {
87
+ if (n === "open") {
88
+ nextTick(() => {
89
+ const dropDownUl = dropdownItems.value;
90
+ if (dropDownUl)
91
+ dropDownSectionHeight.value = `${dropDownUl.$el.scrollHeight}px`;
92
+ });
93
+ } else {
94
+ dropDownSectionHeight.value = null;
95
+ }
96
+ });
97
+ </script>
98
+
1
99
  <template>
2
- <navbar-item>
3
- <button class="button ac-nav-button ac-profile-button">
4
- {{ user.full_name || user.username }}
5
- <i class="fa fa-angle-down" aria-hidden="true"></i>
6
- <div class="ac-user-profile">
100
+ <navbar-item :modifierClasses="'ac-profile-button'">
101
+ <template #navbar-item>
102
+ <div class="ac-user-profile mr-8">
7
103
  <img :src="user.avatar_url" alt="User Photo" />
8
104
  </div>
9
- </button>
10
- <navbar-item-content class="navbar-dropdown-wrapper">
11
- <div
12
- v-if="user.username"
13
- class="user-profile-wrapper"
14
- @mouseleave="onMouseLeave()"
15
- >
16
- <div class="profile-area">
17
- <div class="profile-photo">
18
- <img
19
- :src="user.avatar_url"
20
- alt="User Photo"
21
- class="width-50 height-50"
22
- />
23
- <button class="camera-icon"></button>
24
- </div>
25
- <div class="profile-info" style="width: calc(100% - 60px)">
26
- <a
27
- :href="`${serverDomain}/${user.username}`"
28
- :title="user.username.toUpperCase()"
29
- data-testid="user-profile-link"
30
- class="line-break-anywhere is-ellipsis-1"
31
- >{{ user.username.toUpperCase() }}</a
32
- >
33
- <a :href="`mailto:${user.email}`"> {{ user.email }}</a>
105
+ {{ user.full_name || user.username }}
106
+ <i class="fa fa-angle-down" aria-hidden="true"></i>
107
+ </template>
108
+ <!-- <button class="button ac-nav-button ac-profile-button">
109
+
110
+ </button> -->
111
+
112
+ <template #navbar-content>
113
+ <navbar-item-content class="navbar-dropdown-wrapper">
114
+ <div
115
+ v-if="user.username"
116
+ class="user-profile-wrapper"
117
+ @mouseleave="onMouseLeave()"
118
+ >
119
+ <div class="profile-area">
120
+ <div class="profile-photo">
121
+ <img
122
+ :src="user.avatar_url"
123
+ alt="User Photo"
124
+ class="width-32 height-32"
125
+ />
126
+ <button class="camera-icon"></button>
127
+ </div>
128
+ <div class="profile-info" style="width: calc(100% - 60px)">
129
+ <a
130
+ :href="`${serverDomain}/${user.username}`"
131
+ :title="user.username.toUpperCase()"
132
+ data-testid="user-profile-link"
133
+ class="line-break-anywhere is-ellipsis-1 has-text-weight-medium"
134
+ >{{ user.username }}</a
135
+ >
136
+ <a :href="`mailto:${user.email}`"> {{ user.email }}</a>
137
+ </div>
34
138
  </div>
35
- </div>
36
- <transition-group name="list" tag="ul">
37
- <li key="settings">
38
- <a
39
- data-testid="user-settings-link"
40
- :href="`${serverDomain}/user/settings/`"
41
- >Settings</a
42
- >
43
- </li>
44
- <li v-if="user.is_admin" key="site-admin">
45
- <a data-testid="site-admin-link" :href="`${accountsDomain}/admin`"
46
- >Site Administration</a
47
- >
48
- </li>
49
- <li
50
- v-if="showAccountSwitcher"
51
- :class="`is-${dropDownStatus}`"
52
- key="switcher"
139
+ <transition-group
140
+ name="list"
141
+ tag="ul"
142
+ class="list-items py-2 ac-scrollbar px-0"
53
143
  >
54
- <a
55
- class="
56
- ac-dropdown-button
57
- is-fullwidth
58
- is-flex
59
- is-justify-content-space-between
60
- is-align-items-center
61
- "
62
- @click="toggleList()"
63
- >
64
- <span>Switch Account</span>
65
- <span
66
- ><i
67
- :class="`fa fa-angle-${
68
- dropDownStatus === 'open' ? 'up' : 'down'
69
- }`"
70
- ></i
71
- ></span>
72
- </a>
73
- <transition-group
74
- name="list"
75
- tag="ul"
76
- class="ac-vscrollbar"
77
- ref="dropdownItems"
78
- :style="{ maxHeight: dropDownSectionHeight }"
144
+ <li key="settings">
145
+ <a
146
+ data-testid="user-settings-link"
147
+ :href="`${serverDomain}/user/settings/`"
148
+ ><span class="icon"><HeroiconsCog6Tooth /></span
149
+ ><span>Settings</span></a
150
+ >
151
+ </li>
152
+ <li v-if="user.is_admin" key="site-admin">
153
+ <a data-testid="site-admin-link" :href="`${accountsDomain}/admin`"
154
+ ><span class="icon"><HeroiconsWrenchScrewdriver /></span
155
+ ><span>Site Administration</span></a
156
+ >
157
+ </li>
158
+ <li
159
+ v-if="showAccountSwitcher"
160
+ :class="`is-${dropDownStatus}`"
161
+ key="switcher"
79
162
  >
80
- <li
81
- v-for="(org, idx) in formattedOrganizations"
82
- :key="org.username"
163
+ <a
164
+ class="ac-dropdown-button is-fullwidth is-flex is-justify-content-space-between is-align-items-center"
165
+ @click="toggleList()"
83
166
  >
84
- <a
85
- class="is-flex is-align-items-center"
86
- @click="onOrganizationClick(org.username)"
167
+ <div class="is-flex gap-8">
168
+ <span class="icon"><HeroiconsUserGroup /></span
169
+ ><span>Switch Account</span>
170
+ </div>
171
+ <span
172
+ ><i
173
+ :class="`fa fa-angle-${
174
+ dropDownStatus === 'open' ? 'up' : 'down'
175
+ }`"
176
+ ></i
177
+ ></span>
178
+ </a>
179
+ <transition-group
180
+ name="list"
181
+ tag="ul"
182
+ class="ac-vscrollbar"
183
+ ref="dropdownItems"
184
+ :style="{ maxHeight: dropDownSectionHeight }"
185
+ >
186
+ <li
187
+ v-for="(org, idx) in formattedOrganizations"
188
+ :key="org.username"
87
189
  >
88
- <div class="width-30 height-30 image">
89
- <img
90
- :src="org.avatar_url"
91
- class="ac-user-profile is-rounded"
92
- alt="icon"
93
- />
94
- </div>
95
- <div
96
- class="
97
- is-flex
98
- is-align-items-center
99
- is-justify-content-space-between
100
- is-fullwidth
101
- ml-10
102
- "
190
+ <a
191
+ class="is-flex is-align-items-center"
192
+ @click="onOrganizationClick(org.username)"
103
193
  >
104
- <div class="org-info">
105
- <strong
106
- :title="org.username"
107
- class="line-break-anywhere is-ellipsis-1"
108
- >{{ org.username }}</strong
109
- >
110
- <p>
111
- {{
112
- org.isPersonalAccount
113
- ? "Personal Account"
114
- : "Organization"
115
- }}
116
- </p>
194
+ <div class="width-30 height-30 image">
195
+ <img
196
+ :src="org.avatar_url"
197
+ class="ac-user-profile is-rounded"
198
+ alt="icon"
199
+ />
117
200
  </div>
118
- <span
119
- v-if="idx === 0"
120
- class="
121
- material-icons-outlined
122
- font-size-18
123
- ml-10
124
- is-pulled-right
125
- "
201
+ <div
202
+ class="is-flex is-align-items-center is-justify-content-space-between is-fullwidth ml-10"
126
203
  >
127
- check
128
- </span>
129
- </div>
130
- </a>
131
- </li>
132
- </transition-group>
133
- </li>
134
- <li key="dashboard">
135
- <nuxt-link
136
- v-if="isPlatformDomain"
137
- to="/dashboard"
138
- data-testid="user-dashboard-link"
139
- >
140
- Dashboard
141
- </nuxt-link>
142
- <a
143
- v-else
144
- :href="`${serverDomain}/dashboard`"
145
- data-testid="user-dashboard-link"
146
- >
147
- Dashboard
148
- </a>
149
- </li>
150
- <li key="signout" @click="$emit('on-logout')">
151
- <a
152
- data-testid="user-logout-link"
153
- :href="`${accountsDomain}/user/logout`"
154
- >
155
- Sign out
156
- </a>
157
- </li>
158
- <li key="theme" v-if="showThemeMode">
159
- <theme-mode @set:theme="setTheme" />
160
- </li>
161
- </transition-group>
162
- </div>
163
- </navbar-item-content>
204
+ <div class="org-info">
205
+ <strong
206
+ :title="org.username"
207
+ class="line-break-anywhere is-ellipsis-1"
208
+ >{{ org.username }}</strong
209
+ >
210
+ <p>
211
+ {{
212
+ org.isPersonalAccount
213
+ ? "Personal Account"
214
+ : "Organization"
215
+ }}
216
+ </p>
217
+ </div>
218
+ <span
219
+ v-if="idx === 0"
220
+ class="material-icons font-size-18 ml-10 is-pulled-right"
221
+ >
222
+ <HeroiconsCheck />
223
+ </span>
224
+ </div>
225
+ </a>
226
+ </li>
227
+ </transition-group>
228
+ </li>
229
+ <li key="signout" @click="$emit('on-logout')">
230
+ <a
231
+ data-testid="user-logout-link"
232
+ :href="`${accountsDomain}/user/logout`"
233
+ >
234
+ <span class="icon"><HeroiconsPower /></span>
235
+ <span>Sign out</span>
236
+ </a>
237
+ </li>
238
+ <!-- <li key="theme" v-if="showThemeMode">
239
+ <theme-mode @set:theme="setTheme" />
240
+ </li> -->
241
+ </transition-group>
242
+ </div>
243
+ </navbar-item-content>
244
+ </template>
164
245
  </navbar-item>
165
246
  </template>
166
247
 
167
- <script>
168
- import { defineComponent, defineAsyncComponent } from "vue";
169
-
170
- export default defineComponent({
171
- props: {
172
- // active user info
173
- user: {
174
- type: Object,
175
- default: () => ({}),
176
- },
177
- serverDomain: {
178
- type: String,
179
- default: "",
180
- },
181
- accountsDomain: {
182
- type: String,
183
- default: "",
184
- },
185
- showAccountSwitcher: {
186
- type: Boolean,
187
- default: false,
188
- },
189
- // all available organization list including personal account
190
- organizations: {
191
- type: Array,
192
- default: () => [],
193
- },
194
- showThemeMode: {
195
- type: Boolean,
196
- default: false,
197
- },
198
- isPlatformDomain: {
199
- type: Boolean,
200
- default: false,
201
- },
202
- },
203
- emits: ["set:theme", "on-logout"],
204
-
205
- components: {
206
- NavbarItem: defineAsyncComponent(() =>
207
- import("../../v2/navbar/NavbarItem.vue").then((module) => module.default)
208
- ),
209
- NavbarItemContent: defineAsyncComponent(() =>
210
- import("../../v2/navbar/NavbarItemContent.vue").then(
211
- (module) => module.default
212
- )
213
- ),
214
- ThemeMode: defineAsyncComponent(() =>
215
- import("../../v3/navbar/ThemeMode.vue").then((module) => module.default)
216
- ),
217
- },
218
-
219
- computed: {
220
- formattedOrganizations() {
221
- let activeUser;
222
- const filteredList = this.organizations.filter((item) => {
223
- if (item.username === this.user.username) {
224
- activeUser = item;
225
- } else {
226
- return true;
227
- }
228
- return false;
229
- });
230
-
231
- filteredList.unshift(activeUser);
232
-
233
- return filteredList || [];
234
- },
235
- },
236
-
237
- data() {
238
- return {
239
- dropDownStatus: "close",
240
- dropDownSectionHeight: null,
241
- };
242
- },
243
-
244
- methods: {
245
- toggleList() {
246
- this.dropDownStatus = this.dropDownStatus === "open" ? "close" : "open";
247
- this.$nextTick(() => {
248
- this.$refs["dropdownItems"].$el.scrollTo(0, 0);
249
- });
250
- },
251
- onOrganizationClick(orgName) {
252
- this.$refs["dropdownItems"].$el.scrollTo(0, 0);
253
- this.$emit("activeorg$set", orgName);
254
- },
255
- onMouseLeave() {
256
- this.dropDownStatus = "close";
257
- },
258
- setTheme(val) {
259
- this.$emit("set:theme", val);
260
- },
261
- },
262
-
263
- watch: {
264
- dropDownStatus: {
265
- immediate: true,
266
- handler(n) {
267
- if (n === "open") {
268
- this.$nextTick(() => {
269
- const dropDownUl = this.$refs["dropdownItems"];
270
- if (dropDownUl)
271
- this.dropDownSectionHeight = `${dropDownUl.scrollHeight}px`;
272
- });
273
- } else {
274
- this.dropDownSectionHeight = null;
275
- }
276
- },
277
- },
278
- },
279
- });
280
- </script>
281
248
  <style lang="scss" scoped>
282
249
  .ac-vscrollbar {
283
250
  overflow: auto !important;
@@ -285,4 +252,164 @@ export default defineComponent({
285
252
  .line-break-anywhere {
286
253
  line-break: anywhere;
287
254
  }
288
- </style>
255
+ .navbar-dropdown-wrapper {
256
+ width: 240px;
257
+ }
258
+
259
+ .user-profile-wrapper {
260
+ background-color: $white-100;
261
+ border-radius: 4px;
262
+ border: 1px solid $primary-90;
263
+
264
+ .profile-area {
265
+ display: flex;
266
+ align-items: center;
267
+ border-bottom: 1px solid $primary-90;
268
+ padding: 16px 16px;
269
+
270
+ .profile-photo {
271
+ // width: 50px;
272
+ // height: 50px;
273
+ border-radius: 50%;
274
+ position: relative;
275
+ z-index: 1;
276
+ margin-right: 10px;
277
+
278
+ img {
279
+ border-radius: 50%;
280
+ width: 100%;
281
+ border: 2px solid #d2e7f9;
282
+ }
283
+
284
+ .camera-icon {
285
+ position: absolute;
286
+ right: -10px;
287
+ top: 0;
288
+ background-color: transparent;
289
+ border: none;
290
+ cursor: pointer;
291
+ }
292
+ }
293
+
294
+ .profile-info {
295
+ p {
296
+ color: $primary-10;
297
+ font-size: 13px;
298
+ font-weight: 500;
299
+ line-height: 1.3;
300
+ }
301
+
302
+ a {
303
+ font-size: 1rem;
304
+ color: $primary-20;
305
+ line-height: 1.3;
306
+ }
307
+ }
308
+ }
309
+ .list-items {
310
+ max-height: calc(100vh - 100px);
311
+ overflow-y: auto;
312
+ }
313
+ }
314
+
315
+ .ac-menu-item {
316
+ &.ac-profile-button {
317
+ margin-right: 15px;
318
+ button.button.ac-nav-button {
319
+ .ac-user-profile {
320
+ width: 32px;
321
+ height: 32px;
322
+ border-radius: 50%;
323
+ overflow: hidden;
324
+ border: 2px solid $primary-90;
325
+ }
326
+ i.fa {
327
+ padding-left: 8px;
328
+ }
329
+ }
330
+ }
331
+ }
332
+
333
+ .list-items {
334
+ li {
335
+ &.is-close {
336
+ ul {
337
+ max-height: 0;
338
+ visibility: hidden;
339
+ transition: max-height 0.25s ease-out;
340
+ &.ac-vscrollbar {
341
+ padding: 0;
342
+ }
343
+ }
344
+ }
345
+
346
+ &.is-open {
347
+ ul {
348
+ padding: 8px;
349
+ max-height: 200px;
350
+ visibility: visible;
351
+ transition: max-height 0.25s ease-out;
352
+ li {
353
+ padding: 0;
354
+ border: 1px solid $primary-95;
355
+ }
356
+ }
357
+ }
358
+ a {
359
+ padding: 8px 16px;
360
+ font-weight: 500;
361
+ display: block;
362
+ color: $primary-10;
363
+ transition: 0.3s;
364
+ display: flex;
365
+ align-items: center;
366
+ gap: 8px;
367
+
368
+ &:hover {
369
+ background-color: $primary-97;
370
+ color: $primary;
371
+ }
372
+ }
373
+ }
374
+ }
375
+ .ac-menu-item {
376
+ .is-fullwidth {
377
+ width: 100%;
378
+ }
379
+ }
380
+ .ac-nav-button {
381
+ background-color: transparent;
382
+ border: none;
383
+ color: $primary-80;
384
+ padding: 0 14px;
385
+ margin-left: 15px;
386
+
387
+ // &.ac-profile-button {
388
+ // color: $primary-10;
389
+ // font-weight: 500;
390
+ // }
391
+
392
+ &:last-child {
393
+ margin-left: 0;
394
+ }
395
+
396
+ span {
397
+ position: absolute;
398
+ top: 5px;
399
+ right: 5px;
400
+ width: 15px;
401
+ height: 15px;
402
+ background-color: $white-100;
403
+ font-size: 12px;
404
+ line-height: 15px;
405
+ border-radius: 50%;
406
+ color: $primary;
407
+ z-index: 9;
408
+ }
409
+
410
+ &:focus {
411
+ outline: none;
412
+ box-shadow: none !important;
413
+ }
414
+ }
415
+ </style>