@apptegy/nuxt-navigation 0.1.127 → 0.2.1-alpha.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.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.0.0"
5
5
  },
6
6
  "configKey": "@apptegy/nuxt-navigation",
7
- "version": "0.1.127",
7
+ "version": "0.2.1-alpha.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.1",
10
10
  "unbuild": "unknown"
@@ -1,7 +1,36 @@
1
1
  <template>
2
- <div class="avatar-container">
3
- <img v-if="src" :src="src" class="avatar-size" alt="">
4
- <span v-else class="avatar-size">
2
+ <PAvatar
3
+ v-if="isBeaconNavEnabled"
4
+ :image="src || void 0"
5
+ :label="!src ? initials : void 0"
6
+ class="beacon-avatar"
7
+ shape="square"
8
+ size="normal"
9
+ >
10
+ <template
11
+ v-if="!src && !initials"
12
+ #icon
13
+ >
14
+ <Icon
15
+ name="lucide:user"
16
+ class="icon"
17
+ />
18
+ </template>
19
+ </PAvatar>
20
+ <div
21
+ v-else
22
+ class="avatar-container"
23
+ >
24
+ <img
25
+ v-if="src"
26
+ :src="src"
27
+ class="avatar-size"
28
+ alt=""
29
+ />
30
+ <span
31
+ v-else
32
+ class="avatar-size"
33
+ >
5
34
  {{ initials }}
6
35
  </span>
7
36
  <svg
@@ -14,22 +43,39 @@
14
43
  xmlns="http://www.w3.org/2000/svg"
15
44
  aria-label="Impersonated user"
16
45
  >
