@dloizides/ui-nav 1.30.0 → 1.31.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.d.mts +13 -17
- package/dist/index.d.ts +13 -17
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -155,7 +155,7 @@ interface SidebarProps {
|
|
|
155
155
|
/** Navigation callback — receives a `NavItem.route`. */
|
|
156
156
|
onNavigate: (route: string) => void;
|
|
157
157
|
/** Localized menu title (heading). */
|
|
158
|
-
title:
|
|
158
|
+
title: React.ReactNode;
|
|
159
159
|
/** Localized accessibility label for the navigation landmark. */
|
|
160
160
|
regionLabel: string;
|
|
161
161
|
/** a11y hint for a leaf item, given its label. Defaults to the label. */
|
|
@@ -711,6 +711,13 @@ interface AppShellProps {
|
|
|
711
711
|
}
|
|
712
712
|
declare const AppShell: ({ header, nav, sidebar, collapsedSidebar, collapsedRailRange, mobileMenu, banner, width, contentPadding, chromeAlignment, gate, state, testID, children, }: AppShellProps) => React.ReactElement | null;
|
|
713
713
|
|
|
714
|
+
interface NavShellCollapsedRail {
|
|
715
|
+
items?: NavItem[];
|
|
716
|
+
header?: React.ReactNode;
|
|
717
|
+
footer?: React.ReactNode;
|
|
718
|
+
range?: CollapsedRailRange;
|
|
719
|
+
}
|
|
720
|
+
|
|
714
721
|
/**
|
|
715
722
|
* NavShell — the ONE first-class navigation shell that renders a **top bar**, a
|
|
716
723
|
* **side rail**, or **BOTH together**, chosen by a single `layout` prop
|
|
@@ -786,22 +793,7 @@ interface NavShellTopBar {
|
|
|
786
793
|
*/
|
|
787
794
|
barTheme?: UiTheme;
|
|
788
795
|
}
|
|
789
|
-
|
|
790
|
-
* Config for the intermediate COLLAPSED (icon-only) rail — opts the side layout
|
|
791
|
-
* into a THREE-tier responsive scheme (full rail → collapsed rail → drawer). When
|
|
792
|
-
* present, NavShell builds a `<CollapsedRail>` and hands it to `AppShell` for the
|
|
793
|
-
* tablet band; omit it and the layout stays two-tier.
|
|
794
|
-
*/
|
|
795
|
-
interface NavShellCollapsedRail {
|
|
796
|
-
/** Items for the icon rail. Defaults to the full rail's `items`. */
|
|
797
|
-
items?: NavItem[];
|
|
798
|
-
/** Optional header slot (e.g. a home shortcut). */
|
|
799
|
-
header?: React.ReactNode;
|
|
800
|
-
/** Optional footer slot (dark-mode toggle, logout). */
|
|
801
|
-
footer?: React.ReactNode;
|
|
802
|
-
/** The `[min, max)` viewport band for the collapsed rail (default `{ min: 768, max: 1024 }`). */
|
|
803
|
-
range?: CollapsedRailRange;
|
|
804
|
-
}
|
|
796
|
+
|
|
805
797
|
/**
|
|
806
798
|
* Config for the SIDE rail (rendered as a `Sidebar` in `AppShell`'s sidebar
|
|
807
799
|
* slot). Used when `layout` is `'side'` or `'both'`.
|
|
@@ -809,6 +801,7 @@ interface NavShellCollapsedRail {
|
|
|
809
801
|
interface NavShellSideRail {
|
|
810
802
|
/** Side-rail nav entries (sections — leaf + expandable). */
|
|
811
803
|
items: NavItem[];
|
|
804
|
+
brand?: React.ReactNode;
|
|
812
805
|
/** Localized menu title (heading). */
|
|
813
806
|
title: string;
|
|
814
807
|
/** Optional header slot rendered above the items (e.g. a Home shortcut). */
|
|
@@ -1372,6 +1365,9 @@ declare const navStyles: {
|
|
|
1372
1365
|
borderRightWidth: number;
|
|
1373
1366
|
height: "100%";
|
|
1374
1367
|
};
|
|
1368
|
+
sidebarBrand: {
|
|
1369
|
+
marginBottom: number;
|
|
1370
|
+
};
|
|
1375
1371
|
sidebarTitle: {
|
|
1376
1372
|
fontWeight: "700";
|
|
1377
1373
|
marginBottom: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -155,7 +155,7 @@ interface SidebarProps {
|
|
|
155
155
|
/** Navigation callback — receives a `NavItem.route`. */
|
|
156
156
|
onNavigate: (route: string) => void;
|
|
157
157
|
/** Localized menu title (heading). */
|
|
158
|
-
title:
|
|
158
|
+
title: React.ReactNode;
|
|
159
159
|
/** Localized accessibility label for the navigation landmark. */
|
|
160
160
|
regionLabel: string;
|
|
161
161
|
/** a11y hint for a leaf item, given its label. Defaults to the label. */
|
|
@@ -711,6 +711,13 @@ interface AppShellProps {
|
|
|
711
711
|
}
|
|
712
712
|
declare const AppShell: ({ header, nav, sidebar, collapsedSidebar, collapsedRailRange, mobileMenu, banner, width, contentPadding, chromeAlignment, gate, state, testID, children, }: AppShellProps) => React.ReactElement | null;
|
|
713
713
|
|
|
714
|
+
interface NavShellCollapsedRail {
|
|
715
|
+
items?: NavItem[];
|
|
716
|
+
header?: React.ReactNode;
|
|
717
|
+
footer?: React.ReactNode;
|
|
718
|
+
range?: CollapsedRailRange;
|
|
719
|
+
}
|
|
720
|
+
|
|
714
721
|
/**
|
|
715
722
|
* NavShell — the ONE first-class navigation shell that renders a **top bar**, a
|
|
716
723
|
* **side rail**, or **BOTH together**, chosen by a single `layout` prop
|
|
@@ -786,22 +793,7 @@ interface NavShellTopBar {
|
|
|
786
793
|
*/
|
|
787
794
|
barTheme?: UiTheme;
|
|
788
795
|
}
|
|
789
|
-
|
|
790
|
-
* Config for the intermediate COLLAPSED (icon-only) rail — opts the side layout
|
|
791
|
-
* into a THREE-tier responsive scheme (full rail → collapsed rail → drawer). When
|
|
792
|
-
* present, NavShell builds a `<CollapsedRail>` and hands it to `AppShell` for the
|
|
793
|
-
* tablet band; omit it and the layout stays two-tier.
|
|
794
|
-
*/
|
|
795
|
-
interface NavShellCollapsedRail {
|
|
796
|
-
/** Items for the icon rail. Defaults to the full rail's `items`. */
|
|
797
|
-
items?: NavItem[];
|
|
798
|
-
/** Optional header slot (e.g. a home shortcut). */
|
|
799
|
-
header?: React.ReactNode;
|
|
800
|
-
/** Optional footer slot (dark-mode toggle, logout). */
|
|
801
|
-
footer?: React.ReactNode;
|
|
802
|
-
/** The `[min, max)` viewport band for the collapsed rail (default `{ min: 768, max: 1024 }`). */
|
|
803
|
-
range?: CollapsedRailRange;
|
|
804
|
-
}
|
|
796
|
+
|
|
805
797
|
/**
|
|
806
798
|
* Config for the SIDE rail (rendered as a `Sidebar` in `AppShell`'s sidebar
|
|
807
799
|
* slot). Used when `layout` is `'side'` or `'both'`.
|
|
@@ -809,6 +801,7 @@ interface NavShellCollapsedRail {
|
|
|
809
801
|
interface NavShellSideRail {
|
|
810
802
|
/** Side-rail nav entries (sections — leaf + expandable). */
|
|
811
803
|
items: NavItem[];
|
|
804
|
+
brand?: React.ReactNode;
|
|
812
805
|
/** Localized menu title (heading). */
|
|
813
806
|
title: string;
|
|
814
807
|
/** Optional header slot rendered above the items (e.g. a Home shortcut). */
|
|
@@ -1372,6 +1365,9 @@ declare const navStyles: {
|
|
|
1372
1365
|
borderRightWidth: number;
|
|
1373
1366
|
height: "100%";
|
|
1374
1367
|
};
|
|
1368
|
+
sidebarBrand: {
|
|
1369
|
+
marginBottom: number;
|
|
1370
|
+
};
|
|
1375
1371
|
sidebarTitle: {
|
|
1376
1372
|
fontWeight: "700";
|
|
1377
1373
|
marginBottom: number;
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,9 @@ var navStyles = reactNative.StyleSheet.create({
|
|
|
34
34
|
borderRightWidth: 1,
|
|
35
35
|
height: "100%"
|
|
36
36
|
},
|
|
37
|
+
sidebarBrand: {
|
|
38
|
+
marginBottom: 12
|
|
39
|
+
},
|
|
37
40
|
sidebarTitle: {
|
|
38
41
|
fontWeight: "700",
|
|
39
42
|
marginBottom: 12
|
|
@@ -821,7 +824,7 @@ var Sidebar = ({
|
|
|
821
824
|
containerStyle
|
|
822
825
|
],
|
|
823
826
|
children: [
|
|
824
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [navStyles.sidebarTitle, { color: colors.text }], children: title }),
|
|
827
|
+
typeof title === "string" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [navStyles.sidebarTitle, { color: colors.text }], children: title }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: navStyles.sidebarBrand, children: title }),
|
|
825
828
|
showInlineSearch && search !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
826
829
|
SidebarSearch,
|
|
827
830
|
{
|
|
@@ -2073,7 +2076,7 @@ var NavShell = ({
|
|
|
2073
2076
|
renderChevron: sideRail.renderChevron,
|
|
2074
2077
|
search: sideRail.search,
|
|
2075
2078
|
searchQuery: sideRail.searchQuery,
|
|
2076
|
-
title: sideRail.title,
|
|
2079
|
+
title: sideRail.brand ?? sideRail.title,
|
|
2077
2080
|
onNavigate,
|
|
2078
2081
|
onSearchChange: sideRail.onSearchChange
|
|
2079
2082
|
}
|