@servicetitan/navigation 10.7.0 → 11.0.0-canary.237.4cefc6a.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 (215) hide show
  1. package/package.json +4 -4
  2. package/src/components/header-navigation/header-navigation-extra.stories.tsx +7 -0
  3. package/src/components/header-navigation/header-navigation-links.tsx +2 -0
  4. package/src/components/header-navigation/header-navigation-stacked.stories.tsx +4 -0
  5. package/src/components/header-navigation/header-navigation.stories.tsx +5 -0
  6. package/src/components/left-navigation/header-navigation-tiny.stories.tsx +6 -0
  7. package/src/components/links.tsx +33 -13
  8. package/src/components/logo/logo-company-title.tsx +8 -6
  9. package/src/components/profile-dropdown/profile-dropdown.module.less +4 -0
  10. package/src/components/profile-dropdown/profile-dropdown.stories.tsx +4 -4
  11. package/src/components/profile-dropdown/profile-dropdown.tsx +43 -46
  12. package/src/components/titan-layout/index.ts +5 -0
  13. package/src/components/titan-layout/interface-internal.ts +6 -0
  14. package/src/components/titan-layout/interface.ts +26 -0
  15. package/src/components/titan-layout/layout-context.tsx +30 -0
  16. package/src/components/titan-layout/layout-header-links.tsx +144 -0
  17. package/{dist/components/left-navigation/header-navigation-tiny.module.less → src/components/titan-layout/layout-header.module.less} +41 -5
  18. package/src/components/titan-layout/layout-header.tsx +86 -0
  19. package/src/components/titan-layout/layout-logo.stories.tsx +31 -0
  20. package/src/components/titan-layout/layout-logo.tsx +57 -0
  21. package/src/components/titan-layout/layout-profile.stories.tsx +37 -0
  22. package/src/components/titan-layout/layout-profile.tsx +116 -0
  23. package/src/components/titan-layout/layout-sidebar-links-internal.tsx +265 -0
  24. package/src/components/titan-layout/layout-sidebar-links.tsx +56 -0
  25. package/src/components/titan-layout/layout-sidebar.module.less +528 -0
  26. package/src/components/titan-layout/layout-sidebar.tsx +298 -0
  27. package/src/components/titan-layout/titan-layout.module.less +53 -0
  28. package/src/components/titan-layout/titan-layout.stories.tsx +194 -0
  29. package/src/components/titan-layout/titan-layout.tsx +270 -0
  30. package/src/components/titan-layout/with-tooltip.tsx +16 -0
  31. package/src/index.ts +2 -1
  32. package/src/test/data.tsx +3 -2
  33. package/src/utils/navigation-legacy.ts +3 -1
  34. package/src/utils/use-breakpoint.ts +19 -0
  35. package/dist/components/badge-tag.d.ts +0 -12
  36. package/dist/components/badge-tag.d.ts.map +0 -1
  37. package/dist/components/badge-tag.js +0 -8
  38. package/dist/components/badge-tag.js.map +0 -1
  39. package/dist/components/counter-tag.d.ts +0 -12
  40. package/dist/components/counter-tag.d.ts.map +0 -1
  41. package/dist/components/counter-tag.js +0 -8
  42. package/dist/components/counter-tag.js.map +0 -1
  43. package/dist/components/header-navigation/header-navigation-content.d.ts +0 -30
  44. package/dist/components/header-navigation/header-navigation-content.d.ts.map +0 -1
  45. package/dist/components/header-navigation/header-navigation-content.js +0 -22
  46. package/dist/components/header-navigation/header-navigation-content.js.map +0 -1
  47. package/dist/components/header-navigation/header-navigation-extra-stacked.stories.d.ts +0 -9
  48. package/dist/components/header-navigation/header-navigation-extra-stacked.stories.d.ts.map +0 -1
  49. package/dist/components/header-navigation/header-navigation-extra-stacked.stories.js +0 -13
  50. package/dist/components/header-navigation/header-navigation-extra-stacked.stories.js.map +0 -1
  51. package/dist/components/header-navigation/header-navigation-extra.stories.d.ts +0 -12
  52. package/dist/components/header-navigation/header-navigation-extra.stories.d.ts.map +0 -1
  53. package/dist/components/header-navigation/header-navigation-extra.stories.js +0 -29
  54. package/dist/components/header-navigation/header-navigation-extra.stories.js.map +0 -1
  55. package/dist/components/header-navigation/header-navigation-links.d.ts +0 -11
  56. package/dist/components/header-navigation/header-navigation-links.d.ts.map +0 -1
  57. package/dist/components/header-navigation/header-navigation-links.js +0 -26
  58. package/dist/components/header-navigation/header-navigation-links.js.map +0 -1
  59. package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts +0 -12
  60. package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts.map +0 -1
  61. package/dist/components/header-navigation/header-navigation-stacked.stories.js +0 -50
  62. package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +0 -1
  63. package/dist/components/header-navigation/header-navigation-stories.module.less +0 -6
  64. package/dist/components/header-navigation/header-navigation.d.ts +0 -59
  65. package/dist/components/header-navigation/header-navigation.d.ts.map +0 -1
  66. package/dist/components/header-navigation/header-navigation.js +0 -96
  67. package/dist/components/header-navigation/header-navigation.js.map +0 -1
  68. package/dist/components/header-navigation/header-navigation.module.less +0 -260
  69. package/dist/components/header-navigation/header-navigation.stories.d.ts +0 -12
  70. package/dist/components/header-navigation/header-navigation.stories.d.ts.map +0 -1
  71. package/dist/components/header-navigation/header-navigation.stories.js +0 -54
  72. package/dist/components/header-navigation/header-navigation.stories.js.map +0 -1
  73. package/dist/components/header-navigation/index.d.ts +0 -2
  74. package/dist/components/header-navigation/index.d.ts.map +0 -1
  75. package/dist/components/header-navigation/index.js +0 -2
  76. package/dist/components/header-navigation/index.js.map +0 -1
  77. package/dist/components/header-navigation/with-tooltip.d.ts +0 -4
  78. package/dist/components/header-navigation/with-tooltip.d.ts.map +0 -1
  79. package/dist/components/header-navigation/with-tooltip.js +0 -4
  80. package/dist/components/header-navigation/with-tooltip.js.map +0 -1
  81. package/dist/components/layout.stories.d.ts +0 -13
  82. package/dist/components/layout.stories.d.ts.map +0 -1
  83. package/dist/components/layout.stories.js +0 -29
  84. package/dist/components/layout.stories.js.map +0 -1
  85. package/dist/components/left-navigation/header-navigation-extra-tiny.stories.d.ts +0 -9
  86. package/dist/components/left-navigation/header-navigation-extra-tiny.stories.d.ts.map +0 -1
  87. package/dist/components/left-navigation/header-navigation-extra-tiny.stories.js +0 -13
  88. package/dist/components/left-navigation/header-navigation-extra-tiny.stories.js.map +0 -1
  89. package/dist/components/left-navigation/header-navigation-tiny-links.d.ts +0 -18
  90. package/dist/components/left-navigation/header-navigation-tiny-links.d.ts.map +0 -1
  91. package/dist/components/left-navigation/header-navigation-tiny-links.js +0 -32
  92. package/dist/components/left-navigation/header-navigation-tiny-links.js.map +0 -1
  93. package/dist/components/left-navigation/header-navigation-tiny.d.ts +0 -23
  94. package/dist/components/left-navigation/header-navigation-tiny.d.ts.map +0 -1
  95. package/dist/components/left-navigation/header-navigation-tiny.js +0 -7
  96. package/dist/components/left-navigation/header-navigation-tiny.js.map +0 -1
  97. package/dist/components/left-navigation/header-navigation-tiny.stories.d.ts +0 -12
  98. package/dist/components/left-navigation/header-navigation-tiny.stories.d.ts.map +0 -1
  99. package/dist/components/left-navigation/header-navigation-tiny.stories.js +0 -30
  100. package/dist/components/left-navigation/header-navigation-tiny.stories.js.map +0 -1
  101. package/dist/components/left-navigation/index.d.ts +0 -5
  102. package/dist/components/left-navigation/index.d.ts.map +0 -1
  103. package/dist/components/left-navigation/index.js +0 -5
  104. package/dist/components/left-navigation/index.js.map +0 -1
  105. package/dist/components/left-navigation/interface-internal.d.ts +0 -10
  106. package/dist/components/left-navigation/interface-internal.d.ts.map +0 -1
  107. package/dist/components/left-navigation/interface-internal.js +0 -2
  108. package/dist/components/left-navigation/interface-internal.js.map +0 -1
  109. package/dist/components/left-navigation/interface.d.ts +0 -20
  110. package/dist/components/left-navigation/interface.d.ts.map +0 -1
  111. package/dist/components/left-navigation/interface.js +0 -2
  112. package/dist/components/left-navigation/interface.js.map +0 -1
  113. package/dist/components/left-navigation/side-navigation-context.d.ts +0 -8
  114. package/dist/components/left-navigation/side-navigation-context.d.ts.map +0 -1
  115. package/dist/components/left-navigation/side-navigation-context.js +0 -7
  116. package/dist/components/left-navigation/side-navigation-context.js.map +0 -1
  117. package/dist/components/left-navigation/side-navigation-links-internal.d.ts +0 -28
  118. package/dist/components/left-navigation/side-navigation-links-internal.d.ts.map +0 -1
  119. package/dist/components/left-navigation/side-navigation-links-internal.js +0 -29
  120. package/dist/components/left-navigation/side-navigation-links-internal.js.map +0 -1
  121. package/dist/components/left-navigation/side-navigation-links.d.ts +0 -6
  122. package/dist/components/left-navigation/side-navigation-links.d.ts.map +0 -1
  123. package/dist/components/left-navigation/side-navigation-links.js +0 -27
  124. package/dist/components/left-navigation/side-navigation-links.js.map +0 -1
  125. package/dist/components/left-navigation/side-navigation.d.ts +0 -29
  126. package/dist/components/left-navigation/side-navigation.d.ts.map +0 -1
  127. package/dist/components/left-navigation/side-navigation.js +0 -182
  128. package/dist/components/left-navigation/side-navigation.js.map +0 -1
  129. package/dist/components/left-navigation/side-navigation.module.less +0 -530
  130. package/dist/components/left-navigation/side-navigation.stories.d.ts +0 -17
  131. package/dist/components/left-navigation/side-navigation.stories.d.ts.map +0 -1
  132. package/dist/components/left-navigation/side-navigation.stories.js +0 -115
  133. package/dist/components/left-navigation/side-navigation.stories.js.map +0 -1
  134. package/dist/components/left-navigation/with-tooltip.d.ts +0 -4
  135. package/dist/components/left-navigation/with-tooltip.d.ts.map +0 -1
  136. package/dist/components/left-navigation/with-tooltip.js +0 -4
  137. package/dist/components/left-navigation/with-tooltip.js.map +0 -1
  138. package/dist/components/links.d.ts +0 -5
  139. package/dist/components/links.d.ts.map +0 -1
  140. package/dist/components/links.js +0 -14
  141. package/dist/components/links.js.map +0 -1
  142. package/dist/components/logo/logo-company-title.d.ts +0 -7
  143. package/dist/components/logo/logo-company-title.d.ts.map +0 -1
  144. package/dist/components/logo/logo-company-title.js +0 -6
  145. package/dist/components/logo/logo-company-title.js.map +0 -1
  146. package/dist/components/logo/logo-titan-text.d.ts +0 -29
  147. package/dist/components/logo/logo-titan-text.d.ts.map +0 -1
  148. package/dist/components/logo/logo-titan-text.js +0 -13
  149. package/dist/components/logo/logo-titan-text.js.map +0 -1
  150. package/dist/components/logo/logo-titan-text.module.less +0 -31
  151. package/dist/components/logo/logo-titan.d.ts +0 -9
  152. package/dist/components/logo/logo-titan.d.ts.map +0 -1
  153. package/dist/components/logo/logo-titan.js +0 -13
  154. package/dist/components/logo/logo-titan.js.map +0 -1
  155. package/dist/components/logo/logo.stories.d.ts +0 -14
  156. package/dist/components/logo/logo.stories.d.ts.map +0 -1
  157. package/dist/components/logo/logo.stories.js +0 -20
  158. package/dist/components/logo/logo.stories.js.map +0 -1
  159. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts +0 -9
  160. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts.map +0 -1
  161. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js +0 -13
  162. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js.map +0 -1
  163. package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.d.ts +0 -9
  164. package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.d.ts.map +0 -1
  165. package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js +0 -13
  166. package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js.map +0 -1
  167. package/dist/components/profile-dropdown/profile-dropdown.d.ts +0 -74
  168. package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +0 -1
  169. package/dist/components/profile-dropdown/profile-dropdown.js +0 -86
  170. package/dist/components/profile-dropdown/profile-dropdown.js.map +0 -1
  171. package/dist/components/profile-dropdown/profile-dropdown.module.less +0 -167
  172. package/dist/components/profile-dropdown/profile-dropdown.stories.d.ts +0 -16
  173. package/dist/components/profile-dropdown/profile-dropdown.stories.d.ts.map +0 -1
  174. package/dist/components/profile-dropdown/profile-dropdown.stories.js +0 -51
  175. package/dist/components/profile-dropdown/profile-dropdown.stories.js.map +0 -1
  176. package/dist/components/profile-dropdown/profile-icon.d.ts +0 -3
  177. package/dist/components/profile-dropdown/profile-icon.d.ts.map +0 -1
  178. package/dist/components/profile-dropdown/profile-icon.js +0 -5
  179. package/dist/components/profile-dropdown/profile-icon.js.map +0 -1
  180. package/dist/index.d.ts +0 -12
  181. package/dist/index.d.ts.map +0 -1
  182. package/dist/index.js +0 -12
  183. package/dist/index.js.map +0 -1
  184. package/dist/test/data-stories.module.less +0 -8
  185. package/dist/test/data.d.ts +0 -32
  186. package/dist/test/data.d.ts.map +0 -1
  187. package/dist/test/data.js +0 -244
  188. package/dist/test/data.js.map +0 -1
  189. package/dist/utils/counter-tag.d.ts +0 -5
  190. package/dist/utils/counter-tag.d.ts.map +0 -1
  191. package/dist/utils/counter-tag.js +0 -2
  192. package/dist/utils/counter-tag.js.map +0 -1
  193. package/dist/utils/navigation-context.d.ts +0 -27
  194. package/dist/utils/navigation-context.d.ts.map +0 -1
  195. package/dist/utils/navigation-context.js +0 -10
  196. package/dist/utils/navigation-context.js.map +0 -1
  197. package/dist/utils/navigation-legacy.d.ts +0 -86
  198. package/dist/utils/navigation-legacy.d.ts.map +0 -1
  199. package/dist/utils/navigation-legacy.js +0 -2
  200. package/dist/utils/navigation-legacy.js.map +0 -1
  201. package/dist/utils/navigation.d.ts +0 -48
  202. package/dist/utils/navigation.d.ts.map +0 -1
  203. package/dist/utils/navigation.js +0 -2
  204. package/dist/utils/navigation.js.map +0 -1
  205. package/dist/utils/side-nav.d.ts +0 -6
  206. package/dist/utils/side-nav.d.ts.map +0 -1
  207. package/dist/utils/side-nav.js +0 -28
  208. package/dist/utils/side-nav.js.map +0 -1
  209. package/src/components/header-navigation/header-navigation-stories.module.less.d.ts +0 -3
  210. package/src/components/header-navigation/header-navigation.module.less.d.ts +0 -22
  211. package/src/components/left-navigation/header-navigation-tiny.module.less.d.ts +0 -15
  212. package/src/components/left-navigation/side-navigation.module.less.d.ts +0 -48
  213. package/src/components/logo/logo-titan-text.module.less.d.ts +0 -6
  214. package/src/components/profile-dropdown/profile-dropdown.module.less.d.ts +0 -21
  215. package/src/test/data-stories.module.less.d.ts +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/navigation",