17
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12.6263 1.6087C13.0678 2.13532 13.3333 2.81151 13.3333 3.54897C13.3333 5.22916 11.9559 6.59105 10.2565 6.59105C10.1797 6.59105 10.1036 6.58826 10.0282 6.58278C10.1737 6.83855 10.2567 7.13375 10.2567 7.44821C10.2566 7.73741 10.1864 8.01033 10.0619 8.25129C11.0877 8.74406 11.795 9.78216 11.7952 10.9856C11.7952 11.5456 11.3356 12 10.7692 12H2.56467C1.99821 12 1.53867 11.5456 1.53867 10.9856C1.53881 9.78225 2.2461 8.74396 3.27171 8.25107C3.14726 8.01017 3.07705 7.73732 3.077 7.44821C3.077 7.13376 3.16002 6.83855 3.30555 6.58278C3.23004 6.58826 3.15377 6.59105 3.07683 6.59105C1.37761 6.59088 0 5.22905 0 3.54897C7.92599e-05 2.81135 0.265697 2.13503 0.707484 1.60836C0.585132 1.44137 0.513 1.23606 0.513 1.01408C0.513 0.454021 0.972207 0 1.53867 0H4.61567C5.18213 0 5.64133 0.454021 5.64133 1.01408C5.64133 1.2362 5.56911 1.44165 5.4466 1.6087C5.85423 2.09487 6.11177 2.70851 6.14899 3.38016H7.18434C7.22158 2.70836 7.47929 2.09458 7.88715 1.60836C7.7648 1.44137 7.69267 1.23605 7.69267 1.01408C7.69267 0.454021 8.15187 0 8.71833 0H11.7953C12.3618 0 12.821 0.454021 12.821 1.01408C12.821 1.2362 12.7488 1.44165 12.6263 1.6087ZM8.90015 2.02817C8.47434 2.39969 8.20577 2.94329 8.20567 3.54897C8.20567 4.66898 9.12373 5.57762 10.2565 5.57779C11.3894 5.57779 12.3085 4.66909 12.3085 3.54897C12.3084 2.94329 12.0396 2.39969 11.6136 2.02817H8.90015ZM5.64083 8.70988C5.64083 9.12681 6.24532 9.46433 6.66701 9.46433C7.0887 9.46433 7.69283 9.12681 7.69283 8.70988C7.69284 8.57344 7.74842 8.44248 7.84708 8.34709C7.94289 8.25457 8.07191 8.20267 8.20583 8.20267H8.46759C8.8892 8.20267 9.23051 7.86502 9.23067 7.44821C9.23067 7.03128 8.88929 6.6926 8.46759 6.6926H8.20583C7.96517 6.6926 7.75636 6.52752 7.70452 6.29516L7.28033 4.39457H6.05334L5.62915 6.29516C5.57734 6.52735 5.36945 6.69237 5.129 6.6926H4.86607C4.44452 6.69277 4.103 7.03138 4.103 7.44821C4.10316 7.86492 4.44462 8.2025 4.86607 8.20267H5.129L5.2295 8.21307C5.32786 8.23262 5.41926 8.28053 5.49126 8.35171C5.58728 8.44677 5.64082 8.57552 5.64083 8.70988ZM1.026 3.54897C1.0261 2.94329 1.29467 2.39969 1.72048 2.02817H4.43389C4.85992 2.39969 5.12874 2.94329 5.12883 3.54897C5.12883 4.66909 4.20975 5.57779 3.07683 5.57779C1.94407 5.57762 1.026 4.66898 1.026 3.54897Z" fill="black"/>
18
- <path d="M1.026 3.54897C1.0261 2.94329 1.29467 2.39969 1.72048 2.02817H4.43389C4.85992 2.39969 5.12874 2.94329 5.12883 3.54897C5.12883 4.66909 4.20975 5.57779 3.07683 5.57779C1.94407 5.57762 1.026 4.66898 1.026 3.54897Z" fill="#C8D5F0"/>
19
- <path d="M8.90015 2.02817C8.47434 2.39969 8.20577 2.94329 8.20567 3.54897C8.20567 4.66898 9.12373 5.57762 10.2565 5.57779C11.3894 5.57779 12.3085 4.66909 12.3085 3.54897C12.3084 2.94329 12.0396 2.39969 11.6136 2.02817H8.90015Z" fill="#C8D5F0"/>
20
- <path d="M5.64083 8.70988C5.64083 9.12681 6.24532 9.46433 6.66701 9.46433C7.0887 9.46433 7.69283 9.12681 7.69283 8.70988C7.69284 8.57344 7.74842 8.44248 7.84708 8.34709C7.94289 8.25457 8.07191 8.20267 8.20583 8.20267H8.46759C8.8892 8.20267 9.23051 7.86502 9.23067 7.44821C9.23067 7.03128 8.88929 6.6926 8.46759 6.6926H8.20583C7.96517 6.6926 7.75636 6.52752 7.70452 6.29516L7.28033 4.39457H6.05334L5.62915 6.29516C5.57734 6.52735 5.36945 6.69237 5.129 6.6926H4.86607C4.44452 6.69277 4.103 7.03138 4.103 7.44821C4.10316 7.86492 4.44462 8.2025 4.86607 8.20267H5.129L5.2295 8.21307C5.32786 8.23262 5.41926 8.28053 5.49126 8.35171C5.58728 8.44677 5.64082 8.57552 5.64083 8.70988Z" fill="#E4B7B7"/>
46
+ <path
47
+ fill-rule="evenodd"
48
+ clip-rule="evenodd"
49
+ d="M12.6263 1.6087C13.0678 2.13532 13.3333 2.81151 13.3333 3.54897C13.3333 5.22916 11.9559 6.59105 10.2565 6.59105C10.1797 6.59105 10.1036 6.58826 10.0282 6.58278C10.1737 6.83855 10.2567 7.13375 10.2567 7.44821C10.2566 7.73741 10.1864 8.01033 10.0619 8.25129C11.0877 8.74406 11.795 9.78216 11.7952 10.9856C11.7952 11.5456 11.3356 12 10.7692 12H2.56467C1.99821 12 1.53867 11.5456 1.53867 10.9856C1.53881 9.78225 2.2461 8.74396 3.27171 8.25107C3.14726 8.01017 3.07705 7.73732 3.077 7.44821C3.077 7.13376 3.16002 6.83855 3.30555 6.58278C3.23004 6.58826 3.15377 6.59105 3.07683 6.59105C1.37761 6.59088 0 5.22905 0 3.54897C7.92599e-05 2.81135 0.265697 2.13503 0.707484 1.60836C0.585132 1.44137 0.513 1.23606 0.513 1.01408C0.513 0.454021 0.972207 0 1.53867 0H4.61567C5.18213 0 5.64133 0.454021 5.64133 1.01408C5.64133 1.2362 5.56911 1.44165 5.4466 1.6087C5.85423 2.09487 6.11177 2.70851 6.14899 3.38016H7.18434C7.22158 2.70836 7.47929 2.09458 7.88715 1.60836C7.7648 1.44137 7.69267 1.23605 7.69267 1.01408C7.69267 0.454021 8.15187 0 8.71833 0H11.7953C12.3618 0 12.821 0.454021 12.821 1.01408C12.821 1.2362 12.7488 1.44165 12.6263 1.6087ZM8.90015 2.02817C8.47434 2.39969 8.20577 2.94329 8.20567 3.54897C8.20567 4.66898 9.12373 5.57762 10.2565 5.57779C11.3894 5.57779 12.3085 4.66909 12.3085 3.54897C12.3084 2.94329 12.0396 2.39969 11.6136 2.02817H8.90015ZM5.64083 8.70988C5.64083 9.12681 6.24532 9.46433 6.66701 9.46433C7.0887 9.46433 7.69283 9.12681 7.69283 8.70988C7.69284 8.57344 7.74842 8.44248 7.84708 8.34709C7.94289 8.25457 8.07191 8.20267 8.20583 8.20267H8.46759C8.8892 8.20267 9.23051 7.86502 9.23067 7.44821C9.23067 7.03128 8.88929 6.6926 8.46759 6.6926H8.20583C7.96517 6.6926 7.75636 6.52752 7.70452 6.29516L7.28033 4.39457H6.05334L5.62915 6.29516C5.57734 6.52735 5.36945 6.69237 5.129 6.6926H4.86607C4.44452 6.69277 4.103 7.03138 4.103 7.44821C4.10316 7.86492 4.44462 8.2025 4.86607 8.20267H5.129L5.2295 8.21307C5.32786 8.23262 5.41926 8.28053 5.49126 8.35171C5.58728 8.44677 5.64082 8.57552 5.64083 8.70988ZM1.026 3.54897C1.0261 2.94329 1.29467 2.39969 1.72048 2.02817H4.43389C4.85992 2.39969 5.12874 2.94329 5.12883 3.54897C5.12883 4.66909 4.20975 5.57779 3.07683 5.57779C1.94407 5.57762 1.026 4.66898 1.026 3.54897Z"
50
+ fill="black"
51
+ />
52
+ <path
53
+ d="M1.026 3.54897C1.0261 2.94329 1.29467 2.39969 1.72048 2.02817H4.43389C4.85992 2.39969 5.12874 2.94329 5.12883 3.54897C5.12883 4.66909 4.20975 5.57779 3.07683 5.57779C1.94407 5.57762 1.026 4.66898 1.026 3.54897Z"
54
+ fill="#C8D5F0"
55
+ />
56
+ <path
57
+ d="M8.90015 2.02817C8.47434 2.39969 8.20577 2.94329 8.20567 3.54897C8.20567 4.66898 9.12373 5.57762 10.2565 5.57779C11.3894 5.57779 12.3085 4.66909 12.3085 3.54897C12.3084 2.94329 12.0396 2.39969 11.6136 2.02817H8.90015Z"
58
+ fill="#C8D5F0"
59
+ />
60
+ <path
61
+ d="M5.64083 8.70988C5.64083 9.12681 6.24532 9.46433 6.66701 9.46433C7.0887 9.46433 7.69283 9.12681 7.69283 8.70988C7.69284 8.57344 7.74842 8.44248 7.84708 8.34709C7.94289 8.25457 8.07191 8.20267 8.20583 8.20267H8.46759C8.8892 8.20267 9.23051 7.86502 9.23067 7.44821C9.23067 7.03128 8.88929 6.6926 8.46759 6.6926H8.20583C7.96517 6.6926 7.75636 6.52752 7.70452 6.29516L7.28033 4.39457H6.05334L5.62915 6.29516C5.57734 6.52735 5.36945 6.69237 5.129 6.6926H4.86607C4.44452 6.69277 4.103 7.03138 4.103 7.44821C4.10316 7.86492 4.44462 8.2025 4.86607 8.20267H5.129L5.2295 8.21307C5.32786 8.23262 5.41926 8.28053 5.49126 8.35171C5.58728 8.44677 5.64082 8.57552 5.64083 8.70988Z"
62
+ fill="#E4B7B7"
63
+ />
21
64
  </svg>
