@apptegy/nuxt-navigation 1.0.0-alpha.1 → 1.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 (71) hide show
  1. package/README.md +70 -5
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.mts +2 -3
  4. package/dist/module.d.ts +7 -0
  5. package/dist/module.json +2 -5
  6. package/dist/module.mjs +3 -7
  7. package/dist/runtime/assets/icons/24/Minus.svg +5 -0
  8. package/dist/runtime/assets/icons/24/Plus.svg +5 -0
  9. package/dist/runtime/assets/thrillshare-logo-white.svg +1 -22
  10. package/dist/runtime/components/Nav/Avatar.vue +23 -46
  11. package/dist/runtime/components/Nav/Header.vue +159 -161
  12. package/dist/runtime/components/Nav/HelpArticles.vue +61 -119
  13. package/dist/runtime/components/Nav/ImpersonateInfoPanel.vue +32 -45
  14. package/dist/runtime/components/Nav/OrgSelect.vue +117 -162
  15. package/dist/runtime/components/Nav/Sidebar.vue +109 -216
  16. package/dist/runtime/components/Nav/SidebarItem.vue +17 -44
  17. package/dist/runtime/components/Nav/SidebarSection.vue +38 -88
  18. package/dist/runtime/components/Nav/SubMenu.vue +4 -0
  19. package/dist/runtime/components/Nav/SubMenuItem.vue +7 -6
  20. package/dist/runtime/composables/accessibleActions.d.ts +33 -0
  21. package/dist/runtime/composables/accessibleActions.js +195 -0
  22. package/dist/types.d.mts +1 -3
  23. package/dist/types.d.ts +1 -0
  24. package/package.json +33 -31
  25. package/dist/runtime/api/brand.d.ts +0 -3
  26. package/dist/runtime/api/brand.js +0 -8
  27. package/dist/runtime/assets/checkmark.svg +0 -3
  28. package/dist/runtime/assets/hamburger.svg +0 -3
  29. package/dist/runtime/assets/iconPaths.json +0 -13
  30. package/dist/runtime/assets/icons/24/Metadata.svg +0 -4
  31. package/dist/runtime/assets/impersonation.svg +0 -6
  32. package/dist/runtime/assets/poweredby-icon.svg +0 -3
  33. package/dist/runtime/assets/poweredby.svg +0 -19
  34. package/dist/runtime/components/Nav/Avatar.vue.d.ts +0 -16
  35. package/dist/runtime/components/Nav/Breadcrumb.vue.d.ts +0 -12
  36. package/dist/runtime/components/Nav/Header.vue.d.ts +0 -39
  37. package/dist/runtime/components/Nav/HelpArticles.vue.d.ts +0 -14
  38. package/dist/runtime/components/Nav/Icons/ApptegyLogo.vue +0 -30
  39. package/dist/runtime/components/Nav/Icons/ApptegyLogo.vue.d.ts +0 -14
  40. package/dist/runtime/components/Nav/Icons/Pinned.vue +0 -9
  41. package/dist/runtime/components/Nav/Icons/Pinned.vue.d.ts +0 -2
  42. package/dist/runtime/components/Nav/Icons/SidebarToggle.vue +0 -15
  43. package/dist/runtime/components/Nav/Icons/SidebarToggle.vue.d.ts +0 -2
  44. package/dist/runtime/components/Nav/Icons/ThrillshareLogo.vue +0 -25
  45. package/dist/runtime/components/Nav/Icons/ThrillshareLogo.vue.d.ts +0 -2
  46. package/dist/runtime/components/Nav/Icons/Unpinned.vue +0 -9
  47. package/dist/runtime/components/Nav/Icons/Unpinned.vue.d.ts +0 -2
  48. package/dist/runtime/components/Nav/Icons/UserDropdownMenu.vue +0 -5
  49. package/dist/runtime/components/Nav/Icons/UserDropdownMenu.vue.d.ts +0 -2
  50. package/dist/runtime/components/Nav/ImpersonateInfoPanel.vue.d.ts +0 -12
  51. package/dist/runtime/components/Nav/OrgSelect.vue.d.ts +0 -16
  52. package/dist/runtime/components/Nav/Sidebar.vue.d.ts +0 -53
  53. package/dist/runtime/components/Nav/SidebarItem.vue.d.ts +0 -20
  54. package/dist/runtime/components/Nav/SidebarSection.vue.d.ts +0 -18
  55. package/dist/runtime/components/Nav/SidebarToggle.vue +0 -28
  56. package/dist/runtime/components/Nav/SidebarToggle.vue.d.ts +0 -2
  57. package/dist/runtime/components/Nav/SubMenu.vue.d.ts +0 -12
  58. package/dist/runtime/components/Nav/SubMenuItem.vue.d.ts +0 -22
  59. package/dist/runtime/components/Nav/UserDropdown.vue +0 -178
  60. package/dist/runtime/components/Nav/UserDropdown.vue.d.ts +0 -19
  61. package/dist/runtime/composables/useBranding.d.ts +0 -22
  62. package/dist/runtime/composables/useBranding.js +0 -35
  63. package/dist/runtime/composables/useDropdown.d.ts +0 -19
  64. package/dist/runtime/composables/useDropdown.js +0 -236
  65. package/dist/runtime/composables/useSidebar.d.ts +0 -5
  66. package/dist/runtime/composables/useSidebar.js +0 -13
  67. package/dist/runtime/types/index.d.ts +0 -13
  68. package/dist/runtime/types/index.js +0 -0
  69. package/locale/en.json +0 -20
  70. package/locale/index.js +0 -7
  71. /package/dist/runtime/assets/{icon.svg → thrillshare-icon-white.svg} +0 -0