3
- "version": "10.7.0",
3
+ "version": "11.0.0-canary.237.4cefc6a.0",
4
4
  "description": "Navigation components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "classnames": "~2.3.1"
18
18
  },
19
19
  "peerDependencies": {
20
- "@servicetitan/anvil2": ">=1.34.0",
20
+ "@servicetitan/anvil2": ">=1.47.1",
21
21
  "@servicetitan/design-system": ">=14.0.0",
22
22
  "@servicetitan/react-ioc": ">=14.1.1",
23
23
  "@servicetitan/tokens": ">=12.0.0",
@@ -26,7 +26,7 @@
26
26
  "react": ">=18.0.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@servicetitan/anvil2": "~1.34.0",
29
+ "@servicetitan/anvil2": "~1.47.1",
30
30
  "@servicetitan/design-system": "~14.5.1",
31
31
  "@servicetitan/react-ioc": "^30.2.1",
32
32
  "@servicetitan/tokens": ">=12.1.11",
@@ -43,5 +43,5 @@
43
43
  "less": true,
44
44
  "webpack": false
45
45
  },
46
- "gitHead": "2e6d50be0ec53777ff6afa390645fd11cfd7444e"
46
+ "gitHead": "4cefc6a6c7aa880897f643ee1e90e3b30f6f2421"
47
47
  }
