@dloizides/ui-nav 1.12.0 → 1.13.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 +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1665,6 +1665,55 @@ var CommandPalette = ({ open, items, onClose, labels, testID }) => {
|
|
|
1665
1665
|
)
|
|
1666
1666
|
] });
|
|
1667
1667
|
};
|
|
1668
|
+
var MIN_TARGET = 36;
|
|
1669
|
+
var styles5 = StyleSheet.create({
|
|
1670
|
+
trigger: {
|
|
1671
|
+
flexDirection: "row",
|
|
1672
|
+
alignItems: "center",
|
|
1673
|
+
justifyContent: "space-between",
|
|
1674
|
+
columnGap: 8,
|
|
1675
|
+
paddingHorizontal: 12,
|
|
1676
|
+
minHeight: MIN_TARGET,
|
|
1677
|
+
borderWidth: 1,
|
|
1678
|
+
borderRadius: 8
|
|
1679
|
+
},
|
|
1680
|
+
label: { fontSize: 14 },
|
|
1681
|
+
badge: { paddingHorizontal: 6, paddingVertical: 2, borderRadius: 4, borderWidth: 1 },
|
|
1682
|
+
badgeText: { fontSize: 11, fontWeight: "700" }
|
|
1683
|
+
});
|
|
1684
|
+
var CommandPaletteTrigger = ({
|
|
1685
|
+
label,
|
|
1686
|
+
hint,
|
|
1687
|
+
shortcut,
|
|
1688
|
+
onPress,
|
|
1689
|
+
testID
|
|
1690
|
+
}) => {
|
|
1691
|
+
const { theme } = useUi();
|
|
1692
|
+
const colors = theme.colors;
|
|
1693
|
+
const primary = theme.palette.primary["500"];
|
|
1694
|
+
const [focused, setFocused] = React2.useState(false);
|
|
1695
|
+
return /* @__PURE__ */ jsxs(
|
|
1696
|
+
Pressable,
|
|
1697
|
+
{
|
|
1698
|
+
accessibilityHint: hint,
|
|
1699
|
+
accessibilityLabel: label,
|
|
1700
|
+
accessibilityRole: "button",
|
|
1701
|
+
style: [
|
|
1702
|
+
styles5.trigger,
|
|
1703
|
+
{ backgroundColor: colors.surface, borderColor: colors.border },
|
|
1704
|
+
focusRingStyle(focused, primary)
|
|
1705
|
+
],
|
|
1706
|
+
testID,
|
|
1707
|
+
onBlur: () => setFocused(false),
|
|
1708
|
+
onFocus: () => setFocused(true),
|
|
1709
|
+
onPress,
|
|
1710
|
+
children: [
|
|
1711
|
+
/* @__PURE__ */ jsx(Text, { style: [styles5.label, { color: colors.textSecondary }], children: label }),
|
|
1712
|
+
/* @__PURE__ */ jsx(View, { style: [styles5.badge, { borderColor: colors.border }], children: /* @__PURE__ */ jsx(Text, { style: [styles5.badgeText, { color: colors.textSecondary }], children: shortcut }) })
|
|
1713
|
+
]
|
|
1714
|
+
}
|
|
1715
|
+
);
|
|
1716
|
+
};
|
|
1668
1717
|
var LAUNCH_KEY = "k";
|
|
1669
1718
|
function useCommandPaletteHotkey(onOpen, enabled = true) {
|
|
1670
1719
|
useEffect(() => {
|
|
@@ -1690,6 +1739,6 @@ function accessibleNavItems(user, table, translate) {
|
|
|
1690
1739
|
return roleRoutesToNavItems(resolveAccessibleRoutes(user, table), translate);
|
|
1691
1740
|
}
|
|
1692
1741
|
|
|
1693
|
-
export { ACTIVE_BORDER_RADIUS, APP_SHELL_SUFFIX, AppShell, BASE_INDENT, CHEVRON_ICON_SIZE, CollapsedRail, CommandPalette, DEFAULT_COLLAPSED_RAIL_MAX, DarkModeControl, NAV_ICON_SIZE, NAV_LINK_GAP, NAV_TEST_IDS, Nav, NavBar, NavExpandableItem, NavOverflowMenu, NavShell, PillNav, RAIL_FULL_BREAKPOINT, Sidebar, Topbar, accessibleNavItems, collapsedRailStyles, darkModeStyles, expandableStyles, filterCommands, isRouteActive, navStyles, pillNavStyles, resolveContentMaxWidth, resolveRailMode, roleRoutesToNavItems, useCommandPaletteHotkey, useContentMaxWidth };
|
|
1742
|
+
export { ACTIVE_BORDER_RADIUS, APP_SHELL_SUFFIX, AppShell, BASE_INDENT, CHEVRON_ICON_SIZE, CollapsedRail, CommandPalette, CommandPaletteTrigger, DEFAULT_COLLAPSED_RAIL_MAX, DarkModeControl, NAV_ICON_SIZE, NAV_LINK_GAP, NAV_TEST_IDS, Nav, NavBar, NavExpandableItem, NavOverflowMenu, NavShell, PillNav, RAIL_FULL_BREAKPOINT, Sidebar, Topbar, accessibleNavItems, collapsedRailStyles, darkModeStyles, expandableStyles, filterCommands, isRouteActive, navStyles, pillNavStyles, resolveContentMaxWidth, resolveRailMode, roleRoutesToNavItems, useCommandPaletteHotkey, useContentMaxWidth };
|
|
1694
1743
|
//# sourceMappingURL=index.mjs.map
|
|
1695
1744
|
//# sourceMappingURL=index.mjs.map
|