@@ -1,202 +1,200 @@
1
1
  <template>
2
2
  <header
3
- class="header"
4
3
  :class="{ sticky }"
5
4
  role="banner"
6
5
  >
7
- <div class="header__logo">
8
- <slot name="logo">
9
- <NuxtLink
10
- class="no-link-style"
11
- :to="homepageUrl"
12
- >
13
- <div
14
- class="header__logo-content"
15
- :class="{ 'big-logo': _brandLogoWidth > 80 }"
16
- >
17
- <img
18
- v-if="brandLogo"
19
- ref="brandLogoRef"
20
- :src="brandLogo"
21
- :alt="$t('navigation.brandLogoAlt')"
22
- />
23
- <component
24
- :is="ApptegyLogo"
25
- v-else
26
- :alt="$t('navigation.brandLogoAlt')"
27
- :use-light-logo="isAdmin || Object.values(getBrandingStyles).length === 0"
28
- />
29
- <div v-if="!brand?.hide_school_name">
30
- <div class="school-name">{{ brand?.school_name }}</div>
31
- <div
32
- v-if="brand?.school_tag_line"
33
- class="school-tag"
34
- >
35
- {{ brand.school_tag_line }}
36
- </div>
37
- </div>
38
- </div>
39
- </NuxtLink>
40
- </slot>
41
- </div>
6
+ <button
7
+ class="sidebar-toggle"
8
+ @click="toggleSidebar">
9
+ <a-icon
10
+ class="icon"
11
+ icon="16:apptegy"
12
+ />
13
+ <span>Menu</span>
14
+ </button >
42
15
  <div class="header__breadcrumbs">
43
16
  <slot name="breadcrumbs" />
44
17
  </div>
