@dloizides/ui-nav 1.27.0 → 1.29.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 +4 -0
- package/dist/index.d.mts +28 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +127 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +127 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -877,7 +877,8 @@ var NAV_TEST_IDS = {
|
|
|
877
877
|
/** the compact "Current ▾" trigger of `PillNav` with `variant={PillNavVariant.Menu}`. */
|
|
878
878
|
pillNavMenu: "pill-nav-menu",
|
|
879
879
|
/** the optional middle slot of `Topbar` (rendered only when `center` is passed). */
|
|
880
|
-
topbarCenter: "topbar-center"
|
|
880
|
+
topbarCenter: "topbar-center",
|
|
881
|
+
brandHome: "nav-brand-home"
|
|
881
882
|
};
|
|
882
883
|
var APP_SHELL_SUFFIX = {
|
|
883
884
|
content: "-content",
|
|
@@ -897,7 +898,8 @@ var APP_SHELL_SUFFIX = {
|
|
|
897
898
|
pending: "-pending",
|
|
898
899
|
loading: "-loading",
|
|
899
900
|
error: "-error",
|
|
900
|
-
forbidden: "-forbidden"
|
|
901
|
+
forbidden: "-forbidden",
|
|
902
|
+
band: "-backdrop-band"
|
|
901
903
|
};
|
|
902
904
|
var FocusableTouchable = ({
|
|
903
905
|
onPress,
|
|
@@ -1383,6 +1385,7 @@ var NavBarInner = ({
|
|
|
1383
1385
|
() => contentMaxWidth === void 0 ? null : { maxWidth: contentMaxWidth, width: "100%", alignSelf: "center" },
|
|
1384
1386
|
[contentMaxWidth]
|
|
1385
1387
|
);
|
|
1388
|
+
useEffect(() => setOpen(false), [pathname]);
|
|
1386
1389
|
const toggleMenu = useCallback(() => setOpen((v) => !v), []);
|
|
1387
1390
|
const handlePress = useCallback(
|
|
1388
1391
|
(route) => {
|
|
@@ -1530,19 +1533,92 @@ var NavBar = ({ barTheme, ...props }) => {
|
|
|
1530
1533
|
if (barTheme === void 0) return /* @__PURE__ */ jsx(NavBarInner, { ...props });
|
|
1531
1534
|
return /* @__PURE__ */ jsx(UiProvider, { navigate, t, theme: barTheme, children: /* @__PURE__ */ jsx(NavBarInner, { ...props }) });
|
|
1532
1535
|
};
|
|
1536
|
+
var styles3 = StyleSheet.create({
|
|
1537
|
+
hitBox: { minHeight: MIN_TOUCH_TARGET, minWidth: MIN_TOUCH_TARGET, justifyContent: "center" }
|
|
1538
|
+
});
|
|
1539
|
+
function anchorProps(route) {
|
|
1540
|
+
return { href: route };
|
|
1541
|
+
}
|
|
1542
|
+
function hasNewTabModifier(event) {
|
|
1543
|
+
const { ctrlKey, metaKey, shiftKey } = event.nativeEvent;
|
|
1544
|
+
return ctrlKey === true || metaKey === true || shiftKey === true;
|
|
1545
|
+
}
|
|
1546
|
+
var BrandHomeLink = ({ route, label, onNavigate, children }) => {
|
|
1547
|
+
const { theme } = useUi();
|
|
1548
|
+
const [focused, setFocused] = useState(false);
|
|
1549
|
+
const handlePress = (event) => {
|
|
1550
|
+
if (hasNewTabModifier(event)) return;
|
|
1551
|
+
event.preventDefault();
|
|
1552
|
+
onNavigate(route);
|
|
1553
|
+
};
|
|
1554
|
+
return /* @__PURE__ */ jsx(
|
|
1555
|
+
Pressable,
|
|
1556
|
+
{
|
|
1557
|
+
accessibilityLabel: label,
|
|
1558
|
+
accessibilityRole: "link",
|
|
1559
|
+
style: [styles3.hitBox, focusRingStyle(focused, theme.palette.primary["500"])],
|
|
1560
|
+
testID: NAV_TEST_IDS.brandHome,
|
|
1561
|
+
onBlur: () => setFocused(false),
|
|
1562
|
+
onFocus: () => setFocused(true),
|
|
1563
|
+
onPress: handlePress,
|
|
1564
|
+
...anchorProps(route),
|
|
1565
|
+
children
|
|
1566
|
+
}
|
|
1567
|
+
);
|
|
1568
|
+
};
|
|
1533
1569
|
var Nav = (props) => {
|
|
1534
1570
|
if (props.orientation === "vertical") {
|
|
1535
1571
|
return /* @__PURE__ */ jsx(Sidebar, { ...props });
|
|
1536
1572
|
}
|
|
1537
1573
|
return /* @__PURE__ */ jsx(NavBar, { ...props });
|
|
1538
1574
|
};
|
|
1575
|
+
var RAIL_FULL_BREAKPOINT = LAYOUT_COLLAPSE_BREAKPOINT;
|
|
1576
|
+
var DEFAULT_COLLAPSED_RAIL_MAX = 1024;
|
|
1577
|
+
function resolveRailMode({ viewport, hasSidebar, hasCollapsed, range }) {
|
|
1578
|
+
if (!hasSidebar) return "none";
|
|
1579
|
+
if (hasCollapsed) {
|
|
1580
|
+
if (viewport >= range.max) return "full";
|
|
1581
|
+
if (viewport >= range.min) return "collapsed";
|
|
1582
|
+
return "drawer";
|
|
1583
|
+
}
|
|
1584
|
+
return viewport >= RAIL_FULL_BREAKPOINT ? "full" : "drawer";
|
|
1585
|
+
}
|
|
1586
|
+
var styles4 = StyleSheet.create({
|
|
1587
|
+
band: { left: 0, position: "absolute", right: 0, top: 0 }
|
|
1588
|
+
});
|
|
1589
|
+
function readBackdrop(theme) {
|
|
1590
|
+
return theme.backdrop;
|
|
1591
|
+
}
|
|
1592
|
+
function rootStyle(backdrop, fallback) {
|
|
1593
|
+
if (backdrop === void 0) return { backgroundColor: fallback };
|
|
1594
|
+
const base = { backgroundColor: backdrop.color };
|
|
1595
|
+
if (!IS_WEB || backdrop.image === null) return base;
|
|
1596
|
+
const web = { backgroundImage: backdrop.image, backgroundSize: backdrop.imageSize ?? "auto" };
|
|
1597
|
+
return { ...base, ...web };
|
|
1598
|
+
}
|
|
1599
|
+
function resolveShellBackdrop(theme, viewport, contentPadding, testID) {
|
|
1600
|
+
const backdrop = readBackdrop(theme);
|
|
1601
|
+
const band = backdrop?.band ?? null;
|
|
1602
|
+
const root = rootStyle(backdrop, theme.colors.background);
|
|
1603
|
+
if (band === null) return { root, chrome: void 0, chromeText: theme.colors.text, band: null };
|
|
1604
|
+
const overlap = viewport < RAIL_FULL_BREAKPOINT ? band.overlap.compact : band.overlap.wide;
|
|
1605
|
+
const element = /* @__PURE__ */ jsx(
|
|
1606
|
+
View,
|
|
1607
|
+
{
|
|
1608
|
+
pointerEvents: "none",
|
|
1609
|
+
style: [styles4.band, { backgroundColor: band.color, height: contentPadding + overlap }],
|
|
1610
|
+
testID: `${testID}${APP_SHELL_SUFFIX.band}`
|
|
1611
|
+
}
|
|
1612
|
+
);
|
|
1613
|
+
return { root, chrome: { backgroundColor: band.color }, chromeText: band.text, band: element };
|
|
1614
|
+
}
|
|
1539
1615
|
var CARD_PADDING = 20;
|
|
1540
1616
|
var CARD_BORDER_RADIUS = 12;
|
|
1541
1617
|
var CARD_BORDER_WIDTH = 1;
|
|
1542
1618
|
var CARD_TITLE_FONT_SIZE = 16;
|
|
1543
1619
|
var CARD_MESSAGE_FONT_SIZE = 14;
|
|
1544
1620
|
var CARD_TITLE_MARGIN_BOTTOM = 8;
|
|
1545
|
-
var
|
|
1621
|
+
var styles5 = StyleSheet.create({
|
|
1546
1622
|
// Loading is a TRANSITIONAL state: the spinner is an absolute overlay ON TOP of
|
|
1547
1623
|
// stably-mounted children, never a replacement for them. Replacing children here
|
|
1548
1624
|
// would unmount whatever they host (e.g. a navigator), and on remount React
|
|
@@ -1574,9 +1650,9 @@ function MessageCard({
|
|
|
1574
1650
|
}) {
|
|
1575
1651
|
const { theme } = useUi();
|
|
1576
1652
|
const colors = theme.colors;
|
|
1577
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1578
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1579
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1653
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles5.card, { backgroundColor: colors.surface, borderColor: accentColor }], testID, children: [
|
|
1654
|
+
/* @__PURE__ */ jsx(Text, { style: [styles5.cardTitle, { color: accentColor }], children: message.titleText }),
|
|
1655
|
+
/* @__PURE__ */ jsx(Text, { style: [styles5.cardMessage, { color: colors.textSecondary }], children: message.messageText })
|
|
1580
1656
|
] });
|
|
1581
1657
|
}
|
|
1582
1658
|
function useContentBody(state, children, testID) {
|
|
@@ -1588,12 +1664,12 @@ function useContentBody(state, children, testID) {
|
|
|
1588
1664
|
return /* @__PURE__ */ jsx(MessageCard, { accentColor: errorColor, message: state.forbidden, testID: `${testID}${APP_SHELL_SUFFIX.forbidden}` });
|
|
1589
1665
|
if (state.error)
|
|
1590
1666
|
return /* @__PURE__ */ jsx(MessageCard, { accentColor: errorColor, message: state.error, testID: `${testID}${APP_SHELL_SUFFIX.error}` });
|
|
1591
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1667
|
+
return /* @__PURE__ */ jsxs(View, { style: styles5.loadingHost, children: [
|
|
1592
1668
|
children,
|
|
1593
1669
|
state.loading === true ? /* @__PURE__ */ jsx(
|
|
1594
1670
|
View,
|
|
1595
1671
|
{
|
|
1596
|
-
style: [
|
|
1672
|
+
style: [styles5.loadingOverlay, { backgroundColor: theme.colors.background }],
|
|
1597
1673
|
testID: `${testID}${APP_SHELL_SUFFIX.loading}`,
|
|
1598
1674
|
children: /* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" })
|
|
1599
1675
|
}
|
|
@@ -1620,7 +1696,7 @@ var DEFAULT_DRAWER_LABELS = {
|
|
|
1620
1696
|
closeLabel: "Close menu",
|
|
1621
1697
|
closeHint: "Close the navigation menu"
|
|
1622
1698
|
};
|
|
1623
|
-
var
|
|
1699
|
+
var styles6 = StyleSheet.create({
|
|
1624
1700
|
overlay: { ...StyleSheet.absoluteFillObject, zIndex: DRAWER_Z_INDEX },
|
|
1625
1701
|
// The scrim's tap-to-close hit area is anchored to the RIGHT of the panel
|
|
1626
1702
|
// (`left: DRAWER_WIDTH`), so it NEVER overlaps the panel: nav-item taps always
|
|
@@ -1655,10 +1731,10 @@ var MenuToggle = ({ label, hint, onOpen, testID }) => {
|
|
|
1655
1731
|
accessibilityHint: hint,
|
|
1656
1732
|
accessibilityLabel: label,
|
|
1657
1733
|
ringColor: theme.palette.primary["500"],
|
|
1658
|
-
style:
|
|
1734
|
+
style: styles6.menuToggle,
|
|
1659
1735
|
testID,
|
|
1660
1736
|
onPress: onOpen,
|
|
1661
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1737
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles6.menuToggleGlyph, { color: theme.colors.text }], children: MENU_GLYPH2 })
|
|
1662
1738
|
}
|
|
1663
1739
|
);
|
|
1664
1740
|
};
|
|
@@ -1684,14 +1760,14 @@ var MobileDrawer = ({
|
|
|
1684
1760
|
node.addEventListener("click", handleClick);
|
|
1685
1761
|
return () => node.removeEventListener("click", handleClick);
|
|
1686
1762
|
}, [onClose]);
|
|
1687
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1763
|
+
return /* @__PURE__ */ jsxs(View, { style: styles6.overlay, children: [
|
|
1688
1764
|
/* @__PURE__ */ jsx(
|
|
1689
1765
|
Pressable,
|
|
1690
1766
|
{
|
|
1691
1767
|
accessibilityHint: labels.closeHint,
|
|
1692
1768
|
accessibilityLabel: labels.closeLabel,
|
|
1693
1769
|
accessibilityRole: "button",
|
|
1694
|
-
style:
|
|
1770
|
+
style: styles6.scrim,
|
|
1695
1771
|
testID: scrimTestID,
|
|
1696
1772
|
onPress: onClose
|
|
1697
1773
|
}
|
|
@@ -1702,24 +1778,13 @@ var MobileDrawer = ({
|
|
|
1702
1778
|
ref: panelRef,
|
|
1703
1779
|
"aria-modal": true,
|
|
1704
1780
|
role: "dialog",
|
|
1705
|
-
style: [
|
|
1781
|
+
style: [styles6.panel, { backgroundColor: theme.colors.surface }],
|
|
1706
1782
|
testID: drawerTestID,
|
|
1707
1783
|
children: renderTextSlot(sidebar, { color: theme.colors.text })
|
|
1708
1784
|
}
|
|
1709
1785
|
)
|
|
1710
1786
|
] });
|
|
1711
1787
|
};
|
|
1712
|
-
var RAIL_FULL_BREAKPOINT = LAYOUT_COLLAPSE_BREAKPOINT;
|
|
1713
|
-
var DEFAULT_COLLAPSED_RAIL_MAX = 1024;
|
|
1714
|
-
function resolveRailMode({ viewport, hasSidebar, hasCollapsed, range }) {
|
|
1715
|
-
if (!hasSidebar) return "none";
|
|
1716
|
-
if (hasCollapsed) {
|
|
1717
|
-
if (viewport >= range.max) return "full";
|
|
1718
|
-
if (viewport >= range.min) return "collapsed";
|
|
1719
|
-
return "drawer";
|
|
1720
|
-
}
|
|
1721
|
-
return viewport >= RAIL_FULL_BREAKPOINT ? "full" : "drawer";
|
|
1722
|
-
}
|
|
1723
1788
|
function resolveContentMaxWidth(width, viewport) {
|
|
1724
1789
|
if (width === "full") return "full";
|
|
1725
1790
|
const wideMinViewport = width.wideMinViewport ?? Number.POSITIVE_INFINITY;
|
|
@@ -1731,7 +1796,7 @@ function useContentMaxWidth(width) {
|
|
|
1731
1796
|
return resolveContentMaxWidth(width, viewport);
|
|
1732
1797
|
}
|
|
1733
1798
|
var DEFAULT_CONTENT_PADDING = 24;
|
|
1734
|
-
var
|
|
1799
|
+
var styles7 = StyleSheet.create({
|
|
1735
1800
|
root: { flex: 1 },
|
|
1736
1801
|
// Auth-pending spinner: an opaque absolute overlay over the mounted shell, so
|
|
1737
1802
|
// `children` (and any navigator they host) are never unmounted while the gate
|
|
@@ -1771,6 +1836,7 @@ var AppShell = ({
|
|
|
1771
1836
|
const maxWidth = useContentMaxWidth(width);
|
|
1772
1837
|
const body = useContentBody(state, children, testID);
|
|
1773
1838
|
const { width: viewportWidth } = useWindowDimensions();
|
|
1839
|
+
const look = resolveShellBackdrop(theme, viewportWidth, contentPadding, testID);
|
|
1774
1840
|
const railRange = collapsedRailRange ?? { min: RAIL_FULL_BREAKPOINT, max: DEFAULT_COLLAPSED_RAIL_MAX };
|
|
1775
1841
|
const railMode = resolveRailMode({
|
|
1776
1842
|
viewport: viewportWidth,
|
|
@@ -1792,18 +1858,21 @@ var AppShell = ({
|
|
|
1792
1858
|
}, [isUnauthenticated, gate]);
|
|
1793
1859
|
const gatePending = gate?.pending === true;
|
|
1794
1860
|
if (isUnauthenticated) return null;
|
|
1795
|
-
const columnStyle = maxWidth === "full" ?
|
|
1796
|
-
const navInnerStyle = chromeAlignment === "content" && maxWidth !== "full" ? [
|
|
1797
|
-
const scroller = /* @__PURE__ */
|
|
1861
|
+
const columnStyle = maxWidth === "full" ? styles7.columnFull : [styles7.columnCapped, { maxWidth }];
|
|
1862
|
+
const navInnerStyle = chromeAlignment === "content" && maxWidth !== "full" ? [styles7.chromeCapped, { maxWidth, paddingHorizontal: contentPadding }] : void 0;
|
|
1863
|
+
const scroller = /* @__PURE__ */ jsxs(
|
|
1798
1864
|
ScrollView,
|
|
1799
1865
|
{
|
|
1800
|
-
contentContainerStyle: [
|
|
1801
|
-
style:
|
|
1866
|
+
contentContainerStyle: [styles7.scrollContent, { padding: contentPadding }],
|
|
1867
|
+
style: styles7.scroll,
|
|
1802
1868
|
testID: `${testID}${APP_SHELL_SUFFIX.content}`,
|
|
1803
|
-
children:
|
|
1869
|
+
children: [
|
|
1870
|
+
look.band,
|
|
1871
|
+
/* @__PURE__ */ jsx(View, { style: columnStyle, children: body })
|
|
1872
|
+
]
|
|
1804
1873
|
}
|
|
1805
1874
|
);
|
|
1806
|
-
const headerRegion = useDrawer ? /* @__PURE__ */ jsxs(View, { style:
|
|
1875
|
+
const headerRegion = useDrawer ? /* @__PURE__ */ jsxs(View, { style: [styles7.headerRow, look.chrome], testID: `${testID}${APP_SHELL_SUFFIX.header}`, children: [
|
|
1807
1876
|
/* @__PURE__ */ jsx(
|
|
1808
1877
|
MenuToggle,
|
|
1809
1878
|
{
|
|
@@ -1813,14 +1882,14 @@ var AppShell = ({
|
|
|
1813
1882
|
onOpen: openDrawer
|
|
1814
1883
|
}
|
|
1815
1884
|
),
|
|
1816
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
1817
|
-
] }) : /* @__PURE__ */ jsx(View, { testID: `${testID}${APP_SHELL_SUFFIX.header}`, children: renderTextSlot(header, { color:
|
|
1885
|
+
/* @__PURE__ */ jsx(View, { style: styles7.headerFill, children: renderTextSlot(header, { color: look.chromeText }) })
|
|
1886
|
+
] }) : /* @__PURE__ */ jsx(View, { style: look.chrome, testID: `${testID}${APP_SHELL_SUFFIX.header}`, children: renderTextSlot(header, { color: look.chromeText }) });
|
|
1818
1887
|
const railRegion = railMode === "full" ? /* @__PURE__ */ jsx(View, { testID: `${testID}${APP_SHELL_SUFFIX.sidebar}`, children: renderTextSlot(sidebar, { color: theme.colors.text }) }) : railMode === "collapsed" ? /* @__PURE__ */ jsx(View, { testID: `${testID}${APP_SHELL_SUFFIX.collapsedSidebar}`, children: renderTextSlot(collapsedSidebar, { color: theme.colors.text }) }) : null;
|
|
1819
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1888
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles7.root, look.root], testID, children: [
|
|
1820
1889
|
headerRegion,
|
|
1821
|
-
nav !== void 0 ? /* @__PURE__ */ jsx(View, { testID: `${testID}${APP_SHELL_SUFFIX.nav}`, children: navInnerStyle !== void 0 ? /* @__PURE__ */ jsx(View, { style: navInnerStyle, children: renderTextSlot(nav, { color:
|
|
1890
|
+
nav !== void 0 ? /* @__PURE__ */ jsx(View, { style: look.chrome, testID: `${testID}${APP_SHELL_SUFFIX.nav}`, children: navInnerStyle !== void 0 ? /* @__PURE__ */ jsx(View, { style: navInnerStyle, children: renderTextSlot(nav, { color: look.chromeText }) }) : renderTextSlot(nav, { color: look.chromeText }) }) : null,
|
|
1822
1891
|
banner !== void 0 ? /* @__PURE__ */ jsx(View, { testID: `${testID}${APP_SHELL_SUFFIX.banner}`, children: renderTextSlot(banner, { color: theme.colors.text }) }) : null,
|
|
1823
|
-
railRegion !== null ? /* @__PURE__ */ jsxs(View, { style:
|
|
1892
|
+
railRegion !== null ? /* @__PURE__ */ jsxs(View, { style: styles7.bodyRow, children: [
|
|
1824
1893
|
railRegion,
|
|
1825
1894
|
scroller
|
|
1826
1895
|
] }) : scroller,
|
|
@@ -1837,7 +1906,7 @@ var AppShell = ({
|
|
|
1837
1906
|
gatePending ? /* @__PURE__ */ jsx(
|
|
1838
1907
|
View,
|
|
1839
1908
|
{
|
|
1840
|
-
style: [
|
|
1909
|
+
style: [styles7.pendingOverlay, { backgroundColor: theme.colors.background }],
|
|
1841
1910
|
testID: `${testID}${APP_SHELL_SUFFIX.pending}`,
|
|
1842
1911
|
children: /* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" })
|
|
1843
1912
|
}
|
|
@@ -2204,7 +2273,7 @@ var KEY_DOWN = "ArrowDown";
|
|
|
2204
2273
|
var KEY_UP = "ArrowUp";
|
|
2205
2274
|
var KEY_ENTER = "Enter";
|
|
2206
2275
|
var KEY_ESCAPE = "Escape";
|
|
2207
|
-
var
|
|
2276
|
+
var styles8 = StyleSheet.create({
|
|
2208
2277
|
overlay: { ...StyleSheet.absoluteFillObject, zIndex: OVERLAY_Z_INDEX, alignItems: "center" },
|
|
2209
2278
|
scrim: { ...StyleSheet.absoluteFillObject, backgroundColor: SCRIM_COLOR2 },
|
|
2210
2279
|
panel: {
|
|
@@ -2233,14 +2302,14 @@ var PaletteRow = ({ item, selected, onChoose }) => {
|
|
|
2233
2302
|
accessibilityLabel: item.label,
|
|
2234
2303
|
accessibilityRole: "button",
|
|
2235
2304
|
accessibilityState: { selected },
|
|
2236
|
-
style: [
|
|
2305
|
+
style: [styles8.row, selected ? { backgroundColor: colors.border } : void 0],
|
|
2237
2306
|
testID: item.testID ?? item.key,
|
|
2238
2307
|
onPress: () => onChoose(item),
|
|
2239
2308
|
children: [
|
|
2240
2309
|
typeof item.renderIcon === "function" ? item.renderIcon(colors.textSecondary, NAV_ICON_SIZE) : null,
|
|
2241
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2242
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2243
|
-
item.hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2310
|
+
/* @__PURE__ */ jsxs(View, { style: styles8.rowText, children: [
|
|
2311
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.rowLabel, { color: colors.text }], children: item.label }),
|
|
2312
|
+
item.hint ? /* @__PURE__ */ jsx(Text, { style: [styles8.rowHint, { color: colors.textSecondary }], children: item.hint }) : null
|
|
2244
2313
|
] })
|
|
2245
2314
|
]
|
|
2246
2315
|
}
|
|
@@ -2280,14 +2349,14 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2280
2349
|
[results, selected, choose, onClose]
|
|
2281
2350
|
);
|
|
2282
2351
|
if (!open) return null;
|
|
2283
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
2352
|
+
return /* @__PURE__ */ jsxs(View, { style: styles8.overlay, children: [
|
|
2284
2353
|
/* @__PURE__ */ jsx(
|
|
2285
2354
|
Pressable,
|
|
2286
2355
|
{
|
|
2287
2356
|
accessibilityHint: labels.closeHint,
|
|
2288
2357
|
accessibilityLabel: labels.closeLabel,
|
|
2289
2358
|
accessibilityRole: "button",
|
|
2290
|
-
style:
|
|
2359
|
+
style: styles8.scrim,
|
|
2291
2360
|
testID: `${testID ?? "command-palette"}-scrim`,
|
|
2292
2361
|
onPress: onClose
|
|
2293
2362
|
}
|
|
@@ -2298,7 +2367,7 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2298
2367
|
"aria-modal": true,
|
|
2299
2368
|
"aria-label": labels.regionLabel,
|
|
2300
2369
|
role: "dialog",
|
|
2301
|
-
style: [
|
|
2370
|
+
style: [styles8.panel, { backgroundColor: colors.surface, borderColor: colors.border }],
|
|
2302
2371
|
testID: testID ?? "command-palette",
|
|
2303
2372
|
children: [
|
|
2304
2373
|
/* @__PURE__ */ jsx(
|
|
@@ -2308,14 +2377,14 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2308
2377
|
accessibilityLabel: labels.placeholder,
|
|
2309
2378
|
placeholder: labels.placeholder,
|
|
2310
2379
|
placeholderTextColor: colors.textSecondary,
|
|
2311
|
-
style: [
|
|
2380
|
+
style: [styles8.input, { color: colors.text, borderBottomColor: colors.border }],
|
|
2312
2381
|
testID: `${testID ?? "command-palette"}-input`,
|
|
2313
2382
|
value: query,
|
|
2314
2383
|
onChangeText: setQuery,
|
|
2315
2384
|
onKeyPress
|
|
2316
2385
|
}
|
|
2317
2386
|
),
|
|
2318
|
-
results.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2387
|
+
results.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [styles8.empty, { color: colors.textSecondary }], children: labels.emptyText }) : /* @__PURE__ */ jsx(ScrollView, { keyboardShouldPersistTaps: "handled", style: styles8.list, children: results.map((item, index) => /* @__PURE__ */ jsx(PaletteRow, { item, selected: index === selected, onChoose: choose }, item.key)) })
|
|
2319
2388
|
]
|
|
2320
2389
|
}
|
|
2321
2390
|
)
|
|
@@ -2420,7 +2489,7 @@ var TAB_MIN_HEIGHT = 56;
|
|
|
2420
2489
|
var LABEL_SIZE = 12;
|
|
2421
2490
|
var LABEL_GAP = 2;
|
|
2422
2491
|
var TAB_PADDING = 4;
|
|
2423
|
-
var
|
|
2492
|
+
var styles9 = StyleSheet.create({
|
|
2424
2493
|
tab: {
|
|
2425
2494
|
flex: 1,
|
|
2426
2495
|
minHeight: TAB_MIN_HEIGHT,
|
|
@@ -2457,31 +2526,31 @@ var BottomTab = ({
|
|
|
2457
2526
|
accessibilityLabel: item.label,
|
|
2458
2527
|
accessibilityRole: "link",
|
|
2459
2528
|
accessibilityState: { selected: isActive },
|
|
2460
|
-
style: [
|
|
2529
|
+
style: [styles9.tab, { opacity: feedback.opacity }],
|
|
2461
2530
|
testID: item.testID ?? item.key,
|
|
2462
2531
|
onPress: () => onPress(item.route),
|
|
2463
2532
|
onPressIn: () => setPressed(true),
|
|
2464
2533
|
onPressOut: () => setPressed(false),
|
|
2465
2534
|
...ariaCurrentProps3(isActive),
|
|
2466
2535
|
children: [
|
|
2467
|
-
/* @__PURE__ */ jsxs(Animated.View, { style: [
|
|
2536
|
+
/* @__PURE__ */ jsxs(Animated.View, { style: [styles9.iconWrap, { transform: [{ scale }] }], children: [
|
|
2468
2537
|
feedback.pillScale === null ? null : /* @__PURE__ */ jsx(
|
|
2469
2538
|
View,
|
|
2470
2539
|
{
|
|
2471
2540
|
pointerEvents: "none",
|
|
2472
|
-
style: [
|
|
2541
|
+
style: [styles9.pill, { backgroundColor: colors.pill, transform: [{ scale: feedback.pillScale }] }, motion]
|
|
2473
2542
|
}
|
|
2474
2543
|
),
|
|
2475
2544
|
/* @__PURE__ */ jsx(View, { style: [{ transform: feedback.iconTransform }, motion], children: item.renderIcon?.(color, ICON_SIZE) })
|
|
2476
2545
|
] }),
|
|
2477
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2546
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.label, { color }], children: item.label })
|
|
2478
2547
|
]
|
|
2479
2548
|
}
|
|
2480
2549
|
);
|
|
2481
2550
|
};
|
|
2482
2551
|
var DEFAULT_TEST_ID = "bottom-tab-bar";
|
|
2483
2552
|
var SLIDER_HEIGHT = 3;
|
|
2484
|
-
var
|
|
2553
|
+
var styles10 = StyleSheet.create({
|
|
2485
2554
|
bar: { flexDirection: "row", borderTopWidth: StyleSheet.hairlineWidth },
|
|
2486
2555
|
slider: { position: "absolute", top: 0, height: SLIDER_HEIGHT }
|
|
2487
2556
|
});
|
|
@@ -2508,14 +2577,14 @@ var BottomTabBar = ({
|
|
|
2508
2577
|
{
|
|
2509
2578
|
"aria-label": regionLabel,
|
|
2510
2579
|
role: "navigation",
|
|
2511
|
-
style: [
|
|
2580
|
+
style: [styles10.bar, { backgroundColor: theme.colors.surface, borderTopColor: theme.colors.border }, containerStyle],
|
|
2512
2581
|
testID,
|
|
2513
2582
|
children: [
|
|
2514
2583
|
bar === null ? null : /* @__PURE__ */ jsx(
|
|
2515
2584
|
View,
|
|
2516
2585
|
{
|
|
2517
2586
|
pointerEvents: "none",
|
|
2518
|
-
style: [
|
|
2587
|
+
style: [styles10.slider, { left: bar.left, width: bar.width, backgroundColor: primary }, webTransition("left", barMs, reducedMotion)]
|
|
2519
2588
|
}
|
|
2520
2589
|
),
|
|
2521
2590
|
items.map((item) => /* @__PURE__ */ jsx(
|
|
@@ -2536,6 +2605,6 @@ var BottomTabBar = ({
|
|
|
2536
2605
|
);
|
|
2537
2606
|
};
|
|
2538
2607
|
|
|
2539
|
-
export { ACTIVE_BORDER_RADIUS, ACTIVE_TINT_OPACITY, APP_SHELL_SUFFIX, AppShell, BASE_INDENT, BottomTabBar, CHEVRON_ICON_SIZE, CollapsedRail, CommandPalette, CommandPaletteTrigger, DEFAULT_COLLAPSED_RAIL_MAX, DEFAULT_SEARCH_BREAKPOINT, DarkModeControl, HOVER_TINT_OPACITY, NAV_ICON_SIZE, NAV_LINK_GAP, NAV_ROW_RADIUS, NAV_TEST_IDS, Nav, NavBar, NavExpandableItem, NavHoverFeedback, NavOverflowMenu, NavShell, PillNav, PillNavVariant, RAIL_FULL_BREAKPOINT, Sidebar, SidebarChevron, SidebarSearch, TabFeedback, Topbar, accessibleNavItems, collapsedRailStyles, darkModeStyles, expandableStyles, filterCommands, filterNavItems, isFilterActive, isRouteActive, navStyles, pillNavStyles, resolveActiveRoute, resolveContentMaxWidth, resolvePillMenuLabel, resolveRailMode, resolveSearchAffordance, roleRoutesToNavItems, searchTokens, useCommandPaletteHotkey, useContentMaxWidth };
|
|
2608
|
+
export { ACTIVE_BORDER_RADIUS, ACTIVE_TINT_OPACITY, APP_SHELL_SUFFIX, AppShell, BASE_INDENT, BottomTabBar, BrandHomeLink, CHEVRON_ICON_SIZE, CollapsedRail, CommandPalette, CommandPaletteTrigger, DEFAULT_COLLAPSED_RAIL_MAX, DEFAULT_SEARCH_BREAKPOINT, DarkModeControl, HOVER_TINT_OPACITY, NAV_ICON_SIZE, NAV_LINK_GAP, NAV_ROW_RADIUS, NAV_TEST_IDS, Nav, NavBar, NavExpandableItem, NavHoverFeedback, NavOverflowMenu, NavShell, PillNav, PillNavVariant, RAIL_FULL_BREAKPOINT, Sidebar, SidebarChevron, SidebarSearch, TabFeedback, Topbar, accessibleNavItems, collapsedRailStyles, darkModeStyles, expandableStyles, filterCommands, filterNavItems, isFilterActive, isRouteActive, navStyles, pillNavStyles, resolveActiveRoute, resolveContentMaxWidth, resolvePillMenuLabel, resolveRailMode, resolveSearchAffordance, roleRoutesToNavItems, searchTokens, useCommandPaletteHotkey, useContentMaxWidth };
|
|
2540
2609
|
//# sourceMappingURL=index.mjs.map
|
|
2541
2610
|
//# sourceMappingURL=index.mjs.map
|