@dloizides/ui-nav 1.25.0 → 1.26.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 +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -226,7 +226,8 @@ var pillNavStyles = reactNative.StyleSheet.create({
|
|
|
226
226
|
justifyContent: "center"
|
|
227
227
|
},
|
|
228
228
|
pillText: { fontSize: 14, fontWeight: "600" },
|
|
229
|
-
menuTriggerText: { flexShrink: 1 }
|
|
229
|
+
menuTriggerText: { flexShrink: 1 },
|
|
230
|
+
pillOutline: { borderWidth: 2 }
|
|
230
231
|
});
|
|
231
232
|
var darkModeStyles = reactNative.StyleSheet.create({
|
|
232
233
|
// Segmented Light / Dark / System control.
|
|
@@ -1874,7 +1875,6 @@ function resolvePillMenuLabel(items, pathname, fallback) {
|
|
|
1874
1875
|
const active = items.find((item) => item.route === activeRoute);
|
|
1875
1876
|
return active?.label ?? fallback;
|
|
1876
1877
|
}
|
|
1877
|
-
var TEXT_ON_PRIMARY4 = "#ffffff";
|
|
1878
1878
|
var NO_ACTIVE_ROUTE2 = "";
|
|
1879
1879
|
var PILL_MENU_MIN_WIDTH = 200;
|
|
1880
1880
|
var PillNavMenu = ({
|
|
@@ -1888,7 +1888,7 @@ var PillNavMenu = ({
|
|
|
1888
1888
|
menuHeading
|
|
1889
1889
|
}) => {
|
|
1890
1890
|
const { theme } = uiFeedback.useUi();
|
|
1891
|
-
const
|
|
1891
|
+
const { colors } = theme;
|
|
1892
1892
|
const options = React.useMemo(() => items.map((item) => ({ label: item.label, value: item.route })), [items]);
|
|
1893
1893
|
const activeRoute = resolveActiveRoute(items, pathname) ?? NO_ACTIVE_ROUTE2;
|
|
1894
1894
|
const label = resolvePillMenuLabel(items, pathname, regionLabel);
|
|
@@ -1907,11 +1907,12 @@ var PillNavMenu = ({
|
|
|
1907
1907
|
options,
|
|
1908
1908
|
testID,
|
|
1909
1909
|
value: activeRoute,
|
|
1910
|
-
|
|
1910
|
+
selectedMarker: uiLayout.SelectedMarker.AccentCheck,
|
|
1911
|
+
variant: dropdownVariant ?? uiLayout.DropdownVariant.Menu,
|
|
1911
1912
|
onChange: onNavigate,
|
|
1912
|
-
renderTrigger: ({ isOpen }) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [pillNavStyles.pill, { backgroundColor:
|
|
1913
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [pillNavStyles.pillText, pillNavStyles.menuTriggerText, { color:
|
|
1914
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [pillNavStyles.pillText, { color:
|
|
1913
|
+
renderTrigger: ({ isOpen }) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [pillNavStyles.pill, pillNavStyles.pillOutline, { backgroundColor: colors.background, borderColor: colors.text }], children: [
|
|
1914
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [pillNavStyles.pillText, pillNavStyles.menuTriggerText, { color: colors.text }], children: label }),
|
|
1915
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [pillNavStyles.pillText, { color: colors.text }], children: isOpen ? "\u25B4" : "\u25BE" })
|
|
1915
1916
|
] })
|
|
1916
1917
|
}
|
|
1917
1918
|
);
|
|
@@ -1923,7 +1924,7 @@ var PillNavVariant = /* @__PURE__ */ ((PillNavVariant2) => {
|
|
|
1923
1924
|
PillNavVariant2["Menu"] = "menu";
|
|
1924
1925
|
return PillNavVariant2;
|
|
1925
1926
|
})(PillNavVariant || {});
|
|
1926
|
-
var
|
|
1927
|
+
var TEXT_ON_PRIMARY4 = "#ffffff";
|
|
1927
1928
|
var DEFAULT_MIN_ITEMS = 1;
|
|
1928
1929
|
var PillNav = ({
|
|
1929
1930
|
items,
|
|
@@ -1967,7 +1968,7 @@ var PillNav = ({
|
|
|
1967
1968
|
style: [pillNavStyles.container, containerStyle],
|
|
1968
1969
|
children: items.map((item) => {
|
|
1969
1970
|
const active = item.route === activeRoute;
|
|
1970
|
-
const textColor = active ?
|
|
1971
|
+
const textColor = active ? TEXT_ON_PRIMARY4 : colors.textSecondary;
|
|
1971
1972
|
const pillStyle = active ? { backgroundColor: primaryColor } : { backgroundColor: colors.surfaceElevated };
|
|
1972
1973
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1973
1974
|
FocusableTouchable,
|
|
@@ -1990,7 +1991,7 @@ var PillNav = ({
|
|
|
1990
1991
|
}
|
|
1991
1992
|
);
|
|
1992
1993
|
};
|
|
1993
|
-
var
|
|
1994
|
+
var TEXT_ON_PRIMARY5 = "#ffffff";
|
|
1994
1995
|
var DARK_MODE_ICON_SIZE = 16;
|
|
1995
1996
|
var DarkModeControl = ({
|
|
1996
1997
|
value,
|
|
@@ -2039,7 +2040,7 @@ var DarkModeControl = ({
|
|
|
2039
2040
|
style: [darkModeStyles.segmentRow, { borderColor: colors.border }, containerStyle],
|
|
2040
2041
|
children: options.map((option) => {
|
|
2041
2042
|
const active = option.value === value;
|
|
2042
|
-
const textColor = active ?
|
|
2043
|
+
const textColor = active ? TEXT_ON_PRIMARY5 : colors.textSecondary;
|
|
2043
2044
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2044
2045
|
FocusableTouchable,
|
|
2045
2046
|
{
|