@apptegy/nuxt-navigation 0.1.111 → 1.0.0-alpha.1

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 (28) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +3 -2
  3. package/dist/runtime/components/Nav/Header.vue +108 -321
  4. package/dist/runtime/components/Nav/Header.vue.d.ts +12 -39
  5. package/dist/runtime/components/Nav/OrgSelect.vue +8 -8
  6. package/dist/runtime/components/Nav/Sidebar.vue +118 -207
  7. package/dist/runtime/components/Nav/Sidebar.vue.d.ts +7 -15
  8. package/dist/runtime/components/Nav/SidebarItem.vue +19 -22
  9. package/dist/runtime/components/Nav/SidebarSection.vue +28 -35
  10. package/dist/runtime/components/Nav/SidebarSection.vue.d.ts +2 -2
  11. package/dist/runtime/components/Nav/SubMenuItem.vue +1 -1
  12. package/dist/runtime/types/index.d.ts +0 -1
  13. package/locale/en.json +1 -22
  14. package/package.json +25 -29
  15. package/dist/runtime/components/Nav/NotificationItem.vue +0 -337
  16. package/dist/runtime/components/Nav/NotificationItem.vue.d.ts +0 -12
  17. package/dist/runtime/components/Nav/NotificationsPanel.vue +0 -513
  18. package/dist/runtime/components/Nav/NotificationsPanel.vue.d.ts +0 -53
  19. package/dist/runtime/constants/notification-types.d.ts +0 -19
  20. package/dist/runtime/constants/notification-types.js +0 -48
  21. package/dist/runtime/types/notifications.d.ts +0 -79
  22. package/dist/runtime/types/notifications.js +0 -0
  23. package/dist/runtime/utils/notification-api.d.ts +0 -26
  24. package/dist/runtime/utils/notification-api.js +0 -84
  25. package/dist/runtime/utils/notification-dates.d.ts +0 -15
  26. package/dist/runtime/utils/notification-dates.js +0 -81
  27. package/dist/runtime/utils/notifications.d.ts +0 -21
  28. package/dist/runtime/utils/notifications.js +0 -117
@@ -5,10 +5,6 @@
5
5
  aria-label="Main"
6
6
  :class="{ expanded }"
7
7
  :style="getBrandingStyles"
8
- @mouseenter="!lockedExpanded && onHover()"
9
- @mouseleave="!lockedExpanded && onHoverLeave()"
10
- @focusin="!lockedExpanded && onFocusEnter()"
11
- @focusout="!lockedExpanded && onFocusLeave()"
12
8
  >
13
9
  <a
14
10
  :href="`#${skipToContent}`"
@@ -17,87 +13,77 @@
17
13
  >
18
14
  {{ $t("navigation.skipToContent") }}
19
15
  </a>
