@dloizides/ui-nav 1.8.0 → 1.10.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/CHANGELOG.md +49 -0
- package/README.md +14 -0
- package/dist/index.d.mts +39 -3
- package/dist/index.d.ts +39 -3
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -534,6 +534,7 @@ var Topbar = ({
|
|
|
534
534
|
accessibilityLabel: language.label,
|
|
535
535
|
ringColor: primaryColor,
|
|
536
536
|
style: navStyles.topbarRowItem,
|
|
537
|
+
testID: language.testID,
|
|
537
538
|
onPress: language.onPress,
|
|
538
539
|
children: /* @__PURE__ */ jsx(Text, { style: [navStyles.topbarLabel, { color: colors.text }], children: language.label })
|
|
539
540
|
}
|
|
@@ -547,10 +548,10 @@ var Topbar = ({
|
|
|
547
548
|
richAccount.onAccount ? /* @__PURE__ */ jsx(
|
|
548
549
|
FocusableTouchable,
|
|
549
550
|
{
|
|
550
|
-
accessibilityHint: richAccount.displayName,
|
|
551
|
+
accessibilityHint: richAccount.accountHint ?? richAccount.displayName,
|
|
551
552
|
accessibilityLabel: richAccount.displayName,
|
|
552
553
|
ringColor: primaryColor,
|
|
553
|
-
testID: NAV_TEST_IDS.accountName,
|
|
554
|
+
testID: richAccount.accountTestID ?? NAV_TEST_IDS.accountName,
|
|
554
555
|
onPress: richAccount.onAccount,
|
|
555
556
|
children: /* @__PURE__ */ jsx(Text, { style: [navStyles.userName, { color: colors.text }], children: richAccount.displayName })
|
|
556
557
|
}
|
|
@@ -800,7 +801,8 @@ var NavBarInner = ({
|
|
|
800
801
|
collapseBelow = DEFAULT_COLLAPSE_BELOW,
|
|
801
802
|
overflowLabel = "More",
|
|
802
803
|
overflowHint = "",
|
|
803
|
-
containerStyle
|
|
804
|
+
containerStyle,
|
|
805
|
+
contentMaxWidth
|
|
804
806
|
}) => {
|
|
805
807
|
const { theme } = useUi();
|
|
806
808
|
const colors = theme.colors;
|
|
@@ -812,6 +814,10 @@ var NavBarInner = ({
|
|
|
812
814
|
const { visibleCount, setAvailableWidth, setItemWidth, setMoreWidth } = useNavOverflow(items.length, NAV_LINK_GAP);
|
|
813
815
|
const collapsed = width < collapseBelow;
|
|
814
816
|
const showLinks = !collapsed || open;
|
|
817
|
+
const innerCapStyle = useMemo(
|
|
818
|
+
() => contentMaxWidth === void 0 ? null : { maxWidth: contentMaxWidth, width: "100%", alignSelf: "center" },
|
|
819
|
+
[contentMaxWidth]
|
|
820
|
+
);
|
|
815
821
|
const toggleMenu = useCallback(() => setOpen((v) => !v), []);
|
|
816
822
|
const handlePress = useCallback(
|
|
817
823
|
(route) => {
|
|
@@ -841,7 +847,7 @@ var NavBarInner = ({
|
|
|
841
847
|
{ backgroundColor: colors.surface, borderBottomColor: colors.border },
|
|
842
848
|
containerStyle
|
|
843
849
|
],
|
|
844
|
-
children: /* @__PURE__ */ jsxs(View, { style: [navBarStyles.inner, collapsed ? null : navBarStyles.innerNoWrap], children: [
|
|
850
|
+
children: /* @__PURE__ */ jsxs(View, { style: [navBarStyles.inner, collapsed ? null : navBarStyles.innerNoWrap, innerCapStyle], children: [
|
|
845
851
|
brand !== void 0 ? /* @__PURE__ */ jsx(View, { style: navBarStyles.brand, children: brand }) : null,
|
|
846
852
|
collapsed ? /* @__PURE__ */ jsx(
|
|
847
853
|
Pressable,
|
|
@@ -1230,8 +1236,8 @@ var CollapsedRail = ({
|
|
|
1230
1236
|
}
|
|
1231
1237
|
);
|
|
1232
1238
|
};
|
|
1233
|
-
function wantsTopBar(layout, hasHeader
|
|
1234
|
-
return layout === "top" || layout === "both" || hasHeader
|
|
1239
|
+
function wantsTopBar(layout, hasHeader) {
|
|
1240
|
+
return layout === "top" || layout === "both" || hasHeader;
|
|
1235
1241
|
}
|
|
1236
1242
|
function wantsSideRail(layout, hasSideRail) {
|
|
1237
1243
|
return (layout === "side" || layout === "both") && hasSideRail;
|
|
@@ -1250,7 +1256,7 @@ var NavShell = ({
|
|
|
1250
1256
|
collapsedRailRange: collapsedRailRangeProp,
|
|
1251
1257
|
...shellProps
|
|
1252
1258
|
}) => {
|
|
1253
|
-
const showTopBar = wantsTopBar(layout, header !== void 0
|
|
1259
|
+
const showTopBar = wantsTopBar(layout, header !== void 0);
|
|
1254
1260
|
const showSideRail = wantsSideRail(layout, sideRail !== void 0);
|
|
1255
1261
|
const headerNode = header !== void 0 ? header : showTopBar && topBar !== void 0 ? /* @__PURE__ */ jsx(
|
|
1256
1262
|
NavBar,
|
|
@@ -1259,6 +1265,7 @@ var NavShell = ({
|
|
|
1259
1265
|
brand: topBar.brand,
|
|
1260
1266
|
collapseBelow: topBar.collapseBelow,
|
|
1261
1267
|
containerStyle: topBar.containerStyle,
|
|
1268
|
+
contentMaxWidth: topBar.contentMaxWidth,
|
|
1262
1269
|
items: topBar.items,
|
|
1263
1270
|
menuHint: topBar.menuHint,
|
|
1264
1271
|
menuLabel: topBar.menuLabel,
|