@dloizides/ui-nav 1.38.1 → 1.39.1
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 +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, ImageSourcePropType, StyleProp } from 'react-native';
|
|
3
3
|
import { UiTheme } from '@dloizides/ui-feedback';
|
|
4
4
|
import { DropdownVariant } from '@dloizides/ui-layout';
|
|
@@ -498,9 +498,10 @@ interface BrandMarkProps {
|
|
|
498
498
|
onNavigate: (route: string) => void;
|
|
499
499
|
size?: number;
|
|
500
500
|
iconOnly?: boolean;
|
|
501
|
+
mark?: ReactNode;
|
|
501
502
|
}
|
|
502
|
-
/** The app icon with its name, as a link to the app's home route. */
|
|
503
|
-
declare const BrandMark: ({ source, name, route, label, onNavigate, size, iconOnly, }: BrandMarkProps) => React.ReactElement;
|
|
503
|
+
/** The app icon (or a caller-drawn `mark` in the same box) with its name, as a link to the app's home route. */
|
|
504
|
+
declare const BrandMark: ({ source, name, route, label, onNavigate, size, iconOnly, mark, }: BrandMarkProps) => React.ReactElement;
|
|
504
505
|
|
|
505
506
|
/**
|
|
506
507
|
* `Nav` — ONE component that renders EITHER the horizontal top bar (`NavBar`) or the
|
|
@@ -1169,6 +1170,7 @@ declare const NAV_TEST_IDS: {
|
|
|
1169
1170
|
readonly topbarCenter: "topbar-center";
|
|
1170
1171
|
readonly brandHome: "nav-brand-home";
|
|
1171
1172
|
readonly brandMarkIcon: "nav-brand-mark-icon";
|
|
1173
|
+
readonly brandMarkSlot: "nav-brand-mark-slot";
|
|
1172
1174
|
readonly brandMarkName: "nav-brand-mark-name";
|
|
1173
1175
|
};
|
|
1174
1176
|
/** Suffixes appended to an `AppShell`'s required `testID` to name its regions. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, ImageSourcePropType, StyleProp } from 'react-native';
|
|
3
3
|
import { UiTheme } from '@dloizides/ui-feedback';
|
|
4
4
|
import { DropdownVariant } from '@dloizides/ui-layout';
|
|
@@ -498,9 +498,10 @@ interface BrandMarkProps {
|
|
|
498
498
|
onNavigate: (route: string) => void;
|
|
499
499
|
size?: number;
|
|
500
500
|
iconOnly?: boolean;
|
|
501
|
+
mark?: ReactNode;
|
|
501
502
|
}
|
|
502
|
-
/** The app icon with its name, as a link to the app's home route. */
|
|
503
|
-
declare const BrandMark: ({ source, name, route, label, onNavigate, size, iconOnly, }: BrandMarkProps) => React.ReactElement;
|
|
503
|
+
/** The app icon (or a caller-drawn `mark` in the same box) with its name, as a link to the app's home route. */
|
|
504
|
+
declare const BrandMark: ({ source, name, route, label, onNavigate, size, iconOnly, mark, }: BrandMarkProps) => React.ReactElement;
|
|
504
505
|
|
|
505
506
|
/**
|
|
506
507
|
* `Nav` — ONE component that renders EITHER the horizontal top bar (`NavBar`) or the
|
|
@@ -1169,6 +1170,7 @@ declare const NAV_TEST_IDS: {
|
|
|
1169
1170
|
readonly topbarCenter: "topbar-center";
|
|
1170
1171
|
readonly brandHome: "nav-brand-home";
|
|
1171
1172
|
readonly brandMarkIcon: "nav-brand-mark-icon";
|
|
1173
|
+
readonly brandMarkSlot: "nav-brand-mark-slot";
|
|
1172
1174
|
readonly brandMarkName: "nav-brand-mark-name";
|
|
1173
1175
|
};
|
|
1174
1176
|
/** Suffixes appended to an `AppShell`'s required `testID` to name its regions. */
|
package/dist/index.js
CHANGED
|
@@ -986,6 +986,7 @@ var NAV_TEST_IDS = {
|
|
|
986
986
|
topbarCenter: "topbar-center",
|
|
987
987
|
brandHome: "nav-brand-home",
|
|
988
988
|
brandMarkIcon: "nav-brand-mark-icon",
|
|
989
|
+
brandMarkSlot: "nav-brand-mark-slot",
|
|
989
990
|
brandMarkName: "nav-brand-mark-name"
|
|
990
991
|
};
|
|
991
992
|
var APP_SHELL_SUFFIX = {
|
|
@@ -1109,13 +1110,13 @@ var Topbar = ({
|
|
|
1109
1110
|
style: navStyles.accountNameBtn,
|
|
1110
1111
|
testID: richAccount.accountTestID ?? NAV_TEST_IDS.accountName,
|
|
1111
1112
|
onPress: richAccount.onAccount,
|
|
1112
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, {
|
|
1113
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [navStyles.userName, WRAP_ANYWHERE, { color: colors.text }], children: richAccount.displayName })
|
|
1113
1114
|
}
|
|
1114
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, {
|
|
1115
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [navStyles.userName, WRAP_ANYWHERE, { color: colors.text }], testID: NAV_TEST_IDS.accountName, children: richAccount.displayName }),
|
|
1115
1116
|
richAccount.tenantName !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1116
1117
|
reactNative.Text,
|
|
1117
1118
|
{
|
|
1118
|
-
style: [navStyles.accountTenant, { color: colors.textSecondary }],
|
|
1119
|
+
style: [navStyles.accountTenant, WRAP_ANYWHERE, { color: colors.textSecondary }],
|
|
1119
1120
|
testID: NAV_TEST_IDS.accountTenant,
|
|
1120
1121
|
children: richAccount.tenantName
|
|
1121
1122
|
}
|
|
@@ -1726,19 +1727,21 @@ var BrandMark = ({
|
|
|
1726
1727
|
label,
|
|
1727
1728
|
onNavigate,
|
|
1728
1729
|
size = DEFAULT_ICON_SIZE,
|
|
1729
|
-
iconOnly = false
|
|
1730
|
+
iconOnly = false,
|
|
1731
|
+
mark
|
|
1730
1732
|
}) => {
|
|
1731
1733
|
const { theme } = uiFeedback.useUi();
|
|
1734
|
+
const box = { height: size, width: size };
|
|
1732
1735
|
return /* @__PURE__ */ jsxRuntime.jsx(BrandHomeLink, { label, route, onNavigate, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles5.row, children: [
|
|
1733
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1736
|
+
mark === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1734
1737
|
reactNative.Image,
|
|
1735
1738
|
{
|
|
1736
1739
|
accessibilityElementsHidden: true,
|
|
1737
1740
|
source,
|
|
1738
|
-
style:
|
|
1741
|
+
style: box,
|
|
1739
1742
|
testID: NAV_TEST_IDS.brandMarkIcon
|
|
1740
1743
|
}
|
|
1741
|
-
),
|
|
1744
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityElementsHidden: true, style: box, testID: NAV_TEST_IDS.brandMarkSlot, children: mark }),
|
|
1742
1745
|
iconOnly ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1743
1746
|
reactNative.Text,
|
|
1744
1747
|
{
|