@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.
Files changed (85) hide show
  1. package/dist/components/header-navigation/header-navigation-content.d.ts +30 -0
  2. package/dist/components/header-navigation/header-navigation-content.d.ts.map +1 -0
  3. package/dist/components/header-navigation/header-navigation-content.js +21 -0
  4. package/dist/components/header-navigation/header-navigation-content.js.map +1 -0
  5. package/dist/components/header-navigation/header-navigation-extra.stories.d.ts +2 -2
  6. package/dist/components/header-navigation/header-navigation-extra.stories.d.ts.map +1 -1
  7. package/dist/components/header-navigation/header-navigation-extra.stories.js +7 -7
  8. package/dist/components/header-navigation/header-navigation-extra.stories.js.map +1 -1
  9. package/dist/components/header-navigation/header-navigation-links.d.ts +38 -0
  10. package/dist/components/header-navigation/header-navigation-links.d.ts.map +1 -0
  11. package/dist/components/header-navigation/header-navigation-links.js +38 -0
  12. package/dist/components/header-navigation/header-navigation-links.js.map +1 -0
  13. package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts +11 -0
  14. package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts.map +1 -0
  15. package/dist/components/header-navigation/header-navigation-stacked.stories.js +66 -0
  16. package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +1 -0
  17. package/dist/components/header-navigation/header-navigation.d.ts +43 -36
  18. package/dist/components/header-navigation/header-navigation.d.ts.map +1 -1
  19. package/dist/components/header-navigation/header-navigation.js +41 -81
  20. package/dist/components/header-navigation/header-navigation.js.map +1 -1
  21. package/dist/components/header-navigation/header-navigation.module.less +172 -95
  22. package/dist/components/header-navigation/header-navigation.stories.d.ts.map +1 -1
  23. package/dist/components/header-navigation/header-navigation.stories.js +8 -8
  24. package/dist/components/header-navigation/header-navigation.stories.js.map +1 -1
  25. package/dist/components/header-navigation/index.d.ts +3 -0
  26. package/dist/components/header-navigation/index.d.ts.map +1 -0
  27. package/dist/components/header-navigation/index.js +3 -0
  28. package/dist/components/header-navigation/index.js.map +1 -0
  29. package/dist/components/logo/logo-titan-text.d.ts +21 -5
  30. package/dist/components/logo/logo-titan-text.d.ts.map +1 -1
  31. package/dist/components/logo/logo-titan-text.js +9 -3
  32. package/dist/components/logo/logo-titan-text.js.map +1 -1
  33. package/dist/components/logo/logo-titan-text.module.less +12 -9
  34. package/dist/components/logo/logo-titan.d.ts +2 -2
  35. package/dist/components/logo/logo-titan.d.ts.map +1 -1
  36. package/dist/components/logo/logo-titan.js +1 -1
  37. package/dist/components/logo/logo-titan.js.map +1 -1
  38. package/dist/components/logo/logo.stories.d.ts +2 -1
  39. package/dist/components/logo/logo.stories.d.ts.map +1 -1
  40. package/dist/components/logo/logo.stories.js +7 -5
  41. package/dist/components/logo/logo.stories.js.map +1 -1
  42. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts +15 -0
  43. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts.map +1 -0
  44. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js +51 -0
  45. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js.map +1 -0
  46. package/dist/components/profile-dropdown/profile-dropdown.d.ts +1 -0
  47. package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
  48. package/dist/components/profile-dropdown/profile-dropdown.js +3 -3
  49. package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
  50. package/dist/components/profile-dropdown/profile-dropdown.module.less +0 -2
  51. package/dist/components/profile-dropdown/profile-dropdown.stories.js +1 -1
  52. package/dist/components/profile-dropdown/profile-dropdown.stories.js.map +1 -1
  53. package/dist/components/profile-dropdown/profile-icon.d.ts +1 -1
  54. package/dist/components/profile-dropdown/profile-icon.d.ts.map +1 -1
  55. package/dist/components/profile-dropdown/profile-icon.js +1 -1
  56. package/dist/components/profile-dropdown/profile-icon.js.map +1 -1
  57. package/dist/index.d.ts +2 -1
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +2 -1
  60. package/dist/index.js.map +1 -1
  61. package/dist/utils/with-tooltip.d.ts +3 -0
  62. package/dist/utils/with-tooltip.d.ts.map +1 -0
  63. package/dist/utils/with-tooltip.js +4 -0
  64. package/dist/utils/with-tooltip.js.map +1 -0
  65. package/package.json +2 -2
  66. package/src/components/header-navigation/header-navigation-content.tsx +118 -0
  67. package/src/components/header-navigation/header-navigation-extra.stories.tsx +23 -17
  68. package/src/components/header-navigation/header-navigation-links.tsx +143 -0
  69. package/src/components/header-navigation/header-navigation-stacked.stories.tsx +172 -0
  70. package/src/components/header-navigation/header-navigation.module.less +172 -95
  71. package/src/components/header-navigation/header-navigation.module.less.d.ts +14 -9
  72. package/src/components/header-navigation/header-navigation.stories.tsx +11 -19
  73. package/src/components/header-navigation/header-navigation.tsx +163 -283
  74. package/src/components/header-navigation/index.ts +2 -0
  75. package/src/components/logo/logo-titan-text.module.less +12 -9
  76. package/src/components/logo/logo-titan-text.tsx +62 -20
  77. package/src/components/logo/logo-titan.tsx +2 -2
  78. package/src/components/logo/logo.stories.tsx +13 -4
  79. package/src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx +178 -0
  80. package/src/components/profile-dropdown/profile-dropdown.module.less +0 -2
  81. package/src/components/profile-dropdown/profile-dropdown.stories.tsx +1 -1
  82. package/src/components/profile-dropdown/profile-dropdown.tsx +5 -3
  83. package/src/components/profile-dropdown/profile-icon.tsx +2 -1
  84. package/src/index.ts +2 -1
  85. 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