45
- <div class="user-control-actions">
46
- <slot name="org-select" />
47
- <slot name="user-controls" />
48
- <NavUserDropdown
49
- :user="user"
50
- :user-dropdown-options="userDropdownOptions"
51
- :impersonated-user="impersonatedUser"
52
- @select-option="(index) => $emit('selected-option', index)"
18
+ <slot name="org-select" />
19
+ <slot name="user-controls" />
20
+ <div
21
+ ref="settingsTriggerRef"
22
+ aria-controls="settings-dropdown"
23
+ :aria-expanded="active"
24
+ aria-haspopup="listbox"
25
+ role="combobox"
26
+ tabindex="0"
27
+ class="header__dropdown"
28
+ @keydown="keydownActionsOnTrigger($event, userSettingsOptions, settingsOptionsRef, settingsTriggerRef, false, '')"
29
+ @click.prevent="toggleDropdown($event, settingsOptionsRef)">
30
+ <NavAvatar
31
+ :name="user.name"
32
+ :src="user.avatar"
53
33
  />
54
- <template v-if="impersonatedUser?.show">
55
- <button
56
- v-if="useLogoutEmit"
57
- class="logout-impersonate-user"
58
- :aria-label="$t('accountSettings.signOut')"
59
- @click="$emit('user-logout')"
60
- >
61
- <Icon
62
- name="lucide:log-out"
63
- size="20"
64
- color="#662E80"
65
- />
66
- </button>
67
- <NuxtLink
68
- v-else
69
- class="logout-impersonate-user"
70
- :to="'/logout'"
71
- >
72
- <Icon
73
- name="lucide:log-out"
74
- size="20"
75
- color="#662E80"
34
+ <a-icon
35
+ class="icon"
36
+ icon="24:hamburger"
37
+ />
38
+ <span class="sr-only">Account Settings</span>
39
+ </div>
40
+ <div
41
+ v-show="active"
42
+ id="settings-dropdown"
43
+ class="options-dropdown"
44
+ role="listbox"
45
+ >
46
+ <div
47
+ v-for ="(option, idx) in userSettingsOptions"
48
+ v-on-click-outside="onClickOutsideHandler"
49
+ ref="settingsOptionsRef"
50
+ :key="option.label"
51
+ role="option"
52
+ class="option"
53
+ tabindex="-1"
54
+ @keydown="handleKeydownAction(userSettingsOptions, idx, $event, settingsOptionsRef, settingsTriggerRef)"
55
+ @click="handleSelectedClick(idx)"
56
+ >
57
+ <NuxtLink :to="option.url">
58
+ {{ option.label }}
59
+ <a-icon
60
+ :icon="option.icon"
61
+ color="black"
62
+ font-size="32px"
76
63
  />
77
64
  </NuxtLink>
78
- </template>
65
+ </div>
79
66
  </div>
80
67
  </header>
81
68
  </template>
82
69
 
