@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.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { StyleSheet, Platform, Pressable, Text, View, TextInput, useWindowDimens
|
|
|
3
3
|
import { useUi, UiProvider } from '@dloizides/ui-feedback';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { Collapse } from '@dloizides/ui-motion';
|
|
6
|
-
import { LAYOUT_COLLAPSE_BREAKPOINT, ModalDropdown } from '@dloizides/ui-layout';
|
|
6
|
+
import { LAYOUT_COLLAPSE_BREAKPOINT, ModalDropdown, DropdownVariant, SelectedMarker } from '@dloizides/ui-layout';
|
|
7
7
|
import { Z_INDEX } from '@dloizides/design-tokens';
|
|
8
8
|
import { resolveAccessibleRoutes } from '@dloizides/auth-web';
|
|
9
9
|
|
|
@@ -220,7 +220,8 @@ var pillNavStyles = StyleSheet.create({
|
|
|
220
220
|
justifyContent: "center"
|
|
221
221
|
},
|
|
222
222
|
pillText: { fontSize: 14, fontWeight: "600" },
|
|
223
|
-
menuTriggerText: { flexShrink: 1 }
|
|
223
|
+
menuTriggerText: { flexShrink: 1 },
|
|
224
|
+
pillOutline: { borderWidth: 2 }
|
|
224
225
|
});
|
|
225
226
|
var darkModeStyles = StyleSheet.create({
|
|
226
227
|
// Segmented Light / Dark / System control.
|
|
@@ -1868,7 +1869,6 @@ function resolvePillMenuLabel(items, pathname, fallback) {
|
|
|
1868
1869
|
const active = items.find((item) => item.route === activeRoute);
|
|
1869
1870
|
return active?.label ?? fallback;
|
|
1870
1871
|
}
|
|
1871
|
-
var TEXT_ON_PRIMARY4 = "#ffffff";
|
|
1872
1872
|
var NO_ACTIVE_ROUTE2 = "";
|
|
1873
1873
|
var PILL_MENU_MIN_WIDTH = 200;
|
|
1874
1874
|
var PillNavMenu = ({
|
|
@@ -1882,7 +1882,7 @@ var PillNavMenu = ({
|
|
|
1882
1882
|
menuHeading
|
|
1883
1883
|
}) => {
|
|
1884
1884
|
const { theme } = useUi();
|
|
1885
|
-
const
|
|
1885
|
+
const { colors } = theme;
|
|
1886
1886
|
const options = useMemo(() => items.map((item) => ({ label: item.label, value: item.route })), [items]);
|
|
1887
1887
|
const activeRoute = resolveActiveRoute(items, pathname) ?? NO_ACTIVE_ROUTE2;
|
|
1888
1888
|
const label = resolvePillMenuLabel(items, pathname, regionLabel);
|
|
@@ -1901,11 +1901,12 @@ var PillNavMenu = ({
|
|
|
1901
1901
|
options,
|
|
1902
1902
|
testID,
|
|
1903
1903
|
value: activeRoute,
|
|
1904
|
-
|
|
1904
|
+
selectedMarker: SelectedMarker.AccentCheck,
|
|
1905
|
+
variant: dropdownVariant ?? DropdownVariant.Menu,
|
|
1905
1906
|
onChange: onNavigate,
|
|
1906
|
-
renderTrigger: ({ isOpen }) => /* @__PURE__ */ jsxs(View, { style: [pillNavStyles.pill, { backgroundColor:
|
|
1907
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [pillNavStyles.pillText, pillNavStyles.menuTriggerText, { color:
|
|
1908
|
-
/* @__PURE__ */ jsx(Text, { style: [pillNavStyles.pillText, { color:
|
|
1907
|
+
renderTrigger: ({ isOpen }) => /* @__PURE__ */ jsxs(View, { style: [pillNavStyles.pill, pillNavStyles.pillOutline, { backgroundColor: colors.background, borderColor: colors.text }], children: [
|
|
1908
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [pillNavStyles.pillText, pillNavStyles.menuTriggerText, { color: colors.text }], children: label }),
|
|
1909
|
+
/* @__PURE__ */ jsx(Text, { style: [pillNavStyles.pillText, { color: colors.text }], children: isOpen ? "\u25B4" : "\u25BE" })
|
|
1909
1910
|
] })
|
|
1910
1911
|
}
|
|
1911
1912
|
);
|
|
@@ -1917,7 +1918,7 @@ var PillNavVariant = /* @__PURE__ */ ((PillNavVariant2) => {
|
|
|
1917
1918
|
PillNavVariant2["Menu"] = "menu";
|
|
1918
1919
|
return PillNavVariant2;
|
|
1919
1920
|
})(PillNavVariant || {});
|
|
1920
|
-
var
|
|
1921
|
+
var TEXT_ON_PRIMARY4 = "#ffffff";
|
|
1921
1922
|
var DEFAULT_MIN_ITEMS = 1;
|
|
1922
1923
|
var PillNav = ({
|
|
1923
1924
|
items,
|
|
@@ -1961,7 +1962,7 @@ var PillNav = ({
|
|
|
1961
1962
|
style: [pillNavStyles.container, containerStyle],
|
|
1962
1963
|
children: items.map((item) => {
|
|
1963
1964
|
const active = item.route === activeRoute;
|
|
1964
|
-
const textColor = active ?
|
|
1965
|
+
const textColor = active ? TEXT_ON_PRIMARY4 : colors.textSecondary;
|
|
1965
1966
|
const pillStyle = active ? { backgroundColor: primaryColor } : { backgroundColor: colors.surfaceElevated };
|
|
1966
1967
|
return /* @__PURE__ */ jsxs(
|
|
1967
1968
|
FocusableTouchable,
|
|
@@ -1984,7 +1985,7 @@ var PillNav = ({
|
|
|
1984
1985
|
}
|
|
1985
1986
|
);
|
|
1986
1987
|
};
|
|
1987
|
-
var
|
|
1988
|
+
var TEXT_ON_PRIMARY5 = "#ffffff";
|
|
1988
1989
|
var DARK_MODE_ICON_SIZE = 16;
|
|
1989
1990
|
var DarkModeControl = ({
|
|
1990
1991
|
value,
|
|
@@ -2033,7 +2034,7 @@ var DarkModeControl = ({
|
|
|
2033
2034
|
style: [darkModeStyles.segmentRow, { borderColor: colors.border }, containerStyle],
|
|
2034
2035
|
children: options.map((option) => {
|
|
2035
2036
|
const active = option.value === value;
|
|
2036
|
-
const textColor = active ?
|
|
2037
|
+
const textColor = active ? TEXT_ON_PRIMARY5 : colors.textSecondary;
|
|
2037
2038
|
return /* @__PURE__ */ jsxs(
|
|
2038
2039
|
FocusableTouchable,
|
|
2039
2040
|
{
|