@dloizides/ui-nav 1.36.0 → 1.37.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 +4 -0
- package/README.md +18 -0
- package/dist/index.d.mts +37 -12
- package/dist/index.d.ts +37 -12
- package/dist/index.js +158 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -65
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,7 +28,6 @@ var NAV_LINK_GAP = 4;
|
|
|
28
28
|
var navStyles = reactNative.StyleSheet.create({
|
|
29
29
|
// --- Sidebar ---
|
|
30
30
|
sidebarContainer: {
|
|
31
|
-
width: 220,
|
|
32
31
|
paddingTop: 24,
|
|
33
32
|
paddingHorizontal: 12,
|
|
34
33
|
borderRightWidth: 1,
|
|
@@ -837,6 +836,20 @@ var SidebarSearch = ({
|
|
|
837
836
|
}
|
|
838
837
|
);
|
|
839
838
|
};
|
|
839
|
+
|
|
840
|
+
// src/types.ts
|
|
841
|
+
var SIDEBAR_WIDTH_PX = {
|
|
842
|
+
default: 220,
|
|
843
|
+
sm: 240,
|
|
844
|
+
md: 264,
|
|
845
|
+
lg: 288
|
|
846
|
+
};
|
|
847
|
+
var NAV_BRAND_DEFAULTS = {
|
|
848
|
+
brandPlacement: "sidebar",
|
|
849
|
+
sidebarWidth: "default",
|
|
850
|
+
drawerHeader: "none",
|
|
851
|
+
drawerWidth: "default"
|
|
852
|
+
};
|
|
840
853
|
function isBareText(node) {
|
|
841
854
|
return typeof node === "string" || typeof node === "number";
|
|
842
855
|
}
|
|
@@ -854,6 +867,7 @@ var Sidebar = ({
|
|
|
854
867
|
pathname,
|
|
855
868
|
onNavigate,
|
|
856
869
|
title,
|
|
870
|
+
width: railWidth = "default",
|
|
857
871
|
regionLabel,
|
|
858
872
|
navigateHint = (label) => label,
|
|
859
873
|
expandHint = "",
|
|
@@ -901,11 +915,12 @@ var Sidebar = ({
|
|
|
901
915
|
role: "navigation",
|
|
902
916
|
style: [
|
|
903
917
|
navStyles.sidebarContainer,
|
|
918
|
+
{ width: SIDEBAR_WIDTH_PX[railWidth] },
|
|
904
919
|
{ backgroundColor: colors.surface, borderRightColor: colors.border },
|
|
905
920
|
containerStyle
|
|
906
921
|
],
|
|
907
922
|
children: [
|
|
908
|
-
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 }),
|
|
923
|
+
title === null ? null : 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 }),
|
|
909
924
|
showInlineSearch && search !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
910
925
|
SidebarSearch,
|
|
911
926
|
{
|
|
@@ -1835,6 +1850,33 @@ function useContentBody(state, children, testID) {
|
|
|
1835
1850
|
) : null
|
|
1836
1851
|
] });
|
|
1837
1852
|
}
|
|
1853
|
+
var CLOSE_GLYPH = "\u2715";
|
|
1854
|
+
var CLOSE_GLYPH_FONT_SIZE = 18;
|
|
1855
|
+
var BAR_PADDING = 12;
|
|
1856
|
+
var styles8 = reactNative.StyleSheet.create({
|
|
1857
|
+
bar: { flexDirection: "row", alignItems: "center", paddingLeft: BAR_PADDING, borderBottomWidth: 1 },
|
|
1858
|
+
brand: { flex: 1 },
|
|
1859
|
+
close: { minWidth: MIN_TOUCH_TARGET, minHeight: MIN_TOUCH_TARGET, alignItems: "center", justifyContent: "center" },
|
|
1860
|
+
glyph: { fontSize: CLOSE_GLYPH_FONT_SIZE, fontWeight: "700" }
|
|
1861
|
+
});
|
|
1862
|
+
var DrawerHeaderBar = ({ brand, closeLabel, closeHint, onClose, testID }) => {
|
|
1863
|
+
const { theme } = uiFeedback.useUi();
|
|
1864
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles8.bar, { borderBottomColor: theme.colors.border }], testID, children: [
|
|
1865
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles8.brand, children: brand }),
|
|
1866
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1867
|
+
FocusableTouchable,
|
|
1868
|
+
{
|
|
1869
|
+
accessibilityHint: closeHint,
|
|
1870
|
+
accessibilityLabel: closeLabel,
|
|
1871
|
+
ringColor: theme.palette.primary["500"],
|
|
1872
|
+
style: styles8.close,
|
|
1873
|
+
testID: `${testID}-close`,
|
|
1874
|
+
onPress: onClose,
|
|
1875
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.glyph, { color: theme.colors.text }], children: CLOSE_GLYPH })
|
|
1876
|
+
}
|
|
1877
|
+
)
|
|
1878
|
+
] });
|
|
1879
|
+
};
|
|
1838
1880
|
var SCRIM_COLOR = "rgba(0, 0, 0, 0.5)";
|
|
1839
1881
|
var MENU_GLYPH2 = "\u2630";
|
|
1840
1882
|
var MENU_GLYPH_FONT_SIZE = 20;
|
|
@@ -1855,7 +1897,7 @@ var DEFAULT_DRAWER_LABELS = {
|
|
|
1855
1897
|
closeLabel: "Close menu",
|
|
1856
1898
|
closeHint: "Close the navigation menu"
|
|
1857
1899
|
};
|
|
1858
|
-
var
|
|
1900
|
+
var styles9 = reactNative.StyleSheet.create({
|
|
1859
1901
|
overlay: { ...reactNative.StyleSheet.absoluteFillObject, zIndex: DRAWER_Z_INDEX },
|
|
1860
1902
|
// The scrim's tap-to-close hit area is anchored to the RIGHT of the panel
|
|
1861
1903
|
// (`left: DRAWER_WIDTH`), so it NEVER overlaps the panel: nav-item taps always
|
|
@@ -1873,6 +1915,8 @@ var styles8 = reactNative.StyleSheet.create({
|
|
|
1873
1915
|
// so on react-native-web it — and the nav leaves inside it — sit above the scrim
|
|
1874
1916
|
// and receive presses instead of the scrim swallowing them.
|
|
1875
1917
|
panel: { position: "absolute", top: 0, bottom: 0, left: 0, width: DRAWER_WIDTH, zIndex: PANEL_Z_INDEX },
|
|
1918
|
+
panelFull: { width: "100%" },
|
|
1919
|
+
panelBody: { flex: 1 },
|
|
1876
1920
|
menuToggle: {
|
|
1877
1921
|
minWidth: MIN_TOUCH_TARGET,
|
|
1878
1922
|
minHeight: MIN_TOUCH_TARGET,
|
|
@@ -1890,10 +1934,10 @@ var MenuToggle = ({ label, hint, onOpen, testID }) => {
|
|
|
1890
1934
|
accessibilityHint: hint,
|
|
1891
1935
|
accessibilityLabel: label,
|
|
1892
1936
|
ringColor: theme.palette.primary["500"],
|
|
1893
|
-
style:
|
|
1937
|
+
style: styles9.menuToggle,
|
|
1894
1938
|
testID,
|
|
1895
1939
|
onPress: onOpen,
|
|
1896
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1940
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.menuToggleGlyph, { color: theme.colors.text }], children: MENU_GLYPH2 })
|
|
1897
1941
|
}
|
|
1898
1942
|
);
|
|
1899
1943
|
};
|
|
@@ -1902,10 +1946,14 @@ var MobileDrawer = ({
|
|
|
1902
1946
|
labels,
|
|
1903
1947
|
onClose,
|
|
1904
1948
|
drawerTestID,
|
|
1905
|
-
scrimTestID
|
|
1949
|
+
scrimTestID,
|
|
1950
|
+
header,
|
|
1951
|
+
width = "default"
|
|
1906
1952
|
}) => {
|
|
1907
1953
|
const { theme } = uiFeedback.useUi();
|
|
1908
1954
|
const panelRef = React.useRef(null);
|
|
1955
|
+
const isFull = width === "full";
|
|
1956
|
+
const showHeaderBar = header !== void 0 || isFull;
|
|
1909
1957
|
React.useEffect(() => {
|
|
1910
1958
|
const node = panelRef.current;
|
|
1911
1959
|
if (node === null || typeof node.addEventListener !== "function") return void 0;
|
|
@@ -1919,27 +1967,39 @@ var MobileDrawer = ({
|
|
|
1919
1967
|
node.addEventListener("click", handleClick);
|
|
1920
1968
|
return () => node.removeEventListener("click", handleClick);
|
|
1921
1969
|
}, [onClose]);
|
|
1922
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1923
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1970
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles9.overlay, children: [
|
|
1971
|
+
isFull ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1924
1972
|
reactNative.Pressable,
|
|
1925
1973
|
{
|
|
1926
1974
|
accessibilityHint: labels.closeHint,
|
|
1927
1975
|
accessibilityLabel: labels.closeLabel,
|
|
1928
1976
|
accessibilityRole: "button",
|
|
1929
|
-
style:
|
|
1977
|
+
style: styles9.scrim,
|
|
1930
1978
|
testID: scrimTestID,
|
|
1931
1979
|
onPress: onClose
|
|
1932
1980
|
}
|
|
1933
1981
|
),
|
|
1934
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1982
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1935
1983
|
reactNative.View,
|
|
1936
1984
|
{
|
|
1937
1985
|
ref: panelRef,
|
|
1938
1986
|
"aria-modal": true,
|
|
1939
1987
|
role: "dialog",
|
|
1940
|
-
style: [
|
|
1988
|
+
style: [styles9.panel, isFull ? styles9.panelFull : null, { backgroundColor: theme.colors.surface }],
|
|
1941
1989
|
testID: drawerTestID,
|
|
1942
|
-
children:
|
|
1990
|
+
children: [
|
|
1991
|
+
showHeaderBar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1992
|
+
DrawerHeaderBar,
|
|
1993
|
+
{
|
|
1994
|
+
brand: header,
|
|
1995
|
+
closeHint: labels.closeHint,
|
|
1996
|
+
closeLabel: labels.closeLabel,
|
|
1997
|
+
testID: `${drawerTestID}-header`,
|
|
1998
|
+
onClose
|
|
1999
|
+
}
|
|
2000
|
+
) : null,
|
|
2001
|
+
/* @__PURE__ */ jsxRuntime.jsx(NavAccordionContext.Provider, { value: true, children: showHeaderBar ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles9.panelBody, children: renderTextSlot(sidebar, { color: theme.colors.text }) }) : renderTextSlot(sidebar, { color: theme.colors.text }) })
|
|
2002
|
+
]
|
|
1943
2003
|
}
|
|
1944
2004
|
)
|
|
1945
2005
|
] });
|
|
@@ -1955,7 +2015,7 @@ function useContentMaxWidth(width) {
|
|
|
1955
2015
|
return resolveContentMaxWidth(width, viewport);
|
|
1956
2016
|
}
|
|
1957
2017
|
var DEFAULT_CONTENT_PADDING = 24;
|
|
1958
|
-
var
|
|
2018
|
+
var styles10 = reactNative.StyleSheet.create({
|
|
1959
2019
|
root: { flex: 1 },
|
|
1960
2020
|
// Auth-pending spinner: an opaque absolute overlay over the mounted shell, so
|
|
1961
2021
|
// `children` (and any navigator they host) are never unmounted while the gate
|
|
@@ -2017,13 +2077,13 @@ var AppShell = ({
|
|
|
2017
2077
|
}, [isUnauthenticated, gate]);
|
|
2018
2078
|
const gatePending = gate?.pending === true;
|
|
2019
2079
|
if (isUnauthenticated) return null;
|
|
2020
|
-
const columnStyle = maxWidth === "full" ?
|
|
2021
|
-
const navInnerStyle = chromeAlignment === "content" && maxWidth !== "full" ? [
|
|
2080
|
+
const columnStyle = maxWidth === "full" ? styles10.columnFull : [styles10.columnCapped, { maxWidth }];
|
|
2081
|
+
const navInnerStyle = chromeAlignment === "content" && maxWidth !== "full" ? [styles10.chromeCapped, { maxWidth, paddingHorizontal: contentPadding }] : void 0;
|
|
2022
2082
|
const scroller = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2023
2083
|
reactNative.ScrollView,
|
|
2024
2084
|
{
|
|
2025
|
-
contentContainerStyle: [
|
|
2026
|
-
style:
|
|
2085
|
+
contentContainerStyle: [styles10.scrollContent, { padding: contentPadding }],
|
|
2086
|
+
style: styles10.scroll,
|
|
2027
2087
|
testID: `${testID}${APP_SHELL_SUFFIX.content}`,
|
|
2028
2088
|
children: [
|
|
2029
2089
|
look.band,
|
|
@@ -2031,7 +2091,7 @@ var AppShell = ({
|
|
|
2031
2091
|
]
|
|
2032
2092
|
}
|
|
2033
2093
|
);
|
|
2034
|
-
const headerRegion = useDrawer ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
2094
|
+
const headerRegion = useDrawer ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles10.headerRow, look.chrome], testID: `${testID}${APP_SHELL_SUFFIX.header}`, children: [
|
|
2035
2095
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2036
2096
|
MenuToggle,
|
|
2037
2097
|
{
|
|
@@ -2041,14 +2101,14 @@ var AppShell = ({
|
|
|
2041
2101
|
onOpen: openDrawer
|
|
2042
2102
|
}
|
|
2043
2103
|
),
|
|
2044
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2104
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles10.headerFill, children: renderTextSlot(header, { color: look.chromeText }) })
|
|
2045
2105
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: look.chrome, testID: `${testID}${APP_SHELL_SUFFIX.header}`, children: renderTextSlot(header, { color: look.chromeText }) });
|
|
2046
2106
|
const railRegion = railMode === "full" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID: `${testID}${APP_SHELL_SUFFIX.sidebar}`, children: renderTextSlot(sidebar, { color: theme.colors.text }) }) : railMode === "collapsed" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID: `${testID}${APP_SHELL_SUFFIX.collapsedSidebar}`, children: renderTextSlot(collapsedSidebar, { color: theme.colors.text }) }) : null;
|
|
2047
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
2107
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles10.root, look.root], testID, children: [
|
|
2048
2108
|
headerRegion,
|
|
2049
2109
|
nav !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: look.chrome, testID: `${testID}${APP_SHELL_SUFFIX.nav}`, children: navInnerStyle !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: navInnerStyle, children: renderTextSlot(nav, { color: look.chromeText }) }) : renderTextSlot(nav, { color: look.chromeText }) }) : null,
|
|
2050
2110
|
banner !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID: `${testID}${APP_SHELL_SUFFIX.banner}`, children: renderTextSlot(banner, { color: theme.colors.text }) }) : null,
|
|
2051
|
-
railRegion !== null ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
2111
|
+
railRegion !== null ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles10.bodyRow, children: [
|
|
2052
2112
|
railRegion,
|
|
2053
2113
|
scroller
|
|
2054
2114
|
] }) : scroller,
|
|
@@ -2057,15 +2117,17 @@ var AppShell = ({
|
|
|
2057
2117
|
{
|
|
2058
2118
|
drawerTestID: `${testID}${APP_SHELL_SUFFIX.drawer}`,
|
|
2059
2119
|
labels: drawerLabels,
|
|
2120
|
+
header: mobileMenu?.header,
|
|
2060
2121
|
scrimTestID: `${testID}${APP_SHELL_SUFFIX.scrim}`,
|
|
2061
|
-
sidebar,
|
|
2122
|
+
sidebar: mobileMenu?.sidebar ?? sidebar,
|
|
2123
|
+
width: mobileMenu?.width,
|
|
2062
2124
|
onClose: closeDrawer
|
|
2063
2125
|
}
|
|
2064
2126
|
) : null,
|
|
2065
2127
|
gatePending ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2066
2128
|
reactNative.View,
|
|
2067
2129
|
{
|
|
2068
|
-
style: [
|
|
2130
|
+
style: [styles10.pendingOverlay, { backgroundColor: theme.colors.background }],
|
|
2069
2131
|
testID: `${testID}${APP_SHELL_SUFFIX.pending}`,
|
|
2070
2132
|
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: primary, size: "large" })
|
|
2071
2133
|
}
|
|
@@ -2126,6 +2188,45 @@ var CollapsedRail = ({
|
|
|
2126
2188
|
}
|
|
2127
2189
|
);
|
|
2128
2190
|
};
|
|
2191
|
+
function renderShellSidebar({ sideRail, nav, width, showBrand }) {
|
|
2192
|
+
const brandSlot = sideRail.brand ?? sideRail.title;
|
|
2193
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2194
|
+
Sidebar,
|
|
2195
|
+
{
|
|
2196
|
+
collapseHint: sideRail.collapseHint,
|
|
2197
|
+
containerStyle: sideRail.containerStyle,
|
|
2198
|
+
enableInlineSearch: sideRail.enableInlineSearch,
|
|
2199
|
+
expandHint: sideRail.expandHint,
|
|
2200
|
+
footer: sideRail.footer,
|
|
2201
|
+
header: sideRail.header,
|
|
2202
|
+
items: sideRail.items,
|
|
2203
|
+
navigateHint: nav.navigateHint,
|
|
2204
|
+
paletteTrigger: sideRail.paletteTrigger,
|
|
2205
|
+
pathname: nav.pathname,
|
|
2206
|
+
regionLabel: nav.regionLabel,
|
|
2207
|
+
renderChevron: sideRail.renderChevron,
|
|
2208
|
+
search: sideRail.search,
|
|
2209
|
+
searchQuery: sideRail.searchQuery,
|
|
2210
|
+
title: showBrand ? brandSlot : null,
|
|
2211
|
+
width,
|
|
2212
|
+
onNavigate: nav.onNavigate,
|
|
2213
|
+
onSearchChange: sideRail.onSearchChange
|
|
2214
|
+
}
|
|
2215
|
+
);
|
|
2216
|
+
}
|
|
2217
|
+
var styles11 = reactNative.StyleSheet.create({
|
|
2218
|
+
row: { flexDirection: "row", alignItems: "center" },
|
|
2219
|
+
brand: { justifyContent: "center", paddingHorizontal: 12 },
|
|
2220
|
+
fill: { flex: 1 }
|
|
2221
|
+
});
|
|
2222
|
+
var TopbarBrandRow = ({ brand, brandWidth, testID, children }) => {
|
|
2223
|
+
const { width } = reactNative.useWindowDimensions();
|
|
2224
|
+
if (width < RAIL_FULL_BREAKPOINT) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
2225
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles11.row, testID, children: [
|
|
2226
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles11.brand, brandWidth !== void 0 ? { width: brandWidth } : null], testID: `${testID}-brand`, children: brand }),
|
|
2227
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.fill, children })
|
|
2228
|
+
] });
|
|
2229
|
+
};
|
|
2129
2230
|
function wantsTopBar(layout, hasHeader) {
|
|
2130
2231
|
return layout === "top" || layout === "both" || hasHeader;
|
|
2131
2232
|
}
|
|
@@ -2144,6 +2245,11 @@ var NavShell = ({
|
|
|
2144
2245
|
children,
|
|
2145
2246
|
collapsedSidebar: collapsedSidebarProp,
|
|
2146
2247
|
collapsedRailRange: collapsedRailRangeProp,
|
|
2248
|
+
brandPlacement = NAV_BRAND_DEFAULTS.brandPlacement,
|
|
2249
|
+
sidebarWidth = NAV_BRAND_DEFAULTS.sidebarWidth,
|
|
2250
|
+
drawerHeader = NAV_BRAND_DEFAULTS.drawerHeader,
|
|
2251
|
+
drawerWidth = NAV_BRAND_DEFAULTS.drawerWidth,
|
|
2252
|
+
mobileMenu,
|
|
2147
2253
|
...shellProps
|
|
2148
2254
|
}) => {
|
|
2149
2255
|
const showTopBar = wantsTopBar(layout, header !== void 0);
|
|
@@ -2169,28 +2275,13 @@ var NavShell = ({
|
|
|
2169
2275
|
onNavigate
|
|
2170
2276
|
}
|
|
2171
2277
|
) : null;
|
|
2172
|
-
const
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
footer: sideRail.footer,
|
|
2180
|
-
header: sideRail.header,
|
|
2181
|
-
items: sideRail.items,
|
|
2182
|
-
navigateHint,
|
|
2183
|
-
paletteTrigger: sideRail.paletteTrigger,
|
|
2184
|
-
pathname,
|
|
2185
|
-
regionLabel,
|
|
2186
|
-
renderChevron: sideRail.renderChevron,
|
|
2187
|
-
search: sideRail.search,
|
|
2188
|
-
searchQuery: sideRail.searchQuery,
|
|
2189
|
-
title: sideRail.brand ?? sideRail.title,
|
|
2190
|
-
onNavigate,
|
|
2191
|
-
onSearchChange: sideRail.onSearchChange
|
|
2192
|
-
}
|
|
2193
|
-
) : void 0;
|
|
2278
|
+
const nav = { pathname, onNavigate, regionLabel, navigateHint };
|
|
2279
|
+
const rail = showSideRail ? sideRail : void 0;
|
|
2280
|
+
const brandInBar = brandPlacement === "topbar" && rail?.brand !== void 0;
|
|
2281
|
+
const brandInDrawer = drawerHeader === "brand" ? rail?.brand : void 0;
|
|
2282
|
+
const sidebarNode = rail === void 0 ? void 0 : renderShellSidebar({ sideRail: rail, nav, width: sidebarWidth, showBrand: !brandInBar });
|
|
2283
|
+
const drawerSidebar = rail !== void 0 && brandInDrawer !== void 0 && !brandInBar ? renderShellSidebar({ sideRail: rail, nav, width: sidebarWidth, showBrand: false }) : void 0;
|
|
2284
|
+
const shellHeader = brandInBar ? /* @__PURE__ */ jsxRuntime.jsx(TopbarBrandRow, { brand: rail?.brand, brandWidth: SIDEBAR_WIDTH_PX[sidebarWidth], testID: `${shellProps.testID}-topbar-brand-row`, children: headerNode }) : headerNode;
|
|
2194
2285
|
const collapsedCfg = showSideRail ? sideRail?.collapsed : void 0;
|
|
2195
2286
|
const collapsedNode = collapsedCfg !== void 0 && sideRail !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2196
2287
|
CollapsedRail,
|
|
@@ -2211,7 +2302,8 @@ var NavShell = ({
|
|
|
2211
2302
|
...shellProps,
|
|
2212
2303
|
collapsedRailRange: collapsedRange,
|
|
2213
2304
|
collapsedSidebar: collapsedNode,
|
|
2214
|
-
header:
|
|
2305
|
+
header: shellHeader,
|
|
2306
|
+
mobileMenu: { ...mobileMenu, header: brandInDrawer, width: drawerWidth, sidebar: drawerSidebar },
|
|
2215
2307
|
sidebar: sidebarNode,
|
|
2216
2308
|
children
|
|
2217
2309
|
}
|
|
@@ -2434,7 +2526,7 @@ var KEY_DOWN = "ArrowDown";
|
|
|
2434
2526
|
var KEY_UP = "ArrowUp";
|
|
2435
2527
|
var KEY_ENTER = "Enter";
|
|
2436
2528
|
var KEY_ESCAPE = "Escape";
|
|
2437
|
-
var
|
|
2529
|
+
var styles12 = reactNative.StyleSheet.create({
|
|
2438
2530
|
overlay: { ...reactNative.StyleSheet.absoluteFillObject, zIndex: OVERLAY_Z_INDEX, alignItems: "center" },
|
|
2439
2531
|
scrim: { ...reactNative.StyleSheet.absoluteFillObject, backgroundColor: SCRIM_COLOR2 },
|
|
2440
2532
|
panel: {
|
|
@@ -2463,14 +2555,14 @@ var PaletteRow = ({ item, selected, onChoose }) => {
|
|
|
2463
2555
|
accessibilityLabel: item.label,
|
|
2464
2556
|
accessibilityRole: "button",
|
|
2465
2557
|
accessibilityState: { selected },
|
|
2466
|
-
style: [
|
|
2558
|
+
style: [styles12.row, selected ? { backgroundColor: colors.border } : void 0],
|
|
2467
2559
|
testID: item.testID ?? item.key,
|
|
2468
2560
|
onPress: () => onChoose(item),
|
|
2469
2561
|
children: [
|
|
2470
2562
|
typeof item.renderIcon === "function" ? item.renderIcon(colors.textSecondary, NAV_ICON_SIZE) : null,
|
|
2471
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
2472
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2473
|
-
item.hint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2563
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles12.rowText, children: [
|
|
2564
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.rowLabel, { color: colors.text }], children: item.label }),
|
|
2565
|
+
item.hint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.rowHint, { color: colors.textSecondary }], children: item.hint }) : null
|
|
2474
2566
|
] })
|
|
2475
2567
|
]
|
|
2476
2568
|
}
|
|
@@ -2510,14 +2602,14 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2510
2602
|
[results, selected, choose, onClose]
|
|
2511
2603
|
);
|
|
2512
2604
|
if (!open) return null;
|
|
2513
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
2605
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles12.overlay, children: [
|
|
2514
2606
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2515
2607
|
reactNative.Pressable,
|
|
2516
2608
|
{
|
|
2517
2609
|
accessibilityHint: labels.closeHint,
|
|
2518
2610
|
accessibilityLabel: labels.closeLabel,
|
|
2519
2611
|
accessibilityRole: "button",
|
|
2520
|
-
style:
|
|
2612
|
+
style: styles12.scrim,
|
|
2521
2613
|
testID: `${testID ?? "command-palette"}-scrim`,
|
|
2522
2614
|
onPress: onClose
|
|
2523
2615
|
}
|
|
@@ -2528,7 +2620,7 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2528
2620
|
"aria-modal": true,
|
|
2529
2621
|
"aria-label": labels.regionLabel,
|
|
2530
2622
|
role: "dialog",
|
|
2531
|
-
style: [
|
|
2623
|
+
style: [styles12.panel, { backgroundColor: colors.surface, borderColor: colors.border }],
|
|
2532
2624
|
testID: testID ?? "command-palette",
|
|
2533
2625
|
children: [
|
|
2534
2626
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2538,14 +2630,14 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2538
2630
|
accessibilityLabel: labels.placeholder,
|
|
2539
2631
|
placeholder: labels.placeholder,
|
|
2540
2632
|
placeholderTextColor: colors.textSecondary,
|
|
2541
|
-
style: [
|
|
2633
|
+
style: [styles12.input, { color: colors.text, borderBottomColor: colors.border }],
|
|
2542
2634
|
testID: `${testID ?? "command-palette"}-input`,
|
|
2543
2635
|
value: query,
|
|
2544
2636
|
onChangeText: setQuery,
|
|
2545
2637
|
onKeyPress
|
|
2546
2638
|
}
|
|
2547
2639
|
),
|
|
2548
|
-
results.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2640
|
+
results.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.empty, { color: colors.textSecondary }], children: labels.emptyText }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { keyboardShouldPersistTaps: "handled", style: styles12.list, children: results.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(PaletteRow, { item, selected: index === selected, onChoose: choose }, item.key)) })
|
|
2549
2641
|
]
|
|
2550
2642
|
}
|
|
2551
2643
|
)
|
|
@@ -2650,7 +2742,7 @@ var TAB_MIN_HEIGHT = 56;
|
|
|
2650
2742
|
var LABEL_SIZE = 12;
|
|
2651
2743
|
var LABEL_GAP = 2;
|
|
2652
2744
|
var TAB_PADDING = 4;
|
|
2653
|
-
var
|
|
2745
|
+
var styles13 = reactNative.StyleSheet.create({
|
|
2654
2746
|
tab: {
|
|
2655
2747
|
flex: 1,
|
|
2656
2748
|
minHeight: TAB_MIN_HEIGHT,
|
|
@@ -2687,31 +2779,31 @@ var BottomTab = ({
|
|
|
2687
2779
|
accessibilityLabel: item.label,
|
|
2688
2780
|
accessibilityRole: "link",
|
|
2689
2781
|
accessibilityState: { selected: isActive },
|
|
2690
|
-
style: [
|
|
2782
|
+
style: [styles13.tab, { opacity: feedback.opacity }],
|
|
2691
2783
|
testID: item.testID ?? item.key,
|
|
2692
2784
|
onPress: () => onPress(item.route),
|
|
2693
2785
|
onPressIn: () => setPressed(true),
|
|
2694
2786
|
onPressOut: () => setPressed(false),
|
|
2695
2787
|
...ariaCurrentProps3(isActive),
|
|
2696
2788
|
children: [
|
|
2697
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Animated.View, { style: [
|
|
2789
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Animated.View, { style: [styles13.iconWrap, { transform: [{ scale }] }], children: [
|
|
2698
2790
|
feedback.pillScale === null ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2699
2791
|
reactNative.View,
|
|
2700
2792
|
{
|
|
2701
2793
|
pointerEvents: "none",
|
|
2702
|
-
style: [
|
|
2794
|
+
style: [styles13.pill, { backgroundColor: colors.pill, transform: [{ scale: feedback.pillScale }] }, motion]
|
|
2703
2795
|
}
|
|
2704
2796
|
),
|
|
2705
2797
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [{ transform: feedback.iconTransform }, motion], children: item.renderIcon?.(color, ICON_SIZE) })
|
|
2706
2798
|
] }),
|
|
2707
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2799
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.label, { color }], children: item.label })
|
|
2708
2800
|
]
|
|
2709
2801
|
}
|
|
2710
2802
|
);
|
|
2711
2803
|
};
|
|
2712
2804
|
var DEFAULT_TEST_ID = "bottom-tab-bar";
|
|
2713
2805
|
var SLIDER_HEIGHT = 3;
|
|
2714
|
-
var
|
|
2806
|
+
var styles14 = reactNative.StyleSheet.create({
|
|
2715
2807
|
bar: { flexDirection: "row", borderTopWidth: reactNative.StyleSheet.hairlineWidth },
|
|
2716
2808
|
slider: { position: "absolute", top: 0, height: SLIDER_HEIGHT }
|
|
2717
2809
|
});
|
|
@@ -2738,14 +2830,14 @@ var BottomTabBar = ({
|
|
|
2738
2830
|
{
|
|
2739
2831
|
"aria-label": regionLabel,
|
|
2740
2832
|
role: "navigation",
|
|
2741
|
-
style: [
|
|
2833
|
+
style: [styles14.bar, { backgroundColor: theme.colors.surface, borderTopColor: theme.colors.border }, containerStyle],
|
|
2742
2834
|
testID,
|
|
2743
2835
|
children: [
|
|
2744
2836
|
bar === null ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2745
2837
|
reactNative.View,
|
|
2746
2838
|
{
|
|
2747
2839
|
pointerEvents: "none",
|
|
2748
|
-
style: [
|
|
2840
|
+
style: [styles14.slider, { left: bar.left, width: bar.width, backgroundColor: primary }, webTransition("left", barMs, reducedMotion)]
|
|
2749
2841
|
}
|
|
2750
2842
|
),
|
|
2751
2843
|
items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2782,6 +2874,7 @@ exports.DEFAULT_COLLAPSED_RAIL_MAX = DEFAULT_COLLAPSED_RAIL_MAX;
|
|
|
2782
2874
|
exports.DEFAULT_SEARCH_BREAKPOINT = DEFAULT_SEARCH_BREAKPOINT;
|
|
2783
2875
|
exports.DarkModeControl = DarkModeControl;
|
|
2784
2876
|
exports.HOVER_TINT_OPACITY = HOVER_TINT_OPACITY;
|
|
2877
|
+
exports.NAV_BRAND_DEFAULTS = NAV_BRAND_DEFAULTS;
|
|
2785
2878
|
exports.NAV_ICON_SIZE = NAV_ICON_SIZE;
|
|
2786
2879
|
exports.NAV_LINK_GAP = NAV_LINK_GAP;
|
|
2787
2880
|
exports.NAV_ROW_RADIUS = NAV_ROW_RADIUS;
|
|
@@ -2795,6 +2888,7 @@ exports.NavShell = NavShell;
|
|
|
2795
2888
|
exports.PillNav = PillNav;
|
|
2796
2889
|
exports.PillNavVariant = PillNavVariant;
|
|
2797
2890
|
exports.RAIL_FULL_BREAKPOINT = RAIL_FULL_BREAKPOINT;
|
|
2891
|
+
exports.SIDEBAR_WIDTH_PX = SIDEBAR_WIDTH_PX;
|
|
2798
2892
|
exports.Sidebar = Sidebar;
|
|
2799
2893
|
exports.SidebarChevron = SidebarChevron;
|
|
2800
2894
|
exports.SidebarSearch = SidebarSearch;
|