83
- <script setup>
84
- import { useBranding, useNuxtApp, ref, computed, onMounted, onBeforeUnmount } from "#imports";
85
- import ApptegyLogo from "./Icons/ApptegyLogo.vue";
86
- const { $t } = useNuxtApp();
87
- const props = defineProps({
88
- sticky: { type: Boolean, required: false },
89
- clientId: { type: Number, required: false },
90
- homepageUrl: { type: String, required: false, default: "/" },
91
- isAdmin: { type: Boolean, required: false, default: false },
92
- user: { type: Object, required: true },
93
- impersonatedUser: { type: Object, required: false },
94
- useLogoutEmit: { type: Boolean, required: false },
95
- userDropdownOptions: { type: Array, required: true }
96
- });
97
- defineEmits(["selected-option", "user-logout"]);
98
- const { brand, getBrandingStyles } = await useBranding(props.clientId);
99
- const brandLogo = ref(brand.value?.logo_light);
100
- const brandLogoRef = ref(null);
101
- const brandLogoWidthPx = ref(0);
102
- let brandLogoResizeObserver = null;
103
- const _brandLogoWidth = computed(() => brandLogoWidthPx.value);
104
- function updateBrandLogoWidth() {
105
- brandLogoWidthPx.value = brandLogoRef.value?.clientWidth ?? 0;
106
- }
107
- onMounted(() => {
108
- updateBrandLogoWidth();
109
- if (brandLogoRef.value) {
110
- brandLogoResizeObserver = new ResizeObserver(() => {
111
- updateBrandLogoWidth();
112
- });
113
- brandLogoResizeObserver.observe(brandLogoRef.value);
114
- }
115
- });
116
- onBeforeUnmount(() => {
117
- brandLogoResizeObserver?.disconnect();
118
- brandLogoResizeObserver = null;
119
- });
70
+ <script setup lang="ts">
71
+ import { ref } from 'vue';
72
+ import { useDropdown } from '../../composables/accessibleActions.js';
73
+ import { vOnClickOutside } from '@vueuse/components';
74
+
75
+ const {
76
+ active,
77
+ toggleDropdown,
78
+ closeDropdown,
79
+ keydownActionsOnTrigger,
80
+ handleKeydown,
81
+ onClickOutsideHandler,
82
+ } = useDropdown();
83
+
84
+ interface IHeaderProps {
85
+ user: {
86
+ name: string;
87
+ avatar?: string;
88
+ };
89
+ sticky?: boolean;
90
+ userSettingsOptions: Array<any>;
91
+ selectedSetting?: {}
92
+ }
93
+
94
+ const props = defineProps<IHeaderProps>();
95
+
96
+ const settingsTriggerRef = ref();
97
+ const settingsOptionsRef = ref();
98
+
99
+ const emit = defineEmits(['toggle-sidebar', 'select-setting']);
100
+
101
+ function handleSelectedClick(index: number) {
102
+ emit('select-setting', index);
103
+ closeDropdown();
104
+ }
105
+
106
+ function handleKeydownAction(userSettingsOptions: any[], idx: number, $event: { key: string | boolean; }, optionRef: { focus: () => void; }[], dropdownTriggerRef: { focus: () => void; }) {
107
+ emit('select-setting', idx);
108
+ handleKeydown(userSettingsOptions, idx, $event, optionRef, dropdownTriggerRef);
109
+ }
110
+
111
+ function toggleSidebar() {
112
+ emit('toggle-sidebar');
113
+ }
120
114
  </script>
121
115
 
122
116
  <style scoped>