22
65
  </div>
23
66
  </template>
24
67
 
25
68
  <script setup>
69
+ import PAvatar from "primevue/avatar";
26
70
  import { computed } from "vue";
27
71
  const props = defineProps({
28
72
  src: { type: String, required: false },
29
73
  name: { type: String, required: true },
30
- isImpersonated: { type: Boolean, required: false }
74
+ isImpersonated: { type: Boolean, required: false },
75
+ isBeaconNavEnabled: { type: Boolean, required: true }
31
76
  });
32
77
  const initials = computed(() => {
78
+ if (!props.name) return "";
33
79
  const initials2 = props.name.match(/\b\w/g) || [];
34
80
  return ((initials2.shift() || "") + (initials2.pop() || "")).toUpperCase();
35
81
  });
@@ -81,4 +127,20 @@ img {
81
127
  width: 14px;
82
128
  height: 14px;
83
129
  }
130
+
131
+ .beacon-avatar {
132
+ min-width: 28px;
133
+ min-height: 28px;
134
+ max-width: 28px;
135
+ max-height: 28px;
136
+ }
137
+ .beacon-avatar .icon {
138
+ width: 16px;
139
+ height: 16px;
140
+ background-color: #2d2d2d;
141
+ }
142
+ .beacon-avatar :deep(img),
143
+ .beacon-avatar :deep(span) {
144
+ border-radius: 6px;
145
+ }
84
146
  </style>