- .link {
33
- max-height: 56px;
34
- font-family: @base-font-family;
35
- position: relative;
13
+ .right > * {
14
+ color: @color-white;
15
+ }
36
16
 
37
- .counter {
38
- color: @color-white;
39
- font-size: @typescale-0;
40
- font-weight: @font-weight-semibold;
17
+ .right {
18
+ .navigation-icon {
19
+ height: 24px;
20
+ width: 24px;
21
+ font-size: 24px;
41
22
  }
42
23
  }
43
24
 
44
- .link-main {
45
- // styles specific to main nav links
46
- padding: 18px 12px;
47
- }
25
+ .center {
26
+ min-width: 0;
27
+ overflow-x: hidden;
28
+ overflow-y: hidden;
48
29
 
49
- .navigation-items .link {
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
- ins {
57
- margin-left: @spacing-half;
42
+ &.calculating {
43
+ .center {
44
+ opacity: 0;
58
45
  }
59
46
  }
60
47
 
61
- .link-main,
62
- .right .link {
63
- // styles specific to main nav links and extra nav links
64
- color: @color-white;
48
+ :global(.profile-dropdown-image) {
49
+ height: 32px;
50
+ width: 32px;
51
+ }
65
52
 
66
- &.active {
67
- color: @color-blue-200;
68
- }
53
+ :global(.profile-dropdown-svg) {
54
+ height: 28px;
55
+ width: 28px;
56
+ }
69
57
 
70
- &:hover:not(.active) {
71
- opacity: 0.7;
72
- }
58
+ .navigation-item-counter {
59
+ font-size: @typescale-0 !important;
60
+ }
73
61
 
74
- .counter {
75
- position: absolute;
76
- top: @spacing-1;
77
- right: 0;
62
+ .navigation-item-main .navigation-item-counter {
63
+ top: 8px;
64
+ right: -4px;
78
65
 
79
- &.counter-long {
80
- right: -@spacing-half;
81
- }
66
+ &.navigation-item-counter-long {
67
+ right: -8px;
82
68
  }
83
69
  }
84
70
 
85
- .link-overflow {
86
- // styles specific to overflow links
87
- display: inline-flex;
88
- color: @color-black;
89
- padding: @spacing-1 12px;
71
+ .navigation-link .navigation-item-counter {
72
+ top: 8px;
73
+ right: -4px;
74
+ }
75
+ }
90
76
 
91
- &.active:not(:hover) {
92
- color: @color-blue-500;
93
- }
77
+ .overflow-popover {
78
+ padding: @spacing-1 @spacing-0 !important;
94
79
 
95
- &:hover {
96
- background-color: @color-blue-500;
97
- color: @color-white;
98
- }
80
+ .navigation-overflow {
81
+ display: flex;
82
+ flex-direction: column;
83
+ }
84
+ }
99
85
 
100
- ins {
101
- margin-left: @spacing-1;
102
- }
86
+ .header-stacked {
87
+ display: grid;
88
+ grid-template-columns: repeat(3, 1fr);
89
+ grid-template-rows: 44px 36px;
103
90
 
104
- .counter {
105
- margin-left: @spacing-half;
106
- margin-top: -@spacing-1;
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
- .right {
111
- .link {
112
- padding: 18px @spacing-1;
98
+ .he-top-left {
99
+ grid-column: span 1;
100
+ }
113
101
 
114
- .icon {
115
- height: 24px;
116
- width: 24px;
117
- }
102
+ .he-top-center {
103
+ grid-column: span 1;
104
+ }
105
+
106
+ .he-top-right {
107
+ grid-column: span 1;
118
108
 
119
- ins {
120
- margin-left: @spacing-half;
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
- .center {
130
- min-width: 0;
131
- overflow-x: hidden;
132
- overflow-y: hidden;
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
- .center {
132
+ .he-bottom {
137
133
  opacity: 0;
138
134
  }
139
135
  }
140
136
 
141
- &.minimized .link-main {
142
- ins {
143
- display: none;
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
- .overflow-popover {
149
- padding: @spacing-1 @spacing-0 !important;
166
+ .navigation-icon {
167
+ display: inline-block;
168
+ }
150
169
 
151
- .navigation-overflow {
152
- display: flex;
153
- flex-direction: column;
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 counter: string;
6
- export const counterLong: string;
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 icon: string;
9
- export const link: string;
10
- export const linkMain: string;
11
- export const linkOverflow: string;
12
- export const minimized: string;
13
- export const navigationItems: string;
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
- <div onClick={() => setOpen(true)}>
118
- <HeaderNavigationItemContent iconName="help_outline" />
119
- </div>
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
- <HeaderNavigationTriggerCustom id="help-center">
170
- <HelpCenterButton />
171
- </HeaderNavigationTriggerCustom>
163
+ <HelpCenterButton />
172
164
  <HeaderNavigationTrigger id="titanAdvisor" iconName="rocket" />
173
165
 
174
166
  <HeaderNavigationLink