@dloizides/ui-nav 1.38.0 → 1.39.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 +560 -556
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -980,6 +980,7 @@ var NAV_TEST_IDS = {
|
|
|
980
980
|
topbarCenter: "topbar-center",
|
|
981
981
|
brandHome: "nav-brand-home",
|
|
982
982
|
brandMarkIcon: "nav-brand-mark-icon",
|
|
983
|
+
brandMarkSlot: "nav-brand-mark-slot",
|
|
983
984
|
brandMarkName: "nav-brand-mark-name"
|
|
984
985
|
};
|
|
985
986
|
var APP_SHELL_SUFFIX = {
|
|
@@ -1720,19 +1721,21 @@ var BrandMark = ({
|
|
|
1720
1721
|
label,
|
|
1721
1722
|
onNavigate,
|
|
1722
1723
|
size = DEFAULT_ICON_SIZE,
|
|
1723
|
-
iconOnly = false
|
|
1724
|
+
iconOnly = false,
|
|
1725
|
+
mark
|
|
1724
1726
|
}) => {
|
|
1725
1727
|
const { theme } = useUi();
|
|
1728
|
+
const box = { height: size, width: size };
|
|
1726
1729
|
return /* @__PURE__ */ jsx(BrandHomeLink, { label, route, onNavigate, children: /* @__PURE__ */ jsxs(View, { style: styles5.row, children: [
|
|
1727
|
-
/* @__PURE__ */ jsx(
|
|
1730
|
+
mark === void 0 ? /* @__PURE__ */ jsx(
|
|
1728
1731
|
Image,
|
|
1729
1732
|
{
|
|
1730
1733
|
accessibilityElementsHidden: true,
|
|
1731
1734
|
source,
|
|
1732
|
-
style:
|
|
1735
|
+
style: box,
|
|
1733
1736
|
testID: NAV_TEST_IDS.brandMarkIcon
|
|
1734
1737
|
}
|
|
1735
|
-
),
|
|
1738
|
+
) : /* @__PURE__ */ jsx(View, { accessibilityElementsHidden: true, style: box, testID: NAV_TEST_IDS.brandMarkSlot, children: mark }),
|
|
1736
1739
|
iconOnly ? null : /* @__PURE__ */ jsx(
|
|
1737
1740
|
Text,
|
|
1738
1741
|
{
|
|
@@ -1908,7 +1911,7 @@ var styles9 = StyleSheet.create({
|
|
|
1908
1911
|
// so on react-native-web it — and the nav leaves inside it — sit above the scrim
|
|
1909
1912
|
// and receive presses instead of the scrim swallowing them.
|
|
1910
1913
|
panel: { position: "absolute", top: 0, bottom: 0, left: 0, width: DRAWER_WIDTH, zIndex: PANEL_Z_INDEX },
|
|
1911
|
-
|
|
1914
|
+
windowFill: { right: void 0, bottom: void 0 },
|
|
1912
1915
|
panelBody: { flex: 1 },
|
|
1913
1916
|
menuToggle: {
|
|
1914
1917
|
minWidth: MIN_TOUCH_TARGET,
|
|
@@ -1946,6 +1949,8 @@ var MobileDrawer = ({
|
|
|
1946
1949
|
const { theme } = useUi();
|
|
1947
1950
|
const panelRef = useRef(null);
|
|
1948
1951
|
const isFull = width === "full";
|
|
1952
|
+
const viewport = useWindowDimensions();
|
|
1953
|
+
const windowSize = isFull ? [styles9.windowFill, { width: viewport.width, height: viewport.height }] : null;
|
|
1949
1954
|
const showHeaderBar = header !== void 0 || isFull;
|
|
1950
1955
|
useEffect(() => {
|
|
1951
1956
|
const node = panelRef.current;
|
|
@@ -1960,7 +1965,7 @@ var MobileDrawer = ({
|
|
|
1960
1965
|
node.addEventListener("click", handleClick);
|
|
1961
1966
|
return () => node.removeEventListener("click", handleClick);
|
|
1962
1967
|
}, [onClose]);
|
|
1963
|
-
return /* @__PURE__ */ jsxs(View, { style: styles9.overlay, children: [
|
|
1968
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles9.overlay, windowSize], children: [
|
|
1964
1969
|
isFull ? null : /* @__PURE__ */ jsx(
|
|
1965
1970
|
Pressable,
|
|
1966
1971
|
{
|
|
@@ -1978,7 +1983,7 @@ var MobileDrawer = ({
|
|
|
1978
1983
|
ref: panelRef,
|
|
1979
1984
|
"aria-modal": true,
|
|
1980
1985
|
role: "dialog",
|
|
1981
|
-
style: [styles9.panel,
|
|
1986
|
+
style: [styles9.panel, windowSize, { backgroundColor: theme.colors.surface }],
|
|
1982
1987
|
testID: drawerTestID,
|
|
1983
1988
|
children: [
|
|
1984
1989
|
showHeaderBar ? /* @__PURE__ */ jsx(
|