@@ -11,6 +11,10 @@ interface IAvatarProps {
11
11
  * Indicates if the user is being impersonated.
12
12
  */
13
13
  isImpersonated?: boolean;
14
+ /**
15
+ * Indicates if the beacon nav is enabled.
16
+ */
17
+ isBeaconNavEnabled: boolean;
14
18
  }
15
19
  declare const _default: import("vue").DefineComponent<IAvatarProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IAvatarProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
20
  export default _default;
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <header
3
- class="header"
4
- :class="{ sticky }"
3
+ :class="['header', isBeaconNavEnabled ? 'beacon' : 'classic', { sticky }]"
5
4
  role="banner"
6
5
  >
7
6
  <div class="header__breadcrumbs">
@@ -16,128 +15,131 @@
16
15
  v-if="showNotifications"
17
16
  class="header__notifications"
18
17
  >
19
- <Button
20
- type="button"
21
- severity="secondary"
22
- text
23
- rounded
24
- class="notification-bell"
25
- :class="{ 'notification-bell--active': panelOpen }"
26
- :aria-label="$t('navigation.notifications')"
27
- :aria-expanded="panelOpen"
28
- aria-haspopup="dialog"
29
- @click="onBellClick"
30
- >
31
- <svg
32
- class="notification-bell__icon"
33
- :class="{ 'notification-bell__icon--shaking': isBellShaking }"
34
- xmlns="http://www.w3.org/2000/svg"
35
- width="22"
36
- height="22"
37
- viewBox="0 0 24 24"
38
- fill="none"
39
- stroke="currentColor"
40
- stroke-width="2"
41
- stroke-linecap="round"
42
- stroke-linejoin="round"
43
- aria-hidden="true"
44
- @animationend="onBellShakeEnd"
45
- >
46
- <path d="M10.268 21a2 2 0 0 0 3.464 0" />
47
- <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />
48
- </svg>
49
- <span
50
- v-if="notificationCount > 0"
51
- class="notification-bell__badge"
52
- aria-hidden="true"
18
+ <Button
19
+ type="button"
20
+ severity="secondary"
21
+ text
22
+ rounded
23
+ class="notification-bell"
24
+ :class="{ 'notification-bell--active': panelOpen }"
25
+ :aria-label="$t('navigation.notifications')"
26
+ :aria-expanded="panelOpen"
27
+ aria-haspopup="dialog"
28
+ @click="onBellClick"
53
29
  >
54
- {{ formattedNotificationCount }}
55
- </span>
56
- </Button>
30
+ <svg
31
+ class="notification-bell__icon"
32
+ :class="{ 'notification-bell__icon--shaking': isBellShaking }"
33
+ xmlns="http://www.w3.org/2000/svg"
34
+ width="22"
35
+ height="22"
36
+ viewBox="0 0 24 24"
37
+ fill="none"
38
+ stroke="currentColor"
39
+ stroke-width="2"
40
+ stroke-linecap="round"
41
+ stroke-linejoin="round"
42
+ aria-hidden="true"
43
+ @animationend="onBellShakeEnd"
44
+ >
45
+ <path d="M10.268 21a2 2 0 0 0 3.464 0" />
46
+ <path
47
+ d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"
48
+ />
49
+ </svg>
50
+ <span
51
+ v-if="notificationCount > 0"
52
+ class="notification-bell__badge"
53
+ aria-hidden="true"
54
+ >
55
+ {{ formattedNotificationCount }}
56
+ </span>
57
+ </Button>
58
+
59
+ <slot name="notifications">
60
+ <Popover
61
+ v-if="!isMobilePanel"
62
+ ref="popoverRef"
63
+ append-to="body"
64
+ class="notifications-popover"
65
+ :pt="popoverPt"
66
+ @show="onPanelShow"
67
+ @hide="onPanelHide"
68
+ >
69
+ <NavNotificationsPanel
70
+ v-if="notificationsPanel"
71
+ embedded
72
+ :data="notificationsPanel"
73
+ :loading="notificationsLoading"
74
+ :active-tab-id="activeTabId"
75
+ :active-filter-id="activeFilterId"
76
+ :filter-catalog="filterCatalog"
77
+ @update:active-tab-id="handleTabChange"
78
+ @update:active-filter-id="handleFilterChange"
79
+ @update:filter-catalog="filterCatalog = $event"
80
+ @clear-all="(payload) => $emit('notifications-clear-all', payload)"
81
+ @dismiss="(payload) => $emit('notifications-dismiss', payload)"
82
+ @select="handleNotificationSelect"
83
+ />
84
+ </Popover>
57
85
 
