@triptease/tt-navbar 0.0.8 → 0.0.9
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/src/TtNavbar.js +106 -64
- package/dist/src/TtNavbar.js.map +1 -1
- package/dist/src/styles.js +160 -45
- package/dist/src/styles.js.map +1 -1
- package/dist/web/TtNavbar.js +641 -376
- package/dist/web/TtNavbar.js.map +4 -4
- package/dist/web/index.js +641 -376
- package/dist/web/index.js.map +4 -4
- package/dist/web/styles.js +161 -46
- package/dist/web/styles.js.map +2 -2
- package/dist/web/tt-navbar.js +641 -376
- package/dist/web/tt-navbar.js.map +4 -4
- package/package.json +2 -1
- package/src/TtNavbar.ts +106 -64
- package/src/styles.ts +160 -45
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent tt-navbar following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "tt-navbar",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.9",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/src/index.js",
|
|
9
9
|
"module": "dist/src/index.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && storybook build"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@triptease/icons": "^1.1.1",
|
|
30
31
|
"lit": "^3.1.4"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
package/src/TtNavbar.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { html, LitElement } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
4
|
+
import { campaigns, channels, chevronDown, gear, graph, home, user, wallet } from '@triptease/icons';
|
|
3
5
|
import { styles } from './styles.js';
|
|
4
6
|
|
|
5
7
|
export class TtNavbar extends LitElement {
|
|
@@ -32,80 +34,120 @@ export class TtNavbar extends LitElement {
|
|
|
32
34
|
render() {
|
|
33
35
|
return html`
|
|
34
36
|
<nav id=${this.id}>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
<div class="nav-items">
|
|
38
|
+
<a
|
|
39
|
+
class="nav-item"
|
|
40
|
+
href=${this.buildUrl('/')}
|
|
41
|
+
@click=${this.onAnchorClick}
|
|
42
|
+
>${unsafeSVG(home)}Dashboard</a
|
|
43
|
+
>
|
|
44
|
+
<a class="nav-item" href="https://app.campaign-manager.triptease.io"
|
|
45
|
+
>${unsafeSVG(campaigns)}Campaigns</a
|
|
46
|
+
>
|
|
47
|
+
<a
|
|
48
|
+
class="nav-item"
|
|
49
|
+
href=${this.buildUrl('/channels')}
|
|
50
|
+
@click=${this.onAnchorClick}
|
|
51
|
+
>${unsafeSVG(channels)}Channels</a
|
|
52
|
+
>
|
|
53
|
+
<details>
|
|
54
|
+
<summary>
|
|
55
|
+
${unsafeSVG(graph)}
|
|
56
|
+
<span>Market Insights</span>
|
|
57
|
+
<span class="icon chevron"> ${unsafeSVG(chevronDown)}</span>
|
|
58
|
+
</summary>
|
|
59
|
+
<div class="dropdown-items">
|
|
60
|
+
<a
|
|
61
|
+
class="sub-nav-item"
|
|
62
|
+
href=${this.buildUrl('/parity/$CLIENT_KEY')}
|
|
63
|
+
@click=${this.onAnchorClick}
|
|
46
64
|
>Parity</a
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
65
|
+
>
|
|
66
|
+
<a
|
|
67
|
+
class="sub-nav-item"
|
|
68
|
+
href=${this.buildUrl('/guest-insights/$CLIENT_KEY')}
|
|
69
|
+
@click=${this.onAnchorClick}
|
|
51
70
|
>Guest insights</a
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
>
|
|
72
|
+
</div>
|
|
73
|
+
</details>
|
|
74
|
+
<details>
|
|
75
|
+
<summary>
|
|
76
|
+
${unsafeSVG(gear)}
|
|
77
|
+
<span>Settings</span>
|
|
78
|
+
<span class="icon chevron"> ${unsafeSVG(chevronDown)}</span>
|
|
79
|
+
</summary>
|
|
80
|
+
<div class="dropdown-items">
|
|
81
|
+
<a
|
|
82
|
+
class="sub-nav-item"
|
|
83
|
+
href=${this.buildUrl('/$CLIENT_KEY/guest-behavioural-data')}
|
|
84
|
+
@click=${this.onAnchorClick}
|
|
61
85
|
>Email setup</a
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
86
|
+
>
|
|
87
|
+
<a
|
|
88
|
+
class="sub-nav-item"
|
|
89
|
+
href=${this.buildUrl('/$CLIENT_KEY/crm-config')}
|
|
90
|
+
@click=${this.onAnchorClick}
|
|
66
91
|
>CRM connectivity</a
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
92
|
+
>
|
|
93
|
+
<a
|
|
94
|
+
class="sub-nav-item"
|
|
95
|
+
href=${this.buildUrl('/settings/group')}
|
|
96
|
+
@click=${this.onAnchorClick}
|
|
71
97
|
>Group settings</a
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
98
|
+
>
|
|
99
|
+
<a
|
|
100
|
+
class="sub-nav-item"
|
|
101
|
+
href=${this.buildUrl('/settings/$CLIENT_KEY/hotels/')}
|
|
102
|
+
@click=${this.onAnchorClick}
|
|
76
103
|
>Property settings</a
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
>
|
|
105
|
+
</div>
|
|
106
|
+
</details>
|
|
107
|
+
<hr />
|
|
108
|
+
<details>
|
|
109
|
+
<summary>
|
|
110
|
+
${unsafeSVG(user)}
|
|
111
|
+
<span>Account</span>
|
|
112
|
+
<span class="icon chevron"> ${unsafeSVG(chevronDown)}</span>
|
|
113
|
+
</summary>
|
|
114
|
+
<div class="dropdown-items">
|
|
115
|
+
<a
|
|
116
|
+
class="sub-nav-item"
|
|
117
|
+
href=${this.buildUrl('/account')}
|
|
118
|
+
@click=${this.onAnchorClick}
|
|
85
119
|
>User settings</a
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
120
|
+
>
|
|
121
|
+
<a
|
|
122
|
+
class="sub-nav-item"
|
|
123
|
+
href=${this.buildUrl('/account/team/$CLIENT_KEY')}
|
|
124
|
+
@click=${this.onAnchorClick}
|
|
90
125
|
>Team and permissions</a
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
126
|
+
>
|
|
127
|
+
</div>
|
|
128
|
+
</details>
|
|
129
|
+
<details class="dropdown-items">
|
|
130
|
+
<summary>
|
|
131
|
+
${unsafeSVG(wallet)}
|
|
132
|
+
<span>Billing</span>
|
|
133
|
+
<span class="icon chevron"> ${unsafeSVG(chevronDown)}</span>
|
|
134
|
+
</summary>
|
|
135
|
+
<div>
|
|
136
|
+
<a
|
|
137
|
+
class="sub-nav-item"
|
|
138
|
+
href=${this.buildUrl('/account/billing-management/$CLIENT_KEY')}
|
|
139
|
+
@click=${this.onAnchorClick}
|
|
100
140
|
>Booking reconciliation</a
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
141
|
+
>
|
|
142
|
+
<a
|
|
143
|
+
class="sub-nav-item"
|
|
144
|
+
href=${this.buildUrl('/subscriptions/$CLIENT_KEY')}
|
|
145
|
+
@click=${this.onAnchorClick}
|
|
105
146
|
>Subscriptions</a
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
147
|
+
>
|
|
148
|
+
</div>
|
|
149
|
+
</details>
|
|
150
|
+
</div>
|
|
109
151
|
<slot name="clientSelector"></slot>
|
|
110
152
|
</nav>
|
|
111
153
|
`;
|
package/src/styles.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const styles = css`
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
nav {
|
|
16
|
-
|
|
16
|
+
max-width: var(--nav-bar-width);
|
|
17
17
|
width: var(--nav-bar-width);
|
|
18
18
|
min-height: 100vh;
|
|
19
19
|
height: max-content;
|
|
@@ -25,58 +25,63 @@ export const styles = css`
|
|
|
25
25
|
color: var(--color-text-inverted-400);
|
|
26
26
|
padding-top: var(--space-scale-2);
|
|
27
27
|
padding-bottom: var(--space-scale-2);
|
|
28
|
-
|
|
28
|
+
z-index: 1;
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
.nav-items {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
padding: 0 var(--space-scale-1);
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
hr {
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 1px;
|
|
40
|
+
background-color: var(--color-surface-inverted-200);
|
|
41
|
+
border: none;
|
|
42
|
+
}
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
#tertiary-nav {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
margin-top: auto;
|
|
48
|
+
gap: var(--space-scale-2);
|
|
49
|
+
width: 100%;
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
.external-link {
|
|
52
|
+
font-size: var(--font-size-100);
|
|
53
|
+
line-height: var(--font-line-height-100);
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
.icon {
|
|
56
|
+
width: var(--space-scale-2);
|
|
57
|
+
height: var(--space-scale-2);
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
|
-
}
|
|
59
61
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
.icon {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
width: var(--space-scale-3);
|
|
66
|
+
height: var(--space-scale-3);
|
|
67
|
+
color: var(--nav-item-color);
|
|
68
|
+
}
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
.nav-item {
|
|
71
|
+
display: flex;
|
|
72
|
+
font-size: var(--font-size-100);
|
|
73
|
+
line-height: var(--font-line-height-100);
|
|
74
|
+
gap: var(--space-scale-1-5);
|
|
75
|
+
border-radius: var(--border-radius-100);
|
|
76
|
+
color: var(--nav-item-color);
|
|
77
|
+
align-items: center;
|
|
78
|
+
padding: var(--space-scale-1);
|
|
79
|
+
width: 100%;
|
|
80
|
+
text-decoration: none;
|
|
81
|
+
}
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
details {
|
|
79
|
-
width: 100%;
|
|
80
85
|
border-radius: var(--border-radius-100);
|
|
81
86
|
|
|
82
87
|
summary {
|
|
@@ -91,13 +96,13 @@ export const styles = css`
|
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
98
|
|
|
94
|
-
|
|
99
|
+
.chevron > svg {
|
|
95
100
|
margin-left: auto;
|
|
96
101
|
margin-right: var(--space-scale-1);
|
|
97
102
|
width: var(--space-scale-2);
|
|
98
103
|
}
|
|
99
104
|
|
|
100
|
-
&[open]
|
|
105
|
+
&[open] .chevron > svg {
|
|
101
106
|
transform: rotate(180deg);
|
|
102
107
|
}
|
|
103
108
|
|
|
@@ -134,6 +139,7 @@ export const styles = css`
|
|
|
134
139
|
color: var(--color-text-inverted-400);
|
|
135
140
|
font-size: var(--font-size-100);
|
|
136
141
|
line-height: var(--font-line-height-100);
|
|
142
|
+
text-decoration: none;
|
|
137
143
|
|
|
138
144
|
button {
|
|
139
145
|
color: var(--color-text-inverted-400);
|
|
@@ -143,8 +149,8 @@ export const styles = css`
|
|
|
143
149
|
|
|
144
150
|
.sub-nav-item:hover,
|
|
145
151
|
.sub-nav-item:focus-visible,
|
|
146
|
-
|
|
147
|
-
|
|
152
|
+
.nav-item:hover,
|
|
153
|
+
.nav-item:focus-visible {
|
|
148
154
|
background-color: var(--color-surface-inverted-200);
|
|
149
155
|
border-radius: var(--border-radius-100);
|
|
150
156
|
text-decoration: none;
|
|
@@ -155,5 +161,114 @@ export const styles = css`
|
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
163
|
|
|
164
|
+
.current-page {
|
|
165
|
+
--nav-item-color: var(--color-primary-400);
|
|
166
|
+
border-radius: var(--border-radius-100);
|
|
167
|
+
background-color: var(--color-primary-100);
|
|
168
|
+
color: var(--nav-item-color);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.link-page {
|
|
172
|
+
display: flex;
|
|
173
|
+
position: absolute;
|
|
174
|
+
overflow: auto;
|
|
175
|
+
flex-direction: column;
|
|
176
|
+
gap: var(--space-scale-4);
|
|
177
|
+
padding: var(--space-scale-5);
|
|
178
|
+
left: var(--nav-bar-width);
|
|
179
|
+
background-color: var(--color-surface-200);
|
|
180
|
+
width: calc(100% - var(--nav-bar-width));
|
|
181
|
+
height: 100%;
|
|
182
|
+
transition-property: left, visibility;
|
|
183
|
+
transition-duration: 700ms, 400ms;
|
|
184
|
+
transition-timing-function: ease-out, ease-in;
|
|
185
|
+
|
|
186
|
+
&.hidden {
|
|
187
|
+
left: -100%;
|
|
188
|
+
visibility: hidden;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.link-page > .section {
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
gap: var(--space-scale-2);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.section > .links-container {
|
|
199
|
+
display: grid;
|
|
200
|
+
grid-template-columns: repeat(3, 1fr);
|
|
201
|
+
gap: var(--space-scale-3);
|
|
202
|
+
overflow-y: auto;
|
|
203
|
+
height: 100%;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.visually-hidden {
|
|
207
|
+
position: absolute;
|
|
208
|
+
width: 1px;
|
|
209
|
+
height: 1px;
|
|
210
|
+
margin: -1px;
|
|
211
|
+
padding: 0;
|
|
212
|
+
border: 0;
|
|
213
|
+
overflow: hidden;
|
|
214
|
+
clip: rect(0 0 0 0);
|
|
215
|
+
clip-path: inset(50%);
|
|
216
|
+
white-space: nowrap;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.tooltip {
|
|
220
|
+
position: absolute;
|
|
221
|
+
display: flex;
|
|
222
|
+
white-space: nowrap;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: var(--space-scale-1);
|
|
225
|
+
color: black;
|
|
226
|
+
background-color: var(--color-surface-600);
|
|
227
|
+
padding: var(--space-scale-1);
|
|
228
|
+
z-index: 1000;
|
|
229
|
+
border-radius: var(--border-radius-50);
|
|
230
|
+
font-weight: var(--font-weight-medium);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.auth-container {
|
|
234
|
+
display: flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
justify-content: center;
|
|
237
|
+
min-height: 100vh;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.error-container {
|
|
241
|
+
padding: 4rem 1rem 1rem;
|
|
242
|
+
max-width: 1280px;
|
|
243
|
+
margin-left: auto;
|
|
244
|
+
margin-right: auto;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.error-stack {
|
|
248
|
+
width: 100%;
|
|
249
|
+
padding: 1rem;
|
|
250
|
+
overflow-x: auto;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.fullscreen-iframe {
|
|
254
|
+
width: 100%;
|
|
255
|
+
height: 100vh;
|
|
256
|
+
border: 0;
|
|
257
|
+
}
|
|
158
258
|
|
|
259
|
+
.nav-toggle-button {
|
|
260
|
+
position: relative;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.nav-toggle-tooltip {
|
|
264
|
+
left: 100%;
|
|
265
|
+
top: 100%;
|
|
266
|
+
visibility: hidden;
|
|
267
|
+
opacity: 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.nav-toggle-button:hover .nav-toggle-tooltip {
|
|
271
|
+
visibility: visible;
|
|
272
|
+
opacity: 1;
|
|
273
|
+
}
|
|
159
274
|
`;
|