@dloizides/ui-nav 1.25.0 → 1.26.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.26.1
4
+
5
+ - KEFI-LAUNCH-1 "Do every open Kefi task before the public launch": the `Topbar` left slot no longer wraps beside a long account name at 360 px. The left slot keeps its width (`flexShrink: 0`) and the account name truncates to one line.
6
+
3
7
  ## 1.25.0
4
8
 
5
9
  - `PillNav` / `PillNavMenu` get an optional `menuHeading`: a visible, non-focusable heading at the top of the open `Menu` that also names it (needs `@dloizides/ui-layout` >= 1.30.0) (KEFI-EDITOR-HEADER-1 "Compact the landing editor header").
package/dist/index.d.mts CHANGED
@@ -1356,7 +1356,8 @@ declare const navStyles: {
1356
1356
  justifyContent: "space-between";
1357
1357
  };
1358
1358
  topbarLeft: {
1359
- flex: number;
1359
+ flexGrow: number;
1360
+ flexShrink: number;
1360
1361
  };
1361
1362
  topbarCenter: {
1362
1363
  flexShrink: number;
@@ -1368,6 +1369,8 @@ declare const navStyles: {
1368
1369
  topbarRight: {
1369
1370
  flexDirection: "row";
1370
1371
  alignItems: "center";
1372
+ flexShrink: number;
1373
+ minWidth: number;
1371
1374
  };
1372
1375
  topbarRowItem: {
1373
1376
  marginHorizontal: number;
@@ -1382,11 +1385,16 @@ declare const navStyles: {
1382
1385
  userBlock: {
1383
1386
  marginHorizontal: number;
1384
1387
  alignItems: "flex-end";
1388
+ flexShrink: number;
1389
+ minWidth: number;
1385
1390
  };
1386
1391
  userName: {
1387
1392
  fontWeight: "600";
1393
+ maxWidth: "100%";
1388
1394
  };
1389
1395
  accountNameBtn: {
1396
+ flexShrink: number;
1397
+ maxWidth: "100%";
1390
1398
  minHeight: number;
1391
1399
  minWidth: number;
1392
1400
  justifyContent: "center";
@@ -1448,6 +1456,9 @@ declare const pillNavStyles: {
1448
1456
  menuTriggerText: {
1449
1457
  flexShrink: number;
1450
1458
  };
1459
+ pillOutline: {
1460
+ borderWidth: number;
1461
+ };
1451
1462
  };
1452
1463
  declare const darkModeStyles: {
1453
1464
  segmentRow: {
package/dist/index.d.ts CHANGED
@@ -1356,7 +1356,8 @@ declare const navStyles: {
1356
1356
  justifyContent: "space-between";
1357
1357
  };
1358
1358
  topbarLeft: {
1359
- flex: number;
1359
+ flexGrow: number;
1360
+ flexShrink: number;
1360
1361
  };
1361
1362
  topbarCenter: {
1362
1363
  flexShrink: number;
@@ -1368,6 +1369,8 @@ declare const navStyles: {
1368
1369
  topbarRight: {
1369
1370
  flexDirection: "row";
1370
1371
  alignItems: "center";
1372
+ flexShrink: number;
1373
+ minWidth: number;
1371
1374
  };
1372
1375
  topbarRowItem: {
1373
1376
  marginHorizontal: number;
@@ -1382,11 +1385,16 @@ declare const navStyles: {
1382
1385
  userBlock: {
1383
1386
  marginHorizontal: number;
1384
1387
  alignItems: "flex-end";
1388
+ flexShrink: number;
1389
+ minWidth: number;
1385
1390
  };
1386
1391
  userName: {
1387
1392
  fontWeight: "600";
1393
+ maxWidth: "100%";
1388
1394
  };
1389
1395
  accountNameBtn: {
1396
+ flexShrink: number;
1397
+ maxWidth: "100%";
1390
1398
  minHeight: number;
1391
1399
  minWidth: number;
1392
1400
  justifyContent: "center";
@@ -1448,6 +1456,9 @@ declare const pillNavStyles: {
1448
1456
  menuTriggerText: {
1449
1457
  flexShrink: number;
1450
1458
  };
1459
+ pillOutline: {
1460
+ borderWidth: number;
1461
+ };
1451
1462
  };
1452
1463
  declare const darkModeStyles: {
1453
1464
  segmentRow: {
package/dist/index.js CHANGED
@@ -70,9 +70,9 @@ var navStyles = reactNative.StyleSheet.create({
70
70
  alignItems: "center",
71
71
  justifyContent: "space-between"
72
72
  },
73
- topbarLeft: { flex: 1 },
73
+ topbarLeft: { flexGrow: 1, flexShrink: 0 },
74
74
  topbarCenter: { flexShrink: 1, minWidth: 0, flexDirection: "row", alignItems: "center", marginHorizontal: 8 },
75
- topbarRight: { flexDirection: "row", alignItems: "center" },
75
+ topbarRight: { flexDirection: "row", alignItems: "center", flexShrink: 1, minWidth: 0 },
76
76
  topbarRowItem: {
77
77
  marginHorizontal: 8,
78
78
  alignItems: "center",
@@ -81,14 +81,9 @@ var navStyles = reactNative.StyleSheet.create({
81
81
  minWidth: MIN_TOUCH_TARGET
82
82
  },
83
83
  topbarLabel: { fontSize: 14 },
84
- userBlock: { marginHorizontal: 12, alignItems: "flex-end" },
85
- userName: { fontWeight: "600" },
86
- accountNameBtn: {
87
- minHeight: MIN_TOUCH_TARGET,
88
- minWidth: MIN_TOUCH_TARGET,
89
- justifyContent: "center",
90
- alignItems: "flex-end"
91
- },
84
+ userBlock: { marginHorizontal: 12, alignItems: "flex-end", flexShrink: 1, minWidth: 0 },
85
+ userName: { fontWeight: "600", maxWidth: "100%" },
86
+ accountNameBtn: { flexShrink: 1, maxWidth: "100%", minHeight: MIN_TOUCH_TARGET, minWidth: MIN_TOUCH_TARGET, justifyContent: "center", alignItems: "flex-end" },
92
87
  userEmail: { fontSize: 12 },
93
88
  accountBtn: {
94
89
  marginLeft: 8,
@@ -226,7 +221,8 @@ var pillNavStyles = reactNative.StyleSheet.create({
226
221
  justifyContent: "center"
227
222
  },
228
223
  pillText: { fontSize: 14, fontWeight: "600" },
229
- menuTriggerText: { flexShrink: 1 }
224
+ menuTriggerText: { flexShrink: 1 },
225
+ pillOutline: { borderWidth: 2 }
230
226
  });
231
227
  var darkModeStyles = reactNative.StyleSheet.create({
232
228
  // Segmented Light / Dark / System control.
@@ -1000,9 +996,9 @@ var Topbar = ({
1000
996
  style: navStyles.accountNameBtn,
1001
997
  testID: richAccount.accountTestID ?? NAV_TEST_IDS.accountName,
1002
998
  onPress: richAccount.onAccount,
1003
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [navStyles.userName, { color: colors.text }], children: richAccount.displayName })
999
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [navStyles.userName, { color: colors.text }], children: richAccount.displayName })
1004
1000
  }
1005
- ) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [navStyles.userName, { color: colors.text }], testID: NAV_TEST_IDS.accountName, children: richAccount.displayName }),
1001
+ ) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [navStyles.userName, { color: colors.text }], testID: NAV_TEST_IDS.accountName, children: richAccount.displayName }),
1006
1002
  richAccount.tenantName !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1007
1003
  reactNative.Text,
1008
1004
  {
@@ -1874,7 +1870,6 @@ function resolvePillMenuLabel(items, pathname, fallback) {
1874
1870
  const active = items.find((item) => item.route === activeRoute);
1875
1871
  return active?.label ?? fallback;
1876
1872
  }
1877
- var TEXT_ON_PRIMARY4 = "#ffffff";
1878
1873
  var NO_ACTIVE_ROUTE2 = "";
1879
1874
  var PILL_MENU_MIN_WIDTH = 200;
1880
1875
  var PillNavMenu = ({
@@ -1888,7 +1883,7 @@ var PillNavMenu = ({
1888
1883
  menuHeading
1889
1884
  }) => {
1890
1885
  const { theme } = uiFeedback.useUi();
1891
- const primaryColor = theme.palette.primary["500"];
1886
+ const { colors } = theme;
1892
1887
  const options = React.useMemo(() => items.map((item) => ({ label: item.label, value: item.route })), [items]);
1893
1888
  const activeRoute = resolveActiveRoute(items, pathname) ?? NO_ACTIVE_ROUTE2;
1894
1889
  const label = resolvePillMenuLabel(items, pathname, regionLabel);
@@ -1907,11 +1902,12 @@ var PillNavMenu = ({
1907
1902
  options,
1908
1903
  testID,
1909
1904
  value: activeRoute,
1910
- variant: dropdownVariant,
1905
+ selectedMarker: uiLayout.SelectedMarker.AccentCheck,
1906
+ variant: dropdownVariant ?? uiLayout.DropdownVariant.Menu,
1911
1907
  onChange: onNavigate,
1912
- renderTrigger: ({ isOpen }) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [pillNavStyles.pill, { backgroundColor: primaryColor }], children: [
1913
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [pillNavStyles.pillText, pillNavStyles.menuTriggerText, { color: TEXT_ON_PRIMARY4 }], children: label }),
1914
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [pillNavStyles.pillText, { color: TEXT_ON_PRIMARY4 }], children: isOpen ? "\u25B4" : "\u25BE" })
1908
+ renderTrigger: ({ isOpen }) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [pillNavStyles.pill, pillNavStyles.pillOutline, { backgroundColor: colors.background, borderColor: colors.text }], children: [
1909
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [pillNavStyles.pillText, pillNavStyles.menuTriggerText, { color: colors.text }], children: label }),
1910
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [pillNavStyles.pillText, { color: colors.text }], children: isOpen ? "\u25B4" : "\u25BE" })
1915
1911
  ] })
1916
1912
  }
1917
1913
  );
@@ -1923,7 +1919,7 @@ var PillNavVariant = /* @__PURE__ */ ((PillNavVariant2) => {
1923
1919
  PillNavVariant2["Menu"] = "menu";
1924
1920
  return PillNavVariant2;
1925
1921
  })(PillNavVariant || {});
1926
- var TEXT_ON_PRIMARY5 = "#ffffff";
1922
+ var TEXT_ON_PRIMARY4 = "#ffffff";
1927
1923
  var DEFAULT_MIN_ITEMS = 1;
1928
1924
  var PillNav = ({
1929
1925
  items,
@@ -1967,7 +1963,7 @@ var PillNav = ({
1967
1963
  style: [pillNavStyles.container, containerStyle],
1968
1964
  children: items.map((item) => {
1969
1965
  const active = item.route === activeRoute;
1970
- const textColor = active ? TEXT_ON_PRIMARY5 : colors.textSecondary;
1966
+ const textColor = active ? TEXT_ON_PRIMARY4 : colors.textSecondary;
1971
1967
  const pillStyle = active ? { backgroundColor: primaryColor } : { backgroundColor: colors.surfaceElevated };
1972
1968
  return /* @__PURE__ */ jsxRuntime.jsxs(
1973
1969
  FocusableTouchable,
@@ -1990,7 +1986,7 @@ var PillNav = ({
1990
1986
  }
1991
1987
  );
1992
1988
  };
1993
- var TEXT_ON_PRIMARY6 = "#ffffff";
1989
+ var TEXT_ON_PRIMARY5 = "#ffffff";
1994
1990
  var DARK_MODE_ICON_SIZE = 16;
1995
1991
  var DarkModeControl = ({
1996
1992
  value,
@@ -2039,7 +2035,7 @@ var DarkModeControl = ({
2039
2035
  style: [darkModeStyles.segmentRow, { borderColor: colors.border }, containerStyle],
2040
2036
  children: options.map((option) => {
2041
2037
  const active = option.value === value;
2042
- const textColor = active ? TEXT_ON_PRIMARY6 : colors.textSecondary;
2038
+ const textColor = active ? TEXT_ON_PRIMARY5 : colors.textSecondary;
2043
2039
  return /* @__PURE__ */ jsxRuntime.jsxs(
2044
2040
  FocusableTouchable,
2045
2041
  {