123
- header.header {
124
- position: relative;
117
+ header {
125
118
  grid-area: navheader;
126
119
  display: grid;
120
+ grid-auto-flow: column;
127
121
  grid-template-columns: auto 1fr auto;
128
122
  gap: 16px;
129
123
  align-items: center;
130
- padding: 16px 32px;
124
+ padding: 24px 64px 24px 36px;
131
125
  width: 100%;
132
126
  background-color: var(--primary-white);
133
127
  font: var(--font-regular);
134
128
  }
135
- header.header .header__logo {
136
- display: flex;
137
- align-items: center;
129
+ @media only screen and (max-width: 960px) {
130
+ header {
131
+ padding-left: 32px;
132
+ padding-right: 32px;
133
+ }
138
134
  }
139
- header.header .header__logo .no-link-style {
140
- text-decoration: none;
141
- color: inherit;
135
+ header.sticky {
136
+ position: sticky;
142
137
  }
143
- header.header .header__logo .header__logo-content {
138
+ header .sidebar-toggle {
144
139
  display: flex;
145
140
  align-items: center;
146
- gap: 8px;
147
- }
148
- header.header .header__logo .header__logo-content.big-logo {
149
- flex-direction: column;
150
- align-items: flex-start;
151
- }
152
- header.header .header__logo .header__logo-content img {
153
- display: inline;
154
- max-height: 36px;
155
- max-width: 180px;
156
- }
157
- header.header .header__logo .header__logo-content .school-name {
158
- font-size: 16px;
159
- font-weight: 700;
160
- overflow-wrap: break-word;
161
- word-break: break-word;
162
- white-space: nowrap;
163
- }
164
- header.header .header__logo .header__logo-content .school-tag {
165
- font-size: 14px;
166
- font-weight: 400;
167
- overflow-wrap: break-word;
168
- word-break: break-word;
169
- }
170
- header.header .header__breadcrumbs {
171
- grid-column: 2;
172
- }
173
- header.header .user-control-actions {
174
- grid-column: 3;
175
- display: flex;
176
- justify-content: end;
177
- gap: 8px;
141
+ gap: 4px;
142
+ background: var(--purple-20);
143
+ border: none;
144
+ border-radius: 4px;
145
+ padding: 8px 16px;
146
+ color: var(--purple);
147
+ cursor: pointer;
178
148
  }
179
- header.header .logout-impersonate-user {
180
- width: 32px;
181
- height: 32px;
182
- border-radius: 16px;
149
+ header .sidebar-toggle:focus {
150
+ outline: none;
151
+ box-shadow: 0 0 0 2px var(--primary-white), 0 0 0 3px var(--purple);
152
+ }
153
+ header .header__dropdown {
154
+ font-size: 24px;
155
+ min-width: 64px;
156
+ width: 64px;
157
+ max-width: 64px;
158
+ border: none;
159
+ padding: 0;
160
+ outline: none;
161
+ color: var(--purple);
183
162
  background: var(--purple-20);
163
+ border-radius: 16px;
164
+ overflow: hidden;
165
+ text-align: left;
166
+ position: relative;
184
167
  display: flex;
185
168
  align-items: center;
186
- justify-content: center;
187
- border: none;
188
169
  cursor: pointer;
189
170
  }
190
- header.header .logout-impersonate-user:hover {
191
- background: var(--purple-30);
171
+ header .header__dropdown:focus {
172
+ box-shadow: 0 0 0 2px var(--primary-white), 0 0 0 3px var(--purple);
192
173
  }
193
- @media only screen and (width <= 960px) {
194
- header.header {
195
- padding-left: 24px;
196
- padding-right: 24px;
197
- }
174
+ header .header__dropdown .avatar-container:focus {
175
+ outline: none;
198
176
  }
199
- header.header.sticky {
200
- position: sticky;
177
+ header .options-dropdown {
178
+ min-height: 100px;
179
+ position: absolute;
180
+ width: 198px;
181
+ right: 65px;
182
+ top: 80px;
183
+ background-color: #FFFFFF;
184
+ border-radius: 4px;
185
+ box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.06);
186
+ padding: 12px 0;
187
+ z-index: 10;
188
+ }
189
+ header .options-dropdown .option {
190
+ padding: 12px 16px;
191
+ cursor: pointer;
192
+ }
193
+ header .options-dropdown .option a {
194
+ color: #333;
195
+ text-decoration: none;
196
+ }
197
+ header .options-dropdown .option:focus-visible, header .options-dropdown .option:hover {
198
+ background-color: #F8F6FC;
201
199
  }
202
200
  </style>
@@ -1,149 +1,92 @@
1
1
  <template>
2
- <div
3
- class="help-btn-wrapper"
4
- :class="{ collapsed }"
5
- >
6
- <button
7
- v-if="schoolWebsite"
8
- :id="'school-website'"
9
- class="help-articles-btn"
10
- :class="{ collapsed }"
11
- :aria-label="$t('navigation.website')"
12
- @click="goToWebsite"
2
+ <div class="help-btn-wrapper">
3
+ <div
4
+ class="help-btn-actions"
5
+ ref="helpBtnActions"
6
+ :class="{ expanded: expanded && navbarExpanded }"
7
+ :style="{ 'max-height': `${expanded && navbarExpanded ? dropdownScrollHeight : 0}px` }"
13
8
  >
14
- <svg
15
- xmlns="http://www.w3.org/2000/svg"
16
- width="24"
17
- height="24"
18
- viewBox="0 0 24 24"
19
- fill="none"
9
+ <button
10
+ v-for="(option, idx) in helpArticleOptions"
11
+ :key="idx"
12
+ :id="`help-btn-${option.id}`"
13
+ class="help-btn-action"
20
14
  >
21
- <path
22
- d="M4 8H6.64922C6.87629 8 7.0966 7.92272 7.27391 7.78087L11.3753 4.49976C11.7405 4.20758 12.2595 4.20758 12.6247 4.49976L16.7261 7.78087C16.9034 7.92272 17.1237 8 17.3508 8H20M4 18H20M5 10V16M19 10V16M9 11V15M12 11V15M15 11V15M12.5 8.5V8.5C12.2239 8.77614 11.7761 8.77614 11.5 8.5V8.5C11.2239 8.22386 11.2239 7.77614 11.5 7.5V7.5C11.7761 7.22386 12.2239 7.22386 12.5 7.5V7.5C12.7761 7.77614 12.7761 8.22386 12.5 8.5Z"
23
- stroke="currentColor"
24
- stroke-linecap="round"
25
- stroke-linejoin="round"
26
- />
27
- </svg>
28
- </button>
15
+ {{ option.text }}
16
+ </button>
17
+ </div>
29
18
  <button
30
- v-if="showHelpArticles"
31
19
  :id="!isDropdown && 'help-btn'"
32
- :class="[
33
- 'help-articles-btn',
34
- !isDropdown && 'help-btn',
35
- isRoomsUser && `help-btn-${userRoomsRole}`,
36
- collapsed && 'collapsed'
37
- ]"
38
- :aria-label="isDropdown ? $t('navigation.helpCenter') : $t('navigation.helpArticles')"
20
+ :class="['help-articles-btn', !isDropdown && 'help-btn']"
39
21
  @click="expandDropdown"
40
22
  >
41
- <svg
42
- xmlns="http://www.w3.org/2000/svg"
43
- width="24"
44
- height="24"
45
- viewBox="0 0 24 24"
46
- fill="none"
47
- >
48
- <path
49
- d="M10 10C10 8.89543 10.8954 8 12 8C13.1046 8 14 8.89543 14 10C14 10.7571 13.5793 11.4159 12.959 11.7555C12.4745 12.0207 12 12.4477 12 13V14M12 16V17M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4Z"
50
- stroke="currentColor"
51
- stroke-linecap="round"
52
- stroke-linejoin="round"
53
- />
54
- </svg>
55
- </button>
56
- <button
57
- v-if="settingsRoute"
58
- :id="!isDropdown && 'help-btn'"
59
- :class="['help-articles-btn', !isDropdown && 'help-btn', collapsed && 'collapsed']"
60
- :aria-label="$t('navigation.accountSettings')"
61
- @click="goToSettings"
62
- >
63
- <svg
64
- xmlns="http://www.w3.org/2000/svg"
65
- width="24"
66
- height="24"
67
- viewBox="0 0 24 24"
68
- fill="none"
69
- >
70
- <path
71
- d="M17 18.3153L18.3487 16.958C18.5827 16.7213 18.6067 16.3487 18.4047 16.0833L17.4807 14.8713C17.6547 14.5393 17.798 14.1933 17.9087 13.8367L19.42 13.6387C19.752 13.5953 20 13.3127 20 12.978V11.022C20 10.6873 19.752 10.404 19.42 10.3613L17.9 10.162C17.784 9.796 17.6347 9.44133 17.4533 9.10267L18.3773 7.874C18.578 7.608 18.5513 7.23533 18.3153 7.00067L16.958 5.652C16.72 5.41667 16.3473 5.39333 16.084 5.59333L14.8473 6.536C14.5187 6.36533 14.178 6.22467 13.8267 6.116L13.6393 4.586C13.5987 4.25133 13.3153 4 12.978 4H11.022C10.6867 4 10.404 4.24867 10.3613 4.58067L10.1613 6.11733C9.79533 6.23067 9.442 6.37733 9.10333 6.55667L7.87733 5.624C7.612 5.422 7.23667 5.448 7.00067 5.68533L5.65267 7.042C5.416 7.28133 5.39333 7.658 5.6 7.92333L6.53267 9.11533C6.35133 9.45333 6.204 9.80533 6.08933 10.1693L4.58267 10.3607C4.24933 10.4033 4 10.686 4 11.022V12.978C4 13.3147 4.25067 13.5973 4.584 13.6393L6.07867 13.8253C6.192 14.1933 6.34067 14.55 6.52267 14.8933L5.61667 16.134C5.42267 16.4 5.45133 16.768 5.68533 17.0007L7.04333 18.348C7.27933 18.582 7.65 18.6073 7.91467 18.4073L9.13533 17.486C9.466 17.6593 9.81133 17.8007 10.166 17.9107L10.3607 19.4187C10.4033 19.7513 10.6867 20 11.022 20H12.978C13.312 20 13.5947 19.7527 13.6387 19.4213L13.84 17.9053C14.2027 17.7933 14.5533 17.6473 14.89 17.4687L16.1313 18.382C16.3987 18.5773 16.7667 18.5493 17 18.3153Z"
72
- stroke="currentColor"
73
- />
74
- <circle
75
- cx="12"
76
- cy="12"
77
- r="3"
78
- stroke="currentColor"
79
- />
80
- </svg>
23
+ <img v-if="isDropdown" src="../../assets/img/help-toggle.svg" alt="" class="help-center-btn-icon" />
24
+ <img v-else src="../../assets/img/help.svg" alt="" class="help-center-btn-icon" />
25
+ <span v-if="navbarExpanded">
26
+ {{ isDropdown ? $t('dscl.navigation.helpCenter') : $t('dscl.navigation.helpArticles') }}
27
+ </span>
28
+ <img
29
+ v-if="isDropdown && navbarExpanded && !hasArticles"
30
+ class="caret-icon"
31
+ :class="{ collapse: !expanded }"
32
+ src="../../assets/img/navbar-up.svg"
33
+ alt=""
34
+ />
81
35
  </button>
82
36
  </div>
83
37
  </template>
84
38
 
85
- <script setup>
86
- import { useSidebar, navigateTo, useAuth } from "#imports";
87
- import { ref, computed, onMounted } from "vue";
88
- const { userProfile } = useAuth();
89
- const props = defineProps({
90
- helpArticleOptions: { type: Array, required: true, default: () => [] },
91
- settingsRoute: { type: String, required: true, default: "" },
92
- schoolWebsite: { type: String, required: true, default: "" },
93
- showHelpArticles: { type: Boolean, required: true, default: false },
94
- collapsed: { type: Boolean, required: true }
95
- });
96
- const { state: expandedSidebar } = useSidebar();
39
+ <script setup lang="ts">
40
+ import { ref, computed, onMounted } from 'vue'
41
+
42
+ interface IHelpArticlesProps {
43
+ navbarExpanded: boolean;
44
+ helpArticleOptions: Array<any>;
45
+ };
46
+
47
+ const props = withDefaults(defineProps<IHelpArticlesProps>(), {
48
+ helpArticleOptions: () => [],
49
+ })
50
+
97
51
  const expanded = ref(false);
98
52
  const helpBtnActions = ref();
99
53
  const dropdownScrollHeight = ref(0);
100
54
  const isDropdown = ref(false);
101
- const isRoomsUser = computed(() => {
102
- return !!userProfile.value?.roles?.rooms;
103
- });
104
- const userRoomsRole = computed(() => {
105
- return userProfile.value?.roles?.rooms;
106
- });
107
- const hasArticles = computed(() => !!props.helpArticleOptions?.values?.length);
55
+
56
+ const hasArticles = computed(() => {
57
+ return !!props.helpArticleOptions?.values?.length
58
+ })
59
+
108
60
  onMounted(() => {
109
61
  isDropdown.value = !!props.helpArticleOptions?.values?.length;
110
62
  dropdownScrollHeight.value = helpBtnActions.value?.scrollHeight + 12;
111
63
  });
64
+
112
65
  function expandDropdown() {
113
- if (!isDropdown.value) return;
66
+ if (!isDropdown) {
67
+ return;
68
+ }
114
69
  expanded.value = !expanded.value;
115
- }
116
- async function goToSettings() {
117
- await navigateTo(`${props.settingsRoute}`, { external: true });
118
- }
119
- async function goToWebsite() {
120
- await navigateTo(`${props.schoolWebsite}`, { external: true });
121
- }
70
+ };
71
+
122
72
  </script>
123
73
 
124
74
  <style scoped>
125
75
  .help-btn-wrapper {
76
+ box-shadow: inset 0px -1px 0px 0px var(--dscl-nav-section-border-bottom-color, var(--purple-65));
126
77
  display: flex;
127
- flex-direction: row;
78
+ flex-direction: column;
128
79
  align-items: center;
129
- justify-content: flex-start;
130
80
  width: 100%;
131
- text-transform: uppercase;
132
- padding-left: 8px;
133
- }
134
- .help-btn-wrapper.collapsed {
135
- justify-content: center;
136
- flex-direction: column;
137
- padding-left: 0;
138
81
  }
139
82
  .help-btn-wrapper .help-articles-btn {
140
83
  cursor: pointer;
141
84
  display: flex;
85
+ width: 100%;
142
86
  align-items: center;
143
87
  background: none;
144
- padding: 10px 0px 10px 8px;
88
+ padding: 8px 10px 8px 16px;
145
89
  border: none;
146
- text-transform: inherit;
147
90
  }
148
91
  .help-btn-wrapper .help-articles-btn:focus-visible {
149
92
  outline: var(--orange) solid 2px;
@@ -155,11 +98,9 @@ async function goToWebsite() {
155
98
  min-width: 32px;
156
99
  width: 32px;
157
100
  }
158
- .help-btn-wrapper .help-articles-btn.collapsed {
159
- padding: 10px 0px;
160
- }
161
101
  .help-btn-wrapper .help-btn-actions {
162
102
  visibility: hidden;
103
+ width: 100%;
163
104
  max-height: 0px;
164
105
  overflow-y: hidden;
165
106
  transition: all 0.5s ease-in-out;
@@ -173,9 +114,10 @@ async function goToWebsite() {
173
114
  border: none;
174
115
  padding: 0;
175
116
  background: none;
176
- color: var(--nav-text-color, var(--primary-white));
117
+ color: var(--dscl-nav-font-color, var(--dscl-light-font, var(--primary-white)));
177
118
  cursor: pointer;
178
119
  font-size: 14px;
120
+ width: 100%;
179
121
  text-align: left;
180
122
  position: relative;
181
123
  padding: 6px 51px 6px 45px;
@@ -188,7 +130,7 @@ async function goToWebsite() {
188
130
  bottom: 0px;
189
131
  right: 0px;
190
132
  left: -45px;
191
- background-color: var(--nav-background-color, var(--purple-70));
133
+ background-color: var(--dscl-nav-active-background-color, #463e59);
192
134
  }
193
135
  .help-btn-wrapper .caret-icon {
194
136
  margin-left: auto;
@@ -198,12 +140,12 @@ async function goToWebsite() {
198
140
  .help-btn-wrapper .caret-icon.collapse {
199
141
  transform: rotate(0.5turn);
200
142
  }
201
- .help-btn-wrapper svg {
143
+ .help-btn-wrapper img {
144
+ background: #504764;
202
145
  border-radius: 4px;
203
- color: var(--nav-icon-color, #662e80);
204
146
  }
205
147
  .help-btn-wrapper span {
206
- color: var(--nav-text-color, var(--primary-white));
148
+ color: var(--dscl-nav-font-color, var(--dscl-light-font, var(--primary-white)));
207
149
  margin-left: 8px;
208
150
  font-size: 12px;
209
151
  letter-spacing: 0.4px;