20
- <div :class="['navbar--wrapper', fixed && 'fixed']" >
21
- <div class="navbar--header">
22
- <div :class="['header-actions', { 'collapsed': !expanded && !isMobile }]">
23
- <NuxtLink v-if="expanded" class="no-link-style" :to="homepageUrl">
24
- <slot name="logo">
25
- <div class="navbar--logo" :class="{ 'big-logo': _brandLogoWidth > 80 }">
26
- <img v-if="brandLogo" ref="brandLogoRef" :src="brandLogo" :alt="$t('navigation.brandLogoAlt')">
27
- <component
28
- :is="ApptegyLogo"
29
- v-else
30
- :alt="$t('navigation.brandLogoAlt')"
31
- :use-light-logo="isAdmin || Object.values(getBrandingStyles).length === 0"
32
- />
33
- <div v-if="!brand?.hide_school_name">
34
- <div class="school-name"> {{ brand?.school_name }} </div>
35
- <div v-if="brand?.school_tag_line" class="school-tag">{{ brand.school_tag_line }}</div>
36
- </div>
37
- </div>
38
- </slot>
39
- </NuxtLink>
40
- <div v-if="!isMobile && showCollapseButton">
41
- <button v-if="lockedExpanded && !allowCollapse && expanded" class="hamburger-button" @click="closeSidebar" v-tooltip.bottom="'Unpin menu'">
42
- <Pinned />
43
- </button>
44
- <button v-if="!lockedExpanded && allowCollapse && expanded" class="hamburger-button" @click="lockSidebar" v-tooltip.bottom="'Pin menu open'">
45
- <Unpinned />
46
- </button>
47
- <button v-if="!lockedExpanded && allowCollapse && !expanded" ref="hamburgerButtonRef" class="hamburger-button">
48
- <a-icon icon="24:hamburger" />
49
- </button>
50
- </div>
51
- </div>
52
- <slot name="switcher" />
53
- </div>
54
- <div class="navbar--content">
55
- <ul class="navbar-applications">
56
- <li v-for="application of applications" :key="application.id">
57
- <NavSidebarSection
58
- v-if="expanded || currentApplication === application.text || isMobile"
59
- :application="application"
60
- :active="currentApplication === application.text"
61
- :collapsed="!expanded && !isMobile"
62
- >
63
- <slot v-if="currentApplication === application.text" />
64
- </NavSidebarSection>
65
- </li>
66
- </ul>
67
- </div>
68
- <div class="navbar--footer">
69
- <NavHelpArticles
70
- :show-help-articles="showHelpArticles"
71
- :help-article-options="helpArticleOptions"
72
- :settings-route="settingsRoute"
73
- :school-website="schoolWebsite"
74
- :collapsed="!expanded && !isMobile"
75
- />
76
- <NavImpersonateInfoPanel
77
- v-if="impersonatedUser.show"
78
- :impersonated-user="impersonatedUser"
79
- />
16
+ <div :class="['navbar--wrapper', fixed && 'fixed']">
17
+ <div
18
+ v-if="$slots.switcher"
19
+ class="navbar--header"
20
+ >
21
+ <slot name="switcher" />
22
+ </div>
23
+ <div class="navbar--content">
24
+ <ul class="navbar-applications">
25
+ <li
26
+ v-for="application of applications"
27
+ :key="application.id"
28
+ >
29
+ <NavSidebarSection
30
+ v-if="expanded || currentApplication === application.text || isMobile"
31
+ :application="application"
32
+ :active="currentApplication === application.text"
33
+ :collapsed="!expanded && !isMobile"
34
+ >
35
+ <slot v-if="currentApplication === application.text" />
36
+ </NavSidebarSection>
37
+ </li>
38
+ </ul>
39
+ </div>
40
+ <div class="navbar--footer">
41
+ <NavHelpArticles
42
+ :show-help-articles="showHelpArticles"
43
+ :help-article-options="helpArticleOptions"
44
+ :settings-route="settingsRoute"
45
+ :school-website="schoolWebsite"
46
+ :collapsed="!expanded && !isMobile"
47
+ />
48
+ <NavImpersonateInfoPanel
49
+ v-if="impersonatedUser.show"
50
+ :impersonated-user="impersonatedUser"
51
+ />
80
52
 
81
- <slot name="logo">
82
- <template v-if="brand">
83
- <NuxtLink v-if="expanded ? logo.src : logo.iconSrc" :to="homepageUrl">
84
- <div v-if="!isMobile && expanded" class="navbar--footer-logo">
85
- <img :src="expanded ? logo.src : logo.iconSrc" :alt="logo.alt || $t('navigation.logoAlt')">
86
- </div>
87
- </NuxtLink>
88
- </template>
89
- </slot>
90
- </div>
53
+ <slot name="logo">
54
+ <template v-if="brand">
55
+ <NuxtLink
56
+ v-if="expanded ? logo.src : logo.iconSrc"
57
+ :to="homepageUrl"
58
+ >
59
+ <div
60
+ v-if="!isMobile && expanded"
61
+ class="navbar--footer-logo"
62
+ >
63
+ <img
64
+ :src="expanded ? logo.src : logo.iconSrc"
65
+ :alt="logo.alt || $t('navigation.logoAlt')"
66
+ />
67
+ </div>
68
+ </NuxtLink>
69
+ </template>
70
+ </slot>
71
+ </div>
91
72
  </div>
73
+ <button
74
+ v-if="!isMobile"
75
+ class="navbar--collapse-btn"
76
+ :aria-label="expanded ? 'Collapse sidebar' : 'Expand sidebar'"
77
+ @click="expanded = !expanded"
78
+ >
79
+ {{ expanded ? "\xAB" : "\xBB" }}
80
+ </button>
92
81
  </nav>
93
82
  </template>
94
83
 
