@servicetitan/navigation 1.6.0 → 2.1.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/components/header-navigation/header-navigation-content.d.ts +30 -0
- package/dist/components/header-navigation/header-navigation-content.d.ts.map +1 -0
- package/dist/components/header-navigation/header-navigation-content.js +21 -0
- package/dist/components/header-navigation/header-navigation-content.js.map +1 -0
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts +2 -2
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-extra.stories.js +7 -7
- package/dist/components/header-navigation/header-navigation-extra.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-links.d.ts +38 -0
- package/dist/components/header-navigation/header-navigation-links.d.ts.map +1 -0
- package/dist/components/header-navigation/header-navigation-links.js +38 -0
- package/dist/components/header-navigation/header-navigation-links.js.map +1 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts +11 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts.map +1 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.js +66 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +1 -0
- package/dist/components/header-navigation/header-navigation.d.ts +43 -36
- package/dist/components/header-navigation/header-navigation.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation.js +41 -81
- package/dist/components/header-navigation/header-navigation.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.module.less +172 -95
- package/dist/components/header-navigation/header-navigation.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation.stories.js +8 -8
- package/dist/components/header-navigation/header-navigation.stories.js.map +1 -1
- package/dist/components/header-navigation/index.d.ts +3 -0
- package/dist/components/header-navigation/index.d.ts.map +1 -0
- package/dist/components/header-navigation/index.js +3 -0
- package/dist/components/header-navigation/index.js.map +1 -0
- package/dist/components/logo/logo-titan-text.d.ts +21 -5
- package/dist/components/logo/logo-titan-text.d.ts.map +1 -1
- package/dist/components/logo/logo-titan-text.js +9 -3
- package/dist/components/logo/logo-titan-text.js.map +1 -1
- package/dist/components/logo/logo-titan-text.module.less +12 -9
- package/dist/components/logo/logo-titan.d.ts +2 -2
- package/dist/components/logo/logo-titan.d.ts.map +1 -1
- package/dist/components/logo/logo-titan.js +1 -1
- package/dist/components/logo/logo-titan.js.map +1 -1
- package/dist/components/logo/logo.stories.d.ts +2 -1
- package/dist/components/logo/logo.stories.d.ts.map +1 -1
- package/dist/components/logo/logo.stories.js +7 -5
- package/dist/components/logo/logo.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts +15 -0
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js +51 -0
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown.d.ts +1 -0
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +3 -3
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.module.less +0 -2
- package/dist/components/profile-dropdown/profile-dropdown.stories.js +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-icon.d.ts +1 -1
- package/dist/components/profile-dropdown/profile-icon.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-icon.js +1 -1
- package/dist/components/profile-dropdown/profile-icon.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/with-tooltip.d.ts +3 -0
- package/dist/utils/with-tooltip.d.ts.map +1 -0
- package/dist/utils/with-tooltip.js +4 -0
- package/dist/utils/with-tooltip.js.map +1 -0
- package/package.json +2 -2
- package/src/components/header-navigation/header-navigation-content.tsx +118 -0
- package/src/components/header-navigation/header-navigation-extra.stories.tsx +23 -17
- package/src/components/header-navigation/header-navigation-links.tsx +143 -0
- package/src/components/header-navigation/header-navigation-stacked.stories.tsx +172 -0
- package/src/components/header-navigation/header-navigation.module.less +172 -95
- package/src/components/header-navigation/header-navigation.module.less.d.ts +14 -9
- package/src/components/header-navigation/header-navigation.stories.tsx +11 -19
- package/src/components/header-navigation/header-navigation.tsx +163 -283
- package/src/components/header-navigation/index.ts +2 -0
- package/src/components/logo/logo-titan-text.module.less +12 -9
- package/src/components/logo/logo-titan-text.tsx +62 -20
- package/src/components/logo/logo-titan.tsx +2 -2
- package/src/components/logo/logo.stories.tsx +13 -4
- package/src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx +178 -0
- package/src/components/profile-dropdown/profile-dropdown.module.less +0 -2
- package/src/components/profile-dropdown/profile-dropdown.stories.tsx +1 -1
- package/src/components/profile-dropdown/profile-dropdown.tsx +5 -3
- package/src/components/profile-dropdown/profile-icon.tsx +2 -1
- package/src/index.ts +2 -1
- package/src/utils/with-tooltip.tsx +11 -0
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
/* stylelint-disable no-descending-specificity */
|
|
2
2
|
@import (reference) '@servicetitan/tokens/core/tokens.less';
|
|
3
3
|
|
|
4
|
-
.link {
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
flex-wrap: nowrap;
|
|
8
|
-
|
|
9
|
-
.icon {
|
|
10
|
-
display: inline-block;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
ins {
|
|
14
|
-
font-size: @typescale-2;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
& * {
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
white-space: nowrap;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
4
|
.header {
|
|
24
5
|
height: 56px;
|
|
25
6
|
display: flex;
|
|
@@ -29,96 +10,106 @@
|
|
|
29
10
|
background-color: @color-neutral-300;
|
|
30
11
|
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
|
|
31
12
|
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
position: relative;
|
|
13
|
+
.right > * {
|
|
14
|
+
color: @color-white;
|
|
15
|
+
}
|
|
36
16
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
17
|
+
.right {
|
|
18
|
+
.navigation-icon {
|
|
19
|
+
height: 24px;
|
|
20
|
+
width: 24px;
|
|
21
|
+
font-size: 24px;
|
|
41
22
|
}
|
|
42
23
|
}
|
|
43
24
|
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
25
|
+
.center {
|
|
26
|
+
min-width: 0;
|
|
27
|
+
overflow-x: hidden;
|
|
28
|
+
overflow-y: hidden;
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
// styles specific to main nav links and overflow nav links
|
|
51
|
-
i {
|
|
30
|
+
.navigation-icon {
|
|
52
31
|
height: 20px;
|
|
53
32
|
width: 20px;
|
|
33
|
+
font-size: @typescale-4;
|
|
54
34
|
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.navigation-item-main {
|
|
38
|
+
// styles specific to main nav links
|
|
39
|
+
padding: 18px 12px;
|
|
40
|
+
}
|
|
55
41
|
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
&.calculating {
|
|
43
|
+
.center {
|
|
44
|
+
opacity: 0;
|
|
58
45
|
}
|
|
59
46
|
}
|
|
60
47
|
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
:global(.profile-dropdown-image) {
|
|
49
|
+
height: 32px;
|
|
50
|
+
width: 32px;
|
|
51
|
+
}
|
|
65
52
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
53
|
+
:global(.profile-dropdown-svg) {
|
|
54
|
+
height: 28px;
|
|
55
|
+
width: 28px;
|
|
56
|
+
}
|
|
69
57
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
.navigation-item-counter {
|
|
59
|
+
font-size: @typescale-0 !important;
|
|
60
|
+
}
|
|
73
61
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
right: 0;
|
|
62
|
+
.navigation-item-main .navigation-item-counter {
|
|
63
|
+
top: 8px;
|
|
64
|
+
right: -4px;
|
|
78
65
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
66
|
+
&.navigation-item-counter-long {
|
|
67
|
+
right: -8px;
|
|
82
68
|
}
|
|
83
69
|
}
|
|
84
70
|
|
|
85
|
-
.link-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
.navigation-link .navigation-item-counter {
|
|
72
|
+
top: 8px;
|
|
73
|
+
right: -4px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
90
76
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
77
|
+
.overflow-popover {
|
|
78
|
+
padding: @spacing-1 @spacing-0 !important;
|
|
94
79
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
80
|
+
.navigation-overflow {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
99
85
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
86
|
+
.header-stacked {
|
|
87
|
+
display: grid;
|
|
88
|
+
grid-template-columns: repeat(3, 1fr);
|
|
89
|
+
grid-template-rows: 44px 36px;
|
|
103
90
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
91
|
+
background-color: @color-neutral-500;
|
|
92
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
|
|
93
|
+
|
|
94
|
+
& > * {
|
|
95
|
+
overflow-y: hidden;
|
|
108
96
|
}
|
|
109
97
|
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
|
|
98
|
+
.he-top-left {
|
|
99
|
+
grid-column: span 1;
|
|
100
|
+
}
|
|
113
101
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
102
|
+
.he-top-center {
|
|
103
|
+
grid-column: span 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.he-top-right {
|
|
107
|
+
grid-column: span 1;
|
|
118
108
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
109
|
+
.navigation-icon {
|
|
110
|
+
height: 20px;
|
|
111
|
+
width: 20px;
|
|
112
|
+
font-size: @typescale-4;
|
|
122
113
|
}
|
|
123
114
|
|
|
124
115
|
& > * {
|
|
@@ -126,30 +117,116 @@
|
|
|
126
117
|
}
|
|
127
118
|
}
|
|
128
119
|
|
|
129
|
-
.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
120
|
+
.he-bottom {
|
|
121
|
+
grid-column: span 3;
|
|
122
|
+
border-top: 1px solid @color-neutral-200;
|
|
123
|
+
|
|
124
|
+
.navigation-icon {
|
|
125
|
+
height: 20px;
|
|
126
|
+
width: 20px;
|
|
127
|
+
font-size: @typescale-4;
|
|
128
|
+
}
|
|
133
129
|
}
|
|
134
130
|
|
|
135
131
|
&.calculating {
|
|
136
|
-
.
|
|
132
|
+
.he-bottom {
|
|
137
133
|
opacity: 0;
|
|
138
134
|
}
|
|
139
135
|
}
|
|
140
136
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
:global(.profile-dropdown-image) {
|
|
138
|
+
height: 24px;
|
|
139
|
+
width: 24px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:global(.profile-dropdown-svg) {
|
|
143
|
+
height: 20px;
|
|
144
|
+
width: 20px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.navigation-item-counter {
|
|
148
|
+
font-size: 8px !important;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.navigation-item-main .navigation-item-counter {
|
|
152
|
+
top: 4px;
|
|
153
|
+
right: -4px;
|
|
154
|
+
|
|
155
|
+
&.navigation-item-counter-long {
|
|
156
|
+
right: -8px;
|
|
144
157
|
}
|
|
145
158
|
}
|
|
159
|
+
|
|
160
|
+
.navigation-link .navigation-item-counter {
|
|
161
|
+
top: 12px;
|
|
162
|
+
right: 0;
|
|
163
|
+
}
|
|
146
164
|
}
|
|
147
165
|
|
|
148
|
-
.
|
|
149
|
-
|
|
166
|
+
.navigation-icon {
|
|
167
|
+
display: inline-block;
|
|
168
|
+
}
|
|
150
169
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
170
|
+
.navigation-item {
|
|
171
|
+
// styles specific to main nav links and extra nav links
|
|
172
|
+
font-family: @base-font-family;
|
|
173
|
+
color: @color-white;
|
|
174
|
+
position: relative;
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
flex-wrap: nowrap;
|
|
178
|
+
text-wrap: nowrap;
|
|
179
|
+
|
|
180
|
+
&.navigation-item-active:not(.navigation-item-overflow) {
|
|
181
|
+
color: @color-blue-200 !important;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&:hover:not(.navigation-item-active):not(.navigation-item-overflow) {
|
|
185
|
+
opacity: 0.7;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.navigation-item-counter {
|
|
189
|
+
color: @color-white;
|
|
190
|
+
font-weight: @font-weight-semibold;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&:not(.navigation-item-overflow) .navigation-item-counter {
|
|
194
|
+
position: absolute;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.navigation-item-title {
|
|
198
|
+
font-family: @base-font-family;
|
|
199
|
+
font-size: @typescale-2;
|
|
200
|
+
margin-left: @spacing-half;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.navigation-item-main {
|
|
205
|
+
// styles specific to main nav links
|
|
206
|
+
padding: 6px 10px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.navigation-item-overflow {
|
|
210
|
+
// styles specific to overflow links
|
|
211
|
+
display: inline-flex;
|
|
212
|
+
color: @color-black;
|
|
213
|
+
padding: @spacing-1 12px;
|
|
214
|
+
|
|
215
|
+
&.navigation-item-active:not(:hover) {
|
|
216
|
+
color: @color-blue-500;
|
|
154
217
|
}
|
|
218
|
+
|
|
219
|
+
&:hover {
|
|
220
|
+
background-color: @color-blue-500;
|
|
221
|
+
color: @color-white;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.navigation-item-counter {
|
|
225
|
+
margin-left: @spacing-half;
|
|
226
|
+
margin-top: -@spacing-1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.navigation-link {
|
|
231
|
+
padding: 18px @spacing-1;
|
|
155
232
|
}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
export const __esModule: true;
|
|
2
|
-
export const active: string;
|
|
3
2
|
export const calculating: string;
|
|
4
3
|
export const center: string;
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
4
|
+
export const heBottom: string;
|
|
5
|
+
export const heTopCenter: string;
|
|
6
|
+
export const heTopLeft: string;
|
|
7
|
+
export const heTopRight: string;
|
|
7
8
|
export const header: string;
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
9
|
+
export const headerStacked: string;
|
|
10
|
+
export const navigationIcon: string;
|
|
11
|
+
export const navigationItem: string;
|
|
12
|
+
export const navigationItemActive: string;
|
|
13
|
+
export const navigationItemCounter: string;
|
|
14
|
+
export const navigationItemCounterLong: string;
|
|
15
|
+
export const navigationItemMain: string;
|
|
16
|
+
export const navigationItemOverflow: string;
|
|
17
|
+
export const navigationItemTitle: string;
|
|
18
|
+
export const navigationLink: string;
|
|
14
19
|
export const navigationOverflow: string;
|
|
15
20
|
export const overflowPopover: string;
|
|
16
21
|
export const right: string;
|
|
@@ -4,13 +4,7 @@ import { HeaderNavigationItemData, NavLinkComponentProps } from '../../utils/nav
|
|
|
4
4
|
import { LogoCompanyTitle } from '../logo/logo-company-title';
|
|
5
5
|
import { LogoTitanText } from '../logo/logo-titan-text';
|
|
6
6
|
import { ProfileDropdown } from '../profile-dropdown/profile-dropdown';
|
|
7
|
-
import {
|
|
8
|
-
HeaderNavigation,
|
|
9
|
-
HeaderNavigationItemContent,
|
|
10
|
-
HeaderNavigationLink,
|
|
11
|
-
HeaderNavigationTrigger,
|
|
12
|
-
HeaderNavigationTriggerCustom,
|
|
13
|
-
} from './header-navigation';
|
|
7
|
+
import { HeaderNavigation, HeaderNavigationLink, HeaderNavigationTrigger } from './';
|
|
14
8
|
|
|
15
9
|
export default {
|
|
16
10
|
title: 'Navigation/HeaderNavigation',
|
|
@@ -114,9 +108,11 @@ const HelpCenterButton = () => {
|
|
|
114
108
|
direction="bl"
|
|
115
109
|
width="xs"
|
|
116
110
|
trigger={
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
<HeaderNavigationTrigger
|
|
112
|
+
id="help"
|
|
113
|
+
iconName="help_outline"
|
|
114
|
+
onClick={() => setOpen(true)}
|
|
115
|
+
/>
|
|
120
116
|
}
|
|
121
117
|
portal
|
|
122
118
|
>
|
|
@@ -134,22 +130,20 @@ const TimeZoneOffset: FC = () => (
|
|
|
134
130
|
export const withAllMonolithData = () => (
|
|
135
131
|
<HeaderNavigation
|
|
136
132
|
left={<LogoCompanyTitle className="m-l-1" fill="#fff" />}
|
|
137
|
-
align="left"
|
|
138
|
-
alignMinimized="center"
|
|
139
133
|
items={[
|
|
140
134
|
items.dashboard,
|
|
141
135
|
items.calendar,
|
|
142
136
|
items.calls,
|
|
143
137
|
items.accounting,
|
|
144
|
-
items.dispatch,
|
|
138
|
+
// items.dispatch,
|
|
145
139
|
|
|
146
140
|
items.fleet,
|
|
147
|
-
items.followUps,
|
|
141
|
+
// items.followUps,
|
|
148
142
|
items.inventory,
|
|
149
143
|
|
|
150
|
-
items.marketing,
|
|
144
|
+
// items.marketing,
|
|
151
145
|
items.priceBook,
|
|
152
|
-
items.pointOfSale,
|
|
146
|
+
// items.pointOfSale,
|
|
153
147
|
items.reports,
|
|
154
148
|
]}
|
|
155
149
|
navigationComponent={NavLinkMock}
|
|
@@ -166,9 +160,7 @@ export const withAllMonolithData = () => (
|
|
|
166
160
|
hint="Search: for all the questions"
|
|
167
161
|
/>
|
|
168
162
|
|
|
169
|
-
<
|
|
170
|
-
<HelpCenterButton />
|
|
171
|
-
</HeaderNavigationTriggerCustom>
|
|
163
|
+
<HelpCenterButton />
|
|
172
164
|
<HeaderNavigationTrigger id="titanAdvisor" iconName="rocket" />
|
|
173
165
|
|
|
174
166
|
<HeaderNavigationLink
|