@@ -23,6 +23,7 @@ export default {
23
23
  export const ExtraLink = () => (
24
24
  <HeaderNavigationLink
25
25
  id="search"
26
+ title="Search"
26
27
  to="https://google.com"
27
28
  target="_blank"
28
29
  iconName="search"
@@ -35,6 +36,7 @@ export const ExtraLink = () => (
35
36
  export const ExtraTrigger = () => (
36
37
  <HeaderNavigationTrigger
37
38
  id="dialpad"
39
+ title="Dialpad"
38
40
  iconName="phone"
39
41
  counter={2}
40
42
  tooltip="Phones pro"
@@ -47,6 +49,7 @@ export const ExtraWithTooltip = () => (
47
49
  <Fragment>
48
50
  <HeaderNavigationLink
49
51
  id="search"
52
+ title="Search"
50
53
  to="https://google.com"
51
54
  target="_blank"
52
55
  iconName="search"
@@ -58,6 +61,7 @@ export const ExtraWithTooltip = () => (
58
61
 
59
62
  <HeaderNavigationTrigger
60
63
  id="dialpad"
64
+ title="Dialpad"
61
65
  iconName="phone"
62
66
  hint="Dialpad"
63
67
  counter={2}
@@ -99,6 +103,7 @@ const HelpTrigger = () => {
99
103
  return (
100
104
  <HeaderNavigationTrigger
101
105
  id="help"
106
+ title="Help"
102
107
  iconName="help_outline"
103
108
  hint="Help"
104
109
  icon={SvgHelp}
@@ -113,6 +118,7 @@ export const ExtraWithLabel = () => (
113
118
  <Fragment>
114
119
  <HeaderNavigationLink
115
120
  id="search"
121
+ title="Search"
116
122
  to="https://google.com"
117
123
  target="_blank"
118
124
  iconName="search"
@@ -125,6 +131,7 @@ export const ExtraWithLabel = () => (
125
131
  <HelpTrigger />
126
132
  <HeaderNavigationTrigger
127
133
  id="dialpad"
134
+ title="Dialpad"
128
135
  iconName="phone"
129
136
  hint="Dialpad"
130
137
  tag={{ value: 2 }}
@@ -28,6 +28,7 @@ export const HeaderNavigationLink: FC<HeaderNavigationLinkProps> = ({
28
28
  labelClassName,
29
29
  tag,
30
30
  target,
31
+ title,
31
32
  ...rest
32
33
  }) => {
33
34
  const NavigationComponent = useContext(NavigationComponentContext);
@@ -76,6 +77,7 @@ export const HeaderNavigationTrigger: FC<HeaderNavigationTriggerProps> = ({
76
77
  hint,
77
78
  tag,
78
79
  tooltip,
80
+ title,
79
81
  ...rest
80
82
  }) => {
81
83
  return withTooltip(
@@ -85,6 +85,7 @@ export const WithAllMonolithData = () => (
85
85
 
86
86
  <HeaderNavigationLink
87
87
  id="search"
88
+ title="Search"
88
89
  to="https://google.com"
89
90
  target="_blank"
90
91
  iconComponent={SearchIcon}
@@ -95,6 +96,7 @@ export const WithAllMonolithData = () => (
95
96
 
96
97
  <HeaderNavigationTrigger
97
98
  id="dialpad"
99
+ title="Dialpad"
98
100
  iconName="phone"
99
101
  tag={{ value: 2 }}
100
102
  icon={SvgIcon}
@@ -103,6 +105,7 @@ export const WithAllMonolithData = () => (
103
105
 
104
106
  <HeaderNavigationTrigger
105
107
  id="titanAdvisor"
108
+ title="Titan Advisor"
106
109
  iconName="rocket"
107
110
  iconClassName={Styles.rocketIcon}
108
111
  icon={SvgIcon}
@@ -111,6 +114,7 @@ export const WithAllMonolithData = () => (
111
114
 
112
115
  <HeaderNavigationLink
113
116
  id="settings"
117
+ title="Settings"
114
118
  to="https://google.com"
115
119
  target="_blank"
116
120
  iconName="settings"
@@ -64,6 +64,7 @@ const HelpCenterButton = () => {
64
64
  trigger={
65
65
  <HeaderNavigationTrigger
66
66
  id="help"
67
+ title="Help"
67
68
  iconName="help_outline"
68
69
  onClick={() => setOpen(true)}
69
70
  icon={SvgIcon}
@@ -107,6 +108,7 @@ export const WithAllMonolithData = () => (
107
108
 
108
109
  <HeaderNavigationTrigger
109
110
  id="dialpad"
111
+ title="Dialpad"
110
112
  iconName="phone"
111
113
  counter={2}
112
114
  icon={SvgIcon}
@@ -115,6 +117,7 @@ export const WithAllMonolithData = () => (
115
117
 
116
118
  <HeaderNavigationLink
117
119
  id="search"
120
+ title="Search"
118
121
  to="https://google.com"
119
122
  target="_blank"
120
123
  iconComponent={SearchIcon}
@@ -126,6 +129,7 @@ export const WithAllMonolithData = () => (
126
129
  <HelpCenterButton />
127
130
  <HeaderNavigationTrigger
128
131
  id="titanAdvisor"
132
+ title="Titan Advisor"
129
133
  iconName="rocket"
130
134
  iconClassName={Styles.rocketIcon}
131
135
  icon={SvgIcon}
@@ -134,6 +138,7 @@ export const WithAllMonolithData = () => (
134
138
 
135
139
  <HeaderNavigationLink
136
140
  id="settings"
141
+ title="Settings"
137
142
  to="https://google.com"
138
143
  target="_blank"
139
144
  iconName="settings"
@@ -54,6 +54,7 @@ export const WithAllMonolithData = () => (
54
54
 
55
55
  <HeaderNavigationLink
56
56
  id="search"
57
+ title="Search"
57
58
  to="https://google.com"
58
59
  target="_blank"
59
60
  iconComponent={SearchIcon}
@@ -67,6 +68,7 @@ export const WithAllMonolithData = () => (
67
68
 
68
69
  <HeaderNavigationLink
69
70
  id="titanAdvisor"
71
+ title="Titan Advisor"
70
72
  to="titanAdvisor"
71
73
  iconName="rocket"
72
74
  iconClassName={Styles.rocketIcon}
@@ -76,6 +78,7 @@ export const WithAllMonolithData = () => (
76
78
 
77
79
  <HeaderNavigationLink
78
80
  id="settings"
81
+ title="Settings"
79
82
  to="settings"
80
83
  target="_blank"
81
84
  iconName="settings"
@@ -121,6 +124,7 @@ export const WithAllMonolithDataCommercial = () => (
121
124
 
122
125
  <HeaderNavigationLink
123
126
  id="search"
127
+ title="Search"
124
128
  to="https://google.com"
125
129
  target="_blank"
126
130
  iconComponent={SearchIcon}
@@ -133,6 +137,7 @@ export const WithAllMonolithDataCommercial = () => (
133
137
 
134
138
  <HeaderNavigationLink
135
139
  id="titanAdvisor"
140
+ title="Titan Advisor"
136
141
  to="titanAdvisor"
137
142
  iconName="rocket"
138
143
  iconClassName={Styles.rocketIcon}
@@ -142,6 +147,7 @@ export const WithAllMonolithDataCommercial = () => (
142
147
 
143
148
  <HeaderNavigationLink
144
149
  id="settings"
150
+ title="Settings"
145
151
  to="settings"
146
152
  iconName="settings"
147
153
  aria-label="search"
@@ -1,5 +1,4 @@
1
- import { FC, useContext } from 'react';
2
- import { NavigationLegacyContext } from '../utils/navigation-context';
1
+ import { FC } from 'react';
3
2
  import {
4
3
  HeaderNavigationLinkProps,
5
4
  HeaderNavigationTriggerProps,
@@ -8,27 +7,48 @@ import {
8
7
  HeaderNavigationLink as HeaderNavigationLinkLegacy,
9
8
  HeaderNavigationTrigger as HeaderNavigationTriggerLegacy,
10
9
  } from './header-navigation/header-navigation-links';
10
+ import { useTitanLayoutPlacementContext } from './titan-layout';
11
11
  import {
12
- HeaderNavigationLink as HeaderNavigationLinkModern,
13
- HeaderNavigationTrigger as HeaderNavigationTriggerModern,
14
- } from './left-navigation/header-navigation-tiny-links';
12
+ LayoutHeaderNavigationLink,
13
+ LayoutHeaderNavigationTrigger,
14
+ } from './titan-layout/layout-header-links';
15
+ import {
16
+ TitanLayoutSidebarLink,
17
+ TitanLayoutSidebarTrigger,
18
+ } from './titan-layout/layout-sidebar-links';
15
19
 
16
20
  export const HeaderNavigationLink: FC<HeaderNavigationLinkProps> = props => {
17
- const isLegacy = useContext(NavigationLegacyContext);
21
+ const placement = useTitanLayoutPlacementContext();
18
22
 
19
- return isLegacy ? (
20
- <HeaderNavigationLinkLegacy {...props} />
23
+ return placement === 'top' ? (
24
+ <LayoutHeaderNavigationLink {...props} />
25
+ ) : placement === 'side' ? (
26
+ <TitanLayoutSidebarLink
27
+ id={props.id}
28
+ icon={props.icon}
29
+ iconActive={props.iconActive}
30
+ to={props.to}
31
+ title={props.title}
32
+ counter={props.counter}
33
+ />
21
34
  ) : (
22
- <HeaderNavigationLinkModern {...props} />
35
+ <HeaderNavigationLinkLegacy {...props} />
23
36
  );
24
37
  };
25
38
 
26
39
  export const HeaderNavigationTrigger: FC<HeaderNavigationTriggerProps> = props => {
27
- const isLegacy = useContext(NavigationLegacyContext);
40
+ const placement = useTitanLayoutPlacementContext();
28
41
 
29
- return isLegacy ? (
30
- <HeaderNavigationTriggerLegacy {...props} />
42
+ return placement === 'top' ? (
43
+ <LayoutHeaderNavigationTrigger {...props} />
44
+ ) : placement === 'side' ? (
45
+ <TitanLayoutSidebarTrigger
46
+ id={props.id}
47
+ title={props.title}
48
+ icon={props.icon}
49
+ iconActive={props.iconActive}
50
+ />
31
51
  ) : (
32
- <HeaderNavigationTriggerModern {...props} />
52
+ <HeaderNavigationTriggerLegacy {...props} />
33
53
  );
34
54
  };
@@ -1,15 +1,17 @@
1
1
  import { FC } from 'react';
2
2
 
3
3
  /* tslint:disable: max-line-length */
4
- export const LogoCompanyTitle: FC<{ className?: string; fill?: string; size?: string }> = ({
5
- className,
6
- fill = 'currentColor',
7
- size = '162',
8
- }) => {
4
+ export const LogoCompanyTitle: FC<{
5
+ className?: string;
6
+ fill?: string;
7
+ size?: string;
8
+ height?: string | number;
9
+ }> = ({ className, fill = 'currentColor', size = '162', height }) => {
9
10
  return (
10
11
  <svg
11
12
  className={className}
12
- width={size}
13
+ width={height ? undefined : size}
14
+ height={height}
13
15
  viewBox="0 0 322 80"
14
16
  xmlns="http://www.w3.org/2000/svg"
15
17
  >
@@ -105,6 +105,10 @@
105
105
  position: relative;
106
106
  }
107
107
 
108
+ .dropdown-content-wrapper > span {
109
+ display: block !important;
110
+ }
111
+
108
112
  .dropdown-content-bottom-left {
109
113
  .dropdown-content-wrapper::before {
110
114
  content: '';
@@ -21,9 +21,9 @@ export const ProfileDropdownDefault = () => (
21
21
  <ProfileDropdown.Link id="first" to="https://google.com">
22
22
  first link
23
23
  </ProfileDropdown.Link>
24
- <ProfileDropdown.Link id="second" onClick={() => alert('second click')}>
24
+ <ProfileDropdown.Section id="second" onClick={() => alert('second click')}>
25
25
  second link
26
- </ProfileDropdown.Link>
26
+ </ProfileDropdown.Section>
27
27
  <ProfileDropdown.Divider />
28
28
  <ProfileDropdown.Section id="content">some content</ProfileDropdown.Section>
29
29
  <ProfileDropdown.Divider />
@@ -45,9 +45,9 @@ export const ProfileDropdownWithLogo = () => (
45
45
  <ProfileDropdown.Link id="first" to="https://google.com">
46
46
  first link
47
47
  </ProfileDropdown.Link>
48
- <ProfileDropdown.Link id="second" onClick={() => alert('second click')}>
48
+ <ProfileDropdown.Section id="second" onClick={() => alert('second click')}>
49
49
  second link
50
- </ProfileDropdown.Link>
50
+ </ProfileDropdown.Section>
51
51
  </ProfileDropdown>
52
52
  );
53
53
 
@@ -25,6 +25,7 @@ import {
25
25
  } from '../../utils/navigation-context';
26
26
  import { getCounterTag } from '../../utils/side-nav';
27
27
  import { CounterTag } from '../counter-tag';
28
+ import { withTooltip } from '../titan-layout/with-tooltip';
28
29
  import * as Styles from './profile-dropdown.module.less';
29
30
  import { ProfileLogo } from './profile-icon';
30
31
 
@@ -149,11 +150,12 @@ const ProfileDropdownTrigger: FC<ProfileDropdownTriggerProps> = ({
149
150
  export interface ProfileDropdownSectionPropsStrict {
150
151
  children: ReactNode;
151
152
  id: string;
153
+ tooltip?: string;
152
154
  className?: string;
153
155
  onClick?(e: MouseEvent): void;
154
156
  }
155
157
 
156
- interface ProfileDropdownSectionProps extends ProfileDropdownSectionPropsStrict {
158
+ export interface ProfileDropdownSectionProps extends ProfileDropdownSectionPropsStrict {
157
159
  [key: string]: any;
158
160
  }
159
161
 
@@ -161,6 +163,7 @@ export const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
161
163
  children,
162
164
  className,
163
165
  id,
166
+ tooltip,
164
167
  onClick,
165
168
  ...rest
166
169
  }) => {
@@ -172,16 +175,20 @@ export const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
172
175
  }
173
176
  };
174
177
 
175
- return (
178
+ return withTooltip(
176
179
  <div
177
- className={classNames(Styles.dropdownSection, className)}
180
+ className={classNames(Styles.dropdownSection, className, {
181
+ 'cursor-pointer': !!onClick,
182
+ })}
178
183
  onClick={clickHandler}
179
184
  data-cy={`profile-dropdown-section-${id}`}
180
185
  data-pendo={`profile-dropdown-section-${id}`}
181
186
  {...rest}
182
187
  >
183
188
  {children}
184
- </div>
189
+ </div>,
190
+ tooltip,
191
+ 'left'
185
192
  );
186
193
  };
187
194
 
@@ -193,10 +200,10 @@ export interface ProfileDropdownLinkPropsStrict {
193
200
  className?: string;
194
201
  external?: boolean;
195
202
  target?: HTMLAttributeAnchorTarget;
196
- to?: string;
203
+ tooltip?: string;
204
+ to: string;
197
205
  tag?: CounterTagData;
198
206
  counter?: CounterTagValue;
199
- onClick?: () => void;
200
207
  }
201
208
 
202
209
  export interface ProfileDropdownLinkProps extends ProfileDropdownLinkPropsStrict {
@@ -212,16 +219,12 @@ export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
212
219
  tag,
213
220
  target,
214
221
  to,
222
+ tooltip,
215
223
  onClick,
216
224
  ...rest
217
225
  }: ProfileDropdownLinkProps) => {
218
226
  const NavigationComponent = useContext(NavigationComponentContext);
219
227
 
220
- const clickHandler = (e: MouseEvent<any>) => {
221
- e.preventDefault();
222
- onClick?.();
223
- };
224
-
225
228
  const isExternalLink = external ?? to?.startsWith('http');
226
229
 
227
230
  const tagElement = useMemo(
@@ -229,41 +232,34 @@ export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
229
232
  [counter, tag]
230
233
  );
231
234
 
232
- return isExternalLink ? (
233
- <a
234
- className={classNames(Styles.dropdownSection, Styles.dropdownLink, className)}
235
- href={to}
236
- target={target}
237
- data-cy={`profile-dropdown-link-${id}`}
238
- data-pendo={`profile-dropdown-link-${id}`}
239
- {...rest}
240
- >
241
- {children}
242
- {tagElement}
243
- </a>
244
- ) : to ? (
245
- <NavigationComponent
246
- className={classNames(Styles.dropdownSection, Styles.dropdownLink, className)}
247
- target={target}
248
- to={to}
249
- data-cy={`profile-dropdown-link-${id}`}
250
- data-pendo={`profile-dropdown-link-${id}`}
251
- {...rest}
252
- >
253
- {children}
254
- {tagElement}
255
- </NavigationComponent>
256
- ) : (
257
- <a
258
- className={classNames(Styles.dropdownSection, Styles.dropdownLink, className)}
259
- onClick={clickHandler}
260
- data-cy={`profile-dropdown-link-${id}`}
261
- data-pendo={`profile-dropdown-link-${id}`}
262
- {...rest}
263
- >
264
- {children}
265
- {tagElement}
266
- </a>
235
+ return withTooltip(
236
+ isExternalLink ? (
237
+ <a
238
+ className={classNames(Styles.dropdownSection, Styles.dropdownLink, className)}
239
+ href={to}
240
+ target={target}
241
+ data-cy={`profile-dropdown-link-${id}`}
242
+ data-pendo={`profile-dropdown-link-${id}`}
243
+ {...rest}
244
+ >
245
+ {children}
246
+ {tagElement}
247
+ </a>
248
+ ) : (
249
+ <NavigationComponent
250
+ className={classNames(Styles.dropdownSection, Styles.dropdownLink, className)}
251
+ target={target}
252
+ to={to}
253
+ data-cy={`profile-dropdown-link-${id}`}
254
+ data-pendo={`profile-dropdown-link-${id}`}
255
+ {...rest}
256
+ >
257
+ {children}
258
+ {tagElement}
259
+ </NavigationComponent>
260
+ ),
261
+ tooltip,
262
+ 'left'
267
263
  );
268
264
  };
269
265
 
@@ -291,6 +287,7 @@ export interface ProfileDropdownProps extends ProfileDropdownPropsStrict {
291
287
  export interface ProfileDropdownType extends FC<ProfileDropdownProps> {
292
288
  Divider: typeof ProfileDropdownDivider;
293
289
  Link: typeof ProfileDropdownLink;
290
+ Trigger: typeof ProfileDropdownTrigger;
294
291
  Section: typeof ProfileDropdownSection;
295
292
  }
296
293
 
@@ -0,0 +1,5 @@
1
+ export * from './titan-layout';
2
+ export * from './layout-profile';
3
+ export * from './layout-context';
4
+ export * from './layout-logo';
5
+ export * from './interface';
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ import { NavLinkComponentProps } from '../../utils/navigation-context';
3
+
4
+ export interface NavigationComponentProps {
5
+ navigationComponent: FC<NavLinkComponentProps>;
6
+ }
@@ -0,0 +1,26 @@
1
+ import { FC, ReactElement } from 'react';
2
+ import { NavigationItemData } from '../../utils/navigation';
3
+ import { TitanLayoutSidebarContextType } from './layout-context';
4
+
5
+ export interface TitanLayoutSidebarLinkWrapperProps {
6
+ children:
7
+ | ReactElement<TitanLayoutSidebarLinkProps>
8
+ | ReactElement<TitanLayoutSidebarTriggerProps>;
9
+ context: TitanLayoutSidebarContextType;
10
+ }
11
+
12
+ export interface TitanLayoutSidebarLinkProps extends Omit<NavigationItemData, 'submenu'> {
13
+ wrapper?: FC<TitanLayoutSidebarLinkWrapperProps>;
14
+ }
15
+ export interface TitanLayoutSidebarTriggerProps
16
+ extends Omit<TitanLayoutSidebarLinkProps, 'to' | 'isActive'> {
17
+ isActive?: boolean;
18
+ wrapper?: FC<TitanLayoutSidebarLinkWrapperProps>;
19
+ onClick?: () => void;
20
+ onMobileClick?: () => void;
21
+ }
22
+
23
+ export interface TitanLayoutState {
24
+ navCollapsed: boolean;
25
+ submenuExpanded?: string;
26
+ }
@@ -0,0 +1,30 @@
1
+ import { CSSProperties, FC, createContext, useContext } from 'react';
2
+ import { DefaultNavLinkComponent, NavLinkComponentProps } from '../../utils/navigation-context';
3
+ import { TitanBreakpoint } from '../../utils/use-breakpoint';
4
+
5
+ export interface TitanLayoutSidebarContextType {
6
+ styles: {
7
+ popoverContent: CSSProperties;
8
+ };
9
+ }
10
+
11
+ export type TitanLayoutPlacement = 'top' | 'side' | 'unset';
12
+
13
+ export interface TitanLayoutContextType {
14
+ NavigationComponent: FC<NavLinkComponentProps>;
15
+ breakpoint: TitanBreakpoint;
16
+ isTitanLayout: boolean;
17
+ sidebar: TitanLayoutSidebarContextType;
18
+ }
19
+
20
+ export const LayoutContext = createContext<TitanLayoutContextType>({
21
+ NavigationComponent: DefaultNavLinkComponent,
22
+ breakpoint: { name: 'lg', isMobile: false },
23
+ isTitanLayout: false,
24
+ sidebar: { styles: { popoverContent: {} } },
25
+ });
26
+
27
+ export const useTitanLayoutContext = () => useContext(LayoutContext);
28
+
29
+ export const LayoutPlacementContext = createContext<TitanLayoutPlacement | undefined>(undefined);
30
+ export const useTitanLayoutPlacementContext = () => useContext(LayoutPlacementContext);