@apptegy/nuxt-navigation 0.1.17 → 0.1.19

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.19",
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>;
@@ -33,6 +34,7 @@ defineEmits(['selected-option']);
33
34
 
34
35
  <style scoped>
35
36
  header.header {
37
+ position: relative;
36
38
  grid-area: navheader;
37
39
  display: grid;
38
40
  grid-auto-flow: column;
@@ -44,7 +46,7 @@ header.header {
44
46
  background-color: var(--primary-white);
45
47
  font: var(--font-regular);
46
48
  }
47
- @media only screen and (max-width: 960px) {
49
+ @media only screen and (width <= 960px) {
48
50
  header.header {
49
51
  padding-left: 32px;
50
52
  padding-right: 32px;
@@ -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,10 +41,10 @@
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
- <img :src="expanded ? logo.src : logo.iconSrc" :alt="logo.alt">
47
+ <img :src="expanded ? logo.src : logo.iconSrc" :alt="logo.alt || $t('navigation.logoAlt')">
49
48
  </div>
50
49
  </NuxtLink>
51
50
  </slot>
@@ -55,24 +54,11 @@
55
54
 
56
55
  <script setup lang="ts">
57
56
  import { useNuxtApp, useSidebar } from '#imports';
57
+ import type { IApplication, IUser } from "../../types";
58
+
58
59
  const { $t } = useNuxtApp();
59
60
  const { state: expanded } = useSidebar();
60
61
 
61
- interface IApplications {
62
- id: number;
63
- text: string;
64
- url: string;
65
- img_src: string;
66
- }
67
-
68
- interface IUser {
69
- show: boolean;
70
- email: string;
71
- phone_number: string;
72
- client: string;
73
- admin_email: string;
74
- }
75
-
76
62
  interface ILogo {
77
63
  alt: string;
78
64
  src: string;
@@ -80,13 +66,14 @@ interface ILogo {
80
66
  }
81
67
 
82
68
  interface ISidebarProps {
83
- applications: Array<IApplications>;
84
- currentApplication?: IApplications['text'];
69
+ applications: Array<IApplication>;
70
+ currentApplication?: IApplication['text'];
85
71
  homepageUrl?: string;
86
72
  showHelpArticles?: boolean;
87
73
  helpArticleOptions?: Array<unknown>;
88
74
  impersonatedUser?: IUser;
89
75
  logo?: ILogo;
76
+ skipToContent: string;
90
77
  }
91
78
 
92
79
  withDefaults(defineProps<ISidebarProps>(), {
@@ -103,14 +90,15 @@ withDefaults(defineProps<ISidebarProps>(), {
103
90
  admin_email: '',
104
91
  }),
105
92
  logo: () => ({
106
- alt: 'Thrillshare',
93
+ alt: '',
107
94
  src: 'logo.svg',
108
95
  iconSrc: 'icon.svg',
109
- })
96
+ }),
97
+ skipToContent: '#main-content-section',
110
98
  })
111
99
 
112
100
  // Debounced Expand on Hover
113
- let expandedTimer;
101
+ let expandedTimer = null;
114
102
  function onHover() {
115
103
  if(!expanded.value) {
116
104
  expandedTimer = setTimeout(() => {
@@ -13,6 +13,7 @@
13
13
 
14
14
  <script setup lang="ts">
15
15
  import { useSidebar } from "#imports";
16
+ import type { IApplication } from "../../types";
16
17
 
17
18
  defineProps<{
18
19
  application: IApplication;
@@ -21,7 +22,7 @@ defineProps<{
21
22
 
22
23
  const { state: expanded } = useSidebar();
23
24
 
24
- function getActiveIcon(src){
25
+ function getActiveIcon(src: string){
25
26
  return src.replace(".svg", "_active.svg");
26
27
  };
27
28
  </script>
@@ -29,7 +30,6 @@ function getActiveIcon(src){
29
30
  <style scoped>
30
31
  .a-nav-section {
31
32
  box-shadow: inset 0px -1px 0px 0px var(--dscl-nav-section-border-bottom-color, var(--purple-65));
32
- cursor: pointer;
33
33
  min-height: 48px;
34
34
  }
35
35
  .a-nav-section.active {
@@ -52,6 +52,9 @@ function getActiveIcon(src){
52
52
  padding: 0px 16px;
53
53
  width: 100%;
54
54
  }
55
+ .a-nav-section--link:not([href]) {
56
+ cursor: default;
57
+ }
55
58
  .a-nav-section--link:focus-visible {
56
59
  outline: var(--orange) auto 2px;
57
60
  outline-offset: 0px;
@@ -44,9 +44,9 @@ function handleSelectedClick(index: number) {
44
44
  function handleKeydownAction($event: KeyboardEvent, index: number) {
45
45
  if ($event.key === "Enter" || $event.key === " ") {
46
46
  emit("select-option", index);
47
- } else {
48
- handleKeydown($event, index);
47
+ $event?.target?.children[0]?.click();
49
48
  }
49
+ handleKeydown($event, index);
50
50
  }
51
51
  </script>
52
52
 
@@ -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
  };
@@ -0,0 +1,13 @@
1
+ export interface IApplication {
2
+ id: number;
3
+ text: string;
4
+ url: string;
5
+ img_src: string;
6
+ }
7
+ export interface IUser {
8
+ show: boolean;
9
+ email: string;
10
+ phone_number: string;
11
+ client: string;
12
+ admin_email: string;
13
+ }
File without changes
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.19",
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
  }