UNPKG

@medalsocial/meda

Version:

Shared Meda UI shell and runtime package.

76 lines (75 loc) 2.84 kB
import type { ReactNode } from 'react'; import type { AppShellAppTabsConfig, AppShellAuthBranding, AppShellAuthConfig, AppShellContextRailConfig, AppShellIconRailConfig, AppShellMobileNavConfig, AppShellRightPanelConfig, AppShellWorkspaceConfig, ShellMainLayout } from './types.js'; interface AppShellBaseProps { children: ReactNode; className?: string; } export type AppShellProps = AppShellBaseProps & ({ variant: 'auth'; auth?: AppShellAuthConfig; branding?: AppShellAuthBranding; preview?: ReactNode; actions?: ReactNode; } | { variant: 'workspace'; iconRail?: AppShellIconRailConfig; contextRail?: AppShellContextRailConfig; rightPanel?: AppShellRightPanelConfig; /** * Configurable workspace dropdown — replaces the package-default * "Manage workspaces / Settings / Profile / Sign out" entries when * `menuItems` is provided. The theme toggle is preserved automatically. */ workspace?: AppShellWorkspaceConfig; /** * Optional application-tab rendering config, used for router-specific * link integration. */ appTabs?: AppShellAppTabsConfig; globalActions?: ReactNode; /** * Optional center-region header content. Replaces the default * application tabs when provided. */ headerCenter?: ReactNode; /** * Optional leading content rendered in the LEFT header region immediately * after the workspace switcher. On mobile, surfaced inside the menu drawer. */ headerLeading?: ReactNode; /** * Optional chrome-level content rendered below the header and above * the workspace rail row. */ banners?: ReactNode; /** * Layout passed through to the workspace shell's main scroll region. * Defaults to `workspace`. */ mainLayout?: ShellMainLayout; /** * Optional className for the workspace shell's main scroll region. */ mainClassName?: string; /** * Whether meda renders its built-in `CommandPalette` (and provides the * `CommandRegistryContext`) when no command registry is already present. * Defaults to `true` for backwards compatibility. Set `false` when the * host app ships its own command palette to avoid a duplicate dialog. */ builtInCommandPalette?: boolean; /** * Opt-in mobile dock + workspace sheet (replaces the legacy bottom-nav * + four drawers on the mobile viewport). Omit for the legacy nav. */ mobileNav?: AppShellMobileNavConfig; } | { variant: 'chat'; globalActions?: ReactNode; }); export declare function AppShell(props: AppShellProps): import("react/jsx-runtime").JSX.Element; export declare function AppShellBody({ children, className }: { children: ReactNode; className?: string; }): import("react/jsx-runtime").JSX.Element; export {};