luna-one 3.1.354 → 3.1.358
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/application/components/NavBarHandler/NavBarHandler.js +13 -1
- package/dist/luna/components/ComparisonTable/ComparisonTable.scss +2 -9
- package/dist/luna/components/InPageJumpNav/InPageJumpNav.js +1 -1
- package/dist/luna/components/InPageJumpNav/InPageJumpNavMethods.js +3 -2
- package/dist/luna/components/Login/Login.js +57 -9
- package/dist/luna/components/Login/Login.scss +22 -0
- package/dist/luna/components/MegaMenu/MegaMenu.js +9 -5
- package/dist/luna/components/MegaMenu/MegaMenu.scss +18 -0
- package/dist/luna/components/NavBarTop/NavBarTop.js +4 -3
- package/dist/luna/components/NavBarTop/NavBarTop.scss +4 -1
- package/dist/luna/images/cross-medium-white.svg +5 -0
- package/dist/luna/other-organisms/NavBar/NavBar.js +77 -43
- package/dist/luna/other-organisms/NavBar/NavBar.scss +60 -0
- package/dist/luna/other-organisms/NavBar/NavMiniMenu.js +4 -3
- package/dist/luna/other-organisms/SubNav/SubNav.js +92 -60
- package/dist/luna/other-organisms/SubNav/SubNav.scss +54 -37
- package/dist/luna/other-organisms/SubNav/SubNavSiblingsMenu.js +172 -0
- package/package.json +2 -2
|
@@ -102,7 +102,19 @@ var NavBarHandler = function NavBarHandler(_ref) {
|
|
|
102
102
|
saveLanguage: saveLanguage,
|
|
103
103
|
searchComponent: searchComponent,
|
|
104
104
|
searchDeployed: searchDeployed,
|
|
105
|
-
setSearchDeployed: setSearchDeployed
|
|
105
|
+
setSearchDeployed: setSearchDeployed,
|
|
106
|
+
loginPage: function loginPage() {
|
|
107
|
+
return data === null || data === void 0 ? void 0 : data.loginPage();
|
|
108
|
+
},
|
|
109
|
+
logout: function logout() {
|
|
110
|
+
return data === null || data === void 0 ? void 0 : data.logout();
|
|
111
|
+
},
|
|
112
|
+
isAuthenticated: data === null || data === void 0 ? void 0 : data.isAuthenticated,
|
|
113
|
+
userProfile: data === null || data === void 0 ? void 0 : data.userProfile,
|
|
114
|
+
disableMenus: data === null || data === void 0 ? void 0 : data.disableMenus,
|
|
115
|
+
displayIcons: data === null || data === void 0 ? void 0 : data.displayIcons,
|
|
116
|
+
displaySectorName: data === null || data === void 0 ? void 0 : data.displaySectorName,
|
|
117
|
+
theme: data === null || data === void 0 ? void 0 : data.theme
|
|
106
118
|
});
|
|
107
119
|
};
|
|
108
120
|
|
|
@@ -108,23 +108,17 @@
|
|
|
108
108
|
top: 0;
|
|
109
109
|
right: 0;
|
|
110
110
|
bottom: 0;
|
|
111
|
-
left: 0;
|
|
112
111
|
position: absolute;
|
|
113
112
|
background-color: $white;
|
|
114
113
|
border-bottom: 1px solid $trimble-blue;
|
|
115
114
|
border-right: 1px solid $trimble-blue;
|
|
116
|
-
width:
|
|
115
|
+
width: 161px;
|
|
117
116
|
border-left: 1px solid $white;
|
|
118
|
-
@media screen and (min-width: $breakpoint-sm) {
|
|
119
|
-
width: 160px;
|
|
120
|
-
}
|
|
121
117
|
}
|
|
122
118
|
}
|
|
123
119
|
&__row {
|
|
124
120
|
&--header {
|
|
125
121
|
font-weight: 600;
|
|
126
|
-
position: -webkit-sticky;
|
|
127
|
-
position: sticky;
|
|
128
122
|
top: 60px;
|
|
129
123
|
left: 0;
|
|
130
124
|
right: 0;
|
|
@@ -135,8 +129,6 @@
|
|
|
135
129
|
height: 60px; // to allow for two lines of text
|
|
136
130
|
left: 0;
|
|
137
131
|
right: 0;
|
|
138
|
-
position: -webkit-sticky;
|
|
139
|
-
position: sticky;
|
|
140
132
|
z-index: 5;
|
|
141
133
|
top: 0;
|
|
142
134
|
}
|
|
@@ -159,6 +151,7 @@
|
|
|
159
151
|
&__group-title .ter-comparison-table__blank > span {
|
|
160
152
|
background-color: $white;
|
|
161
153
|
border-bottom: none;
|
|
154
|
+
|
|
162
155
|
}
|
|
163
156
|
&__comparison-cell {
|
|
164
157
|
display: flex;
|
|
@@ -45,7 +45,7 @@ var InPageJumpNav = function InPageJumpNav(_ref) {
|
|
|
45
45
|
var observerOptions = {
|
|
46
46
|
root: null,
|
|
47
47
|
rootMargin: "0px",
|
|
48
|
-
threshold: [0
|
|
48
|
+
threshold: [0.25, 0.5, 0.75, 1]
|
|
49
49
|
};
|
|
50
50
|
var observer = (0, _react.useMemo)(function () {
|
|
51
51
|
return new IntersectionObserver(function (pageSections, observer) {
|
|
@@ -49,12 +49,13 @@ var scrollToActiveItem = function scrollToActiveItem(activeItem) {
|
|
|
49
49
|
_smoothscrollPolyfill.default.polyfill();
|
|
50
50
|
|
|
51
51
|
activeItem.scrollIntoView({
|
|
52
|
-
behavior: "smooth"
|
|
52
|
+
behavior: "smooth",
|
|
53
|
+
block: "start"
|
|
53
54
|
});
|
|
54
55
|
} else {
|
|
55
56
|
// if user is on any other browser, we can use the scrollTo with behavior "smooth"
|
|
56
57
|
window.scrollTo({
|
|
57
|
-
top: activeItem.offsetTop,
|
|
58
|
+
top: activeItem.offsetTop > 153 ? activeItem.offsetTop - 153 : activeItem.offsetTop,
|
|
58
59
|
left: 0,
|
|
59
60
|
behavior: "smooth"
|
|
60
61
|
});
|
|
@@ -29,17 +29,27 @@ var Login = function Login(_ref) {
|
|
|
29
29
|
var _login$userInformatio, _login$userInformatio2, _login$userInformatio3, _login$userInformatio4;
|
|
30
30
|
|
|
31
31
|
var login = _ref.login,
|
|
32
|
-
isHidden = _ref.isHidden
|
|
32
|
+
isHidden = _ref.isHidden,
|
|
33
|
+
loginPage = _ref.loginPage,
|
|
34
|
+
Link = _ref.Link,
|
|
35
|
+
isAuthenticated = _ref.isAuthenticated,
|
|
36
|
+
userProfile = _ref.userProfile,
|
|
37
|
+
logout = _ref.logout;
|
|
33
38
|
|
|
34
39
|
var _useState = (0, _react.useState)(false),
|
|
35
40
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
36
41
|
toggle = _useState2[0],
|
|
37
42
|
setToggle = _useState2[1];
|
|
38
43
|
|
|
39
|
-
var _useState3 = (0, _react.useState)(
|
|
44
|
+
var _useState3 = (0, _react.useState)(false),
|
|
40
45
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
showSignout = _useState4[0],
|
|
47
|
+
setShowSignout = _useState4[1];
|
|
48
|
+
|
|
49
|
+
var _useState5 = (0, _react.useState)(_downArrow.default),
|
|
50
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
51
|
+
image = _useState6[0],
|
|
52
|
+
setImage = _useState6[1];
|
|
43
53
|
|
|
44
54
|
var ref = (0, _react.useRef)(null);
|
|
45
55
|
|
|
@@ -110,12 +120,50 @@ var Login = function Login(_ref) {
|
|
|
110
120
|
}
|
|
111
121
|
};
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
|
|
123
|
+
var toggleSignout = function toggleSignout() {
|
|
124
|
+
setShowSignout(!showSignout);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var handleClickLogout = function handleClickLogout() {
|
|
128
|
+
setShowSignout(false);
|
|
129
|
+
logout();
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
var handleClickLogin = function handleClickLogin() {
|
|
133
|
+
loginPage();
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, loginPage && !isAuthenticated ? /*#__PURE__*/_react.default.createElement("a", {
|
|
137
|
+
onClick: handleClickLogin,
|
|
138
|
+
className: "login-button",
|
|
115
139
|
style: {
|
|
116
140
|
display: isHidden ? "none" : ""
|
|
141
|
+
}
|
|
142
|
+
}, "Login") : loginPage && isAuthenticated ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("section", {
|
|
143
|
+
className: "login"
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
145
|
+
onClick: function onClick() {
|
|
146
|
+
return toggleSignout();
|
|
147
|
+
},
|
|
148
|
+
className: "login__text"
|
|
149
|
+
}, "Welcome,", /*#__PURE__*/_react.default.createElement("span", {
|
|
150
|
+
className: "login__user"
|
|
151
|
+
}, " ".concat(userProfile.firstName))), /*#__PURE__*/_react.default.createElement("section", {
|
|
152
|
+
className: "logout",
|
|
153
|
+
style: {
|
|
154
|
+
display: showSignout ? "" : "none"
|
|
155
|
+
}
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
157
|
+
onClick: function onClick() {
|
|
158
|
+
return handleClickLogout();
|
|
117
159
|
},
|
|
118
|
-
|
|
160
|
+
className: "logout__button"
|
|
161
|
+
}, "Log Out")))) : /*#__PURE__*/_react.default.createElement("article", {
|
|
162
|
+
className: mouse ? "sketchup-login" : "sketchup-login tagFocus",
|
|
163
|
+
id: _lodash.default.uniqueId("id-"),
|
|
164
|
+
style: {
|
|
165
|
+
display: isHidden ? "none" : ""
|
|
166
|
+
}
|
|
119
167
|
}, login && login.content && login.content.text && !login.loggedIn && /*#__PURE__*/_react.default.createElement("a", {
|
|
120
168
|
onClick: function onClick() {
|
|
121
169
|
return login.handleLogin();
|
|
@@ -133,7 +181,7 @@ var Login = function Login(_ref) {
|
|
|
133
181
|
}, login.content.text), login && login.loggedIn && /*#__PURE__*/_react.default.createElement("img", {
|
|
134
182
|
tagIndex: mouse ? "" : "0",
|
|
135
183
|
className: mouse ? "sketchup-login__user" : "sketchup-login__user tagFocus",
|
|
136
|
-
src:
|
|
184
|
+
src: userProfile,
|
|
137
185
|
onClick: hangleToggle
|
|
138
186
|
}), login && login.loggedIn && /*#__PURE__*/_react.default.createElement("img", {
|
|
139
187
|
className: "sketchup-login__down-arrow",
|
|
@@ -155,7 +203,7 @@ var Login = function Login(_ref) {
|
|
|
155
203
|
className: "sketchup-login__user-name"
|
|
156
204
|
}, login.userInformation.name), login && login.userInformation && login.userInformation.email && /*#__PURE__*/_react.default.createElement("p", {
|
|
157
205
|
className: "sketchup-login__user-email"
|
|
158
|
-
}, login.userInformation.email))), renderListItems()));
|
|
206
|
+
}, login.userInformation.email))), renderListItems())));
|
|
159
207
|
};
|
|
160
208
|
|
|
161
209
|
var _default = Login;
|
|
@@ -138,3 +138,25 @@
|
|
|
138
138
|
.sketchup-login.tagFocus:focus {
|
|
139
139
|
outline: 2px solid $sky-blue !important;
|
|
140
140
|
}
|
|
141
|
+
|
|
142
|
+
.login {
|
|
143
|
+
position:relative;
|
|
144
|
+
&__text {
|
|
145
|
+
@include benton-normal();
|
|
146
|
+
font-size: $body-font-size;
|
|
147
|
+
color: $mep-blue-2;
|
|
148
|
+
margin: 0 16px 0 16px;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
}
|
|
151
|
+
&__user {
|
|
152
|
+
@include benton-bold();
|
|
153
|
+
}
|
|
154
|
+
.logout {
|
|
155
|
+
@include benton-bold();
|
|
156
|
+
position: absolute;
|
|
157
|
+
width: 100%;
|
|
158
|
+
background-color: $white;
|
|
159
|
+
margin-top: 13px;
|
|
160
|
+
border-top: 4px solid $trimble-gold;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -19,6 +19,8 @@ require("./MegaMenu.scss");
|
|
|
19
19
|
|
|
20
20
|
var _crossMediumBlue = _interopRequireDefault(require("../../images/cross-medium-blue.svg"));
|
|
21
21
|
|
|
22
|
+
var _crossMediumWhite = _interopRequireDefault(require("../../images/cross-medium-white.svg"));
|
|
23
|
+
|
|
22
24
|
var _formatID = _interopRequireDefault(require("../../utils/formatID"));
|
|
23
25
|
|
|
24
26
|
var _FeatureSection = require("./menu-generators/FeatureSection");
|
|
@@ -44,7 +46,9 @@ var MegaMenu = function MegaMenu(props) {
|
|
|
44
46
|
currentOpenMenu = props.currentOpenMenu,
|
|
45
47
|
collapsed = props.collapsed,
|
|
46
48
|
isOpen = props.isOpen,
|
|
47
|
-
Link = props.Link
|
|
49
|
+
Link = props.Link,
|
|
50
|
+
displayIcons = props.displayIcons,
|
|
51
|
+
theme = props.theme;
|
|
48
52
|
|
|
49
53
|
var _useState = (0, _react.useState)(null),
|
|
50
54
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -234,7 +238,7 @@ var MegaMenu = function MegaMenu(props) {
|
|
|
234
238
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
235
239
|
id: _lodash.default.uniqueId("mega-menu-"),
|
|
236
240
|
tabIndex: mouse ? "" : "0",
|
|
237
|
-
className: "ter-mega-menu ".concat(isOpen ? "ter-mega-menu--is-open" : "", " ").concat(mouse ? "" : "tabFocus", " ").concat(returnDeployedChildClass()),
|
|
241
|
+
className: "ter-mega-menu ".concat(isOpen ? "ter-mega-menu--is-open" : "", " ").concat(mouse ? "" : "tabFocus", " ").concat(returnDeployedChildClass(), "\n ").concat(displayIcons ? "ter-mega-menu--with-icon" : ""),
|
|
238
242
|
onKeyDown: function onKeyDown(e) {
|
|
239
243
|
return mouseOverWithKeys(e);
|
|
240
244
|
},
|
|
@@ -246,13 +250,13 @@ var MegaMenu = function MegaMenu(props) {
|
|
|
246
250
|
"aria-label": "".concat(content.text, " menu")
|
|
247
251
|
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
248
252
|
id: (0, _formatID.default)("".concat(content.text, "-mega-menu-nav-text")),
|
|
249
|
-
className: "ter-mega-menu__nav-text ".concat(isOpen ? "ter-mega-menu__nav-text--is-open" : "")
|
|
253
|
+
className: "ter-mega-menu__nav-text ".concat(isOpen ? "ter-mega-menu__nav-text--is-open" : "", "\n ").concat(theme ? "ter-mega-menu__nav-text--".concat(theme) : "", "\n ").concat(displayIcons ? "ter-mega-menu__nav-text--with-icon" : "", "\n ").concat(displayIcons && theme ? "ter-mega-menu__nav-text--with-icon" : "", "\n ")
|
|
250
254
|
}, content.text, /*#__PURE__*/_react.default.createElement("img", {
|
|
251
255
|
id: _lodash.default.uniqueId("cross-icon-"),
|
|
252
|
-
src: _crossMediumBlue.default,
|
|
256
|
+
src: theme === "blue" ? _crossMediumWhite.default : _crossMediumBlue.default,
|
|
253
257
|
alt: "cross icon",
|
|
254
258
|
"aria-label": isOpen ? "Opened" : "Closed",
|
|
255
|
-
className: "ter-nav-icon-cross ".concat(isOpen ? "ter-nav-icon-cross--is-open" : "")
|
|
259
|
+
className: "ter-nav-icon-cross ".concat(isOpen ? "ter-nav-icon-cross--is-open" : "", "\n ")
|
|
256
260
|
})), /*#__PURE__*/_react.default.createElement("section", {
|
|
257
261
|
//Section wrapper class is determined by the menu type
|
|
258
262
|
className: "ter-mega-menu__".concat(menuType, " ").concat(isOpen ? "ter-mega-menu__".concat(menuType, "--is-open ") : "", "\n "),
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
&.tabFocus:focus {
|
|
10
10
|
outline: 2px solid $sky-blue;
|
|
11
11
|
}
|
|
12
|
+
&--with-icon {
|
|
13
|
+
height: 56px;
|
|
14
|
+
padding: 1px 0 20px 0;
|
|
15
|
+
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
&__title-link {
|
|
14
19
|
text-decoration: none;
|
|
@@ -67,9 +72,22 @@
|
|
|
67
72
|
border-bottom: 3px solid transparent;
|
|
68
73
|
white-space: nowrap;
|
|
69
74
|
padding: 16px 8px;
|
|
75
|
+
&--blue {
|
|
76
|
+
color: white
|
|
77
|
+
}
|
|
78
|
+
&--with-icon {
|
|
79
|
+
height: 33px !important;
|
|
80
|
+
padding: 3px 8px 8px;
|
|
81
|
+
&--blue {
|
|
82
|
+
color: white
|
|
83
|
+
}
|
|
84
|
+
}
|
|
70
85
|
|
|
71
86
|
@media screen and (min-width: $breakpoint-md) {
|
|
72
87
|
padding: 16px 18px;
|
|
88
|
+
&--with-icon {
|
|
89
|
+
padding: 5px 8px 8px;
|
|
90
|
+
}
|
|
73
91
|
}
|
|
74
92
|
|
|
75
93
|
&--is-open,
|
|
@@ -54,7 +54,8 @@ var NavBarTop = function NavBarTop(props) {
|
|
|
54
54
|
saveLanguage = props.saveLanguage,
|
|
55
55
|
searchComponent = props.searchComponent,
|
|
56
56
|
searchDeployed = props.searchDeployed,
|
|
57
|
-
setSearchDeployed = props.setSearchDeployed
|
|
57
|
+
setSearchDeployed = props.setSearchDeployed,
|
|
58
|
+
displaySectorName = props.displaySectorName;
|
|
58
59
|
var inputFocus = (0, _utilizeFocus.utilizeFocus)();
|
|
59
60
|
|
|
60
61
|
var _useContext = (0, _react.useContext)(_NavBar.NavBarContext),
|
|
@@ -200,10 +201,10 @@ var NavBarTop = function NavBarTop(props) {
|
|
|
200
201
|
},
|
|
201
202
|
"aria-label": "Link to homepage"
|
|
202
203
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
203
|
-
className: mouse ? "ter-navbar-top__logo" : "ter-navbar-top__logo tabFocus",
|
|
204
|
+
className: "".concat(mouse ? "ter-navbar-top__logo" : "ter-navbar-top__logo tabFocus", "\n ").concat(!displaySectorName ? "ter-navbar-top__logo--no-sector-name" : "", "\n "),
|
|
204
205
|
src: logo === null || logo === void 0 ? void 0 : logo.url,
|
|
205
206
|
alt: logo === null || logo === void 0 ? void 0 : logo.altText
|
|
206
|
-
}), divisionName !== "Global" && /*#__PURE__*/_react.default.createElement("p", {
|
|
207
|
+
}), (divisionName && divisionName) !== "Global" && /*#__PURE__*/_react.default.createElement("p", {
|
|
207
208
|
className: "ter-navbar-top__division-name"
|
|
208
209
|
}, divisionName))), /*#__PURE__*/_react.default.createElement("div", {
|
|
209
210
|
className: "ter-navbar-top__right"
|
|
@@ -75,6 +75,9 @@
|
|
|
75
75
|
height: 25px;
|
|
76
76
|
width: 112px;
|
|
77
77
|
margin: 0 8px 0 0 !important;
|
|
78
|
+
&--no-sector-name {
|
|
79
|
+
width: 289px
|
|
80
|
+
}
|
|
78
81
|
|
|
79
82
|
&-link {
|
|
80
83
|
display: -webkit-box;
|
|
@@ -294,7 +297,7 @@
|
|
|
294
297
|
&__link {
|
|
295
298
|
font-size: $eyebrow-font-size;
|
|
296
299
|
margin: 0 20px;
|
|
297
|
-
padding-right:
|
|
300
|
+
padding-right: 0px;
|
|
298
301
|
@media screen and (max-width: $breakpoint-sm) {
|
|
299
302
|
padding-right: 6px;
|
|
300
303
|
}
|
|
@@ -78,8 +78,10 @@ var NavBar = function NavBar(props) {
|
|
|
78
78
|
featuredLink = props.featuredLink,
|
|
79
79
|
searchPlaceholder = props.searchPlaceholder,
|
|
80
80
|
disableLogin = props.disableLogin,
|
|
81
|
+
disableSearch = props.disableSearch,
|
|
81
82
|
disableLanguageRegion = props.disableLanguageRegion,
|
|
82
83
|
disableSectorFlyOut = props.disableSectorFlyOut,
|
|
84
|
+
disableMenus = props.disableMenus,
|
|
83
85
|
login = props.login,
|
|
84
86
|
navOptions = props.navOptions,
|
|
85
87
|
isExpanded = props.isExpanded,
|
|
@@ -98,7 +100,14 @@ var NavBar = function NavBar(props) {
|
|
|
98
100
|
saveLanguage = _props$saveLanguage === void 0 ? function (language) {} : _props$saveLanguage,
|
|
99
101
|
searchComponent = props.searchComponent,
|
|
100
102
|
searchDeployed = props.searchDeployed,
|
|
101
|
-
setSearchDeployed = props.setSearchDeployed
|
|
103
|
+
setSearchDeployed = props.setSearchDeployed,
|
|
104
|
+
isAuthenticated = props.isAuthenticated,
|
|
105
|
+
userProfile = props.userProfile,
|
|
106
|
+
loginPage = props.loginPage,
|
|
107
|
+
logout = props.logout,
|
|
108
|
+
displayIcons = props.displayIcons,
|
|
109
|
+
displaySectorName = props.displaySectorName,
|
|
110
|
+
theme = props.theme;
|
|
102
111
|
|
|
103
112
|
var _useState = (0, _react.useState)(null),
|
|
104
113
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -251,40 +260,60 @@ var NavBar = function NavBar(props) {
|
|
|
251
260
|
e.stopPropagation();
|
|
252
261
|
};
|
|
253
262
|
|
|
263
|
+
var NavOption = function NavOption(_ref) {
|
|
264
|
+
var displayIcons = _ref.displayIcons,
|
|
265
|
+
option = _ref.option,
|
|
266
|
+
children = _ref.children;
|
|
267
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, displayIcons ? /*#__PURE__*/_react.default.createElement("div", {
|
|
268
|
+
className: "ter-navbar__nav--with-icons"
|
|
269
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
270
|
+
className: "ter-navbar__nav--with-icons--icon"
|
|
271
|
+
}, /*#__PURE__*/_react.default.createElement(_terraOne.Icon, {
|
|
272
|
+
type: option === null || option === void 0 ? void 0 : option.icon,
|
|
273
|
+
size: "20px",
|
|
274
|
+
color: theme === "blue" ? "#ffffff" : "#0063a3",
|
|
275
|
+
className: "ter-navbar__nav--icon "
|
|
276
|
+
})), children) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children));
|
|
277
|
+
};
|
|
278
|
+
|
|
254
279
|
var generateNavOptions = function generateNavOptions() {
|
|
255
|
-
return navOptions.map(function (option) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
280
|
+
return navOptions === null || navOptions === void 0 ? void 0 : navOptions.map(function (option) {
|
|
281
|
+
var _option$links;
|
|
282
|
+
|
|
283
|
+
var isCollapsed = (option === null || option === void 0 ? void 0 : (_option$links = option.links) === null || _option$links === void 0 ? void 0 : _option$links.length) > 4 ? true : false;
|
|
284
|
+
return /*#__PURE__*/_react.default.createElement(NavOption, {
|
|
285
|
+
displayIcons: displayIcons,
|
|
286
|
+
option: option
|
|
287
|
+
}, option.type === "category" ? /*#__PURE__*/_react.default.createElement(_MegaMenu.default, {
|
|
288
|
+
key: option.text,
|
|
289
|
+
isOpen: currentOpenMenu === option.text,
|
|
290
|
+
content: option,
|
|
291
|
+
Link: Link,
|
|
292
|
+
collapsed: isCollapsed ? true : !isExpanded,
|
|
293
|
+
currentOpenMenu: currentOpenMenu,
|
|
294
|
+
displayIcons: displayIcons,
|
|
295
|
+
icon: option.icon,
|
|
296
|
+
theme: theme
|
|
297
|
+
}) : option.type === "links" ? /*#__PURE__*/_react.default.createElement(_NavMiniMenu.default, {
|
|
298
|
+
navText: option.text,
|
|
299
|
+
links: option.links,
|
|
300
|
+
key: option.text,
|
|
301
|
+
isOpen: currentOpenMenu === option.text,
|
|
302
|
+
Link: Link,
|
|
303
|
+
displayIcons: displayIcons,
|
|
304
|
+
icon: option.icon
|
|
305
|
+
}) : /*#__PURE__*/_react.default.createElement(_terraOne.LunaLink, {
|
|
306
|
+
to: option.url,
|
|
307
|
+
tabIndex: mouse ? "" : "0",
|
|
308
|
+
href: option.url,
|
|
309
|
+
key: option.text,
|
|
310
|
+
className: "".concat(mouse ? "ter-navbar__nav-link" : "ter-navbar__nav-link tabFocus", " \n ").concat(theme ? "ter-navbar__nav-link--".concat(theme) : "", "\n ").concat(displayIcons ? "ter-navbar__nav-link--with-icon" : "", "\n ").concat(displayIcons && theme ? "ter-navbar__nav-link--with-icon--".concat(theme) : ""),
|
|
311
|
+
id: (0, _formatID.default)("".concat(option.text, "-navbar-nav-link")),
|
|
312
|
+
Link: Link,
|
|
313
|
+
onClick: closeAllDropDowns,
|
|
314
|
+
displayIcons: displayIcons,
|
|
315
|
+
icon: option.icon
|
|
316
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, option.text)));
|
|
288
317
|
});
|
|
289
318
|
};
|
|
290
319
|
|
|
@@ -355,6 +384,7 @@ var NavBar = function NavBar(props) {
|
|
|
355
384
|
regionLanguageID: regionLanguageID,
|
|
356
385
|
Link: Link,
|
|
357
386
|
disableLogin: disableLogin,
|
|
387
|
+
disableSearch: disableSearch,
|
|
358
388
|
disableLanguageRegion: disableLanguageRegion,
|
|
359
389
|
disableSectorFlyOut: disableSectorFlyOut,
|
|
360
390
|
languageSelectorData: languageSelectorData,
|
|
@@ -363,25 +393,29 @@ var NavBar = function NavBar(props) {
|
|
|
363
393
|
saveLanguage: saveLanguage,
|
|
364
394
|
searchComponent: searchComponent,
|
|
365
395
|
searchDeployed: searchDeployed,
|
|
366
|
-
setSearchDeployed: setSearchDeployed
|
|
367
|
-
|
|
396
|
+
setSearchDeployed: setSearchDeployed,
|
|
397
|
+
displaySectorName: displaySectorName
|
|
398
|
+
}, !disableLogin && /*#__PURE__*/_react.default.createElement(_Login.default, {
|
|
399
|
+
loginPage: loginPage,
|
|
368
400
|
login: login,
|
|
369
|
-
isHidden: disableLogin
|
|
401
|
+
isHidden: disableLogin,
|
|
402
|
+
Link: Link,
|
|
403
|
+
isAuthenticated: isAuthenticated,
|
|
404
|
+
userProfile: userProfile,
|
|
405
|
+
logout: logout
|
|
370
406
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
371
|
-
className: "luna-layout__navigation-padding"
|
|
372
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
373
|
-
className: "ter-navbar__wrapper"
|
|
407
|
+
className: "luna-layout__navigation-padding ".concat(theme ? "luna-layout__navigation-padding--".concat(theme) : "")
|
|
408
|
+
}, !disableMenus && /*#__PURE__*/_react.default.createElement("div", {
|
|
409
|
+
className: "ter-navbar__wrapper \n ".concat(theme ? "ter-navbar__wrapper--".concat(theme) : "", "\n ").concat(displayIcons ? "ter-navbar__wrapper--with-icons" : "", "\n ").concat(displayIcons && theme ? "ter-navbar__wrapper--with-icons--".concat(theme) : "", "\n ")
|
|
374
410
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
375
411
|
id: _lodash.default.uniqueId("id-"),
|
|
376
|
-
className: "ter-navbar__menus-wrapper"
|
|
412
|
+
className: "ter-navbar__menus-wrapper ".concat(displayIcons ? "ter-navbar__menus-wrapper--with-icons" : "")
|
|
377
413
|
}, generateNavOptions(), featuredLink && generateFeaturedLink()))), /*#__PURE__*/_react.default.createElement(_MobileNav.default, {
|
|
378
414
|
rightLinks: rightLinks,
|
|
379
415
|
navOptions: navOptions,
|
|
380
416
|
disableLogin: disableLogin,
|
|
381
417
|
disableLanguageRegion: disableLanguageRegion,
|
|
382
418
|
disableSectorFlyOut: disableSectorFlyOut,
|
|
383
|
-
Link: Link,
|
|
384
|
-
login: login,
|
|
385
419
|
handleSectorFlyoutDeployed: handleSectorFlyoutDeployed,
|
|
386
420
|
sectorFlyoutLabel: sectorFlyoutData === null || sectorFlyoutData === void 0 ? void 0 : sectorFlyoutData.mobileLabel,
|
|
387
421
|
languageSelectorData: languageSelectorData,
|
|
@@ -26,6 +26,15 @@
|
|
|
26
26
|
height: 56px;
|
|
27
27
|
opacity: 1;
|
|
28
28
|
background: $white;
|
|
29
|
+
&--blue {
|
|
30
|
+
background: $trimble-blue;
|
|
31
|
+
}
|
|
32
|
+
&--with-icons {
|
|
33
|
+
height: 81px;
|
|
34
|
+
&--blue {
|
|
35
|
+
background: $trimble-blue;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
}
|
|
31
40
|
|
|
@@ -96,9 +105,17 @@
|
|
|
96
105
|
grid-column: 2;
|
|
97
106
|
overflow: hidden;
|
|
98
107
|
margin: 16px 0 0 -8px;
|
|
108
|
+
|
|
109
|
+
&--with-icons {
|
|
110
|
+
overflow: unset;
|
|
111
|
+
margin: 16px 0 0;
|
|
112
|
+
}
|
|
99
113
|
|
|
100
114
|
@media screen and (min-width: $breakpoint-md) {
|
|
101
115
|
margin: 16px 0 0 -16px;
|
|
116
|
+
&--with-icons {
|
|
117
|
+
margin: 16px 0 0;
|
|
118
|
+
}
|
|
102
119
|
}
|
|
103
120
|
|
|
104
121
|
.ter-navbar-featured-link {
|
|
@@ -148,6 +165,10 @@
|
|
|
148
165
|
height: 82px;
|
|
149
166
|
}
|
|
150
167
|
|
|
168
|
+
&--with-icons {
|
|
169
|
+
height: unset
|
|
170
|
+
}
|
|
171
|
+
|
|
151
172
|
&:hover {
|
|
152
173
|
cursor: pointer;
|
|
153
174
|
}
|
|
@@ -270,6 +291,10 @@
|
|
|
270
291
|
display: block;
|
|
271
292
|
margin: auto;
|
|
272
293
|
}
|
|
294
|
+
&--with-icons {
|
|
295
|
+
height: unset;
|
|
296
|
+
margin-bottom: 0;
|
|
297
|
+
}
|
|
273
298
|
}
|
|
274
299
|
}
|
|
275
300
|
|
|
@@ -312,6 +337,26 @@
|
|
|
312
337
|
white-space: nowrap;
|
|
313
338
|
}
|
|
314
339
|
}
|
|
340
|
+
&--blue {
|
|
341
|
+
p {
|
|
342
|
+
color: white
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
&--with-icon {
|
|
346
|
+
-webkit-transform: translateY(4px);
|
|
347
|
+
-ms-transform: translateY(4px);
|
|
348
|
+
transform: translateY(4px);
|
|
349
|
+
height: 30px;
|
|
350
|
+
p {
|
|
351
|
+
padding: 0;
|
|
352
|
+
margin-bottom: 0;
|
|
353
|
+
}
|
|
354
|
+
&--blue {
|
|
355
|
+
p {
|
|
356
|
+
color: white
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
315
360
|
|
|
316
361
|
&:hover {
|
|
317
362
|
text-decoration: none;
|
|
@@ -379,6 +424,21 @@
|
|
|
379
424
|
}
|
|
380
425
|
}
|
|
381
426
|
}
|
|
427
|
+
&__nav--with-icons {
|
|
428
|
+
display: flex;
|
|
429
|
+
flex-direction: column;
|
|
430
|
+
height: 56px;
|
|
431
|
+
padding: 0 5px;
|
|
432
|
+
&:not(:first-child) {
|
|
433
|
+
padding: 0 32.5px;
|
|
434
|
+
}
|
|
435
|
+
&:first-child {
|
|
436
|
+
padding-right: 32.5px;
|
|
437
|
+
}
|
|
438
|
+
&--icon {
|
|
439
|
+
margin: auto
|
|
440
|
+
}
|
|
441
|
+
}
|
|
382
442
|
}
|
|
383
443
|
|
|
384
444
|
.ter-utility-nav {
|
|
@@ -36,7 +36,8 @@ var NavMiniMenu = function NavMiniMenu(props) {
|
|
|
36
36
|
var navText = props.navText,
|
|
37
37
|
links = props.links,
|
|
38
38
|
Link = props.Link,
|
|
39
|
-
isOpen = props.isOpen
|
|
39
|
+
isOpen = props.isOpen,
|
|
40
|
+
displayIcons = props.displayIcons;
|
|
40
41
|
|
|
41
42
|
var _useIsChrome = (0, _useIsChrome2.default)(),
|
|
42
43
|
isChrome = _useIsChrome.isChrome;
|
|
@@ -92,7 +93,7 @@ var NavMiniMenu = function NavMiniMenu(props) {
|
|
|
92
93
|
|
|
93
94
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
94
95
|
id: _lodash.default.uniqueId("mini-menu-"),
|
|
95
|
-
className: "".concat(mouse ? "ter-nav-mini-menu" : "ter-nav-mini-menu tabFocus", " ").concat(isChrome ? "ter-nav-mini-menu--chrome-browser" : ""),
|
|
96
|
+
className: "".concat(mouse ? "ter-nav-mini-menu" : "ter-nav-mini-menu tabFocus", " ").concat(isChrome ? "ter-nav-mini-menu--chrome-browser" : "", " ").concat(displayIcons ? "ter-nav-mini-menu--with-icons" : ""),
|
|
96
97
|
onKeyDown: function onKeyDown(e) {
|
|
97
98
|
return mouseOverWithKeys(e, navText);
|
|
98
99
|
},
|
|
@@ -105,7 +106,7 @@ var NavMiniMenu = function NavMiniMenu(props) {
|
|
|
105
106
|
"aria-label": "".concat(navText, " menu")
|
|
106
107
|
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
107
108
|
id: (0, _formatID.default)("".concat(navText, "-ter-nav-mini-menu-text")),
|
|
108
|
-
className: "ter-nav-mini-menu__text ".concat(isOpen && " ter-nav-mini-menu__text--is-open")
|
|
109
|
+
className: "ter-nav-mini-menu__text ".concat(isOpen && " ter-nav-mini-menu__text--is-open", "\n ").concat(displayIcons ? "ter-nav-mini-menu__text--with-icons" : "")
|
|
109
110
|
}, navText, /*#__PURE__*/_react.default.createElement("img", {
|
|
110
111
|
id: _lodash.default.uniqueId("cross-icon-"),
|
|
111
112
|
src: _crossMediumBlue.default,
|
|
@@ -25,12 +25,10 @@ require("./SubNav.scss");
|
|
|
25
25
|
|
|
26
26
|
var _ellipses = _interopRequireDefault(require("../../../application/assets/images/ellipses.svg"));
|
|
27
27
|
|
|
28
|
-
var _caratDown = _interopRequireDefault(require("../../../application/assets/images/carat-down.svg"));
|
|
29
|
-
|
|
30
|
-
var _caratUp = _interopRequireDefault(require("../../../application/assets/images/carat-up.svg"));
|
|
31
|
-
|
|
32
28
|
var _close = _interopRequireDefault(require("../../../application/assets/images/close.svg"));
|
|
33
29
|
|
|
30
|
+
var _SubNavSiblingsMenu = _interopRequireDefault(require("./SubNavSiblingsMenu"));
|
|
31
|
+
|
|
34
32
|
var SubNav = function SubNav(_ref) {
|
|
35
33
|
var _window, _window$location, _breadcrumbs, _breadcrumbs2;
|
|
36
34
|
|
|
@@ -56,6 +54,23 @@ var SubNav = function SubNav(_ref) {
|
|
|
56
54
|
openSiblings = _useState4[0],
|
|
57
55
|
setOpenSiblings = _useState4[1];
|
|
58
56
|
|
|
57
|
+
var handleScroll = function handleScroll() {
|
|
58
|
+
setOpenSiblings(false);
|
|
59
|
+
setOpenBreadcrumbs(false);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
(0, _react.useEffect)(function () {
|
|
63
|
+
if (typeof window !== "undefined") {
|
|
64
|
+
window.addEventListener("scroll", handleScroll);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return function () {
|
|
68
|
+
if (typeof window !== "undefined") {
|
|
69
|
+
window.removeEventListener("scroll", handleScroll);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
|
|
59
74
|
var getWindowDimensions = function getWindowDimensions() {
|
|
60
75
|
var height = 0;
|
|
61
76
|
var width = 0;
|
|
@@ -141,8 +156,35 @@ var SubNav = function SubNav(_ref) {
|
|
|
141
156
|
}, breadcrumbs && (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) <= 3 && width > 600 ? breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.map(function (breadcrumb, i) {
|
|
142
157
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
143
158
|
key: "breadcrumb-".concat(i)
|
|
159
|
+
}, (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) === i + 1 ? /*#__PURE__*/_react.default.createElement(_SubNavSiblingsMenu.default, {
|
|
160
|
+
title: breadcrumb.title,
|
|
161
|
+
siblings: siblings,
|
|
162
|
+
isOpen: openSiblings,
|
|
163
|
+
width: width,
|
|
164
|
+
closeSiblingsWithEnter: closeSiblingsWithEnter,
|
|
165
|
+
path: path,
|
|
166
|
+
Link: Link,
|
|
167
|
+
onClose: function onClose() {
|
|
168
|
+
setOpenSiblings(false);
|
|
169
|
+
setOpenBreadcrumbs(false);
|
|
170
|
+
},
|
|
171
|
+
onClick: function onClick() {
|
|
172
|
+
setOpenSiblings(!openSiblings);
|
|
173
|
+
setOpenBreadcrumbs(false);
|
|
174
|
+
}
|
|
175
|
+
}) : breadcrumb.slug ? /*#__PURE__*/_react.default.createElement(_terraOne.LunaLink, {
|
|
176
|
+
to: breadcrumb.slug,
|
|
177
|
+
tabIndex: mouse ? "" : "0",
|
|
178
|
+
key: "".concat(breadcrumb.title, "-").concat(i),
|
|
179
|
+
className: mouse ? "ter-sub-nav__breadcrumbs__link" : "ter-sub-nav__breadcrumbs__link tabFocus",
|
|
180
|
+
target: "_self",
|
|
181
|
+
id: (0, _formatID.default)("".concat(breadcrumb.title, "-subnav-breadcumb")),
|
|
182
|
+
Link: Link
|
|
144
183
|
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
145
|
-
className: "ter-sub-
|
|
184
|
+
className: "ter-sub-nav__breadcrumbs--link__text ".concat(i + 1 === (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && "ter-sub-nav__breadcrumbs--link__text--last")
|
|
185
|
+
}, breadcrumb.title)) : /*#__PURE__*/_react.default.createElement("p", {
|
|
186
|
+
key: "".concat(breadcrumb.title, "-").concat(i),
|
|
187
|
+
className: "ter-sub-nav__breadcrumbs__text"
|
|
146
188
|
}, breadcrumb.title), i + 1 < (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/_react.default.createElement("span", {
|
|
147
189
|
key: "divider-".concat(i),
|
|
148
190
|
style: {
|
|
@@ -185,31 +227,42 @@ var SubNav = function SubNav(_ref) {
|
|
|
185
227
|
display: "flex"
|
|
186
228
|
},
|
|
187
229
|
tabIndex: mouse ? "" : "0",
|
|
188
|
-
onClick: function onClick() {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
,
|
|
230
|
+
onClick: function onClick() {
|
|
231
|
+
setOpenSiblings(!openSiblings);
|
|
232
|
+
setOpenBreadcrumbs(false);
|
|
233
|
+
},
|
|
234
|
+
onKeyDown: function onKeyDown(e) {
|
|
235
|
+
return openSiblingsWithEnter(e);
|
|
236
|
+
},
|
|
192
237
|
"aria-expanded": openBreadcrumbs,
|
|
193
238
|
"aria-controls": "sub-nav-siblings",
|
|
194
239
|
role: "button",
|
|
195
240
|
id: (0, _formatID.default)("".concat((_breadcrumbs = breadcrumbs[(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) - 1]) === null || _breadcrumbs === void 0 ? void 0 : _breadcrumbs.title, "-subnav-breadcumb"))
|
|
196
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
197
|
-
|
|
198
|
-
|
|
241
|
+
}, /*#__PURE__*/_react.default.createElement(_SubNavSiblingsMenu.default, {
|
|
242
|
+
title: (_breadcrumbs2 = breadcrumbs[(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) - 1]) === null || _breadcrumbs2 === void 0 ? void 0 : _breadcrumbs2.title,
|
|
243
|
+
siblings: siblings,
|
|
244
|
+
isOpen: openSiblings,
|
|
245
|
+
width: width,
|
|
246
|
+
closeSiblingsWithEnter: closeSiblingsWithEnter,
|
|
247
|
+
path: path,
|
|
248
|
+
Link: Link,
|
|
249
|
+
onClose: function onClose() {
|
|
250
|
+
setOpenSiblings(false);
|
|
251
|
+
setOpenBreadcrumbs(false);
|
|
199
252
|
},
|
|
200
|
-
|
|
201
|
-
|
|
253
|
+
onClick: function onClick() {
|
|
254
|
+
setOpenSiblings(!openSiblings);
|
|
255
|
+
setOpenBreadcrumbs(false);
|
|
256
|
+
}
|
|
257
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
202
258
|
id: "sub-nav-breadcrumbs",
|
|
259
|
+
className: "sub-nav-breadcrumbs",
|
|
203
260
|
style: {
|
|
204
261
|
position: width > 600 ? "absolute" : "fixed",
|
|
205
|
-
top:
|
|
262
|
+
top: "auto",
|
|
206
263
|
left: width < 600 && "0px",
|
|
207
|
-
backgroundColor: "#0e416c",
|
|
208
264
|
width: width > 600 ? "316px" : "100vw",
|
|
209
|
-
display: openBreadcrumbs ? "flex" : "none"
|
|
210
|
-
flexWrap: "wrap",
|
|
211
|
-
boxShadow: "0px -1px #0063A3",
|
|
212
|
-
padding: "20px"
|
|
265
|
+
display: openBreadcrumbs ? "flex" : "none"
|
|
213
266
|
}
|
|
214
267
|
}, width < 600 && /*#__PURE__*/_react.default.createElement("div", {
|
|
215
268
|
className: "ter-sub-nav__close-btn",
|
|
@@ -242,52 +295,31 @@ var SubNav = function SubNav(_ref) {
|
|
|
242
295
|
display: openBreadcrumbs ? "block" : "none"
|
|
243
296
|
}
|
|
244
297
|
})), breadcrumbs && (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.map(function (breadcrumb, i) {
|
|
245
|
-
return
|
|
298
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
246
299
|
key: "breadcrumb-".concat(i)
|
|
300
|
+
}, breadcrumb.slug && i + 1 < breadcrumbs.length ? /*#__PURE__*/_react.default.createElement(_terraOne.LunaLink, {
|
|
301
|
+
to: breadcrumb.slug,
|
|
302
|
+
tabIndex: mouse ? "" : "0",
|
|
303
|
+
key: breadcrumb.title,
|
|
304
|
+
className: mouse ? "ter-sub-nav__breadcrumbs__link" : "ter-sub-nav__breadcrumbs__link tabFocus",
|
|
305
|
+
target: "_self",
|
|
306
|
+
id: (0, _formatID.default)("".concat(breadcrumb.title, "-subnav-breadcumb")),
|
|
307
|
+
Link: Link,
|
|
308
|
+
style: openBreadcrumbs ? {
|
|
309
|
+
display: "block"
|
|
310
|
+
} : {
|
|
311
|
+
display: "none"
|
|
312
|
+
}
|
|
247
313
|
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
248
|
-
className: "ter-sub-
|
|
249
|
-
}, breadcrumb.title)
|
|
314
|
+
className: "ter-sub-nav__breadcrumbs--link__text ter-sub-nav__breadcrumbs--link__text--dropdown ".concat(i + 1 === (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && "ter-sub-nav__breadcrumbs--link__text--last")
|
|
315
|
+
}, breadcrumb.title)) : /*#__PURE__*/_react.default.createElement("p", {
|
|
316
|
+
className: "ter-sub-nav__breadcrumbs__text "
|
|
317
|
+
}, breadcrumb.title), i < (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) - 1 && /*#__PURE__*/_react.default.createElement("span", {
|
|
250
318
|
style: {
|
|
251
319
|
margin: "auto 0"
|
|
252
320
|
}
|
|
253
321
|
}, "\xA0\xA0/\xA0\xA0"));
|
|
254
|
-
}))))
|
|
255
|
-
className: "ter-sub-nav ter-sub-nav__siblings ter-sub-nav__siblings--expanded"
|
|
256
|
-
}, siblings === null || siblings === void 0 ? void 0 : siblings.map(function (sibling, i) {
|
|
257
|
-
var active = path.includes("".concat(sibling.slug, "/")); // Commenting out breadcrumbs temporarily to disable linking - 20th December 2021.
|
|
258
|
-
// return sibling.slug ? (
|
|
259
|
-
// <LunaLink
|
|
260
|
-
// to={sibling.slug}
|
|
261
|
-
// tabIndex={mouse ? "" : "0"}
|
|
262
|
-
// key={sibling.pageName}
|
|
263
|
-
// className={
|
|
264
|
-
// mouse
|
|
265
|
-
// ? "ter-sub-nav__siblings__link"
|
|
266
|
-
// : "ter-sub-nav__siblings__link tabFocus"
|
|
267
|
-
// }
|
|
268
|
-
// target={
|
|
269
|
-
// sibling.typeName === "ContentfulExternalLink"
|
|
270
|
-
// ? "_blank"
|
|
271
|
-
// : "_self"
|
|
272
|
-
// }
|
|
273
|
-
// id={formatID(`${sibling.pageName}-sub-nav-link`)}
|
|
274
|
-
// Link={Link}
|
|
275
|
-
// >
|
|
276
|
-
// <p
|
|
277
|
-
// className={`${
|
|
278
|
-
// active && "ter-sub-nav__siblings__text--active"
|
|
279
|
-
// } ter-sub-nav__siblings__text`}
|
|
280
|
-
// >
|
|
281
|
-
// {sibling.pageName}
|
|
282
|
-
// </p>
|
|
283
|
-
// </LunaLink>
|
|
284
|
-
// ) : (
|
|
285
|
-
|
|
286
|
-
return /*#__PURE__*/_react.default.createElement("p", {
|
|
287
|
-
key: sibling.pageName,
|
|
288
|
-
className: "ter-sub-nav__siblings__text"
|
|
289
|
-
}, sibling.pageName); // );
|
|
290
|
-
}))));
|
|
322
|
+
}))))));
|
|
291
323
|
};
|
|
292
324
|
|
|
293
325
|
var _default = SubNav;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
@import '../../../global-styles/terra.scss';
|
|
2
2
|
|
|
3
|
+
.sub-nav-breadcrumbs {
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
box-shadow: 0px -1px #0063A3;
|
|
6
|
+
padding: 20px;
|
|
7
|
+
background-color: #0e416c;
|
|
8
|
+
margin-top: 49px;
|
|
9
|
+
@media screen and (max-width: $breakpoint-xs) {
|
|
10
|
+
padding-right: 50px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
.ter-sub-nav {
|
|
4
15
|
color: $white;
|
|
5
16
|
font-size: $eyebrow-font-size;
|
|
@@ -34,13 +45,19 @@
|
|
|
34
45
|
display: block;
|
|
35
46
|
}
|
|
36
47
|
}
|
|
48
|
+
|
|
49
|
+
&__breadcrumbs {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: row;
|
|
52
|
+
margin: 0 16px;
|
|
53
|
+
span {
|
|
54
|
+
opacity: 80%;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
37
57
|
|
|
38
58
|
&__breadcrumbs,
|
|
39
59
|
&__siblings {
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: row;
|
|
42
60
|
font-size: $body-font-size;
|
|
43
|
-
margin: 0 16px;
|
|
44
61
|
&--link {
|
|
45
62
|
font-size: $body-font-size;
|
|
46
63
|
margin: auto 0;
|
|
@@ -48,9 +65,8 @@
|
|
|
48
65
|
&__text {
|
|
49
66
|
font-size: $body-font-size;
|
|
50
67
|
margin: auto 0;
|
|
51
|
-
opacity:
|
|
68
|
+
opacity: 100%;
|
|
52
69
|
&--last {
|
|
53
|
-
line-height: 3em;
|
|
54
70
|
opacity: 100%;
|
|
55
71
|
@include benton-medium();
|
|
56
72
|
}
|
|
@@ -67,16 +83,13 @@
|
|
|
67
83
|
&__text {
|
|
68
84
|
margin: auto 0;
|
|
69
85
|
font-size: $body-font-size;
|
|
70
|
-
opacity:
|
|
86
|
+
opacity: 50%;
|
|
71
87
|
&--last {
|
|
72
88
|
line-height: 3em;
|
|
73
89
|
opacity: 100%;
|
|
74
90
|
@include benton-medium();
|
|
75
91
|
}
|
|
76
92
|
}
|
|
77
|
-
span {
|
|
78
|
-
opacity: 80%;
|
|
79
|
-
}
|
|
80
93
|
|
|
81
94
|
a {
|
|
82
95
|
font-size: $body-font-size;
|
|
@@ -97,15 +110,12 @@
|
|
|
97
110
|
margin: auto 0px;
|
|
98
111
|
}
|
|
99
112
|
}
|
|
100
|
-
|
|
101
|
-
@media screen and (max-width: $breakpoint-sm) {
|
|
102
|
-
margin: 0 16px;
|
|
103
|
-
}
|
|
104
113
|
}
|
|
105
114
|
|
|
106
115
|
&__breadcrumbs {
|
|
107
116
|
margin: 0;
|
|
108
117
|
&--ellipses-icon {
|
|
118
|
+
max-width: 100%;
|
|
109
119
|
&:hover {
|
|
110
120
|
cursor: pointer;
|
|
111
121
|
}
|
|
@@ -141,18 +151,43 @@
|
|
|
141
151
|
@media screen and (max-width: $breakpoint-sm) {
|
|
142
152
|
margin: 0 16px;
|
|
143
153
|
}
|
|
144
|
-
&--current-page p:hover {
|
|
145
|
-
box-shadow: none;
|
|
146
|
-
}
|
|
147
154
|
}
|
|
148
155
|
&__siblings {
|
|
149
|
-
|
|
150
|
-
|
|
156
|
+
padding: 24px 20px;
|
|
157
|
+
position: relative;
|
|
158
|
+
@media screen and (min-width: $breakpoint-xs) {
|
|
159
|
+
left: calc(100% - 30px);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
span {
|
|
163
|
+
opacity: 100%;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&__list {
|
|
167
|
+
list-style: none;
|
|
168
|
+
padding: 0;
|
|
169
|
+
margin: 0;
|
|
170
|
+
&__list-item {
|
|
171
|
+
padding: 0;
|
|
172
|
+
margin: 0;
|
|
173
|
+
}
|
|
174
|
+
&__list-item + &__list-item {
|
|
175
|
+
margin-top: 20px;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
151
179
|
&__link {
|
|
152
|
-
|
|
180
|
+
display: block;
|
|
181
|
+
&:hover .ter-sub-nav__siblings__text--dropdown {
|
|
182
|
+
color: $white;
|
|
183
|
+
box-shadow: 0px 2px $trimble-gold;
|
|
184
|
+
line-height: 1em;
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
}
|
|
153
187
|
}
|
|
154
188
|
|
|
155
189
|
&__text {
|
|
190
|
+
line-height: 1em;
|
|
156
191
|
&--active {
|
|
157
192
|
opacity: 100%;
|
|
158
193
|
@include benton-medium();
|
|
@@ -163,25 +198,10 @@
|
|
|
163
198
|
}
|
|
164
199
|
}
|
|
165
200
|
|
|
166
|
-
&:hover {
|
|
167
|
-
color: $white;
|
|
168
|
-
opacity: 100%;
|
|
169
|
-
box-shadow: 0px 3px $trimble-gold;
|
|
170
|
-
line-height: 3em;
|
|
171
|
-
cursor: pointer;
|
|
172
|
-
}
|
|
173
201
|
&--dropdown {
|
|
174
202
|
font-size: $body-font-size;
|
|
175
203
|
line-height: 1em;
|
|
176
204
|
margin-bottom: 0;
|
|
177
|
-
&:hover {
|
|
178
|
-
color: $white;
|
|
179
|
-
opacity: 100%;
|
|
180
|
-
box-shadow: 0px 2px $trimble-gold;
|
|
181
|
-
line-height: 1em;
|
|
182
|
-
cursor: pointer;
|
|
183
|
-
width: max-content;
|
|
184
|
-
}
|
|
185
205
|
}
|
|
186
206
|
}
|
|
187
207
|
|
|
@@ -198,9 +218,6 @@
|
|
|
198
218
|
}
|
|
199
219
|
}
|
|
200
220
|
}
|
|
201
|
-
a.ter-sub-nav__siblings__link {
|
|
202
|
-
margin-bottom: 16px;
|
|
203
|
-
}
|
|
204
221
|
|
|
205
222
|
.ter-sub-nav__siblings--expanded a.ter-sub-nav__siblings__link {
|
|
206
223
|
margin: auto 0;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _useMouse2 = _interopRequireDefault(require("../../utils/hooks/useMouse"));
|
|
17
|
+
|
|
18
|
+
var _terraOne = require("terra-one");
|
|
19
|
+
|
|
20
|
+
var _formatID = _interopRequireDefault(require("../../utils/formatID"));
|
|
21
|
+
|
|
22
|
+
require("./SubNav.scss");
|
|
23
|
+
|
|
24
|
+
var _caratDown = _interopRequireDefault(require("../../../application/assets/images/carat-down.svg"));
|
|
25
|
+
|
|
26
|
+
var _caratUp = _interopRequireDefault(require("../../../application/assets/images/carat-up.svg"));
|
|
27
|
+
|
|
28
|
+
var _close = _interopRequireDefault(require("../../../application/assets/images/close.svg"));
|
|
29
|
+
|
|
30
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
31
|
+
|
|
32
|
+
var SubNavSiblingsMenu = function SubNavSiblingsMenu(_ref) {
|
|
33
|
+
var _window;
|
|
34
|
+
|
|
35
|
+
var title = _ref.title,
|
|
36
|
+
_ref$siblings = _ref.siblings,
|
|
37
|
+
siblings = _ref$siblings === void 0 ? [] : _ref$siblings,
|
|
38
|
+
isOpen = _ref.isOpen,
|
|
39
|
+
width = _ref.width,
|
|
40
|
+
closeSiblingsWithEnter = _ref.closeSiblingsWithEnter,
|
|
41
|
+
path = _ref.path,
|
|
42
|
+
_onClick = _ref.onClick,
|
|
43
|
+
onClose = _ref.onClose,
|
|
44
|
+
Link = _ref.Link;
|
|
45
|
+
|
|
46
|
+
var _useMouse = (0, _useMouse2.default)(),
|
|
47
|
+
mouse = _useMouse.mouse;
|
|
48
|
+
|
|
49
|
+
if ((siblings === null || siblings === void 0 ? void 0 : siblings.length) <= 1) {
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement("p", {
|
|
51
|
+
className: "ter-sub-nav__breadcrumbs__text ter-sub-nav__breadcrumbs__text--last"
|
|
52
|
+
}, title);
|
|
53
|
+
} // REORDER SIBLINGS MENU
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
var siblingsOverview = siblings === null || siblings === void 0 ? void 0 : siblings.filter(function (d) {
|
|
57
|
+
var _d$pageName, _d$pageName$toLowerCa;
|
|
58
|
+
|
|
59
|
+
return (d === null || d === void 0 ? void 0 : (_d$pageName = d.pageName) === null || _d$pageName === void 0 ? void 0 : (_d$pageName$toLowerCa = _d$pageName.toLowerCase()) === null || _d$pageName$toLowerCa === void 0 ? void 0 : _d$pageName$toLowerCa.indexOf('overview')) === 0;
|
|
60
|
+
});
|
|
61
|
+
var siblingsContact = siblings === null || siblings === void 0 ? void 0 : siblings.filter(function (d) {
|
|
62
|
+
var _d$pageName2, _d$pageName2$toLowerC;
|
|
63
|
+
|
|
64
|
+
return (d === null || d === void 0 ? void 0 : (_d$pageName2 = d.pageName) === null || _d$pageName2 === void 0 ? void 0 : (_d$pageName2$toLowerC = _d$pageName2.toLowerCase()) === null || _d$pageName2$toLowerC === void 0 ? void 0 : _d$pageName2$toLowerC.indexOf('contact')) === 0;
|
|
65
|
+
});
|
|
66
|
+
var siblingsSubset = siblings === null || siblings === void 0 ? void 0 : siblings.filter(function (d) {
|
|
67
|
+
var _d$pageName3, _d$pageName3$toLowerC, _d$pageName4, _d$pageName4$toLowerC;
|
|
68
|
+
|
|
69
|
+
return (d === null || d === void 0 ? void 0 : (_d$pageName3 = d.pageName) === null || _d$pageName3 === void 0 ? void 0 : (_d$pageName3$toLowerC = _d$pageName3.toLowerCase()) === null || _d$pageName3$toLowerC === void 0 ? void 0 : _d$pageName3$toLowerC.indexOf('overview')) !== 0 && (d === null || d === void 0 ? void 0 : (_d$pageName4 = d.pageName) === null || _d$pageName4 === void 0 ? void 0 : (_d$pageName4$toLowerC = _d$pageName4.toLowerCase()) === null || _d$pageName4$toLowerC === void 0 ? void 0 : _d$pageName4$toLowerC.indexOf('contact')) !== 0;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
var siblingsSubsetOrdered = _lodash.default.orderBy(siblingsSubset, ['pageName']);
|
|
73
|
+
|
|
74
|
+
var siblingsOrdered = [].concat((0, _toConsumableArray2.default)(siblingsOverview), (0, _toConsumableArray2.default)(siblingsSubsetOrdered), (0, _toConsumableArray2.default)(siblingsContact));
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
+
style: {
|
|
77
|
+
position: "relative",
|
|
78
|
+
display: "flex",
|
|
79
|
+
flexDirection: "row",
|
|
80
|
+
margin: "auto 0",
|
|
81
|
+
alignItems: "center"
|
|
82
|
+
}
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
84
|
+
className: "ter-sub-nav__breadcrumbs__text ter-sub-nav__breadcrumbs__text--last",
|
|
85
|
+
onClick: function onClick(e) {
|
|
86
|
+
return _onClick(e);
|
|
87
|
+
},
|
|
88
|
+
style: {
|
|
89
|
+
display: "flex",
|
|
90
|
+
alignItems: "center",
|
|
91
|
+
cursor: "pointer"
|
|
92
|
+
}
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, title), /*#__PURE__*/_react.default.createElement("img", {
|
|
94
|
+
src: isOpen ? _caratUp.default : _caratDown.default,
|
|
95
|
+
alt: "carat",
|
|
96
|
+
className: "ter-sub-nav__siblings--carat-icon",
|
|
97
|
+
style: {
|
|
98
|
+
height: "24px",
|
|
99
|
+
padding: "8px",
|
|
100
|
+
cursor: "pointer"
|
|
101
|
+
}
|
|
102
|
+
})), /*#__PURE__*/_react.default.createElement("section", {
|
|
103
|
+
id: "sub-nav-siblings",
|
|
104
|
+
className: "ter-sub-nav__siblings",
|
|
105
|
+
style: {
|
|
106
|
+
backgroundColor: "#0e416c",
|
|
107
|
+
display: isOpen ? "block" : "none",
|
|
108
|
+
flexDirection: "column",
|
|
109
|
+
flexWrap: "wrap",
|
|
110
|
+
boxShadow: "0px -1px #0063A3",
|
|
111
|
+
position: width > 600 ? "absolute" : "fixed",
|
|
112
|
+
top: width > 600 ? "46px" : ((_window = window) === null || _window === void 0 ? void 0 : _window.scrollY) > 0 ? "48px" : "108px",
|
|
113
|
+
left: width < 600 && "0px",
|
|
114
|
+
width: width > 600 ? "280px" : "100vw"
|
|
115
|
+
}
|
|
116
|
+
}, width < 600 && /*#__PURE__*/_react.default.createElement("div", {
|
|
117
|
+
className: "ter-sub-nav__close-btn",
|
|
118
|
+
onClick: function onClick(e) {
|
|
119
|
+
return onClose(e);
|
|
120
|
+
},
|
|
121
|
+
onKeyDown: function onKeyDown(e) {
|
|
122
|
+
return closeSiblingsWithEnter(e);
|
|
123
|
+
},
|
|
124
|
+
style: {
|
|
125
|
+
backgroundColor: "#0063A3",
|
|
126
|
+
height: "44px",
|
|
127
|
+
width: "44px",
|
|
128
|
+
position: "absolute",
|
|
129
|
+
right: "0",
|
|
130
|
+
top: "0",
|
|
131
|
+
display: isOpen ? "block" : "none"
|
|
132
|
+
}
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
134
|
+
tabIndex: "0",
|
|
135
|
+
src: _close.default,
|
|
136
|
+
alt: "close",
|
|
137
|
+
className: "ter-sub-nav__close-btn--icon",
|
|
138
|
+
style: {
|
|
139
|
+
height: "100%",
|
|
140
|
+
width: "100%",
|
|
141
|
+
padding: "15px",
|
|
142
|
+
cursor: "pointer",
|
|
143
|
+
margin: "auto",
|
|
144
|
+
display: isOpen ? "block" : "none"
|
|
145
|
+
}
|
|
146
|
+
})), /*#__PURE__*/_react.default.createElement("ul", {
|
|
147
|
+
className: "ter-sub-nav__siblings__list"
|
|
148
|
+
}, siblingsOrdered && (siblingsOrdered === null || siblingsOrdered === void 0 ? void 0 : siblingsOrdered.map(function (sibling, i) {
|
|
149
|
+
var active = sibling.slug.includes(path);
|
|
150
|
+
console.log('>', path, sibling.slug, active);
|
|
151
|
+
return sibling.slug && !active ? /*#__PURE__*/_react.default.createElement("li", {
|
|
152
|
+
className: "ter-sub-nav__siblings__list__list-item"
|
|
153
|
+
}, /*#__PURE__*/_react.default.createElement(_terraOne.LunaLink, {
|
|
154
|
+
to: sibling.slug,
|
|
155
|
+
tabIndex: mouse ? "" : "0",
|
|
156
|
+
key: sibling.pageName,
|
|
157
|
+
className: mouse ? "ter-sub-nav__siblings__link" : "ter-sub-nav__siblings__link tabFocus",
|
|
158
|
+
target: sibling.typeName === "ContentfulExternalLink" ? "_blank" : "_self",
|
|
159
|
+
id: (0, _formatID.default)("".concat(sibling.pageName, "-sub-nav-link")),
|
|
160
|
+
Link: Link
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
162
|
+
className: "".concat(active && "ter-sub-nav__siblings__text--active--dropdown", " ter-sub-nav__siblings__text--dropdown")
|
|
163
|
+
}, sibling.pageName))) : /*#__PURE__*/_react.default.createElement("li", {
|
|
164
|
+
className: "ter-sub-nav__siblings__list__list-item"
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
166
|
+
className: "ter-sub-nav__siblings__text"
|
|
167
|
+
}, sibling.pageName));
|
|
168
|
+
})))));
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
var _default = SubNavSiblingsMenu;
|
|
172
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "luna-one",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.358",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@storybook/addon-knobs": "^6.3.1",
|
|
6
6
|
"@testing-library/jest-dom": "^5.11.9",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"react-scroll": "^1.7.14",
|
|
24
24
|
"react-slidedown": "^2.4.5",
|
|
25
25
|
"smoothscroll-polyfill": "^0.4.4",
|
|
26
|
-
"terra-one": "^3.0.
|
|
26
|
+
"terra-one": "^3.0.120"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"node-sass": "^4.12.0",
|