58
- <slot name="notifications">
59
- <Popover
60
- v-if="!isMobilePanel"
61
- ref="popoverRef"
62
- append-to="body"
63
- class="notifications-popover"
64
- :pt="popoverPt"
65
- @show="onPanelShow"
66
- @hide="onPanelHide"
86
+ <Teleport
87
+ v-else
88
+ to="body"
89
+ >
90
+ <NavNotificationsPanel
91
+ v-if="notificationsPanel && panelOpen"
92
+ embedded
93
+ mobile
94
+ :data="notificationsPanel"
95
+ :loading="notificationsLoading"
96
+ :active-tab-id="activeTabId"
97
+ :active-filter-id="activeFilterId"
98
+ :filter-catalog="filterCatalog"
99
+ @update:active-tab-id="handleTabChange"
100
+ @update:active-filter-id="handleFilterChange"
101
+ @update:filter-catalog="filterCatalog = $event"
102
+ @clear-all="(payload) => $emit('notifications-clear-all', payload)"
103
+ @dismiss="(payload) => $emit('notifications-dismiss', payload)"
104
+ @select="handleNotificationSelect"
105
+ @close="closeNotificationsPanel"
106
+ />
107
+ </Teleport>
108
+ </slot>
109
+ </div>
110
+ <NavUserDropdown
111
+ :user="user"
112
+ :user-dropdown-options="userDropdownOptions"
113
+ :impersonated-user="impersonatedUser"
114
+ @select-option="(index) => $emit('selected-option', index)"
115
+ />
116
+ <template v-if="impersonatedUser?.show">
117
+ <button
118
+ v-if="useLogoutEmit"
119
+ class="logout-impersonate-user"
120
+ :aria-label="$t('accountSettings.signOut')"
121
+ @click="$emit('user-logout')"
67
122
  >
68
- <NavNotificationsPanel
69
- v-if="notificationsPanel"
70
- embedded
71
- :data="notificationsPanel"
72
- :loading="notificationsLoading"
73
- :active-tab-id="activeTabId"
74
- :active-filter-id="activeFilterId"
75
- :filter-catalog="filterCatalog"
76
- @update:active-tab-id="handleTabChange"
77
- @update:active-filter-id="handleFilterChange"
78
- @update:filter-catalog="filterCatalog = $event"
79
- @clear-all="(payload) => $emit('notifications-clear-all', payload)"
80
- @dismiss="(payload) => $emit('notifications-dismiss', payload)"
81
- @select="handleNotificationSelect"
123
+ <a-icon
124
+ class="icon"
125
+ :icon="'16:logout'"
126
+ font-size="20px"
127
+ color="#662E80"
82
128
  />
83
- </Popover>
84
-
85
- <Teleport
129
+ </button>
130
+ <NuxtLink
86
131
  v-else
87
- to="body"
132
+ class="logout-impersonate-user"
133
+ :to="'/logout'"
88
134
  >
89
- <NavNotificationsPanel
90
- v-if="notificationsPanel && panelOpen"
91
- embedded
92
- mobile
93
- :data="notificationsPanel"
94
- :loading="notificationsLoading"
95
- :active-tab-id="activeTabId"
96
- :active-filter-id="activeFilterId"
97
- :filter-catalog="filterCatalog"
98
- @update:active-tab-id="handleTabChange"
99
- @update:active-filter-id="handleFilterChange"
100
- @update:filter-catalog="filterCatalog = $event"
101
- @clear-all="(payload) => $emit('notifications-clear-all', payload)"
102
- @dismiss="(payload) => $emit('notifications-dismiss', payload)"
103
- @select="handleNotificationSelect"
104
- @close="closeNotificationsPanel"
135
+ <a-icon
136
+ class="icon"
137
+ :icon="'16:logout'"
138
+ font-size="20px"
139
+ color="#662E80"
105
140
  />
