@flytedan/flytebot-design-system 0.15.0 → 0.17.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.cts CHANGED
@@ -416,7 +416,7 @@ interface SidebarNavProps {
416
416
  open?: boolean;
417
417
  className?: string;
418
418
  }
419
- declare function SidebarNav({ brand, groups, current, onNavigate, footer, open, className, ...rest }: SidebarNavProps): React.JSX.Element;
419
+ declare const SidebarNav: React.ForwardRefExoticComponent<SidebarNavProps & React.RefAttributes<HTMLElement>>;
420
420
 
421
421
  interface FlytedeskMarkProps {
422
422
  size?: "sm" | "md" | "lg";
@@ -2239,6 +2239,25 @@ interface AppearancePrefs {
2239
2239
  * itself asked to reduce. */
2240
2240
  reduceMotion: boolean;
2241
2241
  }
2242
+ declare const DEFAULT_STORAGE_KEY = "fd-appearance";
2243
+ declare const DEFAULT_PREFS: AppearancePrefs;
2244
+ /** An app-supplied external store for `AppearancePrefs` — the same read/subscribe shape
2245
+ * `React.useSyncExternalStore` expects, plus a `write`. Implement this over whatever a
2246
+ * consuming app already has (a server-synced prefs cache, a Redux/Zustand store, …) to
2247
+ * drive `AppearanceMenu` from that state instead of the default localStorage store. */
2248
+ interface AppearanceStore {
2249
+ /** Synchronous current value. Called on every render that might have changed it —
2250
+ * must be cheap and must not allocate a new object unless the value actually changed
2251
+ * (React compares by reference to decide whether to re-render). */
2252
+ getSnapshot: () => AppearancePrefs;
2253
+ /** Persist a full prefs object. `AppearanceMenu` always calls this with the complete,
2254
+ * merged record — never a partial patch — so a store never needs to merge itself. */
2255
+ write: (prefs: AppearancePrefs) => void;
2256
+ /** Register a callback fired whenever the snapshot changes for a reason other than this
2257
+ * store's own `write` call returning (e.g. another tab, or an app's async server
2258
+ * hydration completing after mount). Returns its own unsubscribe. */
2259
+ subscribe: (onChange: () => void) => () => void;
2260
+ }
2242
2261
  interface AppearanceStoreOptions {
2243
2262
  /** localStorage (or `storage`) key these prefs are read from / written to. Default
2244
2263
  * "fd-appearance". Namespace this per consuming app. */
@@ -2249,17 +2268,25 @@ interface AppearanceStoreOptions {
2249
2268
  /** Overrides the built-in defaults (`system` / `md` / off / off) per field. */
2250
2269
  defaults?: Partial<AppearancePrefs>;
2251
2270
  }
2252
- declare const DEFAULT_STORAGE_KEY = "fd-appearance";
2253
- declare const DEFAULT_PREFS: AppearancePrefs;
2254
2271
  /** "system" resolved against the OS's current setting. Pure aside from reading
2255
2272
  * `matchMedia` — never throws in an environment without it (SSR, some test runners). */
2256
2273
  declare function resolveTheme(mode: ThemeMode): "light" | "dark";
2257
2274
  /** Reads stored prefs, falling back field-by-field to defaults — a missing key, a
2258
2275
  * malformed JSON blob, or a value of the wrong shape/type each fall back individually
2259
2276
  * rather than discarding the whole record (a bad stored value degrades, it never
2260
- * crashes the caller). */
2277
+ * crashes the caller). Used internally by `createLocalStorageAppearanceStore`; exported
2278
+ * as a low-level primitive for a caller building its own store on top of a similar
2279
+ * key/value backend. */
2261
2280
  declare function loadPrefs(opts?: AppearanceStoreOptions): AppearancePrefs;
2262
2281
  declare function savePrefs(prefs: AppearancePrefs, opts?: AppearanceStoreOptions): void;
2282
+ /** The default `AppearanceStore`: backed by `storage` (default `window.localStorage`)
2283
+ * under `storageKey` (default `"fd-appearance"`). Same-tab writes notify this store's
2284
+ * own subscribers synchronously; the browser's `storage` event keeps every OTHER tab
2285
+ * in sync too (a tab never gets its own `storage` event for its own write, which is
2286
+ * exactly why same-tab notification is handled separately here). The window listener is
2287
+ * attached only while at least one subscriber is registered, and removed once the last
2288
+ * one unsubscribes — a store an app creates per-mount never leaks a listener. */
2289
+ declare function createLocalStorageAppearanceStore(opts?: AppearanceStoreOptions): AppearanceStore;
2263
2290
  /** Sets every attribute this kit's tokens.css rules read: `[data-theme]` (resolved,
2264
2291
  * never "system" itself — nothing downstream re-resolves it), `[data-text-scale]`,
2265
2292
  * `[data-contrast="high"]` (present only when on — absent, not "normal", is the "off"
@@ -2267,14 +2294,20 @@ declare function savePrefs(prefs: AppearancePrefs, opts?: AppearanceStoreOptions
2267
2294
  * `[data-motion="reduce"]` (same absent-is-off shape). No inline styles: every visual
2268
2295
  * effect is a CSS rule in this package's own styles, driven by these attributes alone. */
2269
2296
  declare function applyPrefs(prefs: AppearancePrefs, root?: HTMLElement): void;
2270
- /** [prefs, update] — loads once (lazy initial state, so there's no flash of defaults
2271
- * before localStorage is read), applies + persists on every change, and re-resolves
2272
- * "system" live while it's selected (the OS setting can change without this tab
2273
- * reloading). Any number of independent instances may run at once as long as each is
2274
- * given its own `storageKey` — nothing here is a module-level singleton. */
2275
- declare function useAppearancePrefs(opts?: AppearanceStoreOptions): [AppearancePrefs, (patch: Partial<AppearancePrefs>) => void];
2297
+ /** [prefs, update] over an app-supplied `AppearanceStore`. Reads through
2298
+ * `React.useSyncExternalStore`, so a snapshot that changes for ANY reason — this hook's
2299
+ * own `update`, another tab, or an app's async server hydration landing after mount —
2300
+ * re-renders with the new value and re-applies it to the DOM. Any number of independent
2301
+ * instances may run at once as long as each is given its own store (or its own
2302
+ * `storageKey`, for the default store) — nothing here is a module-level singleton. */
2303
+ declare function useAppearancePrefs(store: AppearanceStore): [AppearancePrefs, (patch: Partial<AppearancePrefs>) => void];
2276
2304
 
2277
2305
  interface AppearanceMenuProps extends AppearanceStoreOptions {
2306
+ /** An app-supplied external store (read/write/subscribe) — e.g. an adapter over a
2307
+ * server-synced prefs cache, so a value that arrives after mount still reaches this
2308
+ * menu and the DOM. Omit to get the default localStorage-backed store, configured by
2309
+ * `storageKey`/`storage`/`defaults`. */
2310
+ store?: AppearanceStore;
2278
2311
  className?: string;
2279
2312
  }
2280
2313
  /**
@@ -2289,7 +2322,7 @@ interface AppearanceMenuProps extends AppearanceStoreOptions {
2289
2322
  * the `[data-theme]`/`[data-text-scale]`/`[data-contrast]`/`[data-motion]` attributes
2290
2323
  * this component sets on `document.documentElement` — no inline styles, no app-side CSS.
2291
2324
  */
2292
- declare function AppearanceMenu({ className, ...storeOptions }: AppearanceMenuProps): React.JSX.Element;
2325
+ declare function AppearanceMenu({ className, store: storeProp, storageKey, storage, defaults }: AppearanceMenuProps): React.JSX.Element;
2293
2326
 
2294
2327
  interface EndpointSpec {
2295
2328
  id: string;
@@ -2336,6 +2369,42 @@ declare function Json({ obj }: {
2336
2369
  /** Drop-in browser for a simulated API contract. Takes the spec as data. */
2337
2370
  declare function ApiSpecBrowser({ spec, onRequest, modules, groups, title, kicker, lede, sourceNote, conventions, openQuestions, className, ...rest }: ApiSpecBrowserProps): React.JSX.Element;
2338
2371
 
2372
+ type ProfileFieldType = "text" | "textarea" | "select" | "readonly";
2373
+ interface ProfileFieldDef {
2374
+ /** Draft/patch key. Also the key `onSave`'s draft carries this value under. */
2375
+ key: string;
2376
+ label: string;
2377
+ /** Default "text". "readonly" renders like "text" but is never editable, regardless
2378
+ * of any `onChange`. */
2379
+ type?: ProfileFieldType;
2380
+ /** Groups fields sharing the same value into one Card, titled by this group's name.
2381
+ * Default group: "Identity". Fields are rendered in the order their group first
2382
+ * appears, then in the order given within that group. */
2383
+ group?: string;
2384
+ /** Shown under the group's title — the first field in a group with one supplies it. */
2385
+ groupDescription?: React.ReactNode;
2386
+ placeholder?: string;
2387
+ /** Static help text, or computed from the signed-in user (e.g. a different string for
2388
+ * an SSO- vs. password-managed account). */
2389
+ help?: string | ((user: SessionUser) => string);
2390
+ /** Required for `type: "select"`. */
2391
+ options?: string[];
2392
+ /** For `type: "textarea"`. Default 3. */
2393
+ rows?: number;
2394
+ /** Forces read-only regardless of `type`. */
2395
+ readOnly?: boolean;
2396
+ /** Computes this field's initial value from the signed-in user. Default: the user
2397
+ * property of the same name, coerced to a string (`String(user[key] ?? "")`) — set
2398
+ * this when the field's key doesn't match a `SessionUser` property, or needs
2399
+ * formatting. */
2400
+ value?: (user: SessionUser) => string;
2401
+ }
2402
+ interface ProfileNotificationDef {
2403
+ /** Draft key, read from/written into `notify: Record<string, boolean>`. */
2404
+ key: string;
2405
+ label: string;
2406
+ description?: string;
2407
+ }
2339
2408
  interface DeviceSession {
2340
2409
  id: string;
2341
2410
  device: string;
@@ -2346,20 +2415,38 @@ interface DeviceSession {
2346
2415
  interface ProfilePageProps {
2347
2416
  /** Defaults to the signed-in user from the injected session. */
2348
2417
  user?: SessionUser;
2349
- /** Persist through your own endpoint. Defaults to the injected session's `saveProfile`
2350
- * (the demo provider wires this to SessionKit.saveProfile); if neither is available, Save
2351
- * is disabled. */
2352
- onSave?: (draft: Partial<SessionUser>) => void | Promise<void>;
2418
+ /** The editable fields this app's profile has. Omit (or pass none) and no field cards
2419
+ * render at all — only the avatar header and the Access card remain. */
2420
+ fields?: ProfileFieldDef[];
2421
+ /** The notification toggles this app has. Omit and the Notifications card doesn't
2422
+ * render. */
2423
+ notifications?: ProfileNotificationDef[];
2424
+ /** Rendered after the field cards and before Notifications — for app-specific content
2425
+ * that isn't a plain field, e.g. a link out to another app's own profile page for
2426
+ * fields that live there instead. */
2427
+ extra?: React.ReactNode;
2428
+ /** Renders the "Change photo" button when supplied; omitted entirely otherwise. */
2429
+ onChangePhoto?: () => void;
2430
+ /** Persist edited fields/notifications through your own endpoint. Defaults to the
2431
+ * injected session's `saveProfile` (the demo provider wires this to
2432
+ * SessionKit.saveProfile); if neither is available, Save is disabled. Receives every
2433
+ * field's current value under its `key`, plus `notify` when `notifications` is set. */
2434
+ onSave?: (draft: Record<string, string> & {
2435
+ notify?: Record<string, boolean>;
2436
+ }) => void | Promise<void>;
2353
2437
  onNavigate?: (href: string) => void;
2438
+ /** Renders the "Signed-in devices" card when supplied (an empty array still renders
2439
+ * the card, showing none); omitted entirely otherwise — no fabricated device list. */
2354
2440
  sessions?: DeviceSession[];
2355
- showSessions?: boolean;
2441
+ onSignOutEverywhere?: () => void | Promise<void>;
2356
2442
  className?: string;
2357
2443
  }
2358
2444
  /**
2359
- * The shared profile page: identity, working preferences, notifications, devices.
2360
- * Roles are shown but never editable — self-promotion is the reason RBAC exists.
2445
+ * The shared profile page: identity, working preferences, notifications, devices — all
2446
+ * driven entirely by the `fields`/`notifications`/`sessions` this app supplies. Roles are
2447
+ * shown but never editable — self-promotion is the reason RBAC exists.
2361
2448
  */
2362
- declare function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSessions, className, ...rest }: ProfilePageProps): React.JSX.Element;
2449
+ declare function ProfilePage({ user: userProp, fields, notifications, extra, onChangePhoto, onSave, onNavigate, sessions, onSignOutEverywhere, className, }: ProfilePageProps): React.JSX.Element;
2363
2450
 
2364
2451
  interface RoadmapTimelineProps {
2365
2452
  /** Called with a flag key when the reader clicks one — route it to your flag admin. */
@@ -3956,4 +4043,57 @@ interface VersionStore<TState, TDiff = unknown> {
3956
4043
  }
3957
4044
  declare function createVersionStore<TState, TDiff = unknown>(initialState: TState, options?: CreateVersionStoreOptions<TState, TDiff>): VersionStore<TState, TDiff>;
3958
4045
 
3959
- export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_UNAVAILABLE, Calendar, type CalendarProps, Card, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, ChatTranscript, type ChatTranscriptProps, ChatTurn, type ChatTurnProps, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DataTable, type DataTableColumn, type DataTableProps, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, FeatureGate, type FeatureGateProps, type FeatureStatus, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterField, type FilterFieldOption, type FilterFieldSelect, type FilterFieldText, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, Gate, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type JobStatus, Json, KeyHint, type KeyHintProps, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NumberInput, type NumberInputProps, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Placement, type PollOptions, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QueryKit, type QueuedTurn, QuotaRow, type QuotaRowProps, Radio, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastProps, Tooltip, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, type UsageLimit, UseFeatureStatus, UseRuntimeMode, type UseServerTableOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, acceptMatches, anyOfFilter, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, iconForMime, importanceLevel, importanceTokens, isImage, isSystemMessage, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useFeatureStatus, usePopoverPosition, useRuntimeMode, useServerTable, useSessionContext, useStagedFiles, visibleMessages };
4046
+ /**
4047
+ * MP-214: the responsive-rail behaviour every app-level shell was hand-rolling (and, in
4048
+ * sms-app's case, already diverging on — see the SMS-5 architecture-gate review). Owns:
4049
+ *
4050
+ * - overlay-vs-docked detection at `breakpoint` (default 1024px, matching the CSS in
4051
+ * components.css's `.fd-side` media query — this hook and that stylesheet must agree
4052
+ * on the same number, since neither reads it from the other);
4053
+ * - the rail's open/closed state, forced closed on entry to overlay and forced open on
4054
+ * return to docked (matching the desktop-collapse behaviour PlannerShell already had);
4055
+ * - Escape-to-close while the overlay is open;
4056
+ * - a body scroll lock while the overlay is open, so the page behind a full-height
4057
+ * off-canvas rail can't scroll;
4058
+ * - a focus trap (Tab/Shift+Tab wrap inside the rail) plus focus return to whatever was
4059
+ * focused before the overlay opened — none of which any prior copy of this behaviour
4060
+ * implemented.
4061
+ *
4062
+ * `initialOpen`/`onPersist` are the seam for a desktop-only persisted preference (e.g. a
4063
+ * `usePref`-backed value) — this hook never persists anything itself, and never reads or
4064
+ * writes storage, so it stays usable in an app with no such preference at all.
4065
+ */
4066
+ interface UseResponsiveRailOptions {
4067
+ /** Max-width (px) at which the rail becomes an overlay. Must match the CSS breakpoint
4068
+ * the consumer's `SidebarNav` styling uses — default 1024, the design system's own. */
4069
+ breakpoint?: number;
4070
+ /** The rail's open state on first render while docked (desktop). Ignored while the
4071
+ * initial viewport is already in overlay range — an overlay always starts closed. */
4072
+ initialOpen?: boolean;
4073
+ /** Called with the new open state whenever it changes *while docked* — the hook's only
4074
+ * hook into persistence. Never called for an overlay open/close, which is transient by
4075
+ * design (mirrors PlannerShell's `railPref`, which never persists a mobile toggle). */
4076
+ onPersist?: (open: boolean) => void;
4077
+ }
4078
+ interface UseResponsiveRailResult {
4079
+ /** Whether the rail is currently visible/expanded. */
4080
+ open: boolean;
4081
+ /** True below `breakpoint` — the rail renders as a scrimmed overlay instead of a
4082
+ * docked column. */
4083
+ overlay: boolean;
4084
+ /** Attach to the rail's root DOM node (e.g. `SidebarNav`'s forwarded ref) — required for
4085
+ * the focus trap and initial-focus behaviour while the overlay is open. */
4086
+ navRef: React.RefObject<HTMLElement>;
4087
+ /** Flips `open`. Wire directly to `Topbar`'s `onMenu` — works at every width the rail is
4088
+ * shown at, docked or overlay, never a no-op. */
4089
+ toggle: () => void;
4090
+ /** Closes the rail. Never persists, even while docked — for the scrim's onClick and
4091
+ * Escape, where the value is a transient dismissal rather than a stated preference. */
4092
+ close: () => void;
4093
+ /** Sets `open` directly. Persists via `onPersist` only while docked, same rule as
4094
+ * `toggle`. */
4095
+ setOpen: (open: boolean) => void;
4096
+ }
4097
+ declare function useResponsiveRail(options?: UseResponsiveRailOptions): UseResponsiveRailResult;
4098
+
4099
+ export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_UNAVAILABLE, Calendar, type CalendarProps, Card, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, ChatTranscript, type ChatTranscriptProps, ChatTurn, type ChatTurnProps, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DataTable, type DataTableColumn, type DataTableProps, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, FeatureGate, type FeatureGateProps, type FeatureStatus, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterField, type FilterFieldOption, type FilterFieldSelect, type FilterFieldText, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, Gate, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type JobStatus, Json, KeyHint, type KeyHintProps, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NumberInput, type NumberInputProps, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Placement, type PollOptions, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QueryKit, type QueuedTurn, QuotaRow, type QuotaRowProps, Radio, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastProps, Tooltip, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, type UsageLimit, UseFeatureStatus, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, acceptMatches, anyOfFilter, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, iconForMime, importanceLevel, importanceTokens, isImage, isSystemMessage, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useFeatureStatus, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStagedFiles, visibleMessages };
package/dist/index.d.ts CHANGED
@@ -416,7 +416,7 @@ interface SidebarNavProps {
416
416
  open?: boolean;
417
417
  className?: string;
418
418
  }
419
- declare function SidebarNav({ brand, groups, current, onNavigate, footer, open, className, ...rest }: SidebarNavProps): React.JSX.Element;
419
+ declare const SidebarNav: React.ForwardRefExoticComponent<SidebarNavProps & React.RefAttributes<HTMLElement>>;
420
420
 
421
421
  interface FlytedeskMarkProps {
422
422
  size?: "sm" | "md" | "lg";
@@ -2239,6 +2239,25 @@ interface AppearancePrefs {
2239
2239
  * itself asked to reduce. */
2240
2240
  reduceMotion: boolean;
2241
2241
  }
2242
+ declare const DEFAULT_STORAGE_KEY = "fd-appearance";
2243
+ declare const DEFAULT_PREFS: AppearancePrefs;
2244
+ /** An app-supplied external store for `AppearancePrefs` — the same read/subscribe shape
2245
+ * `React.useSyncExternalStore` expects, plus a `write`. Implement this over whatever a
2246
+ * consuming app already has (a server-synced prefs cache, a Redux/Zustand store, …) to
2247
+ * drive `AppearanceMenu` from that state instead of the default localStorage store. */
2248
+ interface AppearanceStore {
2249
+ /** Synchronous current value. Called on every render that might have changed it —
2250
+ * must be cheap and must not allocate a new object unless the value actually changed
2251
+ * (React compares by reference to decide whether to re-render). */
2252
+ getSnapshot: () => AppearancePrefs;
2253
+ /** Persist a full prefs object. `AppearanceMenu` always calls this with the complete,
2254
+ * merged record — never a partial patch — so a store never needs to merge itself. */
2255
+ write: (prefs: AppearancePrefs) => void;
2256
+ /** Register a callback fired whenever the snapshot changes for a reason other than this
2257
+ * store's own `write` call returning (e.g. another tab, or an app's async server
2258
+ * hydration completing after mount). Returns its own unsubscribe. */
2259
+ subscribe: (onChange: () => void) => () => void;
2260
+ }
2242
2261
  interface AppearanceStoreOptions {
2243
2262
  /** localStorage (or `storage`) key these prefs are read from / written to. Default
2244
2263
  * "fd-appearance". Namespace this per consuming app. */
@@ -2249,17 +2268,25 @@ interface AppearanceStoreOptions {
2249
2268
  /** Overrides the built-in defaults (`system` / `md` / off / off) per field. */
2250
2269
  defaults?: Partial<AppearancePrefs>;
2251
2270
  }
2252
- declare const DEFAULT_STORAGE_KEY = "fd-appearance";
2253
- declare const DEFAULT_PREFS: AppearancePrefs;
2254
2271
  /** "system" resolved against the OS's current setting. Pure aside from reading
2255
2272
  * `matchMedia` — never throws in an environment without it (SSR, some test runners). */
2256
2273
  declare function resolveTheme(mode: ThemeMode): "light" | "dark";
2257
2274
  /** Reads stored prefs, falling back field-by-field to defaults — a missing key, a
2258
2275
  * malformed JSON blob, or a value of the wrong shape/type each fall back individually
2259
2276
  * rather than discarding the whole record (a bad stored value degrades, it never
2260
- * crashes the caller). */
2277
+ * crashes the caller). Used internally by `createLocalStorageAppearanceStore`; exported
2278
+ * as a low-level primitive for a caller building its own store on top of a similar
2279
+ * key/value backend. */
2261
2280
  declare function loadPrefs(opts?: AppearanceStoreOptions): AppearancePrefs;
2262
2281
  declare function savePrefs(prefs: AppearancePrefs, opts?: AppearanceStoreOptions): void;
2282
+ /** The default `AppearanceStore`: backed by `storage` (default `window.localStorage`)
2283
+ * under `storageKey` (default `"fd-appearance"`). Same-tab writes notify this store's
2284
+ * own subscribers synchronously; the browser's `storage` event keeps every OTHER tab
2285
+ * in sync too (a tab never gets its own `storage` event for its own write, which is
2286
+ * exactly why same-tab notification is handled separately here). The window listener is
2287
+ * attached only while at least one subscriber is registered, and removed once the last
2288
+ * one unsubscribes — a store an app creates per-mount never leaks a listener. */
2289
+ declare function createLocalStorageAppearanceStore(opts?: AppearanceStoreOptions): AppearanceStore;
2263
2290
  /** Sets every attribute this kit's tokens.css rules read: `[data-theme]` (resolved,
2264
2291
  * never "system" itself — nothing downstream re-resolves it), `[data-text-scale]`,
2265
2292
  * `[data-contrast="high"]` (present only when on — absent, not "normal", is the "off"
@@ -2267,14 +2294,20 @@ declare function savePrefs(prefs: AppearancePrefs, opts?: AppearanceStoreOptions
2267
2294
  * `[data-motion="reduce"]` (same absent-is-off shape). No inline styles: every visual
2268
2295
  * effect is a CSS rule in this package's own styles, driven by these attributes alone. */
2269
2296
  declare function applyPrefs(prefs: AppearancePrefs, root?: HTMLElement): void;
2270
- /** [prefs, update] — loads once (lazy initial state, so there's no flash of defaults
2271
- * before localStorage is read), applies + persists on every change, and re-resolves
2272
- * "system" live while it's selected (the OS setting can change without this tab
2273
- * reloading). Any number of independent instances may run at once as long as each is
2274
- * given its own `storageKey` — nothing here is a module-level singleton. */
2275
- declare function useAppearancePrefs(opts?: AppearanceStoreOptions): [AppearancePrefs, (patch: Partial<AppearancePrefs>) => void];
2297
+ /** [prefs, update] over an app-supplied `AppearanceStore`. Reads through
2298
+ * `React.useSyncExternalStore`, so a snapshot that changes for ANY reason — this hook's
2299
+ * own `update`, another tab, or an app's async server hydration landing after mount —
2300
+ * re-renders with the new value and re-applies it to the DOM. Any number of independent
2301
+ * instances may run at once as long as each is given its own store (or its own
2302
+ * `storageKey`, for the default store) — nothing here is a module-level singleton. */
2303
+ declare function useAppearancePrefs(store: AppearanceStore): [AppearancePrefs, (patch: Partial<AppearancePrefs>) => void];
2276
2304
 
2277
2305
  interface AppearanceMenuProps extends AppearanceStoreOptions {
2306
+ /** An app-supplied external store (read/write/subscribe) — e.g. an adapter over a
2307
+ * server-synced prefs cache, so a value that arrives after mount still reaches this
2308
+ * menu and the DOM. Omit to get the default localStorage-backed store, configured by
2309
+ * `storageKey`/`storage`/`defaults`. */
2310
+ store?: AppearanceStore;
2278
2311
  className?: string;
2279
2312
  }
2280
2313
  /**
@@ -2289,7 +2322,7 @@ interface AppearanceMenuProps extends AppearanceStoreOptions {
2289
2322
  * the `[data-theme]`/`[data-text-scale]`/`[data-contrast]`/`[data-motion]` attributes
2290
2323
  * this component sets on `document.documentElement` — no inline styles, no app-side CSS.
2291
2324
  */
2292
- declare function AppearanceMenu({ className, ...storeOptions }: AppearanceMenuProps): React.JSX.Element;
2325
+ declare function AppearanceMenu({ className, store: storeProp, storageKey, storage, defaults }: AppearanceMenuProps): React.JSX.Element;
2293
2326
 
2294
2327
  interface EndpointSpec {
2295
2328
  id: string;
@@ -2336,6 +2369,42 @@ declare function Json({ obj }: {
2336
2369
  /** Drop-in browser for a simulated API contract. Takes the spec as data. */
2337
2370
  declare function ApiSpecBrowser({ spec, onRequest, modules, groups, title, kicker, lede, sourceNote, conventions, openQuestions, className, ...rest }: ApiSpecBrowserProps): React.JSX.Element;
2338
2371
 
2372
+ type ProfileFieldType = "text" | "textarea" | "select" | "readonly";
2373
+ interface ProfileFieldDef {
2374
+ /** Draft/patch key. Also the key `onSave`'s draft carries this value under. */
2375
+ key: string;
2376
+ label: string;
2377
+ /** Default "text". "readonly" renders like "text" but is never editable, regardless
2378
+ * of any `onChange`. */
2379
+ type?: ProfileFieldType;
2380
+ /** Groups fields sharing the same value into one Card, titled by this group's name.
2381
+ * Default group: "Identity". Fields are rendered in the order their group first
2382
+ * appears, then in the order given within that group. */
2383
+ group?: string;
2384
+ /** Shown under the group's title — the first field in a group with one supplies it. */
2385
+ groupDescription?: React.ReactNode;
2386
+ placeholder?: string;
2387
+ /** Static help text, or computed from the signed-in user (e.g. a different string for
2388
+ * an SSO- vs. password-managed account). */
2389
+ help?: string | ((user: SessionUser) => string);
2390
+ /** Required for `type: "select"`. */
2391
+ options?: string[];
2392
+ /** For `type: "textarea"`. Default 3. */
2393
+ rows?: number;
2394
+ /** Forces read-only regardless of `type`. */
2395
+ readOnly?: boolean;
2396
+ /** Computes this field's initial value from the signed-in user. Default: the user
2397
+ * property of the same name, coerced to a string (`String(user[key] ?? "")`) — set
2398
+ * this when the field's key doesn't match a `SessionUser` property, or needs
2399
+ * formatting. */
2400
+ value?: (user: SessionUser) => string;
2401
+ }
2402
+ interface ProfileNotificationDef {
2403
+ /** Draft key, read from/written into `notify: Record<string, boolean>`. */
2404
+ key: string;
2405
+ label: string;
2406
+ description?: string;
2407
+ }
2339
2408
  interface DeviceSession {
2340
2409
  id: string;
2341
2410
  device: string;
@@ -2346,20 +2415,38 @@ interface DeviceSession {
2346
2415
  interface ProfilePageProps {
2347
2416
  /** Defaults to the signed-in user from the injected session. */
2348
2417
  user?: SessionUser;
2349
- /** Persist through your own endpoint. Defaults to the injected session's `saveProfile`
2350
- * (the demo provider wires this to SessionKit.saveProfile); if neither is available, Save
2351
- * is disabled. */
2352
- onSave?: (draft: Partial<SessionUser>) => void | Promise<void>;
2418
+ /** The editable fields this app's profile has. Omit (or pass none) and no field cards
2419
+ * render at all — only the avatar header and the Access card remain. */
2420
+ fields?: ProfileFieldDef[];
2421
+ /** The notification toggles this app has. Omit and the Notifications card doesn't
2422
+ * render. */
2423
+ notifications?: ProfileNotificationDef[];
2424
+ /** Rendered after the field cards and before Notifications — for app-specific content
2425
+ * that isn't a plain field, e.g. a link out to another app's own profile page for
2426
+ * fields that live there instead. */
2427
+ extra?: React.ReactNode;
2428
+ /** Renders the "Change photo" button when supplied; omitted entirely otherwise. */
2429
+ onChangePhoto?: () => void;
2430
+ /** Persist edited fields/notifications through your own endpoint. Defaults to the
2431
+ * injected session's `saveProfile` (the demo provider wires this to
2432
+ * SessionKit.saveProfile); if neither is available, Save is disabled. Receives every
2433
+ * field's current value under its `key`, plus `notify` when `notifications` is set. */
2434
+ onSave?: (draft: Record<string, string> & {
2435
+ notify?: Record<string, boolean>;
2436
+ }) => void | Promise<void>;
2353
2437
  onNavigate?: (href: string) => void;
2438
+ /** Renders the "Signed-in devices" card when supplied (an empty array still renders
2439
+ * the card, showing none); omitted entirely otherwise — no fabricated device list. */
2354
2440
  sessions?: DeviceSession[];
2355
- showSessions?: boolean;
2441
+ onSignOutEverywhere?: () => void | Promise<void>;
2356
2442
  className?: string;
2357
2443
  }
2358
2444
  /**
2359
- * The shared profile page: identity, working preferences, notifications, devices.
2360
- * Roles are shown but never editable — self-promotion is the reason RBAC exists.
2445
+ * The shared profile page: identity, working preferences, notifications, devices — all
2446
+ * driven entirely by the `fields`/`notifications`/`sessions` this app supplies. Roles are
2447
+ * shown but never editable — self-promotion is the reason RBAC exists.
2361
2448
  */
2362
- declare function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSessions, className, ...rest }: ProfilePageProps): React.JSX.Element;
2449
+ declare function ProfilePage({ user: userProp, fields, notifications, extra, onChangePhoto, onSave, onNavigate, sessions, onSignOutEverywhere, className, }: ProfilePageProps): React.JSX.Element;
2363
2450
 
2364
2451
  interface RoadmapTimelineProps {
2365
2452
  /** Called with a flag key when the reader clicks one — route it to your flag admin. */
@@ -3956,4 +4043,57 @@ interface VersionStore<TState, TDiff = unknown> {
3956
4043
  }
3957
4044
  declare function createVersionStore<TState, TDiff = unknown>(initialState: TState, options?: CreateVersionStoreOptions<TState, TDiff>): VersionStore<TState, TDiff>;
3958
4045
 
3959
- export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_UNAVAILABLE, Calendar, type CalendarProps, Card, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, ChatTranscript, type ChatTranscriptProps, ChatTurn, type ChatTurnProps, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DataTable, type DataTableColumn, type DataTableProps, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, FeatureGate, type FeatureGateProps, type FeatureStatus, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterField, type FilterFieldOption, type FilterFieldSelect, type FilterFieldText, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, Gate, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type JobStatus, Json, KeyHint, type KeyHintProps, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NumberInput, type NumberInputProps, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Placement, type PollOptions, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QueryKit, type QueuedTurn, QuotaRow, type QuotaRowProps, Radio, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastProps, Tooltip, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, type UsageLimit, UseFeatureStatus, UseRuntimeMode, type UseServerTableOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, acceptMatches, anyOfFilter, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, iconForMime, importanceLevel, importanceTokens, isImage, isSystemMessage, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useFeatureStatus, usePopoverPosition, useRuntimeMode, useServerTable, useSessionContext, useStagedFiles, visibleMessages };
4046
+ /**
4047
+ * MP-214: the responsive-rail behaviour every app-level shell was hand-rolling (and, in
4048
+ * sms-app's case, already diverging on — see the SMS-5 architecture-gate review). Owns:
4049
+ *
4050
+ * - overlay-vs-docked detection at `breakpoint` (default 1024px, matching the CSS in
4051
+ * components.css's `.fd-side` media query — this hook and that stylesheet must agree
4052
+ * on the same number, since neither reads it from the other);
4053
+ * - the rail's open/closed state, forced closed on entry to overlay and forced open on
4054
+ * return to docked (matching the desktop-collapse behaviour PlannerShell already had);
4055
+ * - Escape-to-close while the overlay is open;
4056
+ * - a body scroll lock while the overlay is open, so the page behind a full-height
4057
+ * off-canvas rail can't scroll;
4058
+ * - a focus trap (Tab/Shift+Tab wrap inside the rail) plus focus return to whatever was
4059
+ * focused before the overlay opened — none of which any prior copy of this behaviour
4060
+ * implemented.
4061
+ *
4062
+ * `initialOpen`/`onPersist` are the seam for a desktop-only persisted preference (e.g. a
4063
+ * `usePref`-backed value) — this hook never persists anything itself, and never reads or
4064
+ * writes storage, so it stays usable in an app with no such preference at all.
4065
+ */
4066
+ interface UseResponsiveRailOptions {
4067
+ /** Max-width (px) at which the rail becomes an overlay. Must match the CSS breakpoint
4068
+ * the consumer's `SidebarNav` styling uses — default 1024, the design system's own. */
4069
+ breakpoint?: number;
4070
+ /** The rail's open state on first render while docked (desktop). Ignored while the
4071
+ * initial viewport is already in overlay range — an overlay always starts closed. */
4072
+ initialOpen?: boolean;
4073
+ /** Called with the new open state whenever it changes *while docked* — the hook's only
4074
+ * hook into persistence. Never called for an overlay open/close, which is transient by
4075
+ * design (mirrors PlannerShell's `railPref`, which never persists a mobile toggle). */
4076
+ onPersist?: (open: boolean) => void;
4077
+ }
4078
+ interface UseResponsiveRailResult {
4079
+ /** Whether the rail is currently visible/expanded. */
4080
+ open: boolean;
4081
+ /** True below `breakpoint` — the rail renders as a scrimmed overlay instead of a
4082
+ * docked column. */
4083
+ overlay: boolean;
4084
+ /** Attach to the rail's root DOM node (e.g. `SidebarNav`'s forwarded ref) — required for
4085
+ * the focus trap and initial-focus behaviour while the overlay is open. */
4086
+ navRef: React.RefObject<HTMLElement>;
4087
+ /** Flips `open`. Wire directly to `Topbar`'s `onMenu` — works at every width the rail is
4088
+ * shown at, docked or overlay, never a no-op. */
4089
+ toggle: () => void;
4090
+ /** Closes the rail. Never persists, even while docked — for the scrim's onClick and
4091
+ * Escape, where the value is a transient dismissal rather than a stated preference. */
4092
+ close: () => void;
4093
+ /** Sets `open` directly. Persists via `onPersist` only while docked, same rule as
4094
+ * `toggle`. */
4095
+ setOpen: (open: boolean) => void;
4096
+ }
4097
+ declare function useResponsiveRail(options?: UseResponsiveRailOptions): UseResponsiveRailResult;
4098
+
4099
+ export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_UNAVAILABLE, Calendar, type CalendarProps, Card, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, ChatTranscript, type ChatTranscriptProps, ChatTurn, type ChatTurnProps, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DataTable, type DataTableColumn, type DataTableProps, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, FeatureGate, type FeatureGateProps, type FeatureStatus, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterField, type FilterFieldOption, type FilterFieldSelect, type FilterFieldText, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, Gate, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type JobStatus, Json, KeyHint, type KeyHintProps, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NumberInput, type NumberInputProps, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Placement, type PollOptions, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QueryKit, type QueuedTurn, QuotaRow, type QuotaRowProps, Radio, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastProps, Tooltip, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, type UsageLimit, UseFeatureStatus, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, acceptMatches, anyOfFilter, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, iconForMime, importanceLevel, importanceTokens, isImage, isSystemMessage, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useFeatureStatus, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStagedFiles, visibleMessages };