@flytedan/flytebot-design-system 0.40.0 → 0.42.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
@@ -316,7 +316,11 @@ interface CollapsibleProps {
316
316
  }
317
317
  declare function Collapsible({ title, subtitle, badge, icon, defaultOpen, open, onToggle, children, className, ...rest }: CollapsibleProps): React.JSX.Element;
318
318
 
319
- /** A right-side panel for detail and editing without losing the list behind it. */
319
+ /** A right-side panel for detail and editing without losing the list behind it.
320
+ * MP-248: always modal (declares `aria-modal="true"`), so it traps Tab/Shift+Tab inside
321
+ * itself and returns focus to its trigger on close, via the design system's shared
322
+ * `useFocusTrap` (the same hook Modal uses) — one focus-trap implementation, reused
323
+ * rather than hand-rolled a second time. */
320
324
  interface DrawerProps {
321
325
  open?: boolean;
322
326
  title?: React.ReactNode;
@@ -2757,6 +2761,17 @@ interface SessionContextValue {
2757
2761
  * passes `AppSwitcher`'s own `apps` prop directly. */
2758
2762
  apps?: AppEntry[];
2759
2763
  demo?: DemoSessionControls;
2764
+ /**
2765
+ * True while this snapshot's permissions cannot be verified right now — an identity
2766
+ * provider or auth-store outage, never an ordinary initial load (that case has its own
2767
+ * "loading" region elsewhere and never reaches a `SessionProvider` at all). Permission is
2768
+ * then UNKNOWN, not denied: `can`/`canAny`/`hasRole` may still be defined and may still
2769
+ * fail closed for any OTHER caller that reads them directly, but `Gate` checks this field
2770
+ * FIRST and, when true, renders its pending state instead of evaluating them against a
2771
+ * snapshot that might already be stale. Omit (or leave `false`) for a session an app never
2772
+ * expects to go stale — every existing integration keeps its current behavior unchanged.
2773
+ */
2774
+ pending?: boolean;
2760
2775
  }
2761
2776
  interface SessionProviderProps {
2762
2777
  value: SessionContextValue;
@@ -3105,22 +3120,39 @@ interface PermissionDeniedProps {
3105
3120
  }
3106
3121
  /** Explains a block rather than hiding it — silence reads as a bug and files a ticket. */
3107
3122
  declare function PermissionDenied({ permission, title, detail, compact, className, ...rest }: PermissionDeniedProps): React.JSX.Element;
3123
+ interface GatePendingProps {
3124
+ compact?: boolean;
3125
+ className?: string;
3126
+ }
3127
+ /** Neutral placeholder for a permission that cannot be verified right now (an identity
3128
+ * provider or auth-store outage) — never a denial, and never the gated content itself,
3129
+ * which may have been authorized under roles that are no longer current. */
3130
+ declare function GatePending({ compact, className }: GatePendingProps): React.JSX.Element;
3108
3131
  interface GateProps {
3109
3132
  /** All of these must be held. */
3110
3133
  perm?: string | string[];
3111
3134
  /** At least one of these must be held. */
3112
3135
  anyOf?: string[];
3113
3136
  role?: string | string[];
3114
- /** Render nothing instead of an explanation — for chrome like toolbar buttons. */
3137
+ /** Render nothing instead of an explanation — for chrome like toolbar buttons. Also
3138
+ * governs the pending case: a `silent` gate renders nothing while pending too, rather
3139
+ * than the default `GatePending` placeholder. */
3115
3140
  silent?: boolean;
3116
3141
  fallback?: React.ReactNode;
3142
+ /** Rendered while `SessionContextValue.pending` is true, in place of the default
3143
+ * `GatePending` placeholder. Never falls back to `fallback` or to evaluating
3144
+ * `perm`/`anyOf`/`role` — a pending session's `can`/`canAny`/`hasRole` are not
3145
+ * evaluated at all, since neither a grant nor a denial would be truthful. */
3146
+ pendingFallback?: React.ReactNode;
3117
3147
  compact?: boolean;
3118
3148
  children?: React.ReactNode;
3119
3149
  }
3120
- /** Permission gate. Denied by default shows PermissionDenied. Reads the injected session
3121
- * (see kits/sessionContext.tsx) — re-renders whenever that context's value changes, so no
3150
+ /** Permission gate. Denied by default shows PermissionDenied. Pending (the session's
3151
+ * permissions can't be verified right now) shows GatePending instead — never a denial,
3152
+ * and never the gated content itself. Reads the injected session (see
3153
+ * kits/sessionContext.tsx) — re-renders whenever that context's value changes, so no
3122
3154
  * separate subscription is needed here. */
3123
- declare function Gate({ perm, anyOf, role, silent, fallback, compact, children }: GateProps): React.ReactNode;
3155
+ declare function Gate({ perm, anyOf, role, silent, fallback, pendingFallback, compact, children }: GateProps): React.ReactNode;
3124
3156
  interface FeatureGateProps {
3125
3157
  flag: string;
3126
3158
  fallback?: React.ReactNode;
@@ -3149,7 +3181,12 @@ interface FeatureGateProps {
3149
3181
  }
3150
3182
  /** Feature gate. ALWAYS silent when off — an unreleased feature should leave no trace. */
3151
3183
  declare function FeatureGate({ flag, fallback, children, onRoadmap, blur, minHeight, label, variant, preview, bypassPerm }: FeatureGateProps): React.ReactNode;
3152
- /** Inline "why is this disabled" affordance for buttons that must stay visible. */
3184
+ /** Inline "why is this disabled" affordance for buttons that must stay visible.
3185
+ * MP-253: while the session is pending, permission is unknown, not denied — the same rule
3186
+ * Gate applies. Rendering the control live would risk a stale-role grant; rendering the
3187
+ * "Requires X" denial would assert a permission gap that might not be real. So it dims the
3188
+ * control (never `can()`), with a title that says the state is unverified rather than
3189
+ * claiming a specific permission is missing. */
3153
3190
  declare function PermissionHint({ perm, children }: {
3154
3191
  perm: string | string[];
3155
3192
  children?: React.ReactNode;
@@ -4743,4 +4780,4 @@ declare function formatDocumentTitle(routeTitle: string | undefined | null, appN
4743
4780
  */
4744
4781
  declare function useDocumentTitle(routeTitle: string | undefined | null, appName: string): void;
4745
4782
 
4746
- export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, 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, DonutChart, type DonutChartProps, type DonutSegment, 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 FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, 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 Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, 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, ScreenHead, type ScreenHeadProps, 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, type SignInContinueAs, SignInPage, type SignInPageProps, 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, TrendChart, type TrendChartProps, type TrendSeries, 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, formatDocumentTitle, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useDocumentTitle, useFeatureStatus, useFocusTrap, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStagedFiles, validateFilterValue, visibleMessages };
4783
+ export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, 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, DonutChart, type DonutChartProps, type DonutSegment, 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 FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, 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 Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, 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, ScreenHead, type ScreenHeadProps, 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, type SignInContinueAs, SignInPage, type SignInPageProps, 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, TrendChart, type TrendChartProps, type TrendSeries, 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, formatDocumentTitle, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useDocumentTitle, useFeatureStatus, useFocusTrap, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStagedFiles, validateFilterValue, visibleMessages };
package/dist/index.d.ts CHANGED
@@ -316,7 +316,11 @@ interface CollapsibleProps {
316
316
  }
317
317
  declare function Collapsible({ title, subtitle, badge, icon, defaultOpen, open, onToggle, children, className, ...rest }: CollapsibleProps): React.JSX.Element;
318
318
 
319
- /** A right-side panel for detail and editing without losing the list behind it. */
319
+ /** A right-side panel for detail and editing without losing the list behind it.
320
+ * MP-248: always modal (declares `aria-modal="true"`), so it traps Tab/Shift+Tab inside
321
+ * itself and returns focus to its trigger on close, via the design system's shared
322
+ * `useFocusTrap` (the same hook Modal uses) — one focus-trap implementation, reused
323
+ * rather than hand-rolled a second time. */
320
324
  interface DrawerProps {
321
325
  open?: boolean;
322
326
  title?: React.ReactNode;
@@ -2757,6 +2761,17 @@ interface SessionContextValue {
2757
2761
  * passes `AppSwitcher`'s own `apps` prop directly. */
2758
2762
  apps?: AppEntry[];
2759
2763
  demo?: DemoSessionControls;
2764
+ /**
2765
+ * True while this snapshot's permissions cannot be verified right now — an identity
2766
+ * provider or auth-store outage, never an ordinary initial load (that case has its own
2767
+ * "loading" region elsewhere and never reaches a `SessionProvider` at all). Permission is
2768
+ * then UNKNOWN, not denied: `can`/`canAny`/`hasRole` may still be defined and may still
2769
+ * fail closed for any OTHER caller that reads them directly, but `Gate` checks this field
2770
+ * FIRST and, when true, renders its pending state instead of evaluating them against a
2771
+ * snapshot that might already be stale. Omit (or leave `false`) for a session an app never
2772
+ * expects to go stale — every existing integration keeps its current behavior unchanged.
2773
+ */
2774
+ pending?: boolean;
2760
2775
  }
2761
2776
  interface SessionProviderProps {
2762
2777
  value: SessionContextValue;
@@ -3105,22 +3120,39 @@ interface PermissionDeniedProps {
3105
3120
  }
3106
3121
  /** Explains a block rather than hiding it — silence reads as a bug and files a ticket. */
3107
3122
  declare function PermissionDenied({ permission, title, detail, compact, className, ...rest }: PermissionDeniedProps): React.JSX.Element;
3123
+ interface GatePendingProps {
3124
+ compact?: boolean;
3125
+ className?: string;
3126
+ }
3127
+ /** Neutral placeholder for a permission that cannot be verified right now (an identity
3128
+ * provider or auth-store outage) — never a denial, and never the gated content itself,
3129
+ * which may have been authorized under roles that are no longer current. */
3130
+ declare function GatePending({ compact, className }: GatePendingProps): React.JSX.Element;
3108
3131
  interface GateProps {
3109
3132
  /** All of these must be held. */
3110
3133
  perm?: string | string[];
3111
3134
  /** At least one of these must be held. */
3112
3135
  anyOf?: string[];
3113
3136
  role?: string | string[];
3114
- /** Render nothing instead of an explanation — for chrome like toolbar buttons. */
3137
+ /** Render nothing instead of an explanation — for chrome like toolbar buttons. Also
3138
+ * governs the pending case: a `silent` gate renders nothing while pending too, rather
3139
+ * than the default `GatePending` placeholder. */
3115
3140
  silent?: boolean;
3116
3141
  fallback?: React.ReactNode;
3142
+ /** Rendered while `SessionContextValue.pending` is true, in place of the default
3143
+ * `GatePending` placeholder. Never falls back to `fallback` or to evaluating
3144
+ * `perm`/`anyOf`/`role` — a pending session's `can`/`canAny`/`hasRole` are not
3145
+ * evaluated at all, since neither a grant nor a denial would be truthful. */
3146
+ pendingFallback?: React.ReactNode;
3117
3147
  compact?: boolean;
3118
3148
  children?: React.ReactNode;
3119
3149
  }
3120
- /** Permission gate. Denied by default shows PermissionDenied. Reads the injected session
3121
- * (see kits/sessionContext.tsx) — re-renders whenever that context's value changes, so no
3150
+ /** Permission gate. Denied by default shows PermissionDenied. Pending (the session's
3151
+ * permissions can't be verified right now) shows GatePending instead — never a denial,
3152
+ * and never the gated content itself. Reads the injected session (see
3153
+ * kits/sessionContext.tsx) — re-renders whenever that context's value changes, so no
3122
3154
  * separate subscription is needed here. */
3123
- declare function Gate({ perm, anyOf, role, silent, fallback, compact, children }: GateProps): React.ReactNode;
3155
+ declare function Gate({ perm, anyOf, role, silent, fallback, pendingFallback, compact, children }: GateProps): React.ReactNode;
3124
3156
  interface FeatureGateProps {
3125
3157
  flag: string;
3126
3158
  fallback?: React.ReactNode;
@@ -3149,7 +3181,12 @@ interface FeatureGateProps {
3149
3181
  }
3150
3182
  /** Feature gate. ALWAYS silent when off — an unreleased feature should leave no trace. */
3151
3183
  declare function FeatureGate({ flag, fallback, children, onRoadmap, blur, minHeight, label, variant, preview, bypassPerm }: FeatureGateProps): React.ReactNode;
3152
- /** Inline "why is this disabled" affordance for buttons that must stay visible. */
3184
+ /** Inline "why is this disabled" affordance for buttons that must stay visible.
3185
+ * MP-253: while the session is pending, permission is unknown, not denied — the same rule
3186
+ * Gate applies. Rendering the control live would risk a stale-role grant; rendering the
3187
+ * "Requires X" denial would assert a permission gap that might not be real. So it dims the
3188
+ * control (never `can()`), with a title that says the state is unverified rather than
3189
+ * claiming a specific permission is missing. */
3153
3190
  declare function PermissionHint({ perm, children }: {
3154
3191
  perm: string | string[];
3155
3192
  children?: React.ReactNode;
@@ -4743,4 +4780,4 @@ declare function formatDocumentTitle(routeTitle: string | undefined | null, appN
4743
4780
  */
4744
4781
  declare function useDocumentTitle(routeTitle: string | undefined | null, appName: string): void;
4745
4782
 
4746
- export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, 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, DonutChart, type DonutChartProps, type DonutSegment, 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 FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, 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 Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, 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, ScreenHead, type ScreenHeadProps, 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, type SignInContinueAs, SignInPage, type SignInPageProps, 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, TrendChart, type TrendChartProps, type TrendSeries, 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, formatDocumentTitle, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useDocumentTitle, useFeatureStatus, useFocusTrap, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStagedFiles, validateFilterValue, visibleMessages };
4783
+ export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, 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, DonutChart, type DonutChartProps, type DonutSegment, 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 FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, 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 Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, 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, ScreenHead, type ScreenHeadProps, 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, type SignInContinueAs, SignInPage, type SignInPageProps, 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, TrendChart, type TrendChartProps, type TrendSeries, 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, formatDocumentTitle, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useDocumentTitle, useFeatureStatus, useFocusTrap, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStagedFiles, validateFilterValue, visibleMessages };
package/dist/index.js CHANGED
@@ -772,54 +772,17 @@ function Collapsible({
772
772
  }
773
773
 
774
774
  // src/components/surfaces/Drawer.tsx
775
- import * as React5 from "react";
775
+ import * as React6 from "react";
776
776
  import { createPortal as createPortal2 } from "react-dom";
777
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
778
- function Drawer({ open = true, title, onClose, footer, children, className = "", ...rest }) {
779
- const zIndex = useOverlayLayer(open);
780
- const [closing, setClosing] = React5.useState(false);
781
- const close = React5.useCallback(() => {
782
- if (!onClose) return;
783
- setClosing(true);
784
- setTimeout(onClose, 210);
785
- }, [onClose]);
786
- React5.useEffect(() => {
787
- if (!open || !onClose) return;
788
- const h = (e) => {
789
- if (e.key === "Escape") close();
790
- };
791
- document.addEventListener("keydown", h);
792
- return () => document.removeEventListener("keydown", h);
793
- }, [open, onClose, close]);
794
- if (!open) return null;
795
- return createPortal2(
796
- /* @__PURE__ */ jsxs6(LayerProvider, { zIndex, children: [
797
- /* @__PURE__ */ jsx8("div", { className: "fd-scrim" + (closing ? " is-closing" : ""), style: { display: "block", zIndex: zIndex - LAYER_STEP }, onClick: close }),
798
- /* @__PURE__ */ jsxs6("aside", { className: ["fd-drawer", closing ? "is-closing" : "", className].filter(Boolean).join(" "), role: "dialog", "aria-modal": "true", ...rest, style: { zIndex }, children: [
799
- /* @__PURE__ */ jsxs6("div", { className: "fd-card-head", style: { flex: "none" }, children: [
800
- /* @__PURE__ */ jsx8("span", { className: "fd-card-head-title", title: truncationTitle(title), children: title }),
801
- onClose ? /* @__PURE__ */ jsx8("button", { type: "button", className: "fd-btn-icon", "aria-label": "Close", onClick: close, children: /* @__PURE__ */ jsx8("i", { className: "ph ph-x" }) }) : null
802
- ] }),
803
- /* @__PURE__ */ jsx8("div", { style: { flex: "1 1 auto", minHeight: 0, overflow: "auto", padding: 20 }, children }),
804
- footer ? /* @__PURE__ */ jsx8("div", { className: "fd-card-foot", style: { flex: "none" }, children: typeof footer === "function" ? footer(close) : footer }) : null
805
- ] })
806
- ] }),
807
- document.body
808
- );
809
- }
810
-
811
- // src/components/surfaces/Modal.tsx
812
- import * as React7 from "react";
813
- import { createPortal as createPortal3 } from "react-dom";
814
777
 
815
778
  // src/kits/useFocusTrap.ts
816
- import * as React6 from "react";
779
+ import * as React5 from "react";
817
780
  var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
818
781
  function getFocusable(container) {
819
782
  return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR));
820
783
  }
821
784
  function useFocusTrap(containerRef, active) {
822
- React6.useEffect(() => {
785
+ React5.useEffect(() => {
823
786
  if (!active) return;
824
787
  const container = containerRef.current;
825
788
  if (!container) return;
@@ -855,7 +818,46 @@ function useFocusTrap(containerRef, active) {
855
818
  }, [active, containerRef]);
856
819
  }
857
820
 
821
+ // src/components/surfaces/Drawer.tsx
822
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
823
+ function Drawer({ open = true, title, onClose, footer, children, className = "", ...rest }) {
824
+ const zIndex = useOverlayLayer(open);
825
+ const asideRef = React6.useRef(null);
826
+ useFocusTrap(asideRef, !!open);
827
+ const [closing, setClosing] = React6.useState(false);
828
+ const close = React6.useCallback(() => {
829
+ if (!onClose) return;
830
+ setClosing(true);
831
+ setTimeout(onClose, 210);
832
+ }, [onClose]);
833
+ React6.useEffect(() => {
834
+ if (!open || !onClose) return;
835
+ const h = (e) => {
836
+ if (e.key === "Escape") close();
837
+ };
838
+ document.addEventListener("keydown", h);
839
+ return () => document.removeEventListener("keydown", h);
840
+ }, [open, onClose, close]);
841
+ if (!open) return null;
842
+ return createPortal2(
843
+ /* @__PURE__ */ jsxs6(LayerProvider, { zIndex, children: [
844
+ /* @__PURE__ */ jsx8("div", { className: "fd-scrim" + (closing ? " is-closing" : ""), style: { display: "block", zIndex: zIndex - LAYER_STEP }, onClick: close }),
845
+ /* @__PURE__ */ jsxs6("aside", { ref: asideRef, className: ["fd-drawer", closing ? "is-closing" : "", className].filter(Boolean).join(" "), role: "dialog", "aria-modal": "true", ...rest, style: { zIndex }, children: [
846
+ /* @__PURE__ */ jsxs6("div", { className: "fd-card-head", style: { flex: "none" }, children: [
847
+ /* @__PURE__ */ jsx8("span", { className: "fd-card-head-title", title: truncationTitle(title), children: title }),
848
+ onClose ? /* @__PURE__ */ jsx8("button", { type: "button", className: "fd-btn-icon", "aria-label": "Close", onClick: close, children: /* @__PURE__ */ jsx8("i", { className: "ph ph-x" }) }) : null
849
+ ] }),
850
+ /* @__PURE__ */ jsx8("div", { style: { flex: "1 1 auto", minHeight: 0, overflow: "auto", padding: 20 }, children }),
851
+ footer ? /* @__PURE__ */ jsx8("div", { className: "fd-card-foot", style: { flex: "none" }, children: typeof footer === "function" ? footer(close) : footer }) : null
852
+ ] })
853
+ ] }),
854
+ document.body
855
+ );
856
+ }
857
+
858
858
  // src/components/surfaces/Modal.tsx
859
+ import * as React7 from "react";
860
+ import { createPortal as createPortal3 } from "react-dom";
859
861
  import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
860
862
  function Modal({ open = true, title, description, onClose, footer, wide = false, children, className = "", ...rest }) {
861
863
  const [closing, setClosing] = React7.useState(false);
@@ -7060,14 +7062,14 @@ function AccountMenu({
7060
7062
  className = "",
7061
7063
  ...rest
7062
7064
  }) {
7063
- const { user, roles, can: can2, signOut: ctxSignOut, demo } = useSessionContext();
7065
+ const { user, roles, can: can2, signOut: ctxSignOut, demo, pending } = useSessionContext();
7064
7066
  const [open, setOpen] = React43.useState(false);
7065
7067
  const [switching, setSwitching] = React43.useState(false);
7066
7068
  const [signingOut, setSigningOut] = React43.useState(false);
7067
7069
  const [signOutError, setSignOutError] = React43.useState(null);
7068
7070
  const ref = React43.useRef(null);
7069
- const visibleLinks = links.filter((l) => !l.perm || can2(l.perm));
7070
- const visibleGroups = groups.map((g) => ({ label: g.label, links: g.links.filter((l) => !l.perm || can2(l.perm)) })).filter((g) => g.links.length);
7071
+ const visibleLinks = links.filter((l) => !l.perm || !pending && can2(l.perm));
7072
+ const visibleGroups = groups.map((g) => ({ label: g.label, links: g.links.filter((l) => !l.perm || !pending && can2(l.perm)) })).filter((g) => g.links.length);
7071
7073
  const closeMenu = () => {
7072
7074
  setOpen(false);
7073
7075
  setSignOutError(null);
@@ -10374,8 +10376,39 @@ function PermissionDenied({ permission, title, detail, compact: compact3 = false
10374
10376
  }
10375
10377
  );
10376
10378
  }
10377
- function Gate({ perm, anyOf, role, silent = false, fallback, compact: compact3 = false, children }) {
10378
- const { can: can2, canAny: canAny2, hasRole: hasRole2 } = useSessionContext();
10379
+ function GatePending({ compact: compact3 = false, className = "" }) {
10380
+ return /* @__PURE__ */ jsxs71(
10381
+ "div",
10382
+ {
10383
+ className: ["fd-stack", className].filter(Boolean).join(" "),
10384
+ role: "status",
10385
+ style: {
10386
+ gap: 10,
10387
+ alignItems: "flex-start",
10388
+ padding: compact3 ? "14px 16px" : "28px 24px",
10389
+ borderRadius: 10,
10390
+ border: "1px dashed var(--border-strong)",
10391
+ background: "var(--surface-2)",
10392
+ maxWidth: 560,
10393
+ textAlign: "left"
10394
+ },
10395
+ children: [
10396
+ /* @__PURE__ */ jsxs71("span", { className: "fd-row", style: { gap: 8 }, children: [
10397
+ /* @__PURE__ */ jsx77("i", { className: "ph ph-arrows-clockwise", style: { fontSize: 16, color: "var(--text-muted)" }, "aria-hidden": "true" }),
10398
+ /* @__PURE__ */ jsx77("span", { className: compact3 ? "fd-label-lg" : "fd-h3", children: "Reconnecting\u2026" })
10399
+ ] }),
10400
+ /* @__PURE__ */ jsx77("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: "Your access can't be verified right now. This will resolve on its own once the connection is back." })
10401
+ ]
10402
+ }
10403
+ );
10404
+ }
10405
+ function Gate({ perm, anyOf, role, silent = false, fallback, pendingFallback, compact: compact3 = false, children }) {
10406
+ const { can: can2, canAny: canAny2, hasRole: hasRole2, pending } = useSessionContext();
10407
+ if (pending) {
10408
+ if (pendingFallback !== void 0) return pendingFallback;
10409
+ if (silent) return null;
10410
+ return /* @__PURE__ */ jsx77(GatePending, { compact: compact3 });
10411
+ }
10379
10412
  let ok = true;
10380
10413
  if (perm) ok = ok && can2(perm);
10381
10414
  if (anyOf) ok = ok && canAny2(anyOf);
@@ -10398,14 +10431,14 @@ function FeatureGate({
10398
10431
  bypassPerm = "flags.manage"
10399
10432
  }) {
10400
10433
  SessionKit.useSession();
10401
- const { can: can2 } = useSessionContext();
10434
+ const { can: can2, pending } = useSessionContext();
10402
10435
  const rt = useFeatureStatus(flag);
10403
10436
  if (!SessionKit.isEnabled(flag)) return fallback;
10404
10437
  if (rt.complete || rt.mode === "test") return children;
10405
10438
  if (!preview) return fallback;
10406
10439
  const f = SessionKit.findFlag(flag) || {};
10407
10440
  const missing = rt.missing || [];
10408
- const canBypass = bypassPerm === null ? false : !bypassPerm || can2(bypassPerm);
10441
+ const canBypass = pending ? false : bypassPerm === null ? false : !bypassPerm || can2(bypassPerm);
10409
10442
  return /* @__PURE__ */ jsx77(
10410
10443
  ComingSoon,
10411
10444
  {
@@ -10425,7 +10458,10 @@ function FeatureGate({
10425
10458
  );
10426
10459
  }
10427
10460
  function PermissionHint({ perm, children }) {
10428
- const { can: can2 } = useSessionContext();
10461
+ const { can: can2, pending } = useSessionContext();
10462
+ if (pending) {
10463
+ return /* @__PURE__ */ jsx77("span", { title: "Access can't be verified right now", style: { display: "inline-flex", opacity: 0.45, cursor: "not-allowed" }, "aria-disabled": "true", children: /* @__PURE__ */ jsx77("span", { style: { pointerEvents: "none" }, children }) });
10464
+ }
10429
10465
  if (can2(perm)) return children;
10430
10466
  return /* @__PURE__ */ jsx77(
10431
10467
  "span",
@@ -13866,6 +13902,7 @@ export {
13866
13902
  FormatEta,
13867
13903
  FunnelChart,
13868
13904
  Gate,
13905
+ GatePending,
13869
13906
  IMPORTANCE_LEVELS,
13870
13907
  IconButton,
13871
13908
  ImportanceTag,