import * as React from 'react'; import React__default, { ReactNode } from 'react'; import { LucideIcon } from 'lucide-react'; interface NBrandingValue { /** Used as the logo's `alt` when the logo does not set one. */ appName?: string; logoExpanded?: ReactNode | string; /** Falls back to `logoExpanded`. */ logoCollapsed?: ReactNode | string; /** Swapped in when a `string` logo fails to load. */ logoFallback?: string; logoHref?: string; } /** * What a Najm branding endpoint returns, as the marks the chrome needs. * * Accepted anywhere branding goes *in* so an application hands over its API * payload unchanged instead of renaming two fields at every call site. Fields * beyond these are ignored: excess-property checks only fire on object * literals, so passing a wider response object — auth logos, a revision — type * checks and drops what the chrome has no use for. */ interface NBrandingPayload { sidebarLogoExpandedPath?: string | null; sidebarLogoCollapsedPath?: string | null; /** * A slot registry, as `najm-theme` resolves branding: slot key to path. * * Read here so a themed application passes what `loadServerBranding()` * returned straight through, rather than renaming two of its slots at the * one call site that mounts the chrome. Only the two sidebar keys are read, * so an auth logo, a hero, and a consumer's own slots stay out of the * context the sidebar sees. * * Structural on purpose: the kit does not depend on `najm-theme`, and the * dependency runs the other way. */ slots?: Record; } /** Resolved marks, an endpoint payload, or both. */ type NBrandingInput = NBrandingValue & NBrandingPayload; /** * Projects an input onto the marks `useNBranding` publishes. * * Explicit marks win over payload fields, which win over slots, so an * application already passing `logoExpanded` — or a `ReactNode` logo, which no * payload can express — is unaffected by the wider input type. */ declare function normalizeBranding(input?: NBrandingInput): NBrandingValue; /** Returns `null` outside a provider, so every consumer stays optional. */ declare function useNBranding(): NBrandingValue | null; /** * Publishes the app's marks once, so shells stop threading a `logo` through * every surface that shows one. `NSidebar` reads this when no `logo` prop is * given; an explicit `logo` always wins. * * Unlike `NSidebarProvider` this owns no state — the values are resolved by the * app (usually server-side) and only forwarded, so memoizing on the fields is * correct here. */ declare function NBrandingProvider({ children, appName, logoExpanded, logoCollapsed, logoFallback, logoHref, }: Readonly): React.JSX.Element; interface NBrandingEditorValue { branding: NBrandingValue; /** * Merges a patch over the current marks. Inert while controlled. * * Takes the endpoint payload shape too, so a settings surface hands back the * response it just received rather than renaming its fields first. */ setBranding: (patch: NBrandingInput) => void; } /** * Lets a settings surface swap the app's marks without a reload. * * Returns `null` outside `NBrandingStateProvider`, so a branding editor stays * mountable in an app that resolves its logos once and never changes them. * * Only the *display* values live here. Where the assets are stored, who may * replace them, and what happens to a superseded upload are the application's * concerns, and folding them in would make this a branding backend. */ declare function useNBrandingEditor(): NBrandingEditorValue | null; interface NBrandingStateProviderProps { children: ReactNode; /** Controlled marks. When given, `setBranding` is inert. */ branding?: NBrandingInput; /** Seeds marks this provider owns from then on; ignored after mount. */ initialBranding?: NBrandingInput; } /** `NBrandingProvider` with the marks held as state an editor can write. */ declare function NBrandingStateProvider({ children, branding, initialBranding, }: Readonly): React.JSX.Element; /** * Shared surface a feedback state renders into. * * - `inline` (default) keeps each component's existing padding and sizing. No * landmark, no page gutter. * - `panel` is for table bodies, card bodies, dialogs, sheets, and nested * surfaces. Centered with a minimum height, no landmark, no page gutter. * - `page` is for actual route-level states. Uses page spacing from the design * config, but renders through `NPageLayout as="div"` so it never introduces * another `
` inside an already-paged shell. */ type NFeedbackSurface = "inline" | "panel" | "page"; interface NLoadingStateProps { label?: string; className?: string; fullScreen?: boolean; spinnerVariant?: "default" | "circle" | "pinwheel" | "circle-filled" | "ellipsis" | "ring" | "bars"; spinnerSize?: number; /** * Layout surface. `inline` is the default and preserves the legacy look; * `panel` is for table/dialog/sheet bodies; `page` uses page spacing * without introducing a `
`. `fullScreen` takes precedence and renders * the fixed viewport overlay regardless of surface. */ surface?: NFeedbackSurface; } declare function NLoadingState({ label, className, fullScreen, spinnerVariant, spinnerSize, surface, }: NLoadingStateProps): React__default.JSX.Element; interface NErrorStateProps { title?: string; message?: string; onRetry?: () => void; retryLabel?: string; className?: string; icon?: React__default.ReactNode; /** Layout surface. See `NLoadingStateProps.surface`. */ surface?: NFeedbackSurface; } declare function NErrorState({ title, message, onRetry, retryLabel, className, icon, surface, }: NErrorStateProps): React__default.JSX.Element; interface NEmptyStateProps { title?: string; description?: string; icon?: React__default.ReactNode | LucideIcon; action?: React__default.ReactNode; className?: string; /** Layout surface. See `NLoadingStateProps.surface`. */ surface?: NFeedbackSurface; } declare function NEmptyState({ title, description, icon, action, className, surface, }: NEmptyStateProps): React__default.JSX.Element; /** * First-class "access denied" state. * * Thin preset over `NEmptyState`. Defaults to the page surface and a token- * backed `ShieldOff` icon, with title and description resolved from the * provider's forbidden defaults. None of the routing, authorization, * metadata, or framework-link behavior lives here — that is the * application's responsibility. */ interface NForbiddenStateProps extends NEmptyStateProps { title?: string; description?: string; } declare function NForbiddenState(props: NForbiddenStateProps): React__default.JSX.Element; /** * First-class "page not found" state. * * Thin preset over `NEmptyState`. Defaults to the page surface and a `Compass` * icon, with title and description resolved from the provider's not-found * defaults. None of the route-target, metadata, redirect, or framework-link * behavior lives here. */ interface NNotFoundStateProps extends NEmptyStateProps { title?: string; description?: string; } declare function NNotFoundState(props: NNotFoundStateProps): React__default.JSX.Element; export { type NBrandingInput as N, NEmptyState as a, type NEmptyStateProps as b, NErrorState as c, type NErrorStateProps as d, type NFeedbackSurface as e, NForbiddenState as f, type NForbiddenStateProps as g, NLoadingState as h, type NLoadingStateProps as i, NNotFoundState as j, type NNotFoundStateProps as k, type NBrandingEditorValue as l, type NBrandingPayload as m, NBrandingProvider as n, NBrandingStateProvider as o, type NBrandingStateProviderProps as p, type NBrandingValue as q, normalizeBranding as r, useNBrandingEditor as s, useNBranding as u };