@flytedan/flytebot-design-system 0.45.0 → 0.47.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.cjs +170 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +169 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +24 -3
package/dist/index.d.cts
CHANGED
|
@@ -4745,6 +4745,12 @@ declare function StackedLayerProvider({ layer, children }: {
|
|
|
4745
4745
|
layer: StackedLayer;
|
|
4746
4746
|
children: React.ReactNode;
|
|
4747
4747
|
}): React.ReactElement;
|
|
4748
|
+
/** MP-248: whether `node` lies within `layer`'s own DOM, or the DOM of anything opened from
|
|
4749
|
+
* inside it — any layer it owns, portaled or not. For outside-click dismissal, which must
|
|
4750
|
+
* not fire for a click that landed inside a further layer this one opened (a Modal opened
|
|
4751
|
+
* from a Popover's own content) — the stack's real ownership, not a component's own class
|
|
4752
|
+
* name, which only ever recognised its own kind of layer. */
|
|
4753
|
+
declare function isWithinLayerTree(layer: StackedLayer, node: Node | null): boolean;
|
|
4748
4754
|
|
|
4749
4755
|
/**
|
|
4750
4756
|
* MP-214: the responsive-rail behaviour every app-level shell was hand-rolling (and, in
|
|
@@ -4819,4 +4825,4 @@ declare function formatDocumentTitle(routeTitle: string | undefined | null, appN
|
|
|
4819
4825
|
*/
|
|
4820
4826
|
declare function useDocumentTitle(routeTitle: string | undefined | null, appName: string): void;
|
|
4821
4827
|
|
|
4822
|
-
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, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, 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, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStackedLayer, useStagedFiles, validateFilterValue, visibleMessages };
|
|
4828
|
+
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, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, 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, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useDocumentTitle, useFeatureStatus, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStackedLayer, useStagedFiles, validateFilterValue, visibleMessages };
|
package/dist/index.d.ts
CHANGED
|
@@ -4745,6 +4745,12 @@ declare function StackedLayerProvider({ layer, children }: {
|
|
|
4745
4745
|
layer: StackedLayer;
|
|
4746
4746
|
children: React.ReactNode;
|
|
4747
4747
|
}): React.ReactElement;
|
|
4748
|
+
/** MP-248: whether `node` lies within `layer`'s own DOM, or the DOM of anything opened from
|
|
4749
|
+
* inside it — any layer it owns, portaled or not. For outside-click dismissal, which must
|
|
4750
|
+
* not fire for a click that landed inside a further layer this one opened (a Modal opened
|
|
4751
|
+
* from a Popover's own content) — the stack's real ownership, not a component's own class
|
|
4752
|
+
* name, which only ever recognised its own kind of layer. */
|
|
4753
|
+
declare function isWithinLayerTree(layer: StackedLayer, node: Node | null): boolean;
|
|
4748
4754
|
|
|
4749
4755
|
/**
|
|
4750
4756
|
* MP-214: the responsive-rail behaviour every app-level shell was hand-rolling (and, in
|
|
@@ -4819,4 +4825,4 @@ declare function formatDocumentTitle(routeTitle: string | undefined | null, appN
|
|
|
4819
4825
|
*/
|
|
4820
4826
|
declare function useDocumentTitle(routeTitle: string | undefined | null, appName: string): void;
|
|
4821
4827
|
|
|
4822
|
-
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, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, 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, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStackedLayer, useStagedFiles, validateFilterValue, visibleMessages };
|
|
4828
|
+
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, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, 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, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useChatEngine, useDocumentTitle, useFeatureStatus, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStackedLayer, useStagedFiles, validateFilterValue, visibleMessages };
|
package/dist/index.js
CHANGED
|
@@ -100,11 +100,21 @@ import { createPortal } from "react-dom";
|
|
|
100
100
|
// src/kits/layerStack.tsx
|
|
101
101
|
import * as React2 from "react";
|
|
102
102
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
103
|
-
var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
103
|
+
var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable]:not([contenteditable="false"])';
|
|
104
104
|
var LayerContext = React2.createContext(null);
|
|
105
105
|
var openLayers = /* @__PURE__ */ new Set();
|
|
106
106
|
var lastOrder = 0;
|
|
107
107
|
var pendingEscape = null;
|
|
108
|
+
var lastClosed = null;
|
|
109
|
+
function isOpener(el) {
|
|
110
|
+
return !!el && el !== document.body && el.isConnected;
|
|
111
|
+
}
|
|
112
|
+
function inheritedOpener() {
|
|
113
|
+
let l = lastClosed;
|
|
114
|
+
lastClosed = null;
|
|
115
|
+
for (; l; l = l.parent) if (isOpener(l.opener)) return l.opener;
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
108
118
|
function rank(layer) {
|
|
109
119
|
const path = [];
|
|
110
120
|
for (let l = layer; l; l = l.parent) if (l.order > 0) path.push(l.order);
|
|
@@ -190,11 +200,13 @@ function open(layer) {
|
|
|
190
200
|
}
|
|
191
201
|
openLayers.add(layer);
|
|
192
202
|
layer.order = ++lastOrder;
|
|
203
|
+
lastClosed = null;
|
|
193
204
|
if (layer.options.trap && !contains(scopeOf(layer), document.activeElement)) focusInto(layer);
|
|
194
205
|
}
|
|
195
206
|
function close(layer) {
|
|
196
207
|
openLayers.delete(layer);
|
|
197
208
|
layer.order = 0;
|
|
209
|
+
lastClosed = layer;
|
|
198
210
|
if (openLayers.size === 0) {
|
|
199
211
|
document.removeEventListener("keydown", onKeydownCapture, true);
|
|
200
212
|
document.removeEventListener("keydown", onKeydown);
|
|
@@ -212,7 +224,7 @@ function returnFocus(layer) {
|
|
|
212
224
|
focusInto(l);
|
|
213
225
|
return;
|
|
214
226
|
}
|
|
215
|
-
if (l.opener
|
|
227
|
+
if (isOpener(l.opener)) {
|
|
216
228
|
l.opener.focus({ preventScroll: true });
|
|
217
229
|
return;
|
|
218
230
|
}
|
|
@@ -223,7 +235,9 @@ function useStackedLayer(options) {
|
|
|
223
235
|
const [layer] = React2.useState(() => ({ parent, options, order: 0, opener: null }));
|
|
224
236
|
const { active } = options;
|
|
225
237
|
React2.useInsertionEffect(() => {
|
|
226
|
-
if (active)
|
|
238
|
+
if (!active) return;
|
|
239
|
+
const current2 = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
240
|
+
layer.opener = isOpener(current2) ? current2 : inheritedOpener();
|
|
227
241
|
}, [active, layer]);
|
|
228
242
|
React2.useLayoutEffect(() => {
|
|
229
243
|
layer.options = options;
|
|
@@ -242,6 +256,9 @@ function useStackedLayer(options) {
|
|
|
242
256
|
function StackedLayerProvider({ layer, children }) {
|
|
243
257
|
return /* @__PURE__ */ jsx3(LayerContext.Provider, { value: layer, children });
|
|
244
258
|
}
|
|
259
|
+
function isWithinLayerTree(layer, node) {
|
|
260
|
+
return contains(scopeOf(layer), node);
|
|
261
|
+
}
|
|
245
262
|
|
|
246
263
|
// src/components/actions/Popover.tsx
|
|
247
264
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -438,15 +455,14 @@ function Popover({
|
|
|
438
455
|
const away = (e) => {
|
|
439
456
|
if (!closeOnOutside) return;
|
|
440
457
|
const target = e.target;
|
|
441
|
-
if (
|
|
458
|
+
if (isWithinLayerTree(layer, target)) return;
|
|
442
459
|
const trigger = (triggerRef || anchorRef).current;
|
|
443
460
|
if (trigger && trigger.contains(target)) return;
|
|
444
|
-
if (e.target.closest && e.target.closest(".fd-pop")) return;
|
|
445
461
|
onClose && onClose();
|
|
446
462
|
};
|
|
447
463
|
document.addEventListener("pointerdown", away, true);
|
|
448
464
|
return () => document.removeEventListener("pointerdown", away, true);
|
|
449
|
-
}, [open2, closeOnOutside, onClose, anchorRef, triggerRef]);
|
|
465
|
+
}, [open2, closeOnOutside, onClose, anchorRef, triggerRef, layer]);
|
|
450
466
|
if (!open2 || !pos) return null;
|
|
451
467
|
return portal(
|
|
452
468
|
/* @__PURE__ */ jsx4(LayerProvider, { zIndex, children: /* @__PURE__ */ jsx4(StackedLayerProvider, { layer, children: /* @__PURE__ */ jsxs3(
|
|
@@ -3050,6 +3066,21 @@ var fmt = (s) => {
|
|
|
3050
3066
|
const d = parse(s);
|
|
3051
3067
|
return d ? MONTHS[d.getMonth()].slice(0, 3) + " " + d.getDate() + ", " + d.getFullYear() : "";
|
|
3052
3068
|
};
|
|
3069
|
+
var fullDateLabel = (d) => new Intl.DateTimeFormat(void 0, { dateStyle: "full" }).format(d);
|
|
3070
|
+
var monthYearLabel = (d) => new Intl.DateTimeFormat(void 0, { month: "long", year: "numeric" }).format(d);
|
|
3071
|
+
var weekdayLong = (i) => new Intl.DateTimeFormat(void 0, { weekday: "long" }).format(new Date(2023, 0, 1 + i));
|
|
3072
|
+
var daysInMonth = (y, m) => new Date(y, m + 1, 0).getDate();
|
|
3073
|
+
var addMonths = (d, n) => {
|
|
3074
|
+
const total = d.getFullYear() * 12 + d.getMonth() + n;
|
|
3075
|
+
const y = Math.floor(total / 12), m = (total % 12 + 12) % 12;
|
|
3076
|
+
return new Date(y, m, Math.min(d.getDate(), daysInMonth(y, m)));
|
|
3077
|
+
};
|
|
3078
|
+
var addYears = (d, n) => {
|
|
3079
|
+
const y = d.getFullYear() + n;
|
|
3080
|
+
return new Date(y, d.getMonth(), Math.min(d.getDate(), daysInMonth(y, d.getMonth())));
|
|
3081
|
+
};
|
|
3082
|
+
var addDays = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
3083
|
+
var sameMonth = (d, y, m) => d.getFullYear() === y && d.getMonth() === m;
|
|
3053
3084
|
function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
3054
3085
|
const today = /* @__PURE__ */ new Date();
|
|
3055
3086
|
const sel = range ? value || {} : { start: value, end: value };
|
|
@@ -3064,8 +3095,38 @@ function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
|
3064
3095
|
const lo = s, hi = e || hoverEnd;
|
|
3065
3096
|
return lo && hi && d > (lo < hi ? lo : hi) && d < (lo < hi ? hi : lo);
|
|
3066
3097
|
};
|
|
3067
|
-
const
|
|
3098
|
+
const isStart = (d) => !!s && iso(d) === iso(s);
|
|
3099
|
+
const isEnd = (d) => !!e && iso(d) === iso(e);
|
|
3100
|
+
const isEdge = (d) => isStart(d) || isEnd(d);
|
|
3101
|
+
const nextY = vm === 11 ? vy + 1 : vy, nextM = (vm + 1) % 12;
|
|
3102
|
+
const [activeDate, setActiveDate] = React23.useState(() => {
|
|
3103
|
+
if (s) return s;
|
|
3104
|
+
if (sameMonth(today, anchor.getFullYear(), anchor.getMonth())) return today;
|
|
3105
|
+
return new Date(anchor.getFullYear(), anchor.getMonth(), 1);
|
|
3106
|
+
});
|
|
3107
|
+
const calRef = React23.useRef(null);
|
|
3108
|
+
const pageToShow = (y, m) => {
|
|
3109
|
+
const idx = y * 12 + m, firstIdx = vy * 12 + vm, secondIdx = firstIdx + 1;
|
|
3110
|
+
if (idx === firstIdx || months > 1 && idx === secondIdx) return;
|
|
3111
|
+
if (idx < firstIdx || months === 1) {
|
|
3112
|
+
setVy(y);
|
|
3113
|
+
setVm(m);
|
|
3114
|
+
return;
|
|
3115
|
+
}
|
|
3116
|
+
const baseIdx = idx - 1;
|
|
3117
|
+
setVy(Math.floor(baseIdx / 12));
|
|
3118
|
+
setVm((baseIdx % 12 + 12) % 12);
|
|
3119
|
+
};
|
|
3120
|
+
const moveActive = (next) => {
|
|
3121
|
+
setActiveDate(next);
|
|
3122
|
+
pageToShow(next.getFullYear(), next.getMonth());
|
|
3123
|
+
};
|
|
3124
|
+
React23.useEffect(() => {
|
|
3125
|
+
const el = calRef.current?.querySelector('[data-iso="' + iso(activeDate) + '"]');
|
|
3126
|
+
if (el) el.focus({ preventScroll: true });
|
|
3127
|
+
}, [activeDate, vy, vm]);
|
|
3068
3128
|
const clickDay = (d) => {
|
|
3129
|
+
setActiveDate(d);
|
|
3069
3130
|
const v = iso(d);
|
|
3070
3131
|
if (!range) {
|
|
3071
3132
|
onPick(v);
|
|
@@ -3090,36 +3151,115 @@ function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
|
3090
3151
|
setVm(m);
|
|
3091
3152
|
setVy(y);
|
|
3092
3153
|
};
|
|
3154
|
+
const onGridKeyDown = (ev) => {
|
|
3155
|
+
const d = activeDate;
|
|
3156
|
+
switch (ev.key) {
|
|
3157
|
+
case "ArrowLeft":
|
|
3158
|
+
ev.preventDefault();
|
|
3159
|
+
moveActive(addDays(d, -1));
|
|
3160
|
+
return;
|
|
3161
|
+
case "ArrowRight":
|
|
3162
|
+
ev.preventDefault();
|
|
3163
|
+
moveActive(addDays(d, 1));
|
|
3164
|
+
return;
|
|
3165
|
+
case "ArrowUp":
|
|
3166
|
+
ev.preventDefault();
|
|
3167
|
+
moveActive(addDays(d, -7));
|
|
3168
|
+
return;
|
|
3169
|
+
case "ArrowDown":
|
|
3170
|
+
ev.preventDefault();
|
|
3171
|
+
moveActive(addDays(d, 7));
|
|
3172
|
+
return;
|
|
3173
|
+
case "Home":
|
|
3174
|
+
ev.preventDefault();
|
|
3175
|
+
moveActive(addDays(d, -d.getDay()));
|
|
3176
|
+
return;
|
|
3177
|
+
case "End":
|
|
3178
|
+
ev.preventDefault();
|
|
3179
|
+
moveActive(addDays(d, 6 - d.getDay()));
|
|
3180
|
+
return;
|
|
3181
|
+
case "PageUp":
|
|
3182
|
+
ev.preventDefault();
|
|
3183
|
+
moveActive(ev.shiftKey ? addYears(d, -1) : addMonths(d, -1));
|
|
3184
|
+
return;
|
|
3185
|
+
case "PageDown":
|
|
3186
|
+
ev.preventDefault();
|
|
3187
|
+
moveActive(ev.shiftKey ? addYears(d, 1) : addMonths(d, 1));
|
|
3188
|
+
return;
|
|
3189
|
+
case "Enter":
|
|
3190
|
+
case " ":
|
|
3191
|
+
ev.preventDefault();
|
|
3192
|
+
clickDay(d);
|
|
3193
|
+
return;
|
|
3194
|
+
default:
|
|
3195
|
+
return;
|
|
3196
|
+
}
|
|
3197
|
+
};
|
|
3198
|
+
const monthHeading = mode2 === "days" ? MONTHS[vm] + " " + vy : mode2 === "months" ? String(vy) : vy - 5 + " \u2013 " + (vy + 6);
|
|
3199
|
+
const prevLabel = mode2 === "days" ? "Previous month, " + monthYearLabel(new Date(vy, vm - 1, 1)) : mode2 === "months" ? "Previous year, " + (vy - 1) : "Previous years, " + (vy - 17) + " \u2013 " + (vy - 6);
|
|
3200
|
+
const nextLabel = mode2 === "days" ? "Next month, " + monthYearLabel(new Date(vy, vm + 1, 1)) : mode2 === "months" ? "Next year, " + (vy + 1) : "Next years, " + (vy + 7) + " \u2013 " + (vy + 18);
|
|
3093
3201
|
const monthGrid = (y, m) => {
|
|
3094
3202
|
const startPad = new Date(y, m, 1).getDay();
|
|
3203
|
+
const last = daysInMonth(y, m);
|
|
3095
3204
|
const cells = [];
|
|
3096
|
-
for (let i = 0; i < 42; i++)
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3205
|
+
for (let i = 0; i < 42; i++) {
|
|
3206
|
+
const dom = i - startPad + 1;
|
|
3207
|
+
cells.push(dom >= 1 && dom <= last ? new Date(y, m, dom) : null);
|
|
3208
|
+
}
|
|
3209
|
+
return /* @__PURE__ */ jsxs37(
|
|
3210
|
+
"div",
|
|
3211
|
+
{
|
|
3212
|
+
className: "fd-cal-grid",
|
|
3213
|
+
role: "grid",
|
|
3214
|
+
"aria-label": monthYearLabel(new Date(y, m, 1)),
|
|
3215
|
+
style: { width: months > 1 ? 252 : "auto", flex: "none" },
|
|
3216
|
+
onMouseLeave: () => setHover(null),
|
|
3217
|
+
children: [
|
|
3218
|
+
/* @__PURE__ */ jsx44("div", { className: "fd-cal-row", role: "row", children: DOW.map((d, i) => /* @__PURE__ */ jsx44("span", { className: "fd-cal-dow", role: "columnheader", "aria-label": weekdayLong(i), children: d }, d)) }),
|
|
3219
|
+
Array.from({ length: 6 }, (_, row) => /* @__PURE__ */ jsx44("div", { className: "fd-cal-row", role: "row", children: cells.slice(row * 7, row * 7 + 7).map((d, col) => {
|
|
3220
|
+
if (!d) return /* @__PURE__ */ jsx44("div", { className: "fd-cal-day is-empty", role: "presentation", "aria-hidden": "true" }, col);
|
|
3221
|
+
const today_ = iso(d) === iso(today);
|
|
3222
|
+
const start = isStart(d), end = isEnd(d), selected = isEdge(d);
|
|
3223
|
+
const bits = [];
|
|
3224
|
+
if (range && start) bits.push("start date");
|
|
3225
|
+
if (range && end) bits.push("end date");
|
|
3226
|
+
if (selected && !range) bits.push("selected");
|
|
3227
|
+
if (today_) bits.push("today");
|
|
3228
|
+
const name = bits.length ? fullDateLabel(d) + ", " + bits.join(", ") : fullDateLabel(d);
|
|
3229
|
+
return /* @__PURE__ */ jsx44(
|
|
3230
|
+
"div",
|
|
3231
|
+
{
|
|
3232
|
+
"data-iso": iso(d),
|
|
3233
|
+
role: "gridcell",
|
|
3234
|
+
tabIndex: iso(d) === iso(activeDate) ? 0 : -1,
|
|
3235
|
+
"aria-label": name,
|
|
3236
|
+
"aria-selected": selected,
|
|
3237
|
+
"aria-current": today_ ? "date" : void 0,
|
|
3238
|
+
className: ["fd-cal-day", today_ ? "is-today" : "", inRange(d) ? "in-range" : "", selected ? "is-edge" : ""].filter(Boolean).join(" "),
|
|
3239
|
+
onClick: () => clickDay(d),
|
|
3240
|
+
onMouseEnter: () => range && setHover(iso(d)),
|
|
3241
|
+
onKeyDown: onGridKeyDown,
|
|
3242
|
+
onFocus: () => setActiveDate(d),
|
|
3243
|
+
children: d.getDate()
|
|
3244
|
+
},
|
|
3245
|
+
col
|
|
3246
|
+
);
|
|
3247
|
+
}) }, row))
|
|
3248
|
+
]
|
|
3249
|
+
}
|
|
3250
|
+
);
|
|
3111
3251
|
};
|
|
3112
|
-
|
|
3113
|
-
return /* @__PURE__ */ jsxs37("div", { className: "fd-cal", style: { width: months > 1 && mode2 === "days" ? "auto" : void 0 }, children: [
|
|
3252
|
+
return /* @__PURE__ */ jsxs37("div", { className: "fd-cal", style: { width: months > 1 && mode2 === "days" ? "auto" : void 0 }, ref: calRef, children: [
|
|
3114
3253
|
/* @__PURE__ */ jsxs37("div", { className: "fd-cal-head", children: [
|
|
3115
|
-
/* @__PURE__ */ jsx44("button", { type: "button", className: "fd-btn-icon", "aria-label":
|
|
3254
|
+
/* @__PURE__ */ jsx44("button", { type: "button", className: "fd-btn-icon", "aria-label": prevLabel, onClick: () => mode2 === "years" ? setVy(vy - 12) : mode2 === "months" ? setVy(vy - 1) : nav(-1), children: /* @__PURE__ */ jsx44("i", { className: "ph ph-caret-left" }) }),
|
|
3116
3255
|
/* @__PURE__ */ jsxs37("button", { type: "button", className: "fd-cal-title", onClick: () => setMode(mode2 === "days" ? "months" : mode2 === "months" ? "years" : "days"), children: [
|
|
3117
|
-
|
|
3256
|
+
monthHeading,
|
|
3118
3257
|
/* @__PURE__ */ jsx44("i", { className: "ph ph-caret-down", style: { fontSize: 10, marginLeft: 6, color: "var(--text-muted)" } })
|
|
3119
3258
|
] }),
|
|
3120
3259
|
months > 1 && mode2 === "days" ? /* @__PURE__ */ jsx44("span", { className: "fd-cal-title", style: { cursor: "default", background: "none" }, children: MONTHS[nextM] + " " + nextY }) : null,
|
|
3121
|
-
/* @__PURE__ */ jsx44("button", { type: "button", className: "fd-btn-icon", "aria-label":
|
|
3260
|
+
/* @__PURE__ */ jsx44("button", { type: "button", className: "fd-btn-icon", "aria-label": nextLabel, onClick: () => mode2 === "years" ? setVy(vy + 12) : mode2 === "months" ? setVy(vy + 1) : nav(1), children: /* @__PURE__ */ jsx44("i", { className: "ph ph-caret-right" }) })
|
|
3122
3261
|
] }),
|
|
3262
|
+
/* @__PURE__ */ jsx44("span", { "aria-live": "polite", className: "fd-sr-only", children: monthHeading }),
|
|
3123
3263
|
mode2 === "days" ? /* @__PURE__ */ jsxs37("div", { style: { display: "flex", gap: 18 }, children: [
|
|
3124
3264
|
monthGrid(vy, vm),
|
|
3125
3265
|
months > 1 ? monthGrid(nextY, nextM) : null
|
|
@@ -3159,6 +3299,7 @@ function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
|
3159
3299
|
setVy(today.getFullYear());
|
|
3160
3300
|
setVm(today.getMonth());
|
|
3161
3301
|
setMode("days");
|
|
3302
|
+
moveActive(today);
|
|
3162
3303
|
},
|
|
3163
3304
|
children: "Today"
|
|
3164
3305
|
}
|
|
@@ -14007,6 +14148,7 @@ export {
|
|
|
14007
14148
|
installFlytedeskFavicon,
|
|
14008
14149
|
isImage,
|
|
14009
14150
|
isSystemMessage,
|
|
14151
|
+
isWithinLayerTree,
|
|
14010
14152
|
jobBucket,
|
|
14011
14153
|
languageLabel,
|
|
14012
14154
|
loadPrefs,
|