@nulogy/components 7.5.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +52 -51
- package/dist/main.module.js +52 -51
- package/dist/src/BrandedNavBar/MobileMenu.d.ts +3 -3
- package/dist/src/BrandedNavBar/NavBarDropdownMenu.d.ts +18 -7
- package/dist/src/BrandedNavBar/SmallNavBar.d.ts +27 -15
- package/dist/src/BrandedNavBar/SmallNavBar.story.d.ts +21 -0
- package/dist/src/BrandedNavBar/index.d.ts +1 -1
- package/dist/src/NavBar/NavBarDropdownMenu.d.ts +2 -7
- package/dist/src/NavBar/SmallNavBar.d.ts +2 -7
- package/dist/src/index.d.ts +1 -1
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/withMenuState.d.ts +5 -7
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -12512,26 +12512,19 @@
|
|
|
12512
12512
|
return MenuState;
|
|
12513
12513
|
}(MenuStateInt);
|
|
12514
12514
|
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
var showDelay = _a.showDelay,
|
|
12518
|
-
hideDelay = _a.hideDelay,
|
|
12519
|
-
defaultOpen = _a.defaultOpen,
|
|
12520
|
-
props = __rest(_a, ["showDelay", "hideDelay", "defaultOpen"]);
|
|
12521
|
-
|
|
12515
|
+
function withMenuState(MenuComponent) {
|
|
12516
|
+
return function (props) {
|
|
12522
12517
|
return /*#__PURE__*/React__default['default'].createElement(MenuState, {
|
|
12523
|
-
showDelay: showDelay,
|
|
12524
|
-
hideDelay: hideDelay,
|
|
12525
|
-
defaultOpen: defaultOpen
|
|
12518
|
+
showDelay: props.showDelay,
|
|
12519
|
+
hideDelay: props.hideDelay,
|
|
12520
|
+
defaultOpen: props.defaultOpen
|
|
12526
12521
|
}, function (menuComponentProps) {
|
|
12527
12522
|
return /*#__PURE__*/React__default['default'].createElement(MenuComponent, Object.assign({
|
|
12528
12523
|
menuState: menuComponentProps
|
|
12529
12524
|
}, props));
|
|
12530
12525
|
});
|
|
12531
12526
|
};
|
|
12532
|
-
|
|
12533
|
-
return MenuComponentWithState;
|
|
12534
|
-
};
|
|
12527
|
+
}
|
|
12535
12528
|
|
|
12536
12529
|
function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
12537
12530
|
|
|
@@ -43571,14 +43564,14 @@
|
|
|
43571
43564
|
closeMenu = _a.closeMenu,
|
|
43572
43565
|
subtext = _a.subtext,
|
|
43573
43566
|
themeColorObject = _a.themeColorObject,
|
|
43574
|
-
|
|
43575
|
-
props = __rest(_a, ["menuData", "closeMenu", "subtext", "themeColorObject", "
|
|
43567
|
+
showNulogyLogo = _a.showNulogyLogo,
|
|
43568
|
+
props = __rest(_a, ["menuData", "closeMenu", "subtext", "themeColorObject", "showNulogyLogo"]);
|
|
43576
43569
|
|
|
43577
43570
|
return /*#__PURE__*/React__default['default'].createElement(Nav, Object.assign({
|
|
43578
43571
|
backgroundColor: themeColorObject && themeColorObject.background
|
|
43579
43572
|
}, props), /*#__PURE__*/React__default['default'].createElement(BrandingWrap, null, /*#__PURE__*/React__default['default'].createElement(BrandingText, {
|
|
43580
43573
|
logoColor: themeColorObject && themeColorObject.logoColor
|
|
43581
|
-
})), /*#__PURE__*/React__default['default'].createElement(Menu$1, null, menuData.primaryMenu && renderTopLayerMenuItems(menuData.primaryMenu, closeMenu, themeColorObject), menuData.secondaryMenu && renderTopLayerMenuItems(menuData.secondaryMenu, closeMenu, themeColorObject)),
|
|
43574
|
+
})), /*#__PURE__*/React__default['default'].createElement(Menu$1, null, menuData.primaryMenu && renderTopLayerMenuItems(menuData.primaryMenu, closeMenu, themeColorObject), menuData.secondaryMenu && renderTopLayerMenuItems(menuData.secondaryMenu, closeMenu, themeColorObject)), showNulogyLogo && /*#__PURE__*/React__default['default'].createElement(Flex, {
|
|
43582
43575
|
textAlign: "center",
|
|
43583
43576
|
borderTop: borderStyle,
|
|
43584
43577
|
height: "40px",
|
|
@@ -43684,16 +43677,15 @@
|
|
|
43684
43677
|
toggleMenu = _a$menuState.toggleMenu,
|
|
43685
43678
|
closeMenu = _a$menuState.closeMenu,
|
|
43686
43679
|
subtext = _a.subtext,
|
|
43687
|
-
_a$brandingLinkHref = _a.brandingLinkHref,
|
|
43688
|
-
brandingLinkHref = _a$brandingLinkHref === void 0 ? "/" : _a$brandingLinkHref,
|
|
43689
|
-
brandingLinkTo = _a.brandingLinkTo,
|
|
43690
43680
|
environment = _a.environment,
|
|
43691
|
-
|
|
43681
|
+
showNulogyLogo = _a.showNulogyLogo,
|
|
43692
43682
|
_a$breakpointLower = _a.breakpointLower,
|
|
43693
43683
|
breakpointLower = _a$breakpointLower === void 0 ? "small" : _a$breakpointLower,
|
|
43694
43684
|
themeColorObject = _a.themeColorObject,
|
|
43695
43685
|
navBarHeight = _a.navBarHeight,
|
|
43696
|
-
|
|
43686
|
+
logo = _a.logo,
|
|
43687
|
+
renderMenuButton = _a.renderMenuButton,
|
|
43688
|
+
props = __rest(_a, ["menuData", "menuState", "subtext", "environment", "showNulogyLogo", "breakpointLower", "themeColorObject", "navBarHeight", "logo", "renderMenuButton"]);
|
|
43697
43689
|
|
|
43698
43690
|
var navRef = React__default['default'].useRef(null);
|
|
43699
43691
|
React.useEffect(function () {
|
|
@@ -43705,6 +43697,7 @@
|
|
|
43705
43697
|
var _useTheme = styled.useTheme(),
|
|
43706
43698
|
breakpoints = _useTheme.breakpoints;
|
|
43707
43699
|
|
|
43700
|
+
var ariaExpanded = isOpen ? true : null;
|
|
43708
43701
|
return /*#__PURE__*/React__default['default'].createElement(SmallHeader, Object.assign({
|
|
43709
43702
|
ref: navRef,
|
|
43710
43703
|
isOpen: isOpen,
|
|
@@ -43712,12 +43705,7 @@
|
|
|
43712
43705
|
}, props), environment && /*#__PURE__*/React__default['default'].createElement(EnvironmentBanner, null, environment), /*#__PURE__*/React__default['default'].createElement(NavBarBackground, {
|
|
43713
43706
|
backgroundColor: "white",
|
|
43714
43707
|
height: navBarHeight
|
|
43715
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
43716
|
-
logoSrc: logoSrc,
|
|
43717
|
-
brandingLinkHref: brandingLinkHref,
|
|
43718
|
-
brandingLinkTo: brandingLinkTo,
|
|
43719
|
-
subtext: subtext
|
|
43720
|
-
}), /*#__PURE__*/React__default['default'].createElement(Flex, {
|
|
43708
|
+
}, logo, /*#__PURE__*/React__default['default'].createElement(Flex, {
|
|
43721
43709
|
justifyContent: "flex-end",
|
|
43722
43710
|
ml: "x3",
|
|
43723
43711
|
flexGrow: 1
|
|
@@ -43725,17 +43713,22 @@
|
|
|
43725
43713
|
maxWidth: "18em",
|
|
43726
43714
|
alignItems: "center",
|
|
43727
43715
|
px: "0"
|
|
43728
|
-
}, /*#__PURE__*/React__default['default'].createElement(NavBarSearch, Object.assign({}, menuData.search))), (menuData.primaryMenu || menuData.secondaryMenu) &&
|
|
43716
|
+
}, /*#__PURE__*/React__default['default'].createElement(NavBarSearch, Object.assign({}, menuData.search))), (menuData.primaryMenu || menuData.secondaryMenu) && (renderMenuButton ? renderMenuButton({
|
|
43717
|
+
themeColorObject: themeColorObject,
|
|
43718
|
+
onClick: toggleMenu,
|
|
43719
|
+
ariaExpanded: ariaExpanded,
|
|
43720
|
+
isOpen: isOpen
|
|
43721
|
+
}) : /*#__PURE__*/React__default['default'].createElement(MobileMenuTrigger, Object.assign({}, themeColorObject, {
|
|
43729
43722
|
onClick: toggleMenu,
|
|
43730
|
-
"aria-expanded":
|
|
43723
|
+
"aria-expanded": ariaExpanded
|
|
43731
43724
|
}), /*#__PURE__*/React__default['default'].createElement(MenuIcon, {
|
|
43732
43725
|
isOpen: isOpen
|
|
43733
|
-
})))), isOpen && /*#__PURE__*/React__default['default'].createElement(PreventBodyElementScrolling, null, /*#__PURE__*/React__default['default'].createElement(MobileMenu, {
|
|
43726
|
+
}))))), isOpen && /*#__PURE__*/React__default['default'].createElement(PreventBodyElementScrolling, null, /*#__PURE__*/React__default['default'].createElement(MobileMenu, {
|
|
43734
43727
|
themeColorObject: themeColorObject,
|
|
43735
43728
|
subtext: subtext,
|
|
43736
43729
|
menuData: menuData,
|
|
43737
43730
|
closeMenu: closeMenu,
|
|
43738
|
-
|
|
43731
|
+
showNulogyLogo: showNulogyLogo
|
|
43739
43732
|
})));
|
|
43740
43733
|
};
|
|
43741
43734
|
/* eslint-enable react/destructuring-assignment */
|
|
@@ -43755,14 +43748,11 @@
|
|
|
43755
43748
|
|
|
43756
43749
|
var MediumNavBar = function MediumNavBar(_a) {
|
|
43757
43750
|
var menuData = _a.menuData,
|
|
43758
|
-
subtext = _a.subtext,
|
|
43759
43751
|
environment = _a.environment,
|
|
43760
|
-
|
|
43761
|
-
|
|
43762
|
-
|
|
43763
|
-
|
|
43764
|
-
brandingLinkComponent = _a.brandingLinkComponent,
|
|
43765
|
-
props = __rest(_a, ["menuData", "subtext", "environment", "logoSrc", "brandingLinkHref", "brandingLinkTo", "brandingLinkComponent"]);
|
|
43752
|
+
logo = _a.logo,
|
|
43753
|
+
showNulogyLogo = _a.showNulogyLogo,
|
|
43754
|
+
subtext = _a.subtext,
|
|
43755
|
+
props = __rest(_a, ["menuData", "environment", "logo", "showNulogyLogo", "subtext"]);
|
|
43766
43756
|
|
|
43767
43757
|
var _useTranslation = useTranslation(),
|
|
43768
43758
|
t = _useTranslation.t;
|
|
@@ -43770,13 +43760,7 @@
|
|
|
43770
43760
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, environment && /*#__PURE__*/React__default['default'].createElement(EnvironmentBanner, null, environment), /*#__PURE__*/React__default['default'].createElement("header", Object.assign({}, props), /*#__PURE__*/React__default['default'].createElement(NavBarBackground, {
|
|
43771
43761
|
backgroundColor: "white",
|
|
43772
43762
|
height: NAVBAR_HEIGHT
|
|
43773
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
43774
|
-
logoSrc: logoSrc,
|
|
43775
|
-
brandingLinkHref: brandingLinkHref,
|
|
43776
|
-
brandingLinkTo: brandingLinkTo,
|
|
43777
|
-
brandingLinkComponent: brandingLinkComponent,
|
|
43778
|
-
subtext: subtext
|
|
43779
|
-
}), /*#__PURE__*/React__default['default'].createElement(Flex, {
|
|
43763
|
+
}, logo, /*#__PURE__*/React__default['default'].createElement(Flex, {
|
|
43780
43764
|
justifyContent: "space-between",
|
|
43781
43765
|
alignContent: "flex-end",
|
|
43782
43766
|
flexGrow: 1,
|
|
@@ -43793,7 +43777,7 @@
|
|
|
43793
43777
|
themeColorObject: themeColorObject,
|
|
43794
43778
|
"aria-label": t("secondary navigation"),
|
|
43795
43779
|
menuData: menuData.secondaryMenu
|
|
43796
|
-
}),
|
|
43780
|
+
}), showNulogyLogo && /*#__PURE__*/React__default['default'].createElement(Box, {
|
|
43797
43781
|
pl: "x3"
|
|
43798
43782
|
}, /*#__PURE__*/React__default['default'].createElement(NulogyLogoContainer, {
|
|
43799
43783
|
height: NAVBAR_HEIGHT,
|
|
@@ -43809,19 +43793,36 @@
|
|
|
43809
43793
|
var width = _a.width,
|
|
43810
43794
|
defaultOpen = _a.defaultOpen,
|
|
43811
43795
|
breakpointUpper = _a.breakpointUpper,
|
|
43812
|
-
|
|
43796
|
+
_a$brandingLinkHref = _a.brandingLinkHref,
|
|
43797
|
+
brandingLinkHref = _a$brandingLinkHref === void 0 ? "/" : _a$brandingLinkHref,
|
|
43798
|
+
brandingLinkTo = _a.brandingLinkTo,
|
|
43799
|
+
brandingLinkComponent = _a.brandingLinkComponent,
|
|
43800
|
+
logoSrc = _a.logoSrc,
|
|
43801
|
+
props = __rest(_a, ["width", "defaultOpen", "breakpointUpper", "brandingLinkHref", "brandingLinkTo", "brandingLinkComponent", "logoSrc"]);
|
|
43813
43802
|
|
|
43814
43803
|
var currentWidth = width || typeof window !== "undefined" && window.innerWidth;
|
|
43804
|
+
var logo = /*#__PURE__*/React__default['default'].createElement(BrandLogoContainer, {
|
|
43805
|
+
logoSrc: logoSrc,
|
|
43806
|
+
brandingLinkHref: brandingLinkHref,
|
|
43807
|
+
brandingLinkTo: brandingLinkTo,
|
|
43808
|
+
brandingLinkComponent: brandingLinkComponent,
|
|
43809
|
+
subtext: props.subtext
|
|
43810
|
+
});
|
|
43815
43811
|
|
|
43816
43812
|
if (currentWidth >= pixelDigitsFrom(breakpointUpper)) {
|
|
43817
|
-
return /*#__PURE__*/React__default['default'].createElement(MediumNavBar, Object.assign({
|
|
43813
|
+
return /*#__PURE__*/React__default['default'].createElement(MediumNavBar, Object.assign({
|
|
43814
|
+
logo: logo,
|
|
43815
|
+
showNulogyLogo: logoSrc
|
|
43816
|
+
}, props));
|
|
43818
43817
|
} else {
|
|
43819
|
-
return /*#__PURE__*/React__default['default'].createElement(SmallNavBar, Object.assign({
|
|
43818
|
+
return /*#__PURE__*/React__default['default'].createElement(SmallNavBar, Object.assign({
|
|
43820
43819
|
width: currentWidth,
|
|
43821
43820
|
defaultOpen: defaultOpen,
|
|
43822
43821
|
themeColorObject: themeColorObject,
|
|
43823
|
-
navBarHeight: NAVBAR_HEIGHT
|
|
43824
|
-
|
|
43822
|
+
navBarHeight: NAVBAR_HEIGHT,
|
|
43823
|
+
logo: logo,
|
|
43824
|
+
showNulogyLogo: logoSrc
|
|
43825
|
+
}, props));
|
|
43825
43826
|
}
|
|
43826
43827
|
};
|
|
43827
43828
|
|
package/dist/main.module.js
CHANGED
|
@@ -12486,26 +12486,19 @@ var MenuState = /*#__PURE__*/function (_MenuStateInt) {
|
|
|
12486
12486
|
return MenuState;
|
|
12487
12487
|
}(MenuStateInt);
|
|
12488
12488
|
|
|
12489
|
-
|
|
12490
|
-
|
|
12491
|
-
var showDelay = _a.showDelay,
|
|
12492
|
-
hideDelay = _a.hideDelay,
|
|
12493
|
-
defaultOpen = _a.defaultOpen,
|
|
12494
|
-
props = __rest(_a, ["showDelay", "hideDelay", "defaultOpen"]);
|
|
12495
|
-
|
|
12489
|
+
function withMenuState(MenuComponent) {
|
|
12490
|
+
return function (props) {
|
|
12496
12491
|
return /*#__PURE__*/React__default.createElement(MenuState, {
|
|
12497
|
-
showDelay: showDelay,
|
|
12498
|
-
hideDelay: hideDelay,
|
|
12499
|
-
defaultOpen: defaultOpen
|
|
12492
|
+
showDelay: props.showDelay,
|
|
12493
|
+
hideDelay: props.hideDelay,
|
|
12494
|
+
defaultOpen: props.defaultOpen
|
|
12500
12495
|
}, function (menuComponentProps) {
|
|
12501
12496
|
return /*#__PURE__*/React__default.createElement(MenuComponent, Object.assign({
|
|
12502
12497
|
menuState: menuComponentProps
|
|
12503
12498
|
}, props));
|
|
12504
12499
|
});
|
|
12505
12500
|
};
|
|
12506
|
-
|
|
12507
|
-
return MenuComponentWithState;
|
|
12508
|
-
};
|
|
12501
|
+
}
|
|
12509
12502
|
|
|
12510
12503
|
function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
12511
12504
|
|
|
@@ -43545,14 +43538,14 @@ var BaseMobileMenu = function BaseMobileMenu(_a) {
|
|
|
43545
43538
|
closeMenu = _a.closeMenu,
|
|
43546
43539
|
subtext = _a.subtext,
|
|
43547
43540
|
themeColorObject = _a.themeColorObject,
|
|
43548
|
-
|
|
43549
|
-
props = __rest(_a, ["menuData", "closeMenu", "subtext", "themeColorObject", "
|
|
43541
|
+
showNulogyLogo = _a.showNulogyLogo,
|
|
43542
|
+
props = __rest(_a, ["menuData", "closeMenu", "subtext", "themeColorObject", "showNulogyLogo"]);
|
|
43550
43543
|
|
|
43551
43544
|
return /*#__PURE__*/React__default.createElement(Nav, Object.assign({
|
|
43552
43545
|
backgroundColor: themeColorObject && themeColorObject.background
|
|
43553
43546
|
}, props), /*#__PURE__*/React__default.createElement(BrandingWrap, null, /*#__PURE__*/React__default.createElement(BrandingText, {
|
|
43554
43547
|
logoColor: themeColorObject && themeColorObject.logoColor
|
|
43555
|
-
})), /*#__PURE__*/React__default.createElement(Menu$1, null, menuData.primaryMenu && renderTopLayerMenuItems(menuData.primaryMenu, closeMenu, themeColorObject), menuData.secondaryMenu && renderTopLayerMenuItems(menuData.secondaryMenu, closeMenu, themeColorObject)),
|
|
43548
|
+
})), /*#__PURE__*/React__default.createElement(Menu$1, null, menuData.primaryMenu && renderTopLayerMenuItems(menuData.primaryMenu, closeMenu, themeColorObject), menuData.secondaryMenu && renderTopLayerMenuItems(menuData.secondaryMenu, closeMenu, themeColorObject)), showNulogyLogo && /*#__PURE__*/React__default.createElement(Flex, {
|
|
43556
43549
|
textAlign: "center",
|
|
43557
43550
|
borderTop: borderStyle,
|
|
43558
43551
|
height: "40px",
|
|
@@ -43658,16 +43651,15 @@ var SmallNavBarNoState = function SmallNavBarNoState(_a) {
|
|
|
43658
43651
|
toggleMenu = _a$menuState.toggleMenu,
|
|
43659
43652
|
closeMenu = _a$menuState.closeMenu,
|
|
43660
43653
|
subtext = _a.subtext,
|
|
43661
|
-
_a$brandingLinkHref = _a.brandingLinkHref,
|
|
43662
|
-
brandingLinkHref = _a$brandingLinkHref === void 0 ? "/" : _a$brandingLinkHref,
|
|
43663
|
-
brandingLinkTo = _a.brandingLinkTo,
|
|
43664
43654
|
environment = _a.environment,
|
|
43665
|
-
|
|
43655
|
+
showNulogyLogo = _a.showNulogyLogo,
|
|
43666
43656
|
_a$breakpointLower = _a.breakpointLower,
|
|
43667
43657
|
breakpointLower = _a$breakpointLower === void 0 ? "small" : _a$breakpointLower,
|
|
43668
43658
|
themeColorObject = _a.themeColorObject,
|
|
43669
43659
|
navBarHeight = _a.navBarHeight,
|
|
43670
|
-
|
|
43660
|
+
logo = _a.logo,
|
|
43661
|
+
renderMenuButton = _a.renderMenuButton,
|
|
43662
|
+
props = __rest(_a, ["menuData", "menuState", "subtext", "environment", "showNulogyLogo", "breakpointLower", "themeColorObject", "navBarHeight", "logo", "renderMenuButton"]);
|
|
43671
43663
|
|
|
43672
43664
|
var navRef = React__default.useRef(null);
|
|
43673
43665
|
useEffect(function () {
|
|
@@ -43679,6 +43671,7 @@ var SmallNavBarNoState = function SmallNavBarNoState(_a) {
|
|
|
43679
43671
|
var _useTheme = useTheme(),
|
|
43680
43672
|
breakpoints = _useTheme.breakpoints;
|
|
43681
43673
|
|
|
43674
|
+
var ariaExpanded = isOpen ? true : null;
|
|
43682
43675
|
return /*#__PURE__*/React__default.createElement(SmallHeader, Object.assign({
|
|
43683
43676
|
ref: navRef,
|
|
43684
43677
|
isOpen: isOpen,
|
|
@@ -43686,12 +43679,7 @@ var SmallNavBarNoState = function SmallNavBarNoState(_a) {
|
|
|
43686
43679
|
}, props), environment && /*#__PURE__*/React__default.createElement(EnvironmentBanner, null, environment), /*#__PURE__*/React__default.createElement(NavBarBackground, {
|
|
43687
43680
|
backgroundColor: "white",
|
|
43688
43681
|
height: navBarHeight
|
|
43689
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
43690
|
-
logoSrc: logoSrc,
|
|
43691
|
-
brandingLinkHref: brandingLinkHref,
|
|
43692
|
-
brandingLinkTo: brandingLinkTo,
|
|
43693
|
-
subtext: subtext
|
|
43694
|
-
}), /*#__PURE__*/React__default.createElement(Flex, {
|
|
43682
|
+
}, logo, /*#__PURE__*/React__default.createElement(Flex, {
|
|
43695
43683
|
justifyContent: "flex-end",
|
|
43696
43684
|
ml: "x3",
|
|
43697
43685
|
flexGrow: 1
|
|
@@ -43699,17 +43687,22 @@ var SmallNavBarNoState = function SmallNavBarNoState(_a) {
|
|
|
43699
43687
|
maxWidth: "18em",
|
|
43700
43688
|
alignItems: "center",
|
|
43701
43689
|
px: "0"
|
|
43702
|
-
}, /*#__PURE__*/React__default.createElement(NavBarSearch, Object.assign({}, menuData.search))), (menuData.primaryMenu || menuData.secondaryMenu) &&
|
|
43690
|
+
}, /*#__PURE__*/React__default.createElement(NavBarSearch, Object.assign({}, menuData.search))), (menuData.primaryMenu || menuData.secondaryMenu) && (renderMenuButton ? renderMenuButton({
|
|
43691
|
+
themeColorObject: themeColorObject,
|
|
43692
|
+
onClick: toggleMenu,
|
|
43693
|
+
ariaExpanded: ariaExpanded,
|
|
43694
|
+
isOpen: isOpen
|
|
43695
|
+
}) : /*#__PURE__*/React__default.createElement(MobileMenuTrigger, Object.assign({}, themeColorObject, {
|
|
43703
43696
|
onClick: toggleMenu,
|
|
43704
|
-
"aria-expanded":
|
|
43697
|
+
"aria-expanded": ariaExpanded
|
|
43705
43698
|
}), /*#__PURE__*/React__default.createElement(MenuIcon, {
|
|
43706
43699
|
isOpen: isOpen
|
|
43707
|
-
})))), isOpen && /*#__PURE__*/React__default.createElement(PreventBodyElementScrolling, null, /*#__PURE__*/React__default.createElement(MobileMenu, {
|
|
43700
|
+
}))))), isOpen && /*#__PURE__*/React__default.createElement(PreventBodyElementScrolling, null, /*#__PURE__*/React__default.createElement(MobileMenu, {
|
|
43708
43701
|
themeColorObject: themeColorObject,
|
|
43709
43702
|
subtext: subtext,
|
|
43710
43703
|
menuData: menuData,
|
|
43711
43704
|
closeMenu: closeMenu,
|
|
43712
|
-
|
|
43705
|
+
showNulogyLogo: showNulogyLogo
|
|
43713
43706
|
})));
|
|
43714
43707
|
};
|
|
43715
43708
|
/* eslint-enable react/destructuring-assignment */
|
|
@@ -43729,14 +43722,11 @@ var themeColorObject = {
|
|
|
43729
43722
|
|
|
43730
43723
|
var MediumNavBar = function MediumNavBar(_a) {
|
|
43731
43724
|
var menuData = _a.menuData,
|
|
43732
|
-
subtext = _a.subtext,
|
|
43733
43725
|
environment = _a.environment,
|
|
43734
|
-
|
|
43735
|
-
|
|
43736
|
-
|
|
43737
|
-
|
|
43738
|
-
brandingLinkComponent = _a.brandingLinkComponent,
|
|
43739
|
-
props = __rest(_a, ["menuData", "subtext", "environment", "logoSrc", "brandingLinkHref", "brandingLinkTo", "brandingLinkComponent"]);
|
|
43726
|
+
logo = _a.logo,
|
|
43727
|
+
showNulogyLogo = _a.showNulogyLogo,
|
|
43728
|
+
subtext = _a.subtext,
|
|
43729
|
+
props = __rest(_a, ["menuData", "environment", "logo", "showNulogyLogo", "subtext"]);
|
|
43740
43730
|
|
|
43741
43731
|
var _useTranslation = useTranslation(),
|
|
43742
43732
|
t = _useTranslation.t;
|
|
@@ -43744,13 +43734,7 @@ var MediumNavBar = function MediumNavBar(_a) {
|
|
|
43744
43734
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, environment && /*#__PURE__*/React__default.createElement(EnvironmentBanner, null, environment), /*#__PURE__*/React__default.createElement("header", Object.assign({}, props), /*#__PURE__*/React__default.createElement(NavBarBackground, {
|
|
43745
43735
|
backgroundColor: "white",
|
|
43746
43736
|
height: NAVBAR_HEIGHT
|
|
43747
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
43748
|
-
logoSrc: logoSrc,
|
|
43749
|
-
brandingLinkHref: brandingLinkHref,
|
|
43750
|
-
brandingLinkTo: brandingLinkTo,
|
|
43751
|
-
brandingLinkComponent: brandingLinkComponent,
|
|
43752
|
-
subtext: subtext
|
|
43753
|
-
}), /*#__PURE__*/React__default.createElement(Flex, {
|
|
43737
|
+
}, logo, /*#__PURE__*/React__default.createElement(Flex, {
|
|
43754
43738
|
justifyContent: "space-between",
|
|
43755
43739
|
alignContent: "flex-end",
|
|
43756
43740
|
flexGrow: 1,
|
|
@@ -43767,7 +43751,7 @@ var MediumNavBar = function MediumNavBar(_a) {
|
|
|
43767
43751
|
themeColorObject: themeColorObject,
|
|
43768
43752
|
"aria-label": t("secondary navigation"),
|
|
43769
43753
|
menuData: menuData.secondaryMenu
|
|
43770
|
-
}),
|
|
43754
|
+
}), showNulogyLogo && /*#__PURE__*/React__default.createElement(Box, {
|
|
43771
43755
|
pl: "x3"
|
|
43772
43756
|
}, /*#__PURE__*/React__default.createElement(NulogyLogoContainer, {
|
|
43773
43757
|
height: NAVBAR_HEIGHT,
|
|
@@ -43783,19 +43767,36 @@ var SelectNavBarBasedOnWidth = function SelectNavBarBasedOnWidth(_a) {
|
|
|
43783
43767
|
var width = _a.width,
|
|
43784
43768
|
defaultOpen = _a.defaultOpen,
|
|
43785
43769
|
breakpointUpper = _a.breakpointUpper,
|
|
43786
|
-
|
|
43770
|
+
_a$brandingLinkHref = _a.brandingLinkHref,
|
|
43771
|
+
brandingLinkHref = _a$brandingLinkHref === void 0 ? "/" : _a$brandingLinkHref,
|
|
43772
|
+
brandingLinkTo = _a.brandingLinkTo,
|
|
43773
|
+
brandingLinkComponent = _a.brandingLinkComponent,
|
|
43774
|
+
logoSrc = _a.logoSrc,
|
|
43775
|
+
props = __rest(_a, ["width", "defaultOpen", "breakpointUpper", "brandingLinkHref", "brandingLinkTo", "brandingLinkComponent", "logoSrc"]);
|
|
43787
43776
|
|
|
43788
43777
|
var currentWidth = width || typeof window !== "undefined" && window.innerWidth;
|
|
43778
|
+
var logo = /*#__PURE__*/React__default.createElement(BrandLogoContainer, {
|
|
43779
|
+
logoSrc: logoSrc,
|
|
43780
|
+
brandingLinkHref: brandingLinkHref,
|
|
43781
|
+
brandingLinkTo: brandingLinkTo,
|
|
43782
|
+
brandingLinkComponent: brandingLinkComponent,
|
|
43783
|
+
subtext: props.subtext
|
|
43784
|
+
});
|
|
43789
43785
|
|
|
43790
43786
|
if (currentWidth >= pixelDigitsFrom(breakpointUpper)) {
|
|
43791
|
-
return /*#__PURE__*/React__default.createElement(MediumNavBar, Object.assign({
|
|
43787
|
+
return /*#__PURE__*/React__default.createElement(MediumNavBar, Object.assign({
|
|
43788
|
+
logo: logo,
|
|
43789
|
+
showNulogyLogo: logoSrc
|
|
43790
|
+
}, props));
|
|
43792
43791
|
} else {
|
|
43793
|
-
return /*#__PURE__*/React__default.createElement(SmallNavBar, Object.assign({
|
|
43792
|
+
return /*#__PURE__*/React__default.createElement(SmallNavBar, Object.assign({
|
|
43794
43793
|
width: currentWidth,
|
|
43795
43794
|
defaultOpen: defaultOpen,
|
|
43796
43795
|
themeColorObject: themeColorObject,
|
|
43797
|
-
navBarHeight: NAVBAR_HEIGHT
|
|
43798
|
-
|
|
43796
|
+
navBarHeight: NAVBAR_HEIGHT,
|
|
43797
|
+
logo: logo,
|
|
43798
|
+
showNulogyLogo: logoSrc
|
|
43799
|
+
}, props));
|
|
43799
43800
|
}
|
|
43800
43801
|
};
|
|
43801
43802
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
declare type ThemeColorObject = {
|
|
3
3
|
textColor?: string;
|
|
4
4
|
background?: string;
|
|
@@ -13,7 +13,7 @@ declare type BaseMobileMenuProps = {
|
|
|
13
13
|
subtext?: string;
|
|
14
14
|
closeMenu?: Function;
|
|
15
15
|
themeColorObject?: ThemeColorObject;
|
|
16
|
-
|
|
16
|
+
showNulogyLogo?: boolean;
|
|
17
17
|
};
|
|
18
|
-
declare const MobileMenu: import("styled-components").StyledComponent<
|
|
18
|
+
declare const MobileMenu: import("styled-components").StyledComponent<React.FC<BaseMobileMenuProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
19
19
|
export default MobileMenu;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type MenuState = {
|
|
3
|
+
isOpen?: boolean;
|
|
4
|
+
openMenu?: Function;
|
|
5
|
+
closeMenu?: Function;
|
|
6
|
+
toggleMenu?: Function;
|
|
7
|
+
};
|
|
8
|
+
declare type NavBarDropdownMenuProps = {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
trigger?: Function;
|
|
11
|
+
menuState?: MenuState;
|
|
12
|
+
showArrow?: boolean;
|
|
13
|
+
placement?: "bottom-start" | "right-start";
|
|
14
|
+
modifiers?: any;
|
|
15
|
+
triggerTogglesMenuState?: boolean;
|
|
16
|
+
dropdownMenuContainerEventHandlers?: Function;
|
|
17
|
+
};
|
|
18
|
+
declare const NavBarDropdownMenu: React.JSXElementConstructor<NavBarDropdownMenuProps & import("../utils").WithMenuStateProps>;
|
|
8
19
|
export default NavBarDropdownMenu;
|
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
import { WithMenuStateProps } from "../utils";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { WithMenuStateProps, AcceptsMenuStateProps } from "../utils";
|
|
3
|
+
export declare type RenderMenuButtonProps = {
|
|
4
|
+
themeColorObject: any;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
ariaExpanded: true | null;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare type SmallNavBarNoStateProps = {
|
|
6
10
|
menuData?: any;
|
|
7
11
|
subtext?: string;
|
|
8
|
-
brandingLinkHref?: string;
|
|
9
|
-
brandingLinkTo?: string;
|
|
10
12
|
breakpointLower?: number | string;
|
|
11
13
|
width?: number;
|
|
12
14
|
themeColor?: "blue" | "white";
|
|
13
|
-
themeColorObject
|
|
15
|
+
themeColorObject?: any;
|
|
14
16
|
environment?: "development" | "training";
|
|
15
17
|
navBarHeight: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
logo?: React.ReactElement;
|
|
19
|
+
showNulogyLogo?: boolean;
|
|
20
|
+
renderMenuButton?: (props: RenderMenuButtonProps) => React.ReactElement;
|
|
21
|
+
} & AcceptsMenuStateProps;
|
|
22
|
+
declare const SmallNavBar: React.JSXElementConstructor<{
|
|
23
|
+
menuData?: any;
|
|
24
|
+
subtext?: string;
|
|
25
|
+
breakpointLower?: number | string;
|
|
26
|
+
width?: number;
|
|
27
|
+
themeColor?: "blue" | "white";
|
|
28
|
+
themeColorObject?: any;
|
|
29
|
+
environment?: "development" | "training";
|
|
30
|
+
navBarHeight: string;
|
|
31
|
+
logo?: React.ReactElement;
|
|
32
|
+
showNulogyLogo?: boolean;
|
|
33
|
+
renderMenuButton?: (props: RenderMenuButtonProps) => React.ReactElement;
|
|
34
|
+
} & AcceptsMenuStateProps & WithMenuStateProps>;
|
|
23
35
|
export declare type SmallNavBarProps = SmallNavBarNoStateProps & WithMenuStateProps;
|
|
24
36
|
export default SmallNavBar;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
viewport: {
|
|
6
|
+
defaultViewport: string;
|
|
7
|
+
};
|
|
8
|
+
chromatic: {
|
|
9
|
+
viewports: number[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
export declare const _SmallNavBar: () => JSX.Element;
|
|
15
|
+
export declare const SmallNavBarOpen: () => JSX.Element;
|
|
16
|
+
export declare const WithALogo: () => JSX.Element;
|
|
17
|
+
export declare const WithALogoOpen: () => JSX.Element;
|
|
18
|
+
export declare const WithABrandLogoContainerLogo: () => JSX.Element;
|
|
19
|
+
export declare const WithANulogyLogoAndAppName: () => JSX.Element;
|
|
20
|
+
export declare const WithEnvironmentBanner: () => JSX.Element;
|
|
21
|
+
export declare const WithCustomMenuButton: () => JSX.Element;
|
|
@@ -10,4 +10,4 @@ export type { BrandLogoContainerProps } from "./BrandLogoContainer";
|
|
|
10
10
|
export { default as DesktopMenu } from "./DesktopMenu";
|
|
11
11
|
export type { DesktopMenuProps } from "./DesktopMenu";
|
|
12
12
|
export { default as SmallNavBar } from "./SmallNavBar";
|
|
13
|
-
export type { SmallNavBarProps } from "./SmallNavBar";
|
|
13
|
+
export type { SmallNavBarProps, RenderMenuButtonProps } from "./SmallNavBar";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const NavBarDropdownMenu: (
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
showDelay: any;
|
|
5
|
-
hideDelay: any;
|
|
6
|
-
defaultOpen: any;
|
|
7
|
-
}) => JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const NavBarDropdownMenu: React.JSXElementConstructor<import("../utils").WithMenuStateProps>;
|
|
8
3
|
export default NavBarDropdownMenu;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const SmallNavBar: (
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
showDelay: any;
|
|
5
|
-
hideDelay: any;
|
|
6
|
-
defaultOpen: any;
|
|
7
|
-
}) => JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const SmallNavBar: React.JSXElementConstructor<import("../utils").WithMenuStateProps>;
|
|
8
3
|
export default SmallNavBar;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export { ALL_NDS_LOCALES } from "./locales.const";
|
|
|
43
43
|
export { TruncatedText } from "./TruncatedText";
|
|
44
44
|
export { Toast } from "./Toast";
|
|
45
45
|
export { BrandedNavBar, MenuTrigger, EnvironmentBanner, NavBarBackground, BrandLogoContainer, DesktopMenu, SmallNavBar, } from "./BrandedNavBar";
|
|
46
|
-
export type { MenuTriggerProps, EnvironmentBannerProps, NavBarBackgroundProps, BrandLogoContainerProps, DesktopMenuProps, SmallNavBarProps, } from "./BrandedNavBar";
|
|
46
|
+
export type { MenuTriggerProps, EnvironmentBannerProps, NavBarBackgroundProps, BrandLogoContainerProps, DesktopMenuProps, SmallNavBarProps, RenderMenuButtonProps, } from "./BrandedNavBar";
|
|
47
47
|
export { AsyncSelect } from "./AsyncSelect";
|
|
48
48
|
export { ApplicationFrame, Page, Sidebar } from "./Layout";
|
|
49
49
|
export { useWindowDimensions } from "./utils";
|
|
@@ -7,6 +7,6 @@ export { default as DetectOutsideClick } from "./DetectOutsideClick";
|
|
|
7
7
|
export { default as PopperArrow } from "./PopperArrow";
|
|
8
8
|
export { default as ScrollIndicators } from "./ScrollIndicators";
|
|
9
9
|
export { default as withMenuState } from "./withMenuState";
|
|
10
|
-
export type { WithMenuStateProps } from "./withMenuState";
|
|
10
|
+
export type { WithMenuStateProps, AcceptsMenuStateProps } from "./withMenuState";
|
|
11
11
|
export { default as PreventBodyElementScrolling } from "./PreventBodyElementScrolling";
|
|
12
12
|
export { default as useWindowDimensions } from "./useWindowDimensions";
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare type WithMenuStateProps = {
|
|
3
3
|
children?: any;
|
|
4
4
|
showDelay?: string | number;
|
|
5
5
|
hideDelay?: string | number;
|
|
6
6
|
defaultOpen?: boolean;
|
|
7
7
|
};
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
defaultOpen: any;
|
|
13
|
-
}) => JSX.Element;
|
|
8
|
+
export declare type AcceptsMenuStateProps = {
|
|
9
|
+
menuState?: any;
|
|
10
|
+
};
|
|
11
|
+
declare function withMenuState<P extends AcceptsMenuStateProps>(MenuComponent: React.JSXElementConstructor<P>): React.JSXElementConstructor<P & WithMenuStateProps>;
|
|
14
12
|
export default withMenuState;
|