@dloizides/ui-nav 1.10.1 → 1.10.2
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 +22 -0
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -998,6 +998,9 @@ var MENU_MIN_TARGET = 44;
|
|
|
998
998
|
var MENU_GLYPH_FONT_SIZE = 20;
|
|
999
999
|
var MENU_TOGGLE_PADDING = 12;
|
|
1000
1000
|
var DRAWER_Z_INDEX = 50;
|
|
1001
|
+
var DRAWER_WIDTH = 280;
|
|
1002
|
+
var SCRIM_Z_INDEX = 1;
|
|
1003
|
+
var PANEL_Z_INDEX = 2;
|
|
1001
1004
|
var NAV_ACTIVATABLE_SELECTOR = 'a, [role="button"], [role="link"]';
|
|
1002
1005
|
var DEFAULT_DRAWER_LABELS = {
|
|
1003
1006
|
openLabel: "Menu",
|
|
@@ -1007,8 +1010,22 @@ var DEFAULT_DRAWER_LABELS = {
|
|
|
1007
1010
|
};
|
|
1008
1011
|
var styles2 = StyleSheet.create({
|
|
1009
1012
|
overlay: { ...StyleSheet.absoluteFillObject, zIndex: DRAWER_Z_INDEX },
|
|
1010
|
-
scrim
|
|
1011
|
-
|
|
1013
|
+
// The scrim's tap-to-close hit area is anchored to the RIGHT of the panel
|
|
1014
|
+
// (`left: DRAWER_WIDTH`), so it NEVER overlaps the panel: nav-item taps always
|
|
1015
|
+
// reach the Sidebar's TouchableOpacity, while taps beside the drawer still close.
|
|
1016
|
+
scrim: {
|
|
1017
|
+
position: "absolute",
|
|
1018
|
+
top: 0,
|
|
1019
|
+
bottom: 0,
|
|
1020
|
+
left: DRAWER_WIDTH,
|
|
1021
|
+
right: 0,
|
|
1022
|
+
backgroundColor: SCRIM_COLOR,
|
|
1023
|
+
zIndex: SCRIM_Z_INDEX
|
|
1024
|
+
},
|
|
1025
|
+
// The panel gets an explicit width (a real drawer) AND a zIndex above the scrim,
|
|
1026
|
+
// so on react-native-web it — and the nav leaves inside it — sit above the scrim
|
|
1027
|
+
// and receive presses instead of the scrim swallowing them.
|
|
1028
|
+
panel: { position: "absolute", top: 0, bottom: 0, left: 0, width: DRAWER_WIDTH, zIndex: PANEL_Z_INDEX },
|
|
1012
1029
|
menuToggle: {
|
|
1013
1030
|
minWidth: MENU_MIN_TARGET,
|
|
1014
1031
|
minHeight: MENU_MIN_TARGET,
|
|
@@ -1065,7 +1082,17 @@ var MobileDrawer = ({
|
|
|
1065
1082
|
onPress: onClose
|
|
1066
1083
|
}
|
|
1067
1084
|
),
|
|
1068
|
-
/* @__PURE__ */ jsx(
|
|
1085
|
+
/* @__PURE__ */ jsx(
|
|
1086
|
+
View,
|
|
1087
|
+
{
|
|
1088
|
+
ref: panelRef,
|
|
1089
|
+
"aria-modal": true,
|
|
1090
|
+
role: "dialog",
|
|
1091
|
+
style: [styles2.panel, { backgroundColor: theme.colors.surface }],
|
|
1092
|
+
testID: drawerTestID,
|
|
1093
|
+
children: renderTextSlot(sidebar, { color: theme.colors.text })
|
|
1094
|
+
}
|
|
1095
|
+
)
|
|
1069
1096
|
] });
|
|
1070
1097
|
};
|
|
1071
1098
|
|