106
- </Teleport>
107
- </slot>
108
- </div>
109
- <NavUserDropdown
110
- :user="user"
111
- :user-dropdown-options="userDropdownOptions"
112
- :impersonated-user="impersonatedUser"
113
- @select-option="(index) => $emit('selected-option', index)"
114
- />
115
- <template v-if="impersonatedUser?.show">
116
- <button
117
- v-if="useLogoutEmit"
118
- class="logout-impersonate-user"
119
- :aria-label="$t('accountSettings.signOut')"
120
- @click="$emit('user-logout')">
121
- <a-icon
122
- class="icon"
123
- :icon="'16:logout'"
124
- font-size="20px"
125
- color="#662E80"
126
- />
127
- </button>
128
- <NuxtLink
129
- v-else
130
- class="logout-impersonate-user"
131
- :to="'/logout'"
132
- >
133
- <a-icon
134
- class="icon"
135
- :icon="'16:logout'"
136
- font-size="20px"
137
- color="#662E80"
138
- />
139
- </NuxtLink>
140
- </template>
141
+ </NuxtLink>
142
+ </template>
141
143
  </div>
142
144
  </div>
143
145
  </header>
@@ -146,13 +148,10 @@
146
148
  <script setup>
147
149
  import { computed, nextTick, ref, watch } from "vue";
148
150
  import { useMediaQuery } from "@vueuse/core";
149
- import { useNuxtApp } from "#app";
151
+ import { useNuxtApp } from "#imports";
150
152
  import Button from "primevue/button";
151
153
  import Popover from "primevue/popover";
