@apptegy/nuxt-navigation 0.1.17 → 0.1.18

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/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
3
  "configKey": "@apptegy/nuxt-navigation",
4
- "version": "0.1.17",
4
+ "version": "0.1.18",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.3",
6
+ "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "unknown"
8
8
  }
9
9
  }
@@ -22,6 +22,7 @@ interface IHeaderProps {
22
22
  interface IUserDropdown {
23
23
  user: {
24
24
  name: string;
25
+ email: string;
25
26
  avatar?: string;
26
27
  };
27
28
  userDropdownOptions: Array<unknown>;
@@ -32,13 +32,16 @@
32
32
  <script setup lang="ts">
33
33
  import { ref, onMounted, useSidebar } from '#imports';
34
34
 
35
+ interface ImpersonatedUser {
36
+ admin_email: string;
37
+ client: string;
38
+ email: string;
39
+ phone_number: string;
40
+ show: boolean;
41
+ }
42
+
35
43
  interface IPanelProps {
36
- impersonatedUser: {
37
- name: string,
38
- email: string,
39
- admin_email: string,
40
- client: string,
41
- }
44
+ impersonatedUser: ImpersonatedUser;
42
45
  }
43
46
 
44
47
  defineProps<IPanelProps>();
@@ -8,7 +8,6 @@
8
8
  @mouseleave="onHoverLeave"
9
9
  >
10
10
  <a
11
- ref="skip-to-content"
12
11
  href="#main-content-section"
13
12
  class="skip-to-content"
14
13
  data-testid="skip-to-content"
@@ -42,7 +41,7 @@
42
41
  :impersonated-user="impersonatedUser"
43
42
  />
44
43
 
45
- <slot name="logo">
44
+ <slot name="logo" v-bind="expanded">
46
45
  <NuxtLink v-if="expanded ? logo.src : logo.iconSrc" :to="homepageUrl">
47
46
  <div class="navbar--logo">
48
47
  <img :src="expanded ? logo.src : logo.iconSrc" :alt="logo.alt">
@@ -87,6 +86,7 @@ interface ISidebarProps {
87
86
  helpArticleOptions?: Array<unknown>;
88
87
  impersonatedUser?: IUser;
89
88
  logo?: ILogo;
89
+ skipToContent: string;
90
90
  }
91
91
 
92
92
  withDefaults(defineProps<ISidebarProps>(), {
@@ -106,7 +106,8 @@ withDefaults(defineProps<ISidebarProps>(), {
106
106
  alt: 'Thrillshare',
107
107
  src: 'logo.svg',
108
108
  iconSrc: 'icon.svg',
109
- })
109
+ }),
110
+ skipToContent: '#main-content-section',
110
111
  })
111
112
 
112
113
  // Debounced Expand on Hover
@@ -3,8 +3,8 @@ export declare function useDropdown(options: Array<unknown>, dropdownOptionsRef:
3
3
  searchable: boolean;
4
4
  trackBy?: string;
5
5
  }): {
6
- active: Ref<boolean, boolean>;
7
- searchQuery: Ref<string, string>;
6
+ active: Ref<boolean>;
7
+ searchQuery: Ref<string>;
8
8
  toggleDropdown: ($event: KeyboardEvent | MouseEvent) => Promise<void>;
9
9
  openDropdown: () => void;
10
10
  closeDropdown: () => void;
@@ -18,20 +18,17 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
18
18
  active.value = false;
19
19
  }
20
20
  function onClickOutsideHandler() {
21
- if (!active.value)
22
- return;
21
+ if (!active.value) return;
23
22
  closeDropdown();
24
23
  }
25
24
  function keydownActionsOnTrigger(event) {
26
- if (event.ctrlKey || event.metaKey || event.shiftKey)
27
- return;
25
+ if (event.ctrlKey || event.metaKey || event.shiftKey) return;
28
26
  if (event.key !== "Tab") {
29
27
  event.preventDefault();
30
28
  }
31
29
  switch (event.key) {
32
30
  case "Tab":
33
- if (!active.value)
34
- return;
31
+ if (!active.value) return;
35
32
  closeDropdown();
36
33
  break;
37
34
  case "ArrowDown":
@@ -96,8 +93,7 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
96
93
  }
97
94
  }
98
95
  function handleKeydown(event, index) {
99
- if (event.ctrlKey || event.metaKey || event.shiftKey)
100
- return;
96
+ if (event.ctrlKey || event.metaKey || event.shiftKey) return;
101
97
  if (event.altKey && event.key === "ArrowUp") {
102
98
  closeDropdown();
103
99
  dropdownTriggerRef.value.focus();
@@ -131,15 +127,13 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
131
127
  });
132
128
  break;
133
129
  case "ArrowDown":
134
- if (index === options.length - 1)
135
- break;
130
+ if (index === options.length - 1) break;
136
131
  nextTick(() => {
137
132
  dropdownOptionsRef.value[index + 1].focus();
138
133
  });
139
134
  return index;
140
135
  case "ArrowUp":
141
- if (index === 0)
142
- break;
136
+ if (index === 0) break;
143
137
  nextTick(() => {
144
138
  dropdownOptionsRef.value[index - 1].focus();
145
139
  });
@@ -176,8 +170,7 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
176
170
  dropdownOptionsRef.value[idx].focus();
177
171
  }, 500);
178
172
  function handleDropdownSearch(inputValue) {
179
- if (!config.searchable)
180
- return;
173
+ if (!config.searchable) return;
181
174
  if (inputValue.key == "Backspace") {
182
175
  searchQuery.value = searchQuery.value.slice(0, -1);
183
176
  return;
@@ -1,5 +1,5 @@
1
1
  export declare function useSidebar(): {
2
- state: any;
2
+ state: import("vue").Ref<boolean>;
3
3
  toggleSidebar: () => void;
4
- sidebarWidth: any;
4
+ sidebarWidth: import("vue").ComputedRef<"256px" | "0px">;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -26,24 +26,24 @@
26
26
  "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@nuxt/kit": "^3.13.1",
30
- "@vueuse/components": "11.0.3",
29
+ "@nuxt/kit": "^3.13.2",
30
+ "@vueuse/components": "11.1.0",
31
31
  "lodash": "^4.17.21"
32
32
  },
33
33
  "devDependencies": {
34
- "@nuxt/devtools": "^1.4.1",
35
- "@nuxt/eslint-config": "^0.5.6",
36
- "@nuxt/module-builder": "^0.8.3",
37
- "@nuxt/schema": "^3.13.1",
38
- "@nuxt/test-utils": "^3.14.1",
39
- "@types/node": "^20.16.5",
40
- "changelogen": "^0.5.5",
41
- "eslint": "^9.9.1",
42
- "nuxt": "^3.13.1",
43
- "sass": "^1.78.0",
44
- "typescript": "^5.5.4",
34
+ "@nuxt/devtools": "^1.5.1",
35
+ "@nuxt/eslint-config": "^0.5.7",
36
+ "@nuxt/module-builder": "^0.8.4",
37
+ "@nuxt/schema": "^3.13.2",
38
+ "@nuxt/test-utils": "^3.14.2",
39
+ "@types/node": "^20.16.6",
40
+ "changelogen": "^0.5.7",
41
+ "eslint": "^9.11.1",
42
+ "nuxt": "^3.13.2",
43
+ "sass": "^1.79.3",
44
+ "typescript": "^5.6.2",
45
45
  "vitest": "^1.6.0",
46
- "vue": "^3.5.2",
46
+ "vue": "^3.5.8",
47
47
  "vue-tsc": "^2.1.6"
48
48
  }
49
49
  }