@columenlabs/lumen-ui 0.0.0-stage → 0.2.1
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/LICENSE +21 -0
- package/NOTICE +12 -0
- package/README.md +4 -2
- package/dist/add-column.d.ts +23 -0
- package/dist/add-column.js +62 -0
- package/dist/api-fetch.d.ts +9 -0
- package/dist/api-fetch.js +60 -0
- package/dist/app-switcher.d.ts +21 -0
- package/dist/app-switcher.js +12 -0
- package/dist/app-views.d.ts +18 -0
- package/dist/app-views.js +41 -0
- package/dist/assistant-context.d.ts +72 -0
- package/dist/assistant-context.js +30 -0
- package/dist/assistant-panel.d.ts +58 -0
- package/dist/assistant-panel.js +244 -0
- package/dist/assistant-screen.d.ts +124 -0
- package/dist/assistant-screen.js +252 -0
- package/dist/card-switch.d.ts +16 -0
- package/dist/card-switch.js +16 -0
- package/dist/color-dot.d.ts +14 -0
- package/dist/color-dot.js +19 -0
- package/dist/confirm.d.ts +18 -0
- package/dist/confirm.js +5 -0
- package/dist/connections.d.ts +45 -0
- package/dist/connections.js +275 -0
- package/dist/coverage-calendar-map.d.ts +27 -0
- package/dist/coverage-calendar-map.js +84 -0
- package/dist/coverage-cells.d.ts +55 -0
- package/dist/coverage-cells.js +85 -0
- package/dist/coverage-map.d.ts +112 -0
- package/dist/coverage-map.js +428 -0
- package/dist/details-table.d.ts +20 -0
- package/dist/details-table.js +13 -0
- package/dist/drawer-section.d.ts +27 -0
- package/dist/drawer-section.js +23 -0
- package/dist/floating-head.d.ts +2 -0
- package/dist/floating-head.js +57 -0
- package/dist/fold.d.ts +16 -0
- package/dist/fold.js +70 -0
- package/dist/form-issues.d.ts +32 -0
- package/dist/form-issues.js +60 -0
- package/dist/formula-input.d.ts +17 -0
- package/dist/formula-input.js +104 -0
- package/dist/frame-script.d.ts +7 -0
- package/dist/frame-script.js +103 -0
- package/dist/freshness.d.ts +24 -0
- package/dist/freshness.js +99 -0
- package/dist/group-button.d.ts +33 -0
- package/dist/group-button.js +67 -0
- package/dist/growth-chart.d.ts +77 -0
- package/dist/growth-chart.js +195 -0
- package/dist/hooks/use-keyboard-fit.d.ts +15 -0
- package/dist/hooks/use-keyboard-fit.js +29 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/icon-button.d.ts +21 -0
- package/dist/icon-button.js +22 -0
- package/dist/icon-picker.d.ts +14 -0
- package/dist/icon-picker.js +36 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.js +90 -0
- package/dist/integrations.d.ts +57 -0
- package/dist/integrations.js +73 -0
- package/dist/joins.d.ts +128 -0
- package/dist/joins.js +767 -0
- package/dist/kit-config.d.ts +13 -0
- package/dist/kit-config.js +15 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/lumen-boundary.d.ts +7 -0
- package/dist/lumen-boundary.js +10 -0
- package/dist/lumen-code-editor-impl.d.ts +2 -0
- package/dist/lumen-code-editor-impl.js +16 -0
- package/dist/lumen-code-editor.d.ts +11 -0
- package/dist/lumen-code-editor.js +11 -0
- package/dist/lumen-code.d.ts +22 -0
- package/dist/lumen-code.js +75 -0
- package/dist/lumen-drawer.d.ts +30 -0
- package/dist/lumen-drawer.js +27 -0
- package/dist/lumen-echart.d.ts +58 -0
- package/dist/lumen-echart.js +129 -0
- package/dist/lumen-filter.d.ts +75 -0
- package/dist/lumen-filter.js +546 -0
- package/dist/lumen-finder.d.ts +62 -0
- package/dist/lumen-finder.js +275 -0
- package/dist/lumen-form.d.ts +34 -0
- package/dist/lumen-form.js +81 -0
- package/dist/lumen-geo-map.d.ts +9 -0
- package/dist/lumen-geo-map.js +135 -0
- package/dist/lumen-grid.d.ts +49 -0
- package/dist/lumen-grid.js +203 -0
- package/dist/lumen-layout.d.ts +150 -0
- package/dist/lumen-layout.js +661 -0
- package/dist/lumen-links.d.ts +96 -0
- package/dist/lumen-links.js +213 -0
- package/dist/lumen-page-state.d.ts +20 -0
- package/dist/lumen-page-state.js +15 -0
- package/dist/lumen-selector.d.ts +139 -0
- package/dist/lumen-selector.js +308 -0
- package/dist/lumen-source.d.ts +137 -0
- package/dist/lumen-source.js +327 -0
- package/dist/lumen-tab-drawer.d.ts +27 -0
- package/dist/lumen-tab-drawer.js +26 -0
- package/dist/lumen-tabs.d.ts +21 -0
- package/dist/lumen-tabs.js +6 -0
- package/dist/lumen-toast.d.ts +11 -0
- package/dist/lumen-toast.js +16 -0
- package/dist/lumen-trend.d.ts +18 -0
- package/dist/lumen-trend.js +157 -0
- package/dist/lumen-view-card.d.ts +35 -0
- package/dist/lumen-view-card.js +50 -0
- package/dist/lumen-view.d.ts +172 -0
- package/dist/lumen-view.js +645 -0
- package/dist/lumen-widget-charts.d.ts +57 -0
- package/dist/lumen-widget-charts.js +69 -0
- package/dist/lumen-widget.d.ts +720 -0
- package/dist/lumen-widget.js +609 -0
- package/dist/market/compare-chart.d.ts +34 -0
- package/dist/market/compare-chart.js +292 -0
- package/dist/market/indicator-picker.d.ts +29 -0
- package/dist/market/indicator-picker.js +125 -0
- package/dist/market/indicators.d.ts +63 -0
- package/dist/market/indicators.js +314 -0
- package/dist/market/live.d.ts +120 -0
- package/dist/market/live.js +444 -0
- package/dist/market/lumen-chart.d.ts +88 -0
- package/dist/market/lumen-chart.js +645 -0
- package/dist/market/market-widget.d.ts +45 -0
- package/dist/market/market-widget.js +346 -0
- package/dist/market/option-chain.d.ts +19 -0
- package/dist/market/option-chain.js +53 -0
- package/dist/market/price-chart.d.ts +128 -0
- package/dist/market/price-chart.js +619 -0
- package/dist/mcp-settings.d.ts +20 -0
- package/dist/mcp-settings.js +65 -0
- package/dist/nav.d.ts +77 -0
- package/dist/nav.js +73 -0
- package/dist/note-line.d.ts +13 -0
- package/dist/note-line.js +5 -0
- package/dist/notifications.d.ts +9 -0
- package/dist/notifications.js +166 -0
- package/dist/origin-legend.d.ts +14 -0
- package/dist/origin-legend.js +38 -0
- package/dist/overview.d.ts +84 -0
- package/dist/overview.js +105 -0
- package/dist/page-inputs.d.ts +14 -0
- package/dist/page-inputs.js +16 -0
- package/dist/page.d.ts +32 -0
- package/dist/page.js +45 -0
- package/dist/pager.d.ts +10 -0
- package/dist/pager.js +14 -0
- package/dist/prefs.d.ts +71 -0
- package/dist/prefs.js +126 -0
- package/dist/query-client.d.ts +7 -0
- package/dist/query-client.js +19 -0
- package/dist/refresh.d.ts +4 -0
- package/dist/refresh.js +19 -0
- package/dist/rename-field.d.ts +11 -0
- package/dist/rename-field.js +26 -0
- package/dist/reset-button.d.ts +9 -0
- package/dist/reset-button.js +10 -0
- package/dist/route-error.d.ts +42 -0
- package/dist/route-error.js +229 -0
- package/dist/schedules.d.ts +88 -0
- package/dist/schedules.js +221 -0
- package/dist/settings.d.ts +51 -0
- package/dist/settings.js +181 -0
- package/dist/shell.d.ts +99 -0
- package/dist/shell.js +137 -0
- package/dist/source-health.d.ts +12 -0
- package/dist/source-health.js +58 -0
- package/dist/sourced-card.d.ts +10 -0
- package/dist/sourced-card.js +69 -0
- package/dist/spotlight.d.ts +23 -0
- package/dist/spotlight.js +138 -0
- package/dist/status-health.d.ts +16 -0
- package/dist/status-health.js +41 -0
- package/dist/status.d.ts +9 -0
- package/dist/status.js +12 -0
- package/dist/summary-cards.d.ts +56 -0
- package/dist/summary-cards.js +270 -0
- package/dist/symbol-sheet-context.d.ts +4 -0
- package/dist/symbol-sheet-context.js +5 -0
- package/dist/symbol-sheet.d.ts +9 -0
- package/dist/symbol-sheet.js +24 -0
- package/dist/tasks.d.ts +29 -0
- package/dist/tasks.js +278 -0
- package/dist/theme.css +606 -0
- package/dist/tile.d.ts +37 -0
- package/dist/tile.js +23 -0
- package/dist/ui/alert-dialog.d.ts +18 -0
- package/dist/ui/alert-dialog.js +41 -0
- package/dist/ui/alert.d.ts +10 -0
- package/dist/ui/alert.js +27 -0
- package/dist/ui/avatar.d.ts +11 -0
- package/dist/ui/avatar.js +22 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +27 -0
- package/dist/ui/breadcrumb.d.ts +11 -0
- package/dist/ui/breadcrumb.js +27 -0
- package/dist/ui/button-group.d.ts +11 -0
- package/dist/ui/button-group.js +27 -0
- package/dist/ui/button.d.ts +10 -0
- package/dist/ui/button.js +38 -0
- package/dist/ui/card.d.ts +11 -0
- package/dist/ui/card.js +24 -0
- package/dist/ui/chart.d.ts +44 -0
- package/dist/ui/chart.js +117 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/checkbox.js +8 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/dist/ui/collapsible.js +12 -0
- package/dist/ui/combobox.d.ts +24 -0
- package/dist/ui/combobox.js +60 -0
- package/dist/ui/command.d.ts +18 -0
- package/dist/ui/command.js +34 -0
- package/dist/ui/dialog.d.ts +23 -0
- package/dist/ui/dialog.js +50 -0
- package/dist/ui/dropdown-menu.d.ts +29 -0
- package/dist/ui/dropdown-menu.js +50 -0
- package/dist/ui/emoji-picker.d.ts +6 -0
- package/dist/ui/emoji-picker.js +28 -0
- package/dist/ui/empty.d.ts +11 -0
- package/dist/ui/empty.js +33 -0
- package/dist/ui/field.d.ts +24 -0
- package/dist/ui/field.js +65 -0
- package/dist/ui/hover-card.d.ts +6 -0
- package/dist/ui/hover-card.js +13 -0
- package/dist/ui/input-group.d.ts +16 -0
- package/dist/ui/input-group.js +56 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +6 -0
- package/dist/ui/item.d.ts +23 -0
- package/dist/ui/item.js +67 -0
- package/dist/ui/kbd.d.ts +3 -0
- package/dist/ui/kbd.js +9 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.js +7 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +25 -0
- package/dist/ui/progress.d.ts +4 -0
- package/dist/ui/progress.js +9 -0
- package/dist/ui/resizable.d.ts +7 -0
- package/dist/ui/resizable.js +13 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +10 -0
- package/dist/ui/select.d.ts +15 -0
- package/dist/ui/select.js +36 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/sheet.d.ts +14 -0
- package/dist/ui/sheet.js +54 -0
- package/dist/ui/sidebar.d.ts +69 -0
- package/dist/ui/sidebar.js +206 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +6 -0
- package/dist/ui/slider.d.ts +4 -0
- package/dist/ui/slider.js +9 -0
- package/dist/ui/sonner.d.ts +3 -0
- package/dist/ui/sonner.js +24 -0
- package/dist/ui/spinner.d.ts +2 -0
- package/dist/ui/spinner.js +7 -0
- package/dist/ui/switch.d.ts +6 -0
- package/dist/ui/switch.js +7 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +31 -0
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.js +22 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +6 -0
- package/dist/ui/toggle-group.d.ts +10 -0
- package/dist/ui/toggle-group.js +22 -0
- package/dist/ui/toggle.d.ts +9 -0
- package/dist/ui/toggle.js +25 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +16 -0
- package/dist/view-edit-cell.d.ts +49 -0
- package/dist/view-edit-cell.js +198 -0
- package/dist/view-editor.d.ts +52 -0
- package/dist/view-editor.js +1081 -0
- package/dist/view-formulas.d.ts +61 -0
- package/dist/view-formulas.js +247 -0
- package/dist/view-icons.d.ts +20 -0
- package/dist/view-icons.js +70 -0
- package/dist/view-model.d.ts +390 -0
- package/dist/view-model.js +316 -0
- package/dist/whats-new.d.ts +3 -0
- package/dist/whats-new.js +53 -0
- package/dist/widget-controls.d.ts +9 -0
- package/dist/widget-controls.js +26 -0
- package/dist/widget-data.d.ts +4 -0
- package/dist/widget-data.js +32 -0
- package/dist/widget-settings.d.ts +516 -0
- package/dist/widget-settings.js +290 -0
- package/dist/widget-thumbs.d.ts +3 -0
- package/dist/widget-thumbs.js +29 -0
- package/dist/workspace-keys.d.ts +12 -0
- package/dist/workspace-keys.js +13 -0
- package/dist/workspaces.d.ts +57 -0
- package/dist/workspaces.js +473 -0
- package/package.json +82 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Lumen (the whole component system is Lumen: published as
|
|
2
|
+
// `@columenlabs/lumen-ui` for every app): the frame, page, status bar, sidebar building
|
|
3
|
+
// blocks, preferences, filter, views, widgets, charts and drawers. Shadcn components it is built from
|
|
4
|
+
// are under `@columenlabs/lumen-ui/ui/*`; an app's sidebar content must use these (not its own
|
|
5
|
+
// copies) so it shares the shell's sidebar state. What one product adds (the product's assistant panel,
|
|
6
|
+
// Tasks) lives in that product and plugs into the shell's slots. Every app and the shell use the same major
|
|
7
|
+
// of TanStack Table (v9): vite's dev pre-bundling serves one copy to all of them.
|
|
8
|
+
export { LumenTable, LumenView, CHIP_TONE, RUN_STATE_TONE, FORMULAS_GROUP, ViewValueCell, rollUp, } from './lumen-view.js';
|
|
9
|
+
export { LumenLayout, domainKeys, followRows, } from './lumen-layout.js';
|
|
10
|
+
export { LumenViewCard } from './lumen-view-card.js';
|
|
11
|
+
export { LumenSelector, LumenSelectorList, SelectorRowContent, } from './lumen-selector.js';
|
|
12
|
+
export { ColorChip, ColorDot, colorIcon } from './color-dot.js';
|
|
13
|
+
export { EditCell, EditInputCell } from './view-edit-cell.js';
|
|
14
|
+
export { cardsOnScreen, kindName, onScreen, pointAtCard, spotlight, } from './spotlight.js';
|
|
15
|
+
export { LinkDot, LinkPicker, linkVar } from './lumen-links.js';
|
|
16
|
+
export { CardSegments, CardSwitch } from './card-switch.js';
|
|
17
|
+
export { PageInput, PageInputs } from './page-inputs.js';
|
|
18
|
+
export { LumenTabs } from './lumen-tabs.js';
|
|
19
|
+
export { LumenTabDrawer, TAB_NAME_MAX } from './lumen-tab-drawer.js';
|
|
20
|
+
export { IconPicker } from './icon-picker.js';
|
|
21
|
+
export { LumenEChart, axisStyle, baseOption, useChartTokens, } from './lumen-echart.js';
|
|
22
|
+
export { LumenGeoMap } from './lumen-geo-map.js';
|
|
23
|
+
export { LumenWidget, LumenSavedWidget } from './lumen-widget.js';
|
|
24
|
+
export { LumenConfirm } from './confirm.js';
|
|
25
|
+
export { COVERAGE_LEVELS, CoverageCell, CoverageLegend, coverageClass, coverageLabel, coverageLevel, } from './coverage-cells.js';
|
|
26
|
+
export { LumenCoverageMap, blockName, blockOf, } from './coverage-map.js';
|
|
27
|
+
export { LumenCoverageCalendarMap, } from './coverage-calendar-map.js';
|
|
28
|
+
export { DetailsTable, FactsTable } from './details-table.js';
|
|
29
|
+
export { DrawerSection } from './drawer-section.js';
|
|
30
|
+
export { LumenDrawer } from './lumen-drawer.js';
|
|
31
|
+
export { LumenCode, langOfPath } from './lumen-code.js';
|
|
32
|
+
export { LumenCodeEditor, } from './lumen-code-editor.js';
|
|
33
|
+
export { RenameField } from './rename-field.js';
|
|
34
|
+
export { ResetButton } from './reset-button.js';
|
|
35
|
+
export { GrowthChart, KEY_DATE_KINDS, KeyDateChips, PALETTE, benchColour, keyDateMarkers, paletteAt, } from './growth-chart.js';
|
|
36
|
+
export { FoldGroup, NavGroup, SidebarSection, } from './nav.js';
|
|
37
|
+
export { OverviewList, OverviewPage, ToneDot, } from './overview.js';
|
|
38
|
+
export { IconButton, Page, PageBody, PageHeader, } from './page.js';
|
|
39
|
+
export { DEFAULT_PREFS, TIME_ZONES, getPrefs, resolvedTheme, setPref, timeZoneLabel, usePrefs, ASSISTANT_WIDTH, } from './prefs.js';
|
|
40
|
+
export { KIT, configureLumen } from './kit-config.js';
|
|
41
|
+
export { ConnectionBlock, ErrorLine, IntegrationRow, KeyTestLine, TestBadge, errorText, useClock, } from './integrations.js';
|
|
42
|
+
export { LumenPager } from './pager.js';
|
|
43
|
+
export { createDeskQueryClient } from './query-client.js';
|
|
44
|
+
export { refreshHeaders, withRefreshToken } from './refresh.js';
|
|
45
|
+
export { LumenError, LumenLazy, LumenLoadFooter, LumenLoadTime, LumenProgress, LumenRefresh, LumenSkeleton, LumenStates, marketTrades, useLumenLoad, useLumenSource, useLiveLoad, } from './lumen-source.js';
|
|
46
|
+
export { LumenBoundary } from './lumen-boundary.js';
|
|
47
|
+
export { LumenPageState } from './lumen-page-state.js';
|
|
48
|
+
export { goToIssue, SaveButton } from './form-issues.js';
|
|
49
|
+
export { LumenForm, lumenFormIssues, } from './lumen-form.js';
|
|
50
|
+
export { RouteError, isStaleBuildError, reloadForNewBuild, reportError, watchNewBuilds, } from './route-error.js';
|
|
51
|
+
export { LumenSettings, SettingRow, SettingsActions, SettingsFooter, } from './settings.js';
|
|
52
|
+
export { LumenCard } from './summary-cards.js';
|
|
53
|
+
export { WhatsNew } from './whats-new.js';
|
|
54
|
+
export { LumenAppSwitcher } from './app-switcher.js';
|
|
55
|
+
export { SchedulesSection, } from './schedules.js';
|
|
56
|
+
export { NotificationsSettings } from './notifications.js';
|
|
57
|
+
export { TasksButton, TasksProvider, useTasks } from './tasks.js';
|
|
58
|
+
export { McpSettings } from './mcp-settings.js';
|
|
59
|
+
export { lumenToast } from './lumen-toast.js';
|
|
60
|
+
export { LumenShell, StatusItem, firstName, initials, maskAmount, useAmountsHidden, useApp, useShell, } from './shell.js';
|
|
61
|
+
export { apiJson } from './api-fetch.js';
|
|
62
|
+
export { cn } from './lib/utils.js';
|
|
63
|
+
export { StatusHealth } from './status-health.js';
|
|
64
|
+
export { TimeZoneSelect } from './status.js';
|
|
65
|
+
export { JoinsProvider, SourceStatusItems, YOURS_COLOR, editedCells, editedKey, frameColor, useFrameEdits, useJoins, usedJoinKeys, } from './joins.js';
|
|
66
|
+
export { OriginLegend, originsOf } from './origin-legend.js';
|
|
67
|
+
export { ConnectOffer, connectionFields, linkGroupId } from './connections.js';
|
|
68
|
+
export { FRESHNESS, FreshnessIcon, FreshnessMark, freshnessLine, freshnessOf, } from './freshness.js';
|
|
69
|
+
export { SourcesLine, useSourceHealth } from './source-health.js';
|
|
70
|
+
export { TILE_WIDTH, Tile, TileChip, TileRow, TileToggleGroup, } from './tile.js';
|
|
71
|
+
export { LumenTokenizedFilter, useLumenFilter, } from './lumen-filter.js';
|
|
72
|
+
export { useIsMobile } from './hooks/use-mobile.js';
|
|
73
|
+
export { VIEW_ICONS, iconOf, viewIcon } from './view-icons.js';
|
|
74
|
+
export { useAppView } from './app-views.js';
|
|
75
|
+
export { AssistantScreenProvider, useAssistantMoves, useAssistantPages, useAssistantScreen, useAssistantWorkspace, } from './assistant-screen.js';
|
|
76
|
+
export { AssistantContext, useAssistant, AssistantPendingContext, useAssistantName, useAssistantNote, useAssistantPending, } from './assistant-context.js';
|
|
77
|
+
export { WORKSPACES_KEY, frameKey, workspacesListQuery } from './workspace-keys.js';
|
|
78
|
+
export { WorkspacePage, WorkspacesProvider, WorkspacesSection, } from './workspaces.js';
|
|
79
|
+
export { CHART_INDICATORS, LINE_COLOR, computeIndicators, formulaIndicator, lineColor, resolveIndicator, runFormula, } from './market/indicators.js';
|
|
80
|
+
export { IndicatorPicker } from './market/indicator-picker.js';
|
|
81
|
+
export { OptionChainTable, } from './market/option-chain.js';
|
|
82
|
+
export { MarketProvider, useHasMarket, useMarket, useMarketDaily, useMarketFeed, } from './market/live.js';
|
|
83
|
+
export { MarketBadge, MarketLines, MarketTiles, MarketToday, MarketWidget, } from './market/market-widget.js';
|
|
84
|
+
export { CHART_TYPES, PriceChart, heikinAshi, } from './market/price-chart.js';
|
|
85
|
+
export { LumenChart, SymbolChartProvider, useLumenChart, useSymbolChart, } from './market/lumen-chart.js';
|
|
86
|
+
export { SymbolSheetProvider } from './symbol-sheet.js';
|
|
87
|
+
export { useSymbolSheet } from './symbol-sheet-context.js';
|
|
88
|
+
export { NoteLine } from './note-line.js';
|
|
89
|
+
export { LumenFinderButton, useLumenFinder, useLumenFinderRows, useOpenLumenFinder, } from './lumen-finder.js';
|
|
90
|
+
export { LumenAssistantButton, LumenAssistantChats, LumenAssistantPanel, assistantOpen, tabState, useAssistantHotkey, } from './assistant-panel.js';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** A key's last test: when, whether it worked, and what it read or why it failed. */
|
|
3
|
+
export interface KeyTestResult {
|
|
4
|
+
at: string;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
detail?: string | null;
|
|
7
|
+
error?: string | null;
|
|
8
|
+
}
|
|
9
|
+
/** `Oct 12, 4:34 PM PDT`-style time in the person's time zone. */
|
|
10
|
+
export declare function useClock(): (iso: string) => string;
|
|
11
|
+
/** A fetch that never got an answer is a TypeError ("Load failed" in Safari, "Failed to fetch" in Chrome). */
|
|
12
|
+
export declare const errorText: (e: unknown) => string;
|
|
13
|
+
export declare function ErrorLine({ error }: {
|
|
14
|
+
error: unknown;
|
|
15
|
+
}): import("react").JSX.Element | null;
|
|
16
|
+
/** One integration: a row that expands in place. */
|
|
17
|
+
export declare function IntegrationRow({ name, meta, badge, open, onOpenChange, children, }: {
|
|
18
|
+
name: string;
|
|
19
|
+
meta: string;
|
|
20
|
+
badge: ReactNode;
|
|
21
|
+
open: boolean;
|
|
22
|
+
onOpenChange: (open: boolean) => void;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}): import("react").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* One linked connection (a bank, a broker) and its accounts (an app banks and
|
|
27
|
+
* An app a broker link brokers alike). Collapsed by default, showing its name, `meta` and status; a
|
|
28
|
+
* connection that needs fixing opens on its own. `actions` sit beside the status, outside the toggle.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ConnectionBlock({ name, meta, status, fix, actions, children, }: {
|
|
31
|
+
name: string;
|
|
32
|
+
meta?: string;
|
|
33
|
+
/** `ok` is Connected; `fix` shows the fix button; `failed` shows the last sync failed. */
|
|
34
|
+
status: 'ok' | 'fix' | 'failed';
|
|
35
|
+
/** The fix (sign in again, reconnect); shown while `status` is `fix`. */
|
|
36
|
+
fix?: {
|
|
37
|
+
label: string;
|
|
38
|
+
onClick: () => void;
|
|
39
|
+
busy?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
};
|
|
42
|
+
actions?: ReactNode;
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
/** The row's status: whether the key's last test worked. */
|
|
46
|
+
export declare function TestBadge({ test, ok }: {
|
|
47
|
+
test: {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
} | null;
|
|
50
|
+
ok?: string;
|
|
51
|
+
}): import("react").JSX.Element;
|
|
52
|
+
/** The last test's time and outcome, with the Test button that runs it again. */
|
|
53
|
+
export declare function KeyTestLine({ test, run, }: {
|
|
54
|
+
test: KeyTestResult | null;
|
|
55
|
+
/** Runs the test; the app refreshes its own data when it settles. */
|
|
56
|
+
run: () => Promise<unknown>;
|
|
57
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Settings ▸ Integrations rows, one look on every app (an app since 2026-10-11, an app since
|
|
3
|
+
// 2026-10-12): a row that expands in place, its badge saying whether the key's last test worked, and
|
|
4
|
+
// the Test line that runs it again. A saved key says nothing; each row shows whether it works.
|
|
5
|
+
import { AlertTriangleIcon, CheckIcon, ChevronRightIcon, RefreshCwIcon } from 'lucide-react';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import { IconButton } from './icon-button.js';
|
|
8
|
+
import { cn } from './lib/utils.js';
|
|
9
|
+
import { usePrefs } from './prefs.js';
|
|
10
|
+
import { Badge } from './ui/badge.js';
|
|
11
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './ui/collapsible.js';
|
|
12
|
+
/** `Oct 12, 4:34 PM PDT`-style time in the person's time zone. */
|
|
13
|
+
export function useClock() {
|
|
14
|
+
const { timeZone } = usePrefs();
|
|
15
|
+
return (iso) => new Date(iso).toLocaleString('en-US', {
|
|
16
|
+
timeZone,
|
|
17
|
+
month: 'short',
|
|
18
|
+
day: 'numeric',
|
|
19
|
+
hour: 'numeric',
|
|
20
|
+
minute: '2-digit',
|
|
21
|
+
timeZoneName: 'short',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** A fetch that never got an answer is a TypeError ("Load failed" in Safari, "Failed to fetch" in Chrome). */
|
|
25
|
+
export const errorText = (e) => e instanceof TypeError
|
|
26
|
+
? 'The request was cut off before the desk answered (the page was left or the network dropped). Try again.'
|
|
27
|
+
: e instanceof Error
|
|
28
|
+
? e.message
|
|
29
|
+
: String(e);
|
|
30
|
+
export function ErrorLine({ error }) {
|
|
31
|
+
if (!error)
|
|
32
|
+
return null;
|
|
33
|
+
return (_jsx("p", { role: "alert", className: "text-xs text-loss", children: errorText(error) }));
|
|
34
|
+
}
|
|
35
|
+
/** One integration: a row that expands in place. */
|
|
36
|
+
export function IntegrationRow({ name, meta, badge, open, onOpenChange, children, }) {
|
|
37
|
+
return (_jsxs(Collapsible, { open: open, onOpenChange: onOpenChange, className: "border-b last:border-b-0", children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "flex w-full items-center gap-3 px-1 py-3 text-left hover:bg-muted/50", children: [_jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block font-medium", children: name }), _jsx("span", { className: "block truncate text-xs text-muted-foreground", children: meta })] }), badge, _jsx(ChevronRightIcon, { className: cn('size-4 shrink-0 text-muted-foreground transition-transform', open && 'rotate-90') })] }) }), _jsx(CollapsibleContent, { className: "grid grid-cols-1 gap-5 px-1 pt-1 pb-5", children: children })] }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One linked connection (a bank, a broker) and its accounts (an app banks and
|
|
41
|
+
* An app a broker link brokers alike). Collapsed by default, showing its name, `meta` and status; a
|
|
42
|
+
* connection that needs fixing opens on its own. `actions` sit beside the status, outside the toggle.
|
|
43
|
+
*/
|
|
44
|
+
export function ConnectionBlock({ name, meta, status, fix, actions, children, }) {
|
|
45
|
+
const [open, setOpen] = useState(status !== 'ok');
|
|
46
|
+
return (_jsxs(Collapsible, { open: open, onOpenChange: setOpen, className: "overflow-hidden rounded-md border", children: [_jsxs("div", { className: "flex items-center gap-2 bg-muted/60 px-3 py-1.5 text-sm", children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsxs("button", { type: "button", "aria-label": `${open ? 'Collapse' : 'Expand'} ${name}`, className: "flex min-w-0 flex-1 items-center gap-2 text-left", children: [_jsx(ChevronRightIcon, { className: cn('size-4 shrink-0 text-muted-foreground transition-transform', open && 'rotate-90') }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block font-medium", children: name }), meta && _jsx("span", { className: "block truncate text-xs text-muted-foreground", children: meta })] })] }) }), actions, status === 'fix' && fix ? (_jsx(IconButton, { icon: AlertTriangleIcon, size: "icon-xs", busy: fix.busy, label: fix.label, variant: "outline", className: "text-warning", disabled: fix.disabled, onClick: fix.onClick })) : status === 'failed' ? (_jsx(TestBadge, { test: { ok: false } })) : (_jsxs(Badge, { variant: "outline", className: "text-gain", children: [_jsx(CheckIcon, {}), "Connected"] }))] }), _jsx(CollapsibleContent, { children: children })] }));
|
|
47
|
+
}
|
|
48
|
+
/** The row's status: whether the key's last test worked. */
|
|
49
|
+
export function TestBadge({ test, ok = 'Works' }) {
|
|
50
|
+
if (!test)
|
|
51
|
+
return _jsx(Badge, { variant: "outline", children: "Not tested" });
|
|
52
|
+
return test.ok ? (_jsxs(Badge, { variant: "outline", className: "text-gain", children: [_jsx(CheckIcon, {}), ok] })) : (_jsxs(Badge, { variant: "outline", className: "text-loss", children: [_jsx(AlertTriangleIcon, {}), "Failed"] }));
|
|
53
|
+
}
|
|
54
|
+
/** The last test's time and outcome, with the Test button that runs it again. */
|
|
55
|
+
export function KeyTestLine({ test, run, }) {
|
|
56
|
+
const clock = useClock();
|
|
57
|
+
const [pending, setPending] = useState(false);
|
|
58
|
+
const [error, setError] = useState(null);
|
|
59
|
+
const go = async () => {
|
|
60
|
+
setPending(true);
|
|
61
|
+
setError(null);
|
|
62
|
+
try {
|
|
63
|
+
await run();
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
setError(e);
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
setPending(false);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return (_jsxs("div", { className: "grid grid-cols-1 gap-1", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-3 text-sm", children: [test ? (_jsxs("span", { className: cn('flex min-w-0 items-center gap-2', !test.ok && 'text-loss'), children: [test.ok ? (_jsx(CheckIcon, { className: "size-4 shrink-0 text-gain" })) : (_jsx(AlertTriangleIcon, { className: "size-4 shrink-0" })), _jsxs("span", { className: "truncate", children: ["Tested ", clock(test.at), " \u00B7 ", test.ok ? `works · ${test.detail}` : 'failed'] })] })) : (_jsx("span", { className: "text-muted-foreground", children: "Not tested yet" })), _jsx("span", { className: "flex-1" }), _jsx(IconButton, { icon: RefreshCwIcon, busy: pending, label: pending ? 'Testing…' : 'Test', variant: "outline", disabled: pending, onClick: () => void go() })] }), test && !test.ok && test.error ? (_jsx("p", { role: "alert", className: "text-xs text-loss", children: test.error })) : null, _jsx(ErrorLine, { error: error })] }));
|
|
73
|
+
}
|
package/dist/joins.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type JoinKey, type SourceState } from '@columenlabs/lumen-ui-types/domains';
|
|
2
|
+
import { type FrameChoice, type FrameColumn, type FrameData, type FrameEditInput, type FrameMeta, type YourColumn } from '@columenlabs/lumen-ui-types/frames';
|
|
3
|
+
import { type CustomViewConfig } from '@columenlabs/lumen-ui-types/views';
|
|
4
|
+
import { type ReactNode } from 'react';
|
|
5
|
+
import { type ConnectedDomain } from './connections.js';
|
|
6
|
+
import type { ViewCellValue, ViewDomain } from './view-model.js';
|
|
7
|
+
/** One symbol's facts by field key; a missing key is no data. */
|
|
8
|
+
type SymbolFacts = Record<string, number | string | null>;
|
|
9
|
+
/** An account's facts, by its id. */
|
|
10
|
+
export interface AccountFacts {
|
|
11
|
+
brokerage: string | null;
|
|
12
|
+
trading: string | null;
|
|
13
|
+
cash: number | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* How an app reads each join (an app: `/api/symbols` and its accounts). Each is a hook, called
|
|
17
|
+
* on every render of a card that could join; `on` and `used` say whether to read at all.
|
|
18
|
+
*/
|
|
19
|
+
export interface JoinReaders {
|
|
20
|
+
/** Facts by symbol for a broker and an app fields, when `on`. */
|
|
21
|
+
useSymbolFacts?: (symbols: string[], on: boolean) => {
|
|
22
|
+
facts: Record<string, SymbolFacts>;
|
|
23
|
+
sources: SourceState[];
|
|
24
|
+
};
|
|
25
|
+
/** Facts by account id for the account fields in `used` (empty: none). */
|
|
26
|
+
useAccountFacts?: (ids: string[], used: string[]) => {
|
|
27
|
+
facts: Record<string, AccountFacts>;
|
|
28
|
+
sources: SourceState[];
|
|
29
|
+
};
|
|
30
|
+
/** Option fields by OCC id for the contract fields in `used` (empty: none). */
|
|
31
|
+
useContractFacts?: (contracts: string[], used: string[]) => {
|
|
32
|
+
facts: Record<string, Record<string, ViewCellValue>>;
|
|
33
|
+
sources: SourceState[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The rows of other domains a card connects to (connections), by domain id:
|
|
37
|
+
* `ids` to read, `live` the ones a card shows (priced live), the rest only for the Link offer.
|
|
38
|
+
*/
|
|
39
|
+
useDomains?: (ids: string[], live: string[]) => Record<string, ConnectedDomain>;
|
|
40
|
+
}
|
|
41
|
+
/** Gives every card under it the app's readers for the joins. */
|
|
42
|
+
export declare function JoinsProvider({ readers, children, }: {
|
|
43
|
+
readers: JoinReaders;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
/** The join field keys a view uses anywhere: columns, filters, group, tiles, sort, pivot, cards, formulas. */
|
|
47
|
+
export declare function usedJoinKeys(config: CustomViewConfig, keys: Set<string>): string[];
|
|
48
|
+
/** Something the status bar can do for a source: a linked frame's ↻ (run the assistant's script again). */
|
|
49
|
+
export interface JoinAction {
|
|
50
|
+
label: string;
|
|
51
|
+
run: () => void;
|
|
52
|
+
busy: boolean;
|
|
53
|
+
/** Why it cannot run now (shown instead of running). */
|
|
54
|
+
disabled?: string;
|
|
55
|
+
}
|
|
56
|
+
/** A frame's as-of time as the status bar and the field tree show it. */
|
|
57
|
+
export declare const asOf: (at: string) => string;
|
|
58
|
+
/** Your data: the person's own columns. */
|
|
59
|
+
export declare const YOURS_COLOR = "var(--origin-yours)";
|
|
60
|
+
declare const recipeId: (id: string) => string;
|
|
61
|
+
/** A frame's group name on a card: `Assistant · Targets`, or `Yours · Notes` for the person's own. */
|
|
62
|
+
export declare const frameLabel: (meta: Pick<FrameMeta, 'name' | 'origin'>, assistant?: string) => string;
|
|
63
|
+
export declare const frameColor: (meta: Pick<FrameMeta, 'origin'>) => "var(--origin-assistant)" | "var(--origin-yours)";
|
|
64
|
+
/** The hand-edited cells of a frame, as `column\u0000key` (or `column\u0000#row`). */
|
|
65
|
+
export declare function editedCells(data: FrameData | undefined): Set<string>;
|
|
66
|
+
export declare const editedKey: (column: string, key: string | number) => string;
|
|
67
|
+
/**
|
|
68
|
+
* Edits in place: the cells the person types into a frame on any card, sent
|
|
69
|
+
* to the assistant's API, and the frame's rows in the cache replaced with what came back.
|
|
70
|
+
*/
|
|
71
|
+
export declare function useFrameEdits(api: string | null): import("@tanstack/react-query").UseMutationResult<FrameData, Error, {
|
|
72
|
+
id: string;
|
|
73
|
+
edits: FrameEditInput[];
|
|
74
|
+
}, unknown>;
|
|
75
|
+
/** The one Your data frame per key: every card with that key attaches the same columns. */
|
|
76
|
+
export declare const yoursName: (key: JoinKey) => string;
|
|
77
|
+
/** Makes (or extends) the person's Your data frame for a key with one more column. */
|
|
78
|
+
export declare function useYourData(api: string | null): import("@tanstack/react-query").UseMutationResult<FrameMeta, Error, {
|
|
79
|
+
key: JoinKey;
|
|
80
|
+
column: YourColumn;
|
|
81
|
+
}, unknown>;
|
|
82
|
+
/** A linked frame's group id in a card's field tree (`recipe:fr_…`). */
|
|
83
|
+
export declare const frameGroupId: typeof recipeId;
|
|
84
|
+
/**
|
|
85
|
+
* Edit widget's draft of `config.frames`: `domain` (the card's, joined with
|
|
86
|
+
* its saved frames) with the frames `ids` lists, reading the ones it lacks and dropping the rest.
|
|
87
|
+
*/
|
|
88
|
+
export declare function useDraftFrames<T>(domain: ViewDomain<T>, ids: readonly string[]): ViewDomain<T>;
|
|
89
|
+
/** The person's linked frames (recipes) a card can attach, for Edit widget's + Data. */
|
|
90
|
+
export declare function useFrameChoices(enabled: boolean): import("@tanstack/react-query").UseQueryResult<FrameChoice[], Error>;
|
|
91
|
+
/** A row of plain cells, as a link to a catalog domain or a recipe reads it. */
|
|
92
|
+
type CellRow = Record<string, ViewCellValue>;
|
|
93
|
+
interface PlainColumn {
|
|
94
|
+
key: string;
|
|
95
|
+
label: string;
|
|
96
|
+
type: 'number' | 'text' | 'date';
|
|
97
|
+
format?: FrameColumn['format'];
|
|
98
|
+
amount?: boolean;
|
|
99
|
+
}
|
|
100
|
+
/** Plain rows as a domain: a field per column, and the keys (symbol, account) a column carries. */
|
|
101
|
+
export declare function rowsDomain(id: string, columns: PlainColumn[], keys: readonly JoinKey[]): ViewDomain<CellRow>;
|
|
102
|
+
/**
|
|
103
|
+
* The rows of every domain or recipe the card links (any data domain or recipe,
|
|
104
|
+
* read once a link is defined): the app's own readers for the ones it reads itself (`linkable`),
|
|
105
|
+
* The assistant's API for the rest, a catalog domain through `GET /domains/:id/rows` as the person and a
|
|
106
|
+
* recipe (`frame:<id>`) through its frame. `live` are the ones a card shows; the rest of `ids` are
|
|
107
|
+
* read by the app only, for the Link offer.
|
|
108
|
+
*/
|
|
109
|
+
export declare function useDomainReads(ids: string[], live: string[]): Record<string, ConnectedDomain>;
|
|
110
|
+
/** What one source shows after its name, from how it fared. */
|
|
111
|
+
export declare function detailOf(s: SourceState | undefined, idle: string): string;
|
|
112
|
+
/**
|
|
113
|
+
* `domain` with the registry's join fields for the keys its rows carry, loaded for the join fields
|
|
114
|
+
* `config` uses over `rows`, and how each source fared. A domain with no keys comes back as is.
|
|
115
|
+
*/
|
|
116
|
+
export declare function useJoins<T>(domain: ViewDomain<T>, rows: T[], config: CustomViewConfig): {
|
|
117
|
+
domain: ViewDomain<T>;
|
|
118
|
+
sources: SourceState[];
|
|
119
|
+
actions: Record<string, JoinAction>;
|
|
120
|
+
/** What each connected or connectable domain read, for the Link offer. */
|
|
121
|
+
read: Record<string, ConnectedDomain>;
|
|
122
|
+
};
|
|
123
|
+
/** The status bar's word on each source: its dot and state, or a Connect button where it is off and can be turned on. */
|
|
124
|
+
export declare function SourceStatusItems({ sources, actions, }: {
|
|
125
|
+
sources: SourceState[];
|
|
126
|
+
actions?: Record<string, JoinAction>;
|
|
127
|
+
}): import("react").JSX.Element;
|
|
128
|
+
export {};
|