@dloizides/ui-nav 1.8.0 → 1.9.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/index.mjs CHANGED
@@ -800,7 +800,8 @@ var NavBarInner = ({
800
800
  collapseBelow = DEFAULT_COLLAPSE_BELOW,
801
801
  overflowLabel = "More",
802
802
  overflowHint = "",
803
- containerStyle
803
+ containerStyle,
804
+ contentMaxWidth
804
805
  }) => {
805
806
  const { theme } = useUi();
806
807
  const colors = theme.colors;
@@ -812,6 +813,10 @@ var NavBarInner = ({
812
813
  const { visibleCount, setAvailableWidth, setItemWidth, setMoreWidth } = useNavOverflow(items.length, NAV_LINK_GAP);
813
814
  const collapsed = width < collapseBelow;
814
815
  const showLinks = !collapsed || open;
816
+ const innerCapStyle = useMemo(
817
+ () => contentMaxWidth === void 0 ? null : { maxWidth: contentMaxWidth, width: "100%", alignSelf: "center" },
818
+ [contentMaxWidth]
819
+ );
815
820
  const toggleMenu = useCallback(() => setOpen((v) => !v), []);
816
821
  const handlePress = useCallback(
817
822
  (route) => {
@@ -841,7 +846,7 @@ var NavBarInner = ({
841
846
  { backgroundColor: colors.surface, borderBottomColor: colors.border },
842
847
  containerStyle
843
848
  ],
844
- children: /* @__PURE__ */ jsxs(View, { style: [navBarStyles.inner, collapsed ? null : navBarStyles.innerNoWrap], children: [
849
+ children: /* @__PURE__ */ jsxs(View, { style: [navBarStyles.inner, collapsed ? null : navBarStyles.innerNoWrap, innerCapStyle], children: [
845
850
  brand !== void 0 ? /* @__PURE__ */ jsx(View, { style: navBarStyles.brand, children: brand }) : null,
846
851
  collapsed ? /* @__PURE__ */ jsx(
847
852
  Pressable,
@@ -1259,6 +1264,7 @@ var NavShell = ({
1259
1264
  brand: topBar.brand,
1260
1265
  collapseBelow: topBar.collapseBelow,
1261
1266
  containerStyle: topBar.containerStyle,
1267
+ contentMaxWidth: topBar.contentMaxWidth,
1262
1268
  items: topBar.items,
1263
1269
  menuHint: topBar.menuHint,
1264
1270
  menuLabel: topBar.menuLabel,