95
84
  <script setup>
96
- import { useSidebar, useBranding, useNuxtApp, ref, watch, computed, onMounted, onBeforeUnmount, nextTick } from "#imports";
97
- import ApptegyLogo from "./Icons/ApptegyLogo.vue";
85
+ import { useSidebar, useBranding, useNuxtApp, computed, watch } from "#imports";
98
86
  import { useWindowSize } from "@vueuse/core";
99
- import Unpinned from "./Icons/Unpinned.vue";
100
- import Pinned from "./Icons/Pinned.vue";
101
87
  const { $t } = useNuxtApp();
102
88
  const props = defineProps({
103
89
  clientId: { type: Number, required: true, default: void 0 },
@@ -119,104 +105,25 @@ const props = defineProps({
119
105
  iconSrc: "poweredby-icon.svg"
120
106
  }) },
121
107
  skipToContent: { type: String, required: true, default: "#main-content-section" },
122
- useApptegyLogo: { type: Boolean, required: false, default: false },
123
108
  fixed: { type: Boolean, required: false, default: false },
124
- isAdmin: { type: Boolean, required: false, default: false },
125
109
  settingsRoute: { type: String, required: true, default: "" },
126
- schoolWebsite: { type: String, required: true, default: "" },
127
- showCollapseButton: { type: Boolean, required: false, default: false }
110
+ schoolWebsite: { type: String, required: true, default: "" }
128
111
  });
129
112
  const emit = defineEmits(["toggle-expand"]);
130
113
  const { state: expanded } = useSidebar();
131
114
  const { brand, getBrandingStyles } = await useBranding(props.clientId);
132
- const brandLogo = ref(brand.value?.logo_light);
133
- const brandLogoRef = ref(null);
134
- const brandLogoWidthPx = ref(0);
135
- let brandLogoResizeObserver = null;
136
- const _brandLogoWidth = computed(() => brandLogoWidthPx.value);
137
115
  const { width: windowWidth } = useWindowSize();
138
116
  const isMobile = computed(() => windowWidth.value < 600);
139
- const lockedExpanded = ref(true);
140
- const allowCollapse = ref(false);
141
- let focusOutTimeout = null;
142
- const hamburgerButtonRef = ref(null);
143
- let ignoreNextFocusIn = false;
144
- function updateBrandLogoWidth() {
145
- brandLogoWidthPx.value = brandLogoRef.value?.clientWidth ?? 0;
146
- }
147
- onMounted(() => {
148
- updateBrandLogoWidth();
149
- if (brandLogoRef.value) {
150
- brandLogoResizeObserver = new ResizeObserver(() => {
151
- updateBrandLogoWidth();
152
- });
153
- brandLogoResizeObserver.observe(brandLogoRef.value);
154
- }
155
- });
156
- onBeforeUnmount(() => {
157
- brandLogoResizeObserver?.disconnect();
158
- brandLogoResizeObserver = null;
159
- if (focusOutTimeout) {
160
- clearTimeout(focusOutTimeout);
161
- focusOutTimeout = null;
162
- }
163
- });
164
117
  watch(expanded, (value) => {
165
- emit("toggle-expand", value ? 264 : 64);
118
+ emit("toggle-expand", value ? 240 : 64);
166
119
  });
167
- watch(isMobile, (value) => {
168
- if (value) {
169
- expanded.value = true;
170
- lockedExpanded.value = true;
171
- allowCollapse.value = false;
172
- }
173
- }, { immediate: true });
174
- function onHover() {
175
- if (!expanded.value) {
176
- expanded.value = true;
177
- }
178
- }
179
- function onHoverLeave() {
180
- if (expanded.value) {
181
- expanded.value = false;
182
- }
183
- }
184
- function onFocusEnter() {
185
- if (ignoreNextFocusIn) {
186
- ignoreNextFocusIn = false;
187
- return;
188
- }
189
- if (focusOutTimeout) {
190
- clearTimeout(focusOutTimeout);
191
- focusOutTimeout = null;
192
- }
193
- if (!expanded.value) {
194
- expanded.value = true;
195
- }
196
- }
197
- function onFocusLeave() {
198
- focusOutTimeout = setTimeout(() => {
199
- if (expanded.value) {
200
- expanded.value = false;
201
- }
202
- focusOutTimeout = null;
203
- }, 100);
204
- }
205
- async function closeSidebar() {
206
- expanded.value = false;
207
- lockedExpanded.value = false;
208
- allowCollapse.value = true;
209
- ignoreNextFocusIn = true;
210
- await nextTick();
211
- if (hamburgerButtonRef.value) {
212
- hamburgerButtonRef.value.focus();
213
- }
214
- }
215
- function lockSidebar() {
216
- lockedExpanded.value = true;
217
- expanded.value = true;
218
- allowCollapse.value = false;
219
- }
120
+ watch(
121
+ isMobile,
122
+ (value) => {
123
+ if (value) expanded.value = true;
124
+ },
125
+ { immediate: true }
126
+ );
220
127
  </script>
