@appscode/design-system 2.1.7 → 2.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { ref } from "vue";
2
+ import { useRoute } from "vue-router";
3
+ import { ref, watch } from "vue";
3
4
  import { onClickOutside } from "@vueuse/core";
4
5
 
5
6
  interface Props {
@@ -10,7 +11,7 @@ withDefaults(defineProps<Props>(), {
10
11
  modifierClasses: "",
11
12
  });
12
13
 
13
- const emit = defineEmits(["isActive"]);
14
+ const emit = defineEmits(["isActive", "onRouteChange"]);
14
15
 
15
16
  const navbarItem = ref(null);
16
17
 
@@ -21,6 +22,14 @@ function clickEvent() {
21
22
  emit("isActive", isActive.value);
22
23
  }
23
24
 
25
+ const route = useRoute();
26
+ watch(
27
+ () => route.fullPath,
28
+ (n) => {
29
+ isActive.value = "";
30
+ emit("onRouteChange");
31
+ }
32
+ );
24
33
  onClickOutside(navbarItem, () => (isActive.value = ""));
25
34
  </script>
26
35
 
@@ -3,7 +3,6 @@ import { defineAsyncComponent, ref, watch, computed, nextTick } from "vue";
3
3
  import HeroiconsCog6Tooth from "~icons/heroicons/cog-6-tooth";
4
4
  import HeroiconsWrenchScrewdriver from "~icons/heroicons/wrench-screwdriver";
5
5
  import HeroiconsUserGroup from "~icons/heroicons/user-group";
6
- import HeroiconsChartPie from "~icons/heroicons/chart-pie";
7
6
  import HeroiconsPower from "~icons/heroicons/power";
8
7
  import HeroiconsCheck from "~icons/heroicons/check";
9
8
 
@@ -39,8 +38,6 @@ const emit = defineEmits(["set:theme", "on-logout", "activeorg$set"]);
39
38
  const NavbarItem = defineAsyncComponent(() => import("../navbar/NavbarItem.vue"));
40
39
  const NavbarItemContent = defineAsyncComponent(() => import("../navbar/NavbarItemContent.vue"));
41
40
 
42
- const ThemeMode = defineAsyncComponent(() => import("../navbar/ThemeMode.vue"));
43
-
44
41
  const dropDownStatus = ref("close");
45
42
  const dropDownSectionHeight = ref<string | null>(null);
46
43
  const dropdownItems = ref(null as { $el: HTMLElement } | null);
@@ -73,14 +70,6 @@ const onOrganizationClick = (orgName: string) => {
73
70
  emit("activeorg$set", orgName);
74
71
  };
75
72
 
76
- const onMouseLeave = () => {
77
- dropDownStatus.value = "close";
78
- };
79
-
80
- const setTheme = (val: string) => {
81
- emit("set:theme", val);
82
- };
83
-
84
73
  const locationOrigin = window.location.origin;
85
74
  const isDocsUi = window.location.pathname.startsWith("/docs/");
86
75
 
@@ -94,10 +83,14 @@ watch(dropDownStatus, (n) => {
94
83
  dropDownSectionHeight.value = null;
95
84
  }
96
85
  });
86
+
87
+ function closeDropdown() {
88
+ dropDownStatus.value = "close";
89
+ }
97
90
  </script>
98
91
 
99
92
  <template>
100
- <navbar-item :modifierClasses="'ac-profile-button'">
93
+ <navbar-item :modifierClasses="'ac-profile-button'" @on-route-change="closeDropdown">
101
94
  <template #navbar-item>
102
95
  <div class="ac-user-profile mr-8">
103
96
  <img :src="user.avatar_url" alt="User Photo" />