152
- import {
153
- getNotificationsTotalCount,
154
- mapNotificationsApiResponse
155
- } from "../../utils/notification-api";
154
+ import { getNotificationsTotalCount, mapNotificationsApiResponse } from "../../utils/notification-api";
156
155
  const props = defineProps({
157
156
  sticky: { type: Boolean, required: false },
158
157
  notifications: { type: [Object, null], required: false, default: null },
@@ -161,7 +160,7 @@ const props = defineProps({
161
160
  useLogoutEmit: { type: Boolean, required: false },
162
161
  userDropdownOptions: { type: Array, required: true }
163
162
  });
164
- const nuxtApp = useNuxtApp();
163
+ const { $t, $intl, $ld } = useNuxtApp();
165
164
  const emit = defineEmits([
166
165
  "selected-option",
167
166
  "user-logout",
@@ -187,11 +186,14 @@ const popoverPt = {
187
186
  style: "padding: 0; border: none; box-shadow: none; background: transparent;"
188
187
  }
189
188
  };
189
+ const isBeaconNavEnabled = computed(() => {
190
+ return Boolean($ld?.flags?.beaconNavEnabled);
191
+ });
190
192
  const notificationDateLabels = computed(() => ({
191
- today: nuxtApp.$t("navigation.notificationsPanel.dateGroups.today"),
192
- yesterday: nuxtApp.$t("navigation.notificationsPanel.dateGroups.yesterday"),
193
- yesterdayTimeAgo: nuxtApp.$t("navigation.notificationsPanel.yesterday"),
194
- justNow: nuxtApp.$t("navigation.notificationsPanel.justNow")
193
+ today: $t("navigation.notificationsPanel.dateGroups.today"),
194
+ yesterday: $t("navigation.notificationsPanel.dateGroups.yesterday"),
195
+ yesterdayTimeAgo: $t("navigation.notificationsPanel.yesterday"),
196
+ justNow: $t("navigation.notificationsPanel.justNow")
195
197
  }));
196
198
  const notificationsPanel = computed(() => {
197
199
  if (!notificationsResponse.value) {
@@ -200,36 +202,28 @@ const notificationsPanel = computed(() => {
200
202
  return mapNotificationsApiResponse(notificationsResponse.value, {
201
203
  locale: nuxtApp.$intl.locale,
202
204
  dateLabels: notificationDateLabels.value,
203
- retentionLabel: nuxtApp.$t("navigation.notificationsPanel.retentionLabel"),
205
+ retentionLabel: $t("navigation.notificationsPanel.retentionLabel"),
204
206
  tabs: [
205
- { id: "new", label: nuxtApp.$t("navigation.notificationsPanel.tabs.new"), unreadOnly: true },
206
- { id: "all", label: nuxtApp.$t("navigation.notificationsPanel.tabs.all") }
207
+ { id: "new", label: $t("navigation.notificationsPanel.tabs.new"), unreadOnly: true },
208
+ { id: "all", label: $t("navigation.notificationsPanel.tabs.all") }
207
209
  ]
208
210
  });
209
211
  });
210
- const notificationCount = computed(
211
- () => getNotificationsTotalCount(notificationsResponse.value)
212
- );
212
+ const notificationCount = computed(() => getNotificationsTotalCount(notificationsResponse.value));
213
213
  function patchNotifications(patch) {
214
214
  if (!props.notifications) {
215
215
  return;
216
216
  }
217
217
  emit("update:notifications", {
218
218
  ...props.notifications,
219
- panelOpen: panelOpen.value,
220
- activeTabId: activeTabId.value,
221
- activeFilterId: activeFilterId.value,
222
219
  ...patch
223
220
  });
224
221
  }
225
- watch(
226
- notificationCount,
227
- (newCount, oldCount) => {
228
- if (oldCount !== void 0 && newCount > oldCount) {
229
- playBellShake();
230
- }
222
+ watch(notificationCount, (newCount, oldCount) => {
223
+ if (oldCount !== void 0 && newCount > oldCount) {
224
+ playBellShake();
231
225
  }
232
- );
226
+ });
233
227
  async function playBellShake() {
234
228
  isBellShaking.value = false;
235
229
  await nextTick();
@@ -306,7 +300,7 @@ function handleFilterChange(id) {
306
300
  </script>
307
301
 
308
302
  <style scoped>
309
- header.header {
303
+ header.header.classic {
310
304
  position: relative;
311
305
  grid-area: navheader;
312
306
  display: grid;
@@ -319,35 +313,118 @@ header.header {
319
313
  background-color: var(--primary-white);
320
314
  font: var(--font-regular);
321
315
  }
322
- header.header .header__end {
316
+ header.header.classic .header__end {
323
317
  display: flex;
324
318
  align-items: center;
325
319
  justify-content: flex-end;
326
320
  gap: 24px;
327
321
  min-width: 0;
328
322
  }
329
- header.header .user-control-actions {
323
+ header.header.classic .user-control-actions {
330
324
  display: flex;
331
325
  align-items: center;
332
326
  gap: 8px;
333
327
  flex-shrink: 0;
334
328
  }
335
- header.header .header__notifications {
329
+ header.header.classic .header__notifications {
330
+ position: relative;
331
+ display: flex;
332
+ align-items: center;
333
+ }
334
+ header.header.classic :deep(.notification-bell) {
335
+ position: relative;
336
+ width: 32px;
337
+ height: 32px;
338
+ padding: 0;
339
+ overflow: visible;
340
+ }
341
+ header.header.classic :deep(.notification-bell).notification-bell--active {
342
+ background: var(--grey-10, #f3f4f6);
343
+ }
344
+ header.header.classic .notification-bell__badge {
345
+ position: absolute;
346
+ top: 2px;
347
+ right: -4px;
348
+ min-width: 16px;
349
+ height: 16px;
350
+ padding: 0 4px;
351
+ border: 2px solid var(--primary-white, #fff);
352
+ border-radius: 8px;
353
+ background: #c84b31;
354
+ color: var(--primary-white, #fff);
355
+ font-size: 10px;
356
+ font-weight: 800;
357
+ line-height: 12px;
358
+ text-align: center;
359
+ box-sizing: border-box;
360
+ pointer-events: none;
361
+ }
362
+ header.header.classic .notification-bell__icon {
363
+ display: block;
364
+ flex-shrink: 0;
365
+ color: var(--grey-80, #374151);
366
+ transform-origin: 50% 20%;
367
+ }
368
+ header.header.classic .notification-bell__icon--shaking {
369
+ animation: bellShake 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
370
+ }
371
+ header.header.classic .logout-impersonate-user {
372
+ width: 32px;
373
+ height: 32px;
374
+ border-radius: 16px;
375
+ background: var(--purple-20);
376
+ display: flex;
377
+ align-items: center;
378
+ justify-content: center;
379
+ border: none;
380
+ cursor: pointer;
381
+ }
382
+ header.header.classic .logout-impersonate-user:hover {
383
+ background: var(--purple-30);
384
+ }
385
+ @media only screen and (width <= 960px) {
386
+ header.header.classic {
387
+ padding-left: 32px;
388
+ padding-right: 32px;
389
+ }
390
+ }
391
+ header.header.classic.sticky {
392
+ position: sticky;
393
+ }
394
+ header.header.beacon {
395
+ font: var("Public Sans", --font-regular);
396
+ display: grid;
397
+ grid-auto-flow: column;
398
+ grid-template-columns: 1fr auto;
399
+ gap: 24px;
400
+ align-items: center;
401
+ padding: 12px 16px;
402
+ width: 100%;
403
+ background-color: #f7f7f7;
404
+ border-bottom: 1px solid var(--grey-20, #e9e9e9);
405
+ }
406
+ header.header.beacon .user-control-actions {
407
+ display: flex;
408
+ align-items: center;
409
+ gap: 16px;
410
+ position: relative;
411
+ }
412
+ header.header.beacon .header__notifications {
336
413
  position: relative;
337
414
  display: flex;
338
415
  align-items: center;
339
416
  }
340
- header.header :deep(.notification-bell) {
417
+ header.header.beacon :deep(.notification-bell) {
341
418
  position: relative;
342
419
  width: 32px;
343
420
  height: 32px;
344
421
  padding: 0;
345
422
  overflow: visible;
346
423
  }
347
- header.header :deep(.notification-bell).notification-bell--active {
424
+ header.header.beacon :deep(.notification-bell).notification-bell--active {
348
425
  background: var(--grey-10, #f3f4f6);
349
426
  }
350
- header.header .notification-bell__badge {
427
+ header.header.beacon .notification-bell__badge {
351
428
  position: absolute;
352
429
  top: 2px;
353
430
  right: -4px;
@@ -365,16 +442,16 @@ header.header .notification-bell__badge {
365
442
  box-sizing: border-box;
366
443
  pointer-events: none;
367
444
  }
368
- header.header .notification-bell__icon {
445
+ header.header.beacon .notification-bell__icon {
369
446
  display: block;
370
447
  flex-shrink: 0;
371
448
  color: var(--grey-80, #374151);
372
449
  transform-origin: 50% 20%;
373
450
  }
374
- header.header .notification-bell__icon--shaking {
451
+ header.header.beacon .notification-bell__icon--shaking {
375
452
  animation: bellShake 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
376
453
  }
377
- header.header .logout-impersonate-user {
454
+ header.header.beacon .logout-impersonate-user {
378
455
  width: 32px;
379
456
  height: 32px;
380
457
  border-radius: 16px;
@@ -385,16 +462,16 @@ header.header .logout-impersonate-user {
385
462
  border: none;
386
463
  cursor: pointer;
387
464
  }
388
- header.header .logout-impersonate-user:hover {
465
+ header.header.beacon .logout-impersonate-user:hover {
389
466
  background: var(--purple-30);
390
467
  }
391
468
  @media only screen and (width <= 960px) {
392
- header.header {
469
+ header.header.beacon {
393
470
  padding-left: 32px;
394
471
  padding-right: 32px;
395
472
  }
396
473
  }
397
- header.header.sticky {
474
+ header.header.beacon.sticky {
398
475
  position: sticky;
399
476
  }
400
477
 
@@ -29,23 +29,7 @@ type __VLS_Slots = {} & {
29
29
  } & {
30
30
  notifications?: (props: typeof __VLS_17) => any;
31
31
  };
32
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
- "selected-option": (...args: any[]) => void;
34
- "user-logout": (...args: any[]) => void;
35
- "update:notifications": (...args: any[]) => void;
36
- "notifications-clear-all": (...args: any[]) => void;
37
- "notifications-dismiss": (...args: any[]) => void;
38
- "notifications-select": (...args: any[]) => void;
39
- "notification-click": (...args: any[]) => void;
40
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
41
- "onSelected-option"?: ((...args: any[]) => any) | undefined;
42
- "onUser-logout"?: ((...args: any[]) => any) | undefined;
43
- "onUpdate:notifications"?: ((...args: any[]) => any) | undefined;
44
- "onNotifications-clear-all"?: ((...args: any[]) => any) | undefined;
45
- "onNotifications-dismiss"?: ((...args: any[]) => any) | undefined;
46
- "onNotifications-select"?: ((...args: any[]) => any) | undefined;
47
- "onNotification-click"?: ((...args: any[]) => any) | undefined;
48
- }>, {
32
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
49
33
  notifications: INotificationsHeaderModel | null;
50
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
51
35
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;