221
128
 
222
129
  <style scoped>
@@ -226,8 +133,8 @@ function lockSidebar() {
226
133
  color: var(--nav-text-color, #646464);
227
134
  transition: width 0.3s ease;
228
135
  height: 100%;
229
- overflow-y: auto;
230
- overflow-x: hidden;
136
+ align-self: stretch;
137
+ overflow: visible;
231
138
  scrollbar-width: none;
232
139
  width: 64px;
233
140
  position: relative;
@@ -242,9 +149,8 @@ function lockSidebar() {
242
149
  }
243
150
  .navbar--wrapper {
244
151
  display: grid;
245
- grid-template-rows: 0fr auto 0fr;
246
- background-color: var(--nav-background-color, #FFF);
247
- border-right: 1px solid #DFDFDF;
152
+ grid-template-rows: 1fr;
153
+ background-color: var(--nav-background-color, #fff);
248
154
  height: 100%;
249
155
  overflow-y: auto;
250
156
  overflow-x: hidden;
@@ -259,7 +165,7 @@ function lockSidebar() {
259
165
  z-index: 10;
260
166
  }
261
167
  .navbar--header {
262
- border-bottom: 1px solid var(--nav-border-colors, #DFDFDF);
168
+ border-bottom: 1px solid var(--nav-border-colors, #dfdfdf);
263
169
  }
264
170
  .navbar--header .header-actions {
265
171
  padding: 12px 16px;
@@ -273,45 +179,53 @@ function lockSidebar() {
273
179
  .navbar--header .header-actions.collapsed {
274
180
  justify-content: center;
275
181
  }
276
- .navbar--logo {
277
- display: flex;
278
- align-items: center;
279
- gap: 8px;
280
- }
281
- .navbar--logo.big-logo {
282
- flex-direction: column;
283
- align-items: flex-start;
284
- }
285
- .navbar--logo .school-name {
286
- font-size: 16px;
287
- font-style: normal;
288
- font-weight: 700;
289
- overflow-wrap: break-word;
290
- word-break: break-word;
291
- }
292
- .navbar--logo .school-tag {
293
- font-size: 14px;
294
- font-style: normal;
295
- font-weight: 400;
296
- overflow-wrap: break-word;
297
- word-break: break-word;
298
- }
299
- .navbar--logo img {
300
- display: inline;
301
- max-height: 36px;
302
- max-width: 180px;
303
- }
304
182
  .navbar--content {
305
183
  display: flex;
306
184
  flex-direction: column;
307
185
  }
308
186
  .navbar--content ul {
309
187
  list-style: none;
310
- padding: 0;
188
+ padding: 8px 0;
311
189
  margin: 0;
312
190
  width: 64px;
313
191
  }
192
+ .navbar--collapse-btn {
193
+ /* Fallback: fixed 32px from bottom, at the sidebar's right edge */
194
+ position: absolute;
195
+ bottom: 32px;
196
+ right: 0;
197
+ transform: translateX(50%);
198
+ /* Anchor API: pin exactly to the content/footer seam */
199
+ width: 32px;
200
+ height: 32px;
201
+ border-radius: 50%;
202
+ background-color: var(--primary-white, #fff);
203
+ border: 1px solid #e0e0e0;
204
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
205
+ cursor: pointer;
206
+ display: flex;
207
+ align-items: center;
208
+ justify-content: center;
209
+ font-size: 16px;
210
+ color: #555;
211
+ z-index: 10;
212
+ }
213
+ @supports (anchor-name: --test) {
214
+ .navbar--collapse-btn {
215
+ position: fixed;
216
+ position-anchor: --nav-footer;
217
+ top: anchor(top);
218
+ left: anchor(right);
219
+ bottom: unset;
220
+ right: unset;
221
+ transform: translate(-50%, -50%);
222
+ }
223
+ }
224
+ .navbar--collapse-btn:hover {
225
+ background-color: #f5f5f5;
226
+ }
314
227
  .navbar--footer {
228
+ anchor-name: --nav-footer;
315
229
  display: flex;
316
230
  flex-direction: column;
317
231
  }
@@ -326,13 +240,10 @@ function lockSidebar() {
326
240
  }
327
241
  .navbar.expanded {
328
242
  transition: width 0.3s ease;
329
- width: 264px;
243
+ width: 240px;
330
244
  }
331
245
  .navbar.expanded .navbar--content ul {
332
- width: 264px;
333
- }
334
- .navbar.expanded .navbar--header .header-actions {
335
- width: 264px;
246
+ width: 240px;
336
247
  }
337
248
  .navbar .skip-to-content {
338
249
  overflow: hidden;
@@ -353,7 +264,7 @@ function lockSidebar() {
353
264
  pointer-events: none;
354
265
  }
355
266
  .navbar .skip-to-content:focus-visible {
356
- --native-outline-blue: #0000FF;
267
+ --native-outline-blue: #0000ff;
357
268
  opacity: 1;
358
269
  pointer-events: auto;
359
270
  outline: var(--native-outline-blue) auto 2px;
@@ -1,4 +1,4 @@
1
- import type { IApplication, IUser } from "../../types/index.js";
1
+ import type { IApplication, IUser } from '../../types/index.js';
2
2
  interface ILogo {
3
3
  alt: string;
4
4
  src: string;
@@ -14,43 +14,35 @@ interface ISidebarProps {
14
14
  impersonatedUser?: IUser;
15
15
  logo?: ILogo;
16
16
  skipToContent: string;
17
- useApptegyLogo?: boolean;
18
17
  fixed?: boolean;
19
- isAdmin?: boolean;
20
18
  settingsRoute: string;
21
19
  schoolWebsite: string;
22
- showCollapseButton?: boolean;
23
20
  }
24
- declare var __VLS_6: {}, __VLS_26: {}, __VLS_33: {}, __VLS_45: {};
21
+ declare var __VLS_1: {}, __VLS_8: {}, __VLS_20: {};
25
22
  type __VLS_Slots = {} & {
26
- logo?: (props: typeof __VLS_6) => any;
23
+ switcher?: (props: typeof __VLS_1) => any;
27
24
  } & {
28
- switcher?: (props: typeof __VLS_26) => any;
25
+ default?: (props: typeof __VLS_8) => any;
29
26
  } & {
30
- default?: (props: typeof __VLS_33) => any;
31
- } & {
32
- logo?: (props: typeof __VLS_45) => any;
27
+ logo?: (props: typeof __VLS_20) => any;
33
28
  };
34
29
  declare const __VLS_component: import("vue").DefineComponent<ISidebarProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
35
30
  "toggle-expand": (width: number) => any;
36
31
  }, string, import("vue").PublicProps, Readonly<ISidebarProps> & Readonly<{
37
32
  "onToggle-expand"?: ((width: number) => any) | undefined;
38
33
  }>, {
34
+ clientId: number;
35
+ homepageUrl: string;
39
36
  impersonatedUser: IUser;
40
37
  fixed: boolean;
41
38
  helpArticleOptions: Array<unknown>;
42
39
  settingsRoute: string;
43
40
  schoolWebsite: string;
44
41
  showHelpArticles: boolean;
45
- clientId: number;
46
42
  applications: Array<IApplication>;
47
43
  currentApplication: IApplication["text"];
48
- homepageUrl: string;
49
44
  logo: ILogo;
50
45
  skipToContent: string;
51
- useApptegyLogo: boolean;
52
- isAdmin: boolean;
53
- showCollapseButton: boolean;
54
46
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
55
47
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
56
48
  export default _default;
@@ -11,9 +11,17 @@ const component = computed(() => props.as || resolveComponent("NuxtLink"));
11
11
  </script>
12
12
 
13
13
  <template>
14
- <component :is="component" class="a-navbar-item" :class="{ expanded, active, collapsed: !expanded }">
14
+ <component
15
+ :is="component"
16
+ class="a-navbar-item"
17
+ :class="{ expanded, active, collapsed: !expanded }"
18
+ >
15
19
  <slot name="icon">
16
- <a-icon class="icon" :icon="icon" font-size="24px"/>
20
+ <Icon
21
+ class="icon"
22
+ :name="`lucide:${icon}`"
23
+ size="24"
24
+ />
17
25
  </slot>
18
26
  <slot v-if="expanded" />
19
27
  </component>
@@ -23,20 +31,22 @@ const component = computed(() => props.as || resolveComponent("NuxtLink"));
23
31
  .a-navbar-item {
24
32
  background-color: transparent;
25
33
  color: inherit;
26
- margin: 2px 12px;
34
+ margin: 2px 8px;
27
35
  display: flex;
28
36
  align-items: center;
29
37
  text-decoration: none;
30
38
  text-transform: capitalize;
31
- padding: 4px;
39
+ padding: 10px 8px;
32
40
  border: none;
33
41
  border-radius: 8px;
42
+ gap: 8px;
43
+ width: calc(100% - 16px);
44
+ box-sizing: border-box;
34
45
  user-select: none;
35
46
  }
36
47
  .a-navbar-item.collapsed {
37
48
  justify-content: center;
38
- margin: 8px;
39
- cursor: pointer;
49
+ font-size: 16px;
40
50
  }
41
51
  .a-navbar-item:focus-visible {
42
52
  outline: var(--orange) auto 2px;
@@ -44,27 +54,14 @@ const component = computed(() => props.as || resolveComponent("NuxtLink"));
44
54
  box-shadow: inset 0 0 0px 4px var(--primary-white);
45
55
  }
46
56
  .a-navbar-item.active, .a-navbar-item.nuxt-link-exact-active, .a-navbar-item.router-link-exact-active {
47
- background-color: var(--nav-icon-background, #F7F5F9);
57
+ background-color: var(--nav-icon-background, #eef2ff);
48
58
  font-weight: 500;
49
- color: #2D2D2D;
59
+ color: #2d2d2d;
50
60
  }
51
61
  .a-navbar-item.active svg path, .a-navbar-item.nuxt-link-exact-active svg path, .a-navbar-item.router-link-exact-active svg path {
52
62
  stroke-width: 1.5px;
53
63
  }
54
64
  .a-navbar-item:hover {
55
- background-color: var(--nav-icon-background, #F7F5F9);
56
- }
57
- .a-navbar-item:focus-visible {
58
- outline: var(--orange) auto 2px;
59
- outline-offset: 0px;
60
- box-shadow: inset 0 0 0px 4px var(--primary-white);
61
- }
62
- .a-navbar-item:last-child {
63
- margin-bottom: 8px;
64
- }
65
-
66
- .icon {
67
- margin-right: 12px;
68
- margin-left: 8px;
65
+ background-color: var(--nav-icon-background, #eef2ff);
69
66
  }
70
67
  </style>
@@ -10,17 +10,12 @@
10
10
  :aria-label="appText"
11
11
  >
12
12
  <span v-if="expanded">{{ appText }}</span>
13
- <a-icon
14
- v-if="expanded && active"
13
+ <Icon
14
+ v-if="expanded"
15
+ name="lucide:chevron-up"
16
+ size="16"
15
17
  :class="['caret-icon', { collapse: !isOpen }]"
16
- icon="16:carret-up"
17
- @click="isOpen = !isOpen"
18
- />
19
- <a-icon
20
- v-if="expanded && !active"
21
- :class="['caret-icon', { collapse: !isOpen }]"
22
- icon="16:carret-down"
23
- @click="isOpen = !isOpen"
18
+ @click.prevent="isOpen = !isOpen"
24
19
  />
25
20
  </NuxtLink>
26
21
  <div :class="['a-nav-section--content', { collapse: !isOpen }]">
@@ -39,7 +34,7 @@ const props = defineProps({
39
34
  });
40
35
  const { $ld } = useNuxtApp();
41
36
  const { state: expanded } = useSidebar();
42
- const isOpen = ref(true);
37
+ const isOpen = ref(props.active);
43
38
  const isEngageRenameEnabled = computed(() => {
44
39
  return Boolean($ld?.flags?.engageToNewslettersNameChange);
45
40
  });
@@ -57,7 +52,7 @@ const applicationUrl = computed(() => {
57
52
  const { text, url } = props.application || {};
58
53
  if (props.active) return "";
59
54
  if (text.toLowerCase() === ENGAGE_APP_TEXT && isNewslettersUrlEnabled.value) {
60
- return url.replace(/\/engage(?=[/?#]|$)/i, "/newsletters");
55
+ return url.replace("engage", "newsletters");
61
56
  }
62
57
  return url;
63
58
  });
@@ -65,11 +60,18 @@ const applicationUrl = computed(() => {
65
60
 
66
61
  <style scoped>
67
62
  .a-nav-section {
68
- box-shadow: inset 0px -1px 0px 0px var(--nav-icon-background, #dfdfdf);
63
+ position: relative;
69
64
  min-height: 48px;
70
65
  }
71
- .a-nav-section.active {
72
- box-shadow: inset 0px -1px 0px 0px var(--nav-icon-background, #dfdfdf);
66
+ .a-nav-section::after {
67
+ content: "";
68
+ display: block;
69
+ position: absolute;
70
+ bottom: 0;
71
+ left: 12px;
72
+ right: 12px;
73
+ height: 1px;
74
+ background-color: var(--nav-border-colors, #dfdfdf);
73
75
  }
74
76
  .a-nav-section--content {
75
77
  display: flex;
@@ -83,28 +85,18 @@ const applicationUrl = computed(() => {
83
85
  }
84
86
  .a-nav-section--link {
85
87
  display: flex;
88
+ align-items: center;
89
+ box-sizing: border-box;
90
+ width: 100%;
91
+ min-height: 48px;
92
+ padding: 0 16px;
86
93
  color: inherit;
87
94
  text-decoration: none;
88
- min-height: 48px;
89
- align-items: center;
90
95
  font-size: 12px;
91
96
  letter-spacing: 1.4px;
92
- overflow: hidden;
93
- padding: 0px 16px;
94
- width: 100%;
97
+ text-transform: uppercase;
95
98
  user-select: none;
96
99
  }
97
- .a-nav-section--link svg:first-child {
98
- background: var(--nav-icon-background, #dfdfdf);
99
- color: var(--nav-icon-color, var(--eggplant-30));
100
- border-radius: 4px;
101
- min-width: 32px;
102
- min-height: 32px;
103
- }
104
- .a-nav-section--link svg:first-child.active {
105
- background: var(--nav-active-icon-background, var(--orange-40));
106
- color: var(--nav-active-icon-color, var(--primary-white));
107
- }
108
100
  .a-nav-section--link:not([href]) {
109
101
  cursor: default;
110
102
  }
@@ -114,14 +106,15 @@ const applicationUrl = computed(() => {
114
106
  box-shadow: inset 0 0 0px 4px var(--primary-white);
115
107
  }
116
108
  .a-nav-section--link span {
117
- margin: 0 8px;
109
+ min-width: 0;
118
110
  white-space: nowrap;
119
- text-transform: uppercase;
120
- width: inherit;
111
+ overflow: hidden;
112
+ text-overflow: ellipsis;
121
113
  }
122
114
  .a-nav-section--link .caret-icon {
123
115
  cursor: pointer;
124
- font-size: 24px;
116
+ flex-shrink: 0;
117
+ margin-left: auto;
125
118
  transition: transform 0.2s ease-in-out;
126
119
  }
127
120
  .a-nav-section--link .caret-icon.collapse {
@@ -4,9 +4,9 @@ type __VLS_Props = {
4
4
  active: boolean;
5
5
  collapsed: boolean;
6
6
  };
7
- declare var __VLS_22: {};
7
+ declare var __VLS_14: {};
8
8
  type __VLS_Slots = {} & {
9
- default?: (props: typeof __VLS_22) => any;
9
+ default?: (props: typeof __VLS_14) => any;
10
10
  };
11
11
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -10,7 +10,7 @@ defineProps({
10
10
  <template>
11
11
  <NuxtLink class="menu-item">
12
12
  <div class="menu-item__icon">
13
- <a-icon :icon />
13
+ <Icon :name="`lucide:${icon}`" />
14
14
  </div>
15
15
  <span class="menu-item__text">
16
16
  <slot />