import { type LucideIcon } from 'lucide-react'; import type { NavCollapsibleItem } from './types.js'; /** * Generic, host-agnostic helpers that make ANY installed addon render as a * first-class, polished sidebar module — with zero effort from the addon * author. The whole metacore ecosystem inherits these defaults: * * - icons resolve against the full Lucide set (no hand-maintained allowlist), * falling back to a neutral glyph so a nav entry is NEVER icon-less; * - untranslated namespaced i18n keys (`customers.nav.invoices`) degrade to a * humanized label ("Invoices") instead of leaking the raw key; * - an addon nav group becomes a single collapsible parent item (icon + * chevron, children indented) — the shape `` renders as a * dropdown — so installed addons look like native modules. */ /** Neutral fallback icon for a group/module header that declares none. */ export declare const FALLBACK_GROUP_ICON: LucideIcon; /** Neutral fallback icon for a child nav item that declares none. */ export declare const FALLBACK_ITEM_ICON: LucideIcon; /** * Resolve any icon name against the full Lucide icon set. Names match * case-insensitively after normalising separators, so manifests may use * `shopping-cart`, `shopping_cart`, or `ShoppingCart` interchangeably. * Glyphs come from the shared registry (`@asteby/metacore-ui/icons`): one * this browser loaded before renders synchronously from its stored data, so * a reload does not flash the fallback. * Missing names return `fallback`; unknown ones render it, so something * always shows. */ export declare function resolveIconName(name?: string, fallback?: LucideIcon): LucideIcon; /** * Humanize the last segment of a (possibly namespaced) i18n key: * `customers.nav.invoices` → "Invoices" * `sales_orders` → "Sales Orders" */ export declare function humanizeNavKey(key: string): string; /** * Translate a nav title with a generic safety net: run it through `t()`, and * if the result is unchanged (key not found — common for a third-party addon * whose i18n bundle hasn't loaded) AND it looks namespaced, fall back to the * humanized last segment so the UI never shows a raw `a.b.c` key. */ export declare function translateNavTitle(title: string, t: (key: string) => string): string; /** Minimal shape of an addon-declared nav item (subset of the manifest type). */ export interface AddonNavItemLike { title: string; icon?: string; url?: string; items?: AddonNavItemLike[]; } /** Minimal shape of an addon-declared nav group (subset of the manifest type). */ export interface AddonNavGroupLike { title: string; icon?: string; items: AddonNavItemLike[]; } /** * Convert an addon nav group into a single collapsible parent item — the shape * `` renders as a dropdown (icon + chevron, indented children). * * `resolveUrl` maps an addon item to a host-routable URL (the host owns route * layout / model→table resolution). Icons fall back to neutral defaults on both * the parent and every child, so a bare third-party addon still looks polished. * The parent's `url` points at its first child for active-state matching and * for the collapsed (icon-only) dropdown trigger. */ export declare function addonGroupToCollapsibleItem(group: AddonNavGroupLike, resolveUrl: (item: AddonNavItemLike) => string): NavCollapsibleItem; //# sourceMappingURL=addon-nav.d.ts.map