@dloizides/ui-nav 1.28.0 → 1.30.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 +27 -4
- package/dist/index.d.ts +27 -4
- package/dist/index.js +120 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +120 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useCallback, useMemo, useEffect, useRef } from 'react';
|
|
2
|
-
import { StyleSheet, Platform, Pressable, Text, View, TextInput, useWindowDimensions, ScrollView, ActivityIndicator, Animated } from 'react-native';
|
|
2
|
+
import { StyleSheet, Platform, Pressable, Text, View, TextInput, useWindowDimensions, Image, ScrollView, ActivityIndicator, Animated } from 'react-native';
|
|
3
3
|
import { useUi, UiProvider } from '@dloizides/ui-feedback';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { Collapse, motionDurations, motionEasings } from '@dloizides/ui-motion';
|
|
@@ -877,7 +877,10 @@ 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",
|
|
882
|
+
brandMarkIcon: "nav-brand-mark-icon",
|
|
883
|
+
brandMarkName: "nav-brand-mark-name"
|
|
881
884
|
};
|
|
882
885
|
var APP_SHELL_SUFFIX = {
|
|
883
886
|
content: "-content",
|
|
@@ -1384,6 +1387,7 @@ var NavBarInner = ({
|
|
|
1384
1387
|
() => contentMaxWidth === void 0 ? null : { maxWidth: contentMaxWidth, width: "100%", alignSelf: "center" },
|
|
1385
1388
|
[contentMaxWidth]
|
|
1386
1389
|
);
|
|
1390
|
+
useEffect(() => setOpen(false), [pathname]);
|
|
1387
1391
|
const toggleMenu = useCallback(() => setOpen((v) => !v), []);
|
|
1388
1392
|
const handlePress = useCallback(
|
|
1389
1393
|
(route) => {
|
|
@@ -1531,6 +1535,77 @@ var NavBar = ({ barTheme, ...props }) => {
|
|
|
1531
1535
|
if (barTheme === void 0) return /* @__PURE__ */ jsx(NavBarInner, { ...props });
|
|
1532
1536
|
return /* @__PURE__ */ jsx(UiProvider, { navigate, t, theme: barTheme, children: /* @__PURE__ */ jsx(NavBarInner, { ...props }) });
|
|
1533
1537
|
};
|
|
1538
|
+
var styles3 = StyleSheet.create({
|
|
1539
|
+
hitBox: { minHeight: MIN_TOUCH_TARGET, minWidth: MIN_TOUCH_TARGET, justifyContent: "center" }
|
|
1540
|
+
});
|
|
1541
|
+
function anchorProps(route) {
|
|
1542
|
+
return { href: route };
|
|
1543
|
+
}
|
|
1544
|
+
function hasNewTabModifier(event) {
|
|
1545
|
+
const { ctrlKey, metaKey, shiftKey } = event.nativeEvent;
|
|
1546
|
+
return ctrlKey === true || metaKey === true || shiftKey === true;
|
|
1547
|
+
}
|
|
1548
|
+
var BrandHomeLink = ({ route, label, onNavigate, children }) => {
|
|
1549
|
+
const { theme } = useUi();
|
|
1550
|
+
const [focused, setFocused] = useState(false);
|
|
1551
|
+
const handlePress = (event) => {
|
|
1552
|
+
if (hasNewTabModifier(event)) return;
|
|
1553
|
+
event.preventDefault();
|
|
1554
|
+
onNavigate(route);
|
|
1555
|
+
};
|
|
1556
|
+
return /* @__PURE__ */ jsx(
|
|
1557
|
+
Pressable,
|
|
1558
|
+
{
|
|
1559
|
+
accessibilityLabel: label,
|
|
1560
|
+
accessibilityRole: "link",
|
|
1561
|
+
style: [styles3.hitBox, focusRingStyle(focused, theme.palette.primary["500"])],
|
|
1562
|
+
testID: NAV_TEST_IDS.brandHome,
|
|
1563
|
+
onBlur: () => setFocused(false),
|
|
1564
|
+
onFocus: () => setFocused(true),
|
|
1565
|
+
onPress: handlePress,
|
|
1566
|
+
...anchorProps(route),
|
|
1567
|
+
children
|
|
1568
|
+
}
|
|
1569
|
+
);
|
|
1570
|
+
};
|
|
1571
|
+
var DEFAULT_ICON_SIZE = 32;
|
|
1572
|
+
var NAME_FONT_SIZE = 16;
|
|
1573
|
+
var NAME_GAP = 8;
|
|
1574
|
+
var styles4 = StyleSheet.create({
|
|
1575
|
+
name: { flexShrink: 1, fontSize: NAME_FONT_SIZE, fontWeight: "700" },
|
|
1576
|
+
row: { alignItems: "center", flexDirection: "row", gap: NAME_GAP }
|
|
1577
|
+
});
|
|
1578
|
+
var BrandMark = ({
|
|
1579
|
+
source,
|
|
1580
|
+
name,
|
|
1581
|
+
route,
|
|
1582
|
+
label,
|
|
1583
|
+
onNavigate,
|
|
1584
|
+
size = DEFAULT_ICON_SIZE,
|
|
1585
|
+
iconOnly = false
|
|
1586
|
+
}) => {
|
|
1587
|
+
const { theme } = useUi();
|
|
1588
|
+
return /* @__PURE__ */ jsx(BrandHomeLink, { label, route, onNavigate, children: /* @__PURE__ */ jsxs(View, { style: styles4.row, children: [
|
|
1589
|
+
/* @__PURE__ */ jsx(
|
|
1590
|
+
Image,
|
|
1591
|
+
{
|
|
1592
|
+
accessibilityElementsHidden: true,
|
|
1593
|
+
source,
|
|
1594
|
+
style: { height: size, width: size },
|
|
1595
|
+
testID: NAV_TEST_IDS.brandMarkIcon
|
|
1596
|
+
}
|
|
1597
|
+
),
|
|
1598
|
+
iconOnly ? null : /* @__PURE__ */ jsx(
|
|
1599
|
+
Text,
|
|
1600
|
+
{
|
|
1601
|
+
numberOfLines: 1,
|
|
1602
|
+
style: [styles4.name, { color: theme.colors.text }],
|
|
1603
|
+
testID: NAV_TEST_IDS.brandMarkName,
|
|
1604
|
+
children: name
|
|
1605
|
+
}
|
|
1606
|
+
)
|
|
1607
|
+
] }) });
|
|
1608
|
+
};
|
|
1534
1609
|
var Nav = (props) => {
|
|
1535
1610
|
if (props.orientation === "vertical") {
|
|
1536
1611
|
return /* @__PURE__ */ jsx(Sidebar, { ...props });
|
|
@@ -1548,7 +1623,7 @@ function resolveRailMode({ viewport, hasSidebar, hasCollapsed, range }) {
|
|
|
1548
1623
|
}
|
|
1549
1624
|
return viewport >= RAIL_FULL_BREAKPOINT ? "full" : "drawer";
|
|
1550
1625
|
}
|
|
1551
|
-
var
|
|
1626
|
+
var styles5 = StyleSheet.create({
|
|
1552
1627
|
band: { left: 0, position: "absolute", right: 0, top: 0 }
|
|
1553
1628
|
});
|
|
1554
1629
|
function readBackdrop(theme) {
|
|
@@ -1571,7 +1646,7 @@ function resolveShellBackdrop(theme, viewport, contentPadding, testID) {
|
|
|
1571
1646
|
View,
|
|
1572
1647
|
{
|
|
1573
1648
|
pointerEvents: "none",
|
|
1574
|
-
style: [
|
|
1649
|
+
style: [styles5.band, { backgroundColor: band.color, height: contentPadding + overlap }],
|
|
1575
1650
|
testID: `${testID}${APP_SHELL_SUFFIX.band}`
|
|
1576
1651
|
}
|
|
1577
1652
|
);
|
|
@@ -1583,7 +1658,7 @@ var CARD_BORDER_WIDTH = 1;
|
|
|
1583
1658
|
var CARD_TITLE_FONT_SIZE = 16;
|
|
1584
1659
|
var CARD_MESSAGE_FONT_SIZE = 14;
|
|
1585
1660
|
var CARD_TITLE_MARGIN_BOTTOM = 8;
|
|
1586
|
-
var
|
|
1661
|
+
var styles6 = StyleSheet.create({
|
|
1587
1662
|
// Loading is a TRANSITIONAL state: the spinner is an absolute overlay ON TOP of
|
|
1588
1663
|
// stably-mounted children, never a replacement for them. Replacing children here
|
|
1589
1664
|
// would unmount whatever they host (e.g. a navigator), and on remount React
|
|
@@ -1615,9 +1690,9 @@ function MessageCard({
|
|
|
1615
1690
|
}) {
|
|
1616
1691
|
const { theme } = useUi();
|
|
1617
1692
|
const colors = theme.colors;
|
|
1618
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1619
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1620
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1693
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles6.card, { backgroundColor: colors.surface, borderColor: accentColor }], testID, children: [
|
|
1694
|
+
/* @__PURE__ */ jsx(Text, { style: [styles6.cardTitle, { color: accentColor }], children: message.titleText }),
|
|
1695
|
+
/* @__PURE__ */ jsx(Text, { style: [styles6.cardMessage, { color: colors.textSecondary }], children: message.messageText })
|
|
1621
1696
|
] });
|
|
1622
1697
|
}
|
|
1623
1698
|
function useContentBody(state, children, testID) {
|
|
@@ -1629,12 +1704,12 @@ function useContentBody(state, children, testID) {
|
|
|
1629
1704
|
return /* @__PURE__ */ jsx(MessageCard, { accentColor: errorColor, message: state.forbidden, testID: `${testID}${APP_SHELL_SUFFIX.forbidden}` });
|
|
1630
1705
|
if (state.error)
|
|
1631
1706
|
return /* @__PURE__ */ jsx(MessageCard, { accentColor: errorColor, message: state.error, testID: `${testID}${APP_SHELL_SUFFIX.error}` });
|
|
1632
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1707
|
+
return /* @__PURE__ */ jsxs(View, { style: styles6.loadingHost, children: [
|
|
1633
1708
|
children,
|
|
1634
1709
|
state.loading === true ? /* @__PURE__ */ jsx(
|
|
1635
1710
|
View,
|
|
1636
1711
|
{
|
|
1637
|
-
style: [
|
|
1712
|
+
style: [styles6.loadingOverlay, { backgroundColor: theme.colors.background }],
|
|
1638
1713
|
testID: `${testID}${APP_SHELL_SUFFIX.loading}`,
|
|
1639
1714
|
children: /* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" })
|
|
1640
1715
|
}
|
|
@@ -1661,7 +1736,7 @@ var DEFAULT_DRAWER_LABELS = {
|
|
|
1661
1736
|
closeLabel: "Close menu",
|
|
1662
1737
|
closeHint: "Close the navigation menu"
|
|
1663
1738
|
};
|
|
1664
|
-
var
|
|
1739
|
+
var styles7 = StyleSheet.create({
|
|
1665
1740
|
overlay: { ...StyleSheet.absoluteFillObject, zIndex: DRAWER_Z_INDEX },
|
|
1666
1741
|
// The scrim's tap-to-close hit area is anchored to the RIGHT of the panel
|
|
1667
1742
|
// (`left: DRAWER_WIDTH`), so it NEVER overlaps the panel: nav-item taps always
|
|
@@ -1696,10 +1771,10 @@ var MenuToggle = ({ label, hint, onOpen, testID }) => {
|
|
|
1696
1771
|
accessibilityHint: hint,
|
|
1697
1772
|
accessibilityLabel: label,
|
|
1698
1773
|
ringColor: theme.palette.primary["500"],
|
|
1699
|
-
style:
|
|
1774
|
+
style: styles7.menuToggle,
|
|
1700
1775
|
testID,
|
|
1701
1776
|
onPress: onOpen,
|
|
1702
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1777
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles7.menuToggleGlyph, { color: theme.colors.text }], children: MENU_GLYPH2 })
|
|
1703
1778
|
}
|
|
1704
1779
|
);
|
|
1705
1780
|
};
|
|
@@ -1725,14 +1800,14 @@ var MobileDrawer = ({
|
|
|
1725
1800
|
node.addEventListener("click", handleClick);
|
|
1726
1801
|
return () => node.removeEventListener("click", handleClick);
|
|
1727
1802
|
}, [onClose]);
|
|
1728
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1803
|
+
return /* @__PURE__ */ jsxs(View, { style: styles7.overlay, children: [
|
|
1729
1804
|
/* @__PURE__ */ jsx(
|
|
1730
1805
|
Pressable,
|
|
1731
1806
|
{
|
|
1732
1807
|
accessibilityHint: labels.closeHint,
|
|
1733
1808
|
accessibilityLabel: labels.closeLabel,
|
|
1734
1809
|
accessibilityRole: "button",
|
|
1735
|
-
style:
|
|
1810
|
+
style: styles7.scrim,
|
|
1736
1811
|
testID: scrimTestID,
|
|
1737
1812
|
onPress: onClose
|
|
1738
1813
|
}
|
|
@@ -1743,7 +1818,7 @@ var MobileDrawer = ({
|
|
|
1743
1818
|
ref: panelRef,
|
|
1744
1819
|
"aria-modal": true,
|
|
1745
1820
|
role: "dialog",
|
|
1746
|
-
style: [
|
|
1821
|
+
style: [styles7.panel, { backgroundColor: theme.colors.surface }],
|
|
1747
1822
|
testID: drawerTestID,
|
|
1748
1823
|
children: renderTextSlot(sidebar, { color: theme.colors.text })
|
|
1749
1824
|
}
|
|
@@ -1761,7 +1836,7 @@ function useContentMaxWidth(width) {
|
|
|
1761
1836
|
return resolveContentMaxWidth(width, viewport);
|
|
1762
1837
|
}
|
|
1763
1838
|
var DEFAULT_CONTENT_PADDING = 24;
|
|
1764
|
-
var
|
|
1839
|
+
var styles8 = StyleSheet.create({
|
|
1765
1840
|
root: { flex: 1 },
|
|
1766
1841
|
// Auth-pending spinner: an opaque absolute overlay over the mounted shell, so
|
|
1767
1842
|
// `children` (and any navigator they host) are never unmounted while the gate
|
|
@@ -1823,13 +1898,13 @@ var AppShell = ({
|
|
|
1823
1898
|
}, [isUnauthenticated, gate]);
|
|
1824
1899
|
const gatePending = gate?.pending === true;
|
|
1825
1900
|
if (isUnauthenticated) return null;
|
|
1826
|
-
const columnStyle = maxWidth === "full" ?
|
|
1827
|
-
const navInnerStyle = chromeAlignment === "content" && maxWidth !== "full" ? [
|
|
1901
|
+
const columnStyle = maxWidth === "full" ? styles8.columnFull : [styles8.columnCapped, { maxWidth }];
|
|
1902
|
+
const navInnerStyle = chromeAlignment === "content" && maxWidth !== "full" ? [styles8.chromeCapped, { maxWidth, paddingHorizontal: contentPadding }] : void 0;
|
|
1828
1903
|
const scroller = /* @__PURE__ */ jsxs(
|
|
1829
1904
|
ScrollView,
|
|
1830
1905
|
{
|
|
1831
|
-
contentContainerStyle: [
|
|
1832
|
-
style:
|
|
1906
|
+
contentContainerStyle: [styles8.scrollContent, { padding: contentPadding }],
|
|
1907
|
+
style: styles8.scroll,
|
|
1833
1908
|
testID: `${testID}${APP_SHELL_SUFFIX.content}`,
|
|
1834
1909
|
children: [
|
|
1835
1910
|
look.band,
|
|
@@ -1837,7 +1912,7 @@ var AppShell = ({
|
|
|
1837
1912
|
]
|
|
1838
1913
|
}
|
|
1839
1914
|
);
|
|
1840
|
-
const headerRegion = useDrawer ? /* @__PURE__ */ jsxs(View, { style: [
|
|
1915
|
+
const headerRegion = useDrawer ? /* @__PURE__ */ jsxs(View, { style: [styles8.headerRow, look.chrome], testID: `${testID}${APP_SHELL_SUFFIX.header}`, children: [
|
|
1841
1916
|
/* @__PURE__ */ jsx(
|
|
1842
1917
|
MenuToggle,
|
|
1843
1918
|
{
|
|
@@ -1847,14 +1922,14 @@ var AppShell = ({
|
|
|
1847
1922
|
onOpen: openDrawer
|
|
1848
1923
|
}
|
|
1849
1924
|
),
|
|
1850
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
1925
|
+
/* @__PURE__ */ jsx(View, { style: styles8.headerFill, children: renderTextSlot(header, { color: look.chromeText }) })
|
|
1851
1926
|
] }) : /* @__PURE__ */ jsx(View, { style: look.chrome, testID: `${testID}${APP_SHELL_SUFFIX.header}`, children: renderTextSlot(header, { color: look.chromeText }) });
|
|
1852
1927
|
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;
|
|
1853
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1928
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles8.root, look.root], testID, children: [
|
|
1854
1929
|
headerRegion,
|
|
1855
1930
|
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,
|
|
1856
1931
|
banner !== void 0 ? /* @__PURE__ */ jsx(View, { testID: `${testID}${APP_SHELL_SUFFIX.banner}`, children: renderTextSlot(banner, { color: theme.colors.text }) }) : null,
|
|
1857
|
-
railRegion !== null ? /* @__PURE__ */ jsxs(View, { style:
|
|
1932
|
+
railRegion !== null ? /* @__PURE__ */ jsxs(View, { style: styles8.bodyRow, children: [
|
|
1858
1933
|
railRegion,
|
|
1859
1934
|
scroller
|
|
1860
1935
|
] }) : scroller,
|
|
@@ -1871,7 +1946,7 @@ var AppShell = ({
|
|
|
1871
1946
|
gatePending ? /* @__PURE__ */ jsx(
|
|
1872
1947
|
View,
|
|
1873
1948
|
{
|
|
1874
|
-
style: [
|
|
1949
|
+
style: [styles8.pendingOverlay, { backgroundColor: theme.colors.background }],
|
|
1875
1950
|
testID: `${testID}${APP_SHELL_SUFFIX.pending}`,
|
|
1876
1951
|
children: /* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" })
|
|
1877
1952
|
}
|
|
@@ -2238,7 +2313,7 @@ var KEY_DOWN = "ArrowDown";
|
|
|
2238
2313
|
var KEY_UP = "ArrowUp";
|
|
2239
2314
|
var KEY_ENTER = "Enter";
|
|
2240
2315
|
var KEY_ESCAPE = "Escape";
|
|
2241
|
-
var
|
|
2316
|
+
var styles9 = StyleSheet.create({
|
|
2242
2317
|
overlay: { ...StyleSheet.absoluteFillObject, zIndex: OVERLAY_Z_INDEX, alignItems: "center" },
|
|
2243
2318
|
scrim: { ...StyleSheet.absoluteFillObject, backgroundColor: SCRIM_COLOR2 },
|
|
2244
2319
|
panel: {
|
|
@@ -2267,14 +2342,14 @@ var PaletteRow = ({ item, selected, onChoose }) => {
|
|
|
2267
2342
|
accessibilityLabel: item.label,
|
|
2268
2343
|
accessibilityRole: "button",
|
|
2269
2344
|
accessibilityState: { selected },
|
|
2270
|
-
style: [
|
|
2345
|
+
style: [styles9.row, selected ? { backgroundColor: colors.border } : void 0],
|
|
2271
2346
|
testID: item.testID ?? item.key,
|
|
2272
2347
|
onPress: () => onChoose(item),
|
|
2273
2348
|
children: [
|
|
2274
2349
|
typeof item.renderIcon === "function" ? item.renderIcon(colors.textSecondary, NAV_ICON_SIZE) : null,
|
|
2275
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2276
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2277
|
-
item.hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2350
|
+
/* @__PURE__ */ jsxs(View, { style: styles9.rowText, children: [
|
|
2351
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.rowLabel, { color: colors.text }], children: item.label }),
|
|
2352
|
+
item.hint ? /* @__PURE__ */ jsx(Text, { style: [styles9.rowHint, { color: colors.textSecondary }], children: item.hint }) : null
|
|
2278
2353
|
] })
|
|
2279
2354
|
]
|
|
2280
2355
|
}
|
|
@@ -2314,14 +2389,14 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2314
2389
|
[results, selected, choose, onClose]
|
|
2315
2390
|
);
|
|
2316
2391
|
if (!open) return null;
|
|
2317
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
2392
|
+
return /* @__PURE__ */ jsxs(View, { style: styles9.overlay, children: [
|
|
2318
2393
|
/* @__PURE__ */ jsx(
|
|
2319
2394
|
Pressable,
|
|
2320
2395
|
{
|
|
2321
2396
|
accessibilityHint: labels.closeHint,
|
|
2322
2397
|
accessibilityLabel: labels.closeLabel,
|
|
2323
2398
|
accessibilityRole: "button",
|
|
2324
|
-
style:
|
|
2399
|
+
style: styles9.scrim,
|
|
2325
2400
|
testID: `${testID ?? "command-palette"}-scrim`,
|
|
2326
2401
|
onPress: onClose
|
|
2327
2402
|
}
|
|
@@ -2332,7 +2407,7 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2332
2407
|
"aria-modal": true,
|
|
2333
2408
|
"aria-label": labels.regionLabel,
|
|
2334
2409
|
role: "dialog",
|
|
2335
|
-
style: [
|
|
2410
|
+
style: [styles9.panel, { backgroundColor: colors.surface, borderColor: colors.border }],
|
|
2336
2411
|
testID: testID ?? "command-palette",
|
|
2337
2412
|
children: [
|
|
2338
2413
|
/* @__PURE__ */ jsx(
|
|
@@ -2342,14 +2417,14 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
2342
2417
|
accessibilityLabel: labels.placeholder,
|
|
2343
2418
|
placeholder: labels.placeholder,
|
|
2344
2419
|
placeholderTextColor: colors.textSecondary,
|
|
2345
|
-
style: [
|
|
2420
|
+
style: [styles9.input, { color: colors.text, borderBottomColor: colors.border }],
|
|
2346
2421
|
testID: `${testID ?? "command-palette"}-input`,
|
|
2347
2422
|
value: query,
|
|
2348
2423
|
onChangeText: setQuery,
|
|
2349
2424
|
onKeyPress
|
|
2350
2425
|
}
|
|
2351
2426
|
),
|
|
2352
|
-
results.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2427
|
+
results.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [styles9.empty, { color: colors.textSecondary }], children: labels.emptyText }) : /* @__PURE__ */ jsx(ScrollView, { keyboardShouldPersistTaps: "handled", style: styles9.list, children: results.map((item, index) => /* @__PURE__ */ jsx(PaletteRow, { item, selected: index === selected, onChoose: choose }, item.key)) })
|
|
2353
2428
|
]
|
|
2354
2429
|
}
|
|
2355
2430
|
)
|
|
@@ -2454,7 +2529,7 @@ var TAB_MIN_HEIGHT = 56;
|
|
|
2454
2529
|
var LABEL_SIZE = 12;
|
|
2455
2530
|
var LABEL_GAP = 2;
|
|
2456
2531
|
var TAB_PADDING = 4;
|
|
2457
|
-
var
|
|
2532
|
+
var styles10 = StyleSheet.create({
|
|
2458
2533
|
tab: {
|
|
2459
2534
|
flex: 1,
|
|
2460
2535
|
minHeight: TAB_MIN_HEIGHT,
|
|
@@ -2491,31 +2566,31 @@ var BottomTab = ({
|
|
|
2491
2566
|
accessibilityLabel: item.label,
|
|
2492
2567
|
accessibilityRole: "link",
|
|
2493
2568
|
accessibilityState: { selected: isActive },
|
|
2494
|
-
style: [
|
|
2569
|
+
style: [styles10.tab, { opacity: feedback.opacity }],
|
|
2495
2570
|
testID: item.testID ?? item.key,
|
|
2496
2571
|
onPress: () => onPress(item.route),
|
|
2497
2572
|
onPressIn: () => setPressed(true),
|
|
2498
2573
|
onPressOut: () => setPressed(false),
|
|
2499
2574
|
...ariaCurrentProps3(isActive),
|
|
2500
2575
|
children: [
|
|
2501
|
-
/* @__PURE__ */ jsxs(Animated.View, { style: [
|
|
2576
|
+
/* @__PURE__ */ jsxs(Animated.View, { style: [styles10.iconWrap, { transform: [{ scale }] }], children: [
|
|
2502
2577
|
feedback.pillScale === null ? null : /* @__PURE__ */ jsx(
|
|
2503
2578
|
View,
|
|
2504
2579
|
{
|
|
2505
2580
|
pointerEvents: "none",
|
|
2506
|
-
style: [
|
|
2581
|
+
style: [styles10.pill, { backgroundColor: colors.pill, transform: [{ scale: feedback.pillScale }] }, motion]
|
|
2507
2582
|
}
|
|
2508
2583
|
),
|
|
2509
2584
|
/* @__PURE__ */ jsx(View, { style: [{ transform: feedback.iconTransform }, motion], children: item.renderIcon?.(color, ICON_SIZE) })
|
|
2510
2585
|
] }),
|
|
2511
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2586
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.label, { color }], children: item.label })
|
|
2512
2587
|
]
|
|
2513
2588
|
}
|
|
2514
2589
|
);
|
|
2515
2590
|
};
|
|
2516
2591
|
var DEFAULT_TEST_ID = "bottom-tab-bar";
|
|
2517
2592
|
var SLIDER_HEIGHT = 3;
|
|
2518
|
-
var
|
|
2593
|
+
var styles11 = StyleSheet.create({
|
|
2519
2594
|
bar: { flexDirection: "row", borderTopWidth: StyleSheet.hairlineWidth },
|
|
2520
2595
|
slider: { position: "absolute", top: 0, height: SLIDER_HEIGHT }
|
|
2521
2596
|
});
|
|
@@ -2542,14 +2617,14 @@ var BottomTabBar = ({
|
|
|
2542
2617
|
{
|
|
2543
2618
|
"aria-label": regionLabel,
|
|
2544
2619
|
role: "navigation",
|
|
2545
|
-
style: [
|
|
2620
|
+
style: [styles11.bar, { backgroundColor: theme.colors.surface, borderTopColor: theme.colors.border }, containerStyle],
|
|
2546
2621
|
testID,
|
|
2547
2622
|
children: [
|
|
2548
2623
|
bar === null ? null : /* @__PURE__ */ jsx(
|
|
2549
2624
|
View,
|
|
2550
2625
|
{
|
|
2551
2626
|
pointerEvents: "none",
|
|
2552
|
-
style: [
|
|
2627
|
+
style: [styles11.slider, { left: bar.left, width: bar.width, backgroundColor: primary }, webTransition("left", barMs, reducedMotion)]
|
|
2553
2628
|
}
|
|
2554
2629
|
),
|
|
2555
2630
|
items.map((item) => /* @__PURE__ */ jsx(
|
|
@@ -2570,6 +2645,6 @@ var BottomTabBar = ({
|
|
|
2570
2645
|
);
|
|
2571
2646
|
};
|
|
2572
2647
|
|
|
2573
|
-
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 };
|
|
2648
|
+
export { ACTIVE_BORDER_RADIUS, ACTIVE_TINT_OPACITY, APP_SHELL_SUFFIX, AppShell, BASE_INDENT, BottomTabBar, BrandHomeLink, BrandMark, 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 };
|
|
2574
2649
|
//# sourceMappingURL=index.mjs.map
|
|
2575
2650
|
//# sourceMappingURL=index.mjs.map
|