@flytedan/flytebot-design-system 0.62.0 → 0.64.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 +19 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +18 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1109,6 +1109,8 @@ interface BarListProps {
|
|
|
1109
1109
|
valueFormat?: (n: number) => string;
|
|
1110
1110
|
/** Percent is computed against this. Defaults to the sum of every row's value. */
|
|
1111
1111
|
total?: number;
|
|
1112
|
+
/** How a row's share of `total` (a fraction, 0 to 1) is written: the row, its label and the data table. Defaults to whole percents. */
|
|
1113
|
+
shareFormat?: (share: number) => string;
|
|
1112
1114
|
/** Sort descending by value before rendering. Default true — this IS a ranking. */
|
|
1113
1115
|
sort?: boolean;
|
|
1114
1116
|
/** Cap the number of rows drawn (after sorting). */
|
|
@@ -1138,7 +1140,7 @@ interface BarListProps {
|
|
|
1138
1140
|
* keyboard-reachable and each row's full detail is available as a tooltip even though
|
|
1139
1141
|
* the same numbers are already printed inline.
|
|
1140
1142
|
*/
|
|
1141
|
-
declare function BarList({ rows, label, valueFormat, total, sort, maxRows, barHeight, state, error, onRetry, className, }: BarListProps): React.JSX.Element;
|
|
1143
|
+
declare function BarList({ rows, label, valueFormat, total, shareFormat, sort, maxRows, barHeight, state, error, onRetry, className, }: BarListProps): React.JSX.Element;
|
|
1142
1144
|
|
|
1143
1145
|
interface FunnelStep {
|
|
1144
1146
|
id: string;
|
|
@@ -2424,6 +2426,9 @@ interface StateFigure extends UsState {
|
|
|
2424
2426
|
/** Fraction (0 to 1) of every value given. */
|
|
2425
2427
|
share: number;
|
|
2426
2428
|
}
|
|
2429
|
+
/** A share of the total for a label: whole percent from 10%, one decimal below it, "<0.1%" for a
|
|
2430
|
+
* share too small to show one, and never "0%" for a state that has a value. */
|
|
2431
|
+
declare function formatShare(share: number): string;
|
|
2427
2432
|
|
|
2428
2433
|
interface USChoroplethProps {
|
|
2429
2434
|
/** One entry per state that has a value: USPS code and a whole count. A state not listed, or 0,
|
|
@@ -2442,6 +2447,10 @@ interface USChoroplethProps {
|
|
|
2442
2447
|
/** Show a ranking of this many states beside the map (below it when the component is narrow).
|
|
2443
2448
|
* Leave unset for no ranking. */
|
|
2444
2449
|
topN?: number;
|
|
2450
|
+
/** What 100% is, for every share the component prints (readout, ranking, table). Defaults to the sum
|
|
2451
|
+
* of `values`; pass a larger whole count when some of what you counted has no state. Smaller than
|
|
2452
|
+
* the sum throws. */
|
|
2453
|
+
total?: number;
|
|
2445
2454
|
className?: string;
|
|
2446
2455
|
}
|
|
2447
2456
|
/**
|
|
@@ -2463,7 +2472,7 @@ interface USChoroplethProps {
|
|
|
2463
2472
|
* The outlines and the geo libraries (d3-geo, topojson-client, us-atlas) are one separate chunk,
|
|
2464
2473
|
* fetched when the map first renders; the legend, ranking and table show at once.
|
|
2465
2474
|
*/
|
|
2466
|
-
declare function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, topN, className }: USChoroplethProps): React.JSX.Element;
|
|
2475
|
+
declare function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, topN, total, className }: USChoroplethProps): React.JSX.Element;
|
|
2467
2476
|
|
|
2468
2477
|
/**
|
|
2469
2478
|
* Multi-select control with a 44px comfortable hit area.
|
|
@@ -5346,4 +5355,4 @@ declare function CornerStackPortal({ slot, children }: {
|
|
|
5346
5355
|
children?: React.ReactNode;
|
|
5347
5356
|
}): React.ReactPortal | null;
|
|
5348
5357
|
|
|
5349
|
-
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, AppearanceProvider, type AppearanceProviderProps, 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, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, Calendar, type CalendarProps, Card, CardGrid, type CardGridProps, 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, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTablePhoneRole, 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, type Fact, FactList, type FactListProps, 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 KeysetEnvelope, type KeysetServerTable, LAYER_STEP, 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, OVERLAY_CEILING, 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 QueryPaging, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, 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 ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, 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 TabItem, 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 ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useFeatureStatus, useLayerZIndex, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, writeQueryToUrl };
|
|
5358
|
+
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, AppearanceProvider, type AppearanceProviderProps, 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, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, Calendar, type CalendarProps, Card, CardGrid, type CardGridProps, 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, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTablePhoneRole, 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, type Fact, FactList, type FactListProps, 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 KeysetEnvelope, type KeysetServerTable, LAYER_STEP, 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, OVERLAY_CEILING, 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 QueryPaging, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, 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 ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, 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 TabItem, 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 ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useFeatureStatus, useLayerZIndex, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, writeQueryToUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -1109,6 +1109,8 @@ interface BarListProps {
|
|
|
1109
1109
|
valueFormat?: (n: number) => string;
|
|
1110
1110
|
/** Percent is computed against this. Defaults to the sum of every row's value. */
|
|
1111
1111
|
total?: number;
|
|
1112
|
+
/** How a row's share of `total` (a fraction, 0 to 1) is written: the row, its label and the data table. Defaults to whole percents. */
|
|
1113
|
+
shareFormat?: (share: number) => string;
|
|
1112
1114
|
/** Sort descending by value before rendering. Default true — this IS a ranking. */
|
|
1113
1115
|
sort?: boolean;
|
|
1114
1116
|
/** Cap the number of rows drawn (after sorting). */
|
|
@@ -1138,7 +1140,7 @@ interface BarListProps {
|
|
|
1138
1140
|
* keyboard-reachable and each row's full detail is available as a tooltip even though
|
|
1139
1141
|
* the same numbers are already printed inline.
|
|
1140
1142
|
*/
|
|
1141
|
-
declare function BarList({ rows, label, valueFormat, total, sort, maxRows, barHeight, state, error, onRetry, className, }: BarListProps): React.JSX.Element;
|
|
1143
|
+
declare function BarList({ rows, label, valueFormat, total, shareFormat, sort, maxRows, barHeight, state, error, onRetry, className, }: BarListProps): React.JSX.Element;
|
|
1142
1144
|
|
|
1143
1145
|
interface FunnelStep {
|
|
1144
1146
|
id: string;
|
|
@@ -2424,6 +2426,9 @@ interface StateFigure extends UsState {
|
|
|
2424
2426
|
/** Fraction (0 to 1) of every value given. */
|
|
2425
2427
|
share: number;
|
|
2426
2428
|
}
|
|
2429
|
+
/** A share of the total for a label: whole percent from 10%, one decimal below it, "<0.1%" for a
|
|
2430
|
+
* share too small to show one, and never "0%" for a state that has a value. */
|
|
2431
|
+
declare function formatShare(share: number): string;
|
|
2427
2432
|
|
|
2428
2433
|
interface USChoroplethProps {
|
|
2429
2434
|
/** One entry per state that has a value: USPS code and a whole count. A state not listed, or 0,
|
|
@@ -2442,6 +2447,10 @@ interface USChoroplethProps {
|
|
|
2442
2447
|
/** Show a ranking of this many states beside the map (below it when the component is narrow).
|
|
2443
2448
|
* Leave unset for no ranking. */
|
|
2444
2449
|
topN?: number;
|
|
2450
|
+
/** What 100% is, for every share the component prints (readout, ranking, table). Defaults to the sum
|
|
2451
|
+
* of `values`; pass a larger whole count when some of what you counted has no state. Smaller than
|
|
2452
|
+
* the sum throws. */
|
|
2453
|
+
total?: number;
|
|
2445
2454
|
className?: string;
|
|
2446
2455
|
}
|
|
2447
2456
|
/**
|
|
@@ -2463,7 +2472,7 @@ interface USChoroplethProps {
|
|
|
2463
2472
|
* The outlines and the geo libraries (d3-geo, topojson-client, us-atlas) are one separate chunk,
|
|
2464
2473
|
* fetched when the map first renders; the legend, ranking and table show at once.
|
|
2465
2474
|
*/
|
|
2466
|
-
declare function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, topN, className }: USChoroplethProps): React.JSX.Element;
|
|
2475
|
+
declare function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, topN, total, className }: USChoroplethProps): React.JSX.Element;
|
|
2467
2476
|
|
|
2468
2477
|
/**
|
|
2469
2478
|
* Multi-select control with a 44px comfortable hit area.
|
|
@@ -5346,4 +5355,4 @@ declare function CornerStackPortal({ slot, children }: {
|
|
|
5346
5355
|
children?: React.ReactNode;
|
|
5347
5356
|
}): React.ReactPortal | null;
|
|
5348
5357
|
|
|
5349
|
-
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, AppearanceProvider, type AppearanceProviderProps, 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, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, Calendar, type CalendarProps, Card, CardGrid, type CardGridProps, 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, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTablePhoneRole, 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, type Fact, FactList, type FactListProps, 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 KeysetEnvelope, type KeysetServerTable, LAYER_STEP, 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, OVERLAY_CEILING, 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 QueryPaging, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, 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 ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, 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 TabItem, 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 ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useFeatureStatus, useLayerZIndex, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, writeQueryToUrl };
|
|
5358
|
+
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, AppearanceProvider, type AppearanceProviderProps, 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, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, Calendar, type CalendarProps, Card, CardGrid, type CardGridProps, 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, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTablePhoneRole, 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, type Fact, FactList, type FactListProps, 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 KeysetEnvelope, type KeysetServerTable, LAYER_STEP, 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, OVERLAY_CEILING, 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 QueryPaging, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, 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 ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, 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 TabItem, 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 ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, markdownToText, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useFeatureStatus, useLayerZIndex, usePopoverPosition, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, writeQueryToUrl };
|
package/dist/index.js
CHANGED
|
@@ -2779,11 +2779,13 @@ function DonutChart({
|
|
|
2779
2779
|
// src/components/data/BarList.tsx
|
|
2780
2780
|
import * as React25 from "react";
|
|
2781
2781
|
import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2782
|
+
var wholePercent = (share) => formatPercent(Math.round(share * 100));
|
|
2782
2783
|
function BarList({
|
|
2783
2784
|
rows,
|
|
2784
2785
|
label,
|
|
2785
2786
|
valueFormat = formatCompact,
|
|
2786
2787
|
total,
|
|
2788
|
+
shareFormat = wholePercent,
|
|
2787
2789
|
sort = true,
|
|
2788
2790
|
maxRows,
|
|
2789
2791
|
barHeight = 10,
|
|
@@ -2812,9 +2814,9 @@ function BarList({
|
|
|
2812
2814
|
/* @__PURE__ */ jsx40("ol", { className: "fd-barlist-list", "aria-label": label, children: ordered.map((r, i) => {
|
|
2813
2815
|
const value = Number(r.value) || 0;
|
|
2814
2816
|
const barPct = Math.max(0, Math.min(100, value / maxValue * 100));
|
|
2815
|
-
const
|
|
2817
|
+
const share = effectiveTotal ? value / effectiveTotal : 0;
|
|
2816
2818
|
const color = chartColor(i, r.color);
|
|
2817
|
-
const detail = `${r.label} \u2014 ${valueFormat(value)} (${
|
|
2819
|
+
const detail = `${r.label} \u2014 ${valueFormat(value)} (${shareFormat(share)})`;
|
|
2818
2820
|
return /* @__PURE__ */ jsx40("li", { className: "fd-barlist-row", children: /* @__PURE__ */ jsx40(Tooltip, { label: detail, children: /* @__PURE__ */ jsxs31("button", { type: "button", className: "fd-barlist-btn", children: [
|
|
2819
2821
|
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-label", title: truncationTitle(r.label), children: r.label }),
|
|
2820
2822
|
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-track", style: { height: barHeight }, children: /* @__PURE__ */ jsxs31("svg", { viewBox: "0 0 100 10", preserveAspectRatio: "none", role: "img", "aria-label": detail, children: [
|
|
@@ -2822,7 +2824,7 @@ function BarList({
|
|
|
2822
2824
|
/* @__PURE__ */ jsx40("rect", { x: 0, y: 0, width: barPct, height: 10, rx: 3, fill: color })
|
|
2823
2825
|
] }) }),
|
|
2824
2826
|
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-value fd-tabular", children: valueFormat(value) }),
|
|
2825
|
-
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-pct fd-tabular", children:
|
|
2827
|
+
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-pct fd-tabular", children: shareFormat(share) })
|
|
2826
2828
|
] }) }) }, r.id);
|
|
2827
2829
|
}) }),
|
|
2828
2830
|
/* @__PURE__ */ jsx40(
|
|
@@ -2832,8 +2834,8 @@ function BarList({
|
|
|
2832
2834
|
columns: ["", "Value", "Percent"],
|
|
2833
2835
|
rows: ordered.map((r) => {
|
|
2834
2836
|
const value = Number(r.value) || 0;
|
|
2835
|
-
const
|
|
2836
|
-
return [r.label, valueFormat(value),
|
|
2837
|
+
const share = effectiveTotal ? value / effectiveTotal : 0;
|
|
2838
|
+
return [r.label, valueFormat(value), shareFormat(share)];
|
|
2837
2839
|
})
|
|
2838
2840
|
}
|
|
2839
2841
|
)
|
|
@@ -6423,9 +6425,9 @@ function formatShare(share) {
|
|
|
6423
6425
|
return tenths >= 10 ? `${Math.round(percent)}%` : `${tenths.toFixed(1)}%`;
|
|
6424
6426
|
}
|
|
6425
6427
|
var byValue = (a, b) => b.value - a.value;
|
|
6426
|
-
function buildChoroplethModel(values, topN) {
|
|
6428
|
+
function buildChoroplethModel(values, topN, givenTotal) {
|
|
6427
6429
|
const byCode = /* @__PURE__ */ new Map();
|
|
6428
|
-
let
|
|
6430
|
+
let sum = 0;
|
|
6429
6431
|
for (const { state, value } of values) {
|
|
6430
6432
|
if (!isUsStateCode(state)) throw new Error(`USChoropleth: "${state}" is not a US state code`);
|
|
6431
6433
|
if (byCode.has(state)) throw new Error(`USChoropleth: ${state} is given more than once`);
|
|
@@ -6433,8 +6435,12 @@ function buildChoroplethModel(values, topN) {
|
|
|
6433
6435
|
throw new Error(`USChoropleth: the value for ${state} must be a whole count of 0 or more, got ${value}`);
|
|
6434
6436
|
}
|
|
6435
6437
|
byCode.set(state, value);
|
|
6436
|
-
|
|
6438
|
+
sum += value;
|
|
6439
|
+
}
|
|
6440
|
+
if (givenTotal !== void 0 && !(Number.isInteger(givenTotal) && givenTotal >= sum)) {
|
|
6441
|
+
throw new Error(`USChoropleth: total must be a whole count of at least the sum of values (${sum}), got ${givenTotal}`);
|
|
6437
6442
|
}
|
|
6443
|
+
const total = givenTotal ?? sum;
|
|
6438
6444
|
const share = (value) => total === 0 ? 0 : value / total;
|
|
6439
6445
|
const rows = US_STATES.map((state) => {
|
|
6440
6446
|
const value = byCode.get(state.code) ?? 0;
|
|
@@ -6544,8 +6550,8 @@ function StateTable({ model, valueLabel, formatValue }) {
|
|
|
6544
6550
|
];
|
|
6545
6551
|
return /* @__PURE__ */ jsx66(Collapsible, { title: TABLE_TITLE, children: /* @__PURE__ */ jsx66(DataTable, { columns, rows: model.rows, rowKey: "code", compact: true }) });
|
|
6546
6552
|
}
|
|
6547
|
-
function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, topN, className = "" }) {
|
|
6548
|
-
const model = React44.useMemo(() => buildChoroplethModel(values, topN ?? 0), [values, topN]);
|
|
6553
|
+
function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, topN, total, className = "" }) {
|
|
6554
|
+
const model = React44.useMemo(() => buildChoroplethModel(values, topN ?? 0, total), [values, topN, total]);
|
|
6549
6555
|
const figures = React44.useMemo(() => new Map(model.rows.map((row) => [row.code, row])), [model]);
|
|
6550
6556
|
const { state, retry } = useUsStateShapes();
|
|
6551
6557
|
return /* @__PURE__ */ jsxs56("div", { className: ["fd-uschoro", className].filter(Boolean).join(" "), children: [
|
|
@@ -6571,6 +6577,7 @@ function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, t
|
|
|
6571
6577
|
rows: model.top.map((row) => ({ id: row.code, label: row.name, value: row.value, color: "var(--seq-4)" })),
|
|
6572
6578
|
valueFormat: formatValue,
|
|
6573
6579
|
total: model.total,
|
|
6580
|
+
shareFormat: formatShare,
|
|
6574
6581
|
sort: false
|
|
6575
6582
|
}
|
|
6576
6583
|
) }) : null
|
|
@@ -15185,6 +15192,7 @@ export {
|
|
|
15185
15192
|
formatDuration,
|
|
15186
15193
|
formatEta,
|
|
15187
15194
|
formatRelative,
|
|
15195
|
+
formatShare,
|
|
15188
15196
|
groupMessages,
|
|
15189
15197
|
hasModifier,
|
|
15190
15198
|
historyUrlAdapter,
|