@digithings-ai/ui 0.0.0-stage → 0.1.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/README.md +48 -2
- package/package.json +143 -4
- package/src/components/NavShell.tsx +776 -0
- package/src/components/SocialRow.tsx +87 -0
- package/src/components/Spinner.tsx +27 -0
- package/src/components/StackLogo.tsx +40 -0
- package/src/components/Terminal.tsx +110 -0
- package/src/components/TerminalManifest.tsx +212 -0
- package/src/components/ThemeProvider.tsx +271 -0
- package/src/components/account/AuthCard.tsx +309 -0
- package/src/components/assistant-ui/elements/mermaid-diagram.aui.tsx +63 -0
- package/src/components/assistant-ui/elements/mermaid-diagram.tsx +340 -0
- package/src/components/brand/BrandWordmark.tsx +32 -0
- package/src/components/changelog/ReleaseRail.tsx +81 -0
- package/src/components/changelog/index.ts +1 -0
- package/src/components/chat/ChatCodeBlock.tsx +67 -0
- package/src/components/chat/ChatMarkdown.tsx +66 -0
- package/src/components/chat/ChatMarkdownSource.tsx +203 -0
- package/src/components/chat/ChatMermaidBlock.tsx +202 -0
- package/src/components/chat/ChatMessage.tsx +77 -0
- package/src/components/chat/ChatPlayback.tsx +422 -0
- package/src/components/chat/ChatStreamCursor.tsx +25 -0
- package/src/components/chat/ChatThinking.tsx +113 -0
- package/src/components/chat/ChatToolCall.tsx +190 -0
- package/src/components/chat/ChatTranscript.tsx +60 -0
- package/src/components/chat/ChatWidgetFrame.tsx +107 -0
- package/src/components/chat/DigichatBootLoader.tsx +683 -0
- package/src/components/chat/DigichatLauncher.tsx +361 -0
- package/src/components/chat/DigichatThread.tsx +118 -0
- package/src/components/chat/DigichatThreadList.tsx +54 -0
- package/src/components/chat/DigichatWordmark.tsx +24 -0
- package/src/components/chat/DotMatrix.tsx +650 -0
- package/src/components/chat/boot-lab.tsx +766 -0
- package/src/components/chat/boot-signal.ts +144 -0
- package/src/components/chat/chat-surfaces.ts +52 -0
- package/src/components/chat/connection-status.ts +40 -0
- package/src/components/chat/digichat-wordmark.ts +355 -0
- package/src/components/chat/disclosure-chevron.tsx +49 -0
- package/src/components/chat/followable-href.ts +9 -0
- package/src/components/chat/gallery-thread/action-icons.tsx +25 -0
- package/src/components/chat/gallery-thread/attachment.aui.tsx +262 -0
- package/src/components/chat/gallery-thread/block-caret.tsx +439 -0
- package/src/components/chat/gallery-thread/cn.ts +1 -0
- package/src/components/chat/gallery-thread/composer-keyboard.ts +106 -0
- package/src/components/chat/gallery-thread/composer-trigger-popover.aui.tsx +235 -0
- package/src/components/chat/gallery-thread/css.d.ts +6 -0
- package/src/components/chat/gallery-thread/file.tsx +238 -0
- package/src/components/chat/gallery-thread/follow-up-suggestions.aui.tsx +92 -0
- package/src/components/chat/gallery-thread/format-json-dump.ts +112 -0
- package/src/components/chat/gallery-thread/hooks/use-attachment-src.ts +46 -0
- package/src/components/chat/gallery-thread/hooks/use-copy-to-clipboard.ts +9 -0
- package/src/components/chat/gallery-thread/image.tsx +519 -0
- package/src/components/chat/gallery-thread/markdown-text.tsx +278 -0
- package/src/components/chat/gallery-thread/message-error.aui.tsx +105 -0
- package/src/components/chat/gallery-thread/message-timing.aui.tsx +143 -0
- package/src/components/chat/gallery-thread/private-work-step.tsx +188 -0
- package/src/components/chat/gallery-thread/reasoning.tsx +332 -0
- package/src/components/chat/gallery-thread/scroll-mode.ts +174 -0
- package/src/components/chat/gallery-thread/source.tsx +76 -0
- package/src/components/chat/gallery-thread/thread.aui.tsx +1619 -0
- package/src/components/chat/gallery-thread/tooltip-icon-button.tsx +53 -0
- package/src/components/chat/gallery-thread/typed-welcome-copy.tsx +18 -0
- package/src/components/chat/gallery-thread/ui/tooltip.tsx +22 -0
- package/src/components/chat/gallery-thread/work-chain-summary.tsx +48 -0
- package/src/components/chat/gallery-thread/work-chain.tsx +110 -0
- package/src/components/chat/gallery-thread/work-status.ts +66 -0
- package/src/components/chat/overlay-scrollbar.tsx +86 -0
- package/src/components/chat/sanitize-mermaid-svg.ts +38 -0
- package/src/components/chat/skins/SOURCE.md +36 -0
- package/src/components/chat/skins/base/attachment.aui.tsx +287 -0
- package/src/components/chat/skins/base/aui-default/README.md +45 -0
- package/src/components/chat/skins/base/aui-default/collapsible-root.tsx +19 -0
- package/src/components/chat/skins/base/aui-default/collapsible.tsx +21 -0
- package/src/components/chat/skins/base/aui-default/reasoning.aui.tsx +120 -0
- package/src/components/chat/skins/base/aui-default/reasoning.tsx +331 -0
- package/src/components/chat/skins/base/aui-default/surfaces.ts +7 -0
- package/src/components/chat/skins/base/aui-default/tool-fallback.aui.tsx +772 -0
- package/src/components/chat/skins/base/aui-default/tool-group.aui.tsx +241 -0
- package/src/components/chat/skins/base/docs-model-options.ts +6 -0
- package/src/components/chat/skins/base/elements/assistant-trace.aui.tsx +169 -0
- package/src/components/chat/skins/base/elements/composer-trigger-popover.aui.tsx +271 -0
- package/src/components/chat/skins/base/elements/directive-text.aui.tsx +29 -0
- package/src/components/chat/skins/base/elements/directive-text.tsx +76 -0
- package/src/components/chat/skins/base/elements/message-timing.aui.tsx +104 -0
- package/src/components/chat/skins/base/elements/model-selector.aui.tsx +140 -0
- package/src/components/chat/skins/base/elements/model-selector.tsx +720 -0
- package/src/components/chat/skins/base/elements/quote.aui.tsx +290 -0
- package/src/components/chat/skins/base/elements/work-chain.tsx +100 -0
- package/src/components/chat/skins/base/markdown-text.tsx +294 -0
- package/src/components/chat/skins/base/model.ts +1 -0
- package/src/components/chat/skins/base/thread.tsx +1050 -0
- package/src/components/chat/skins/base/tooltip-icon-button.tsx +56 -0
- package/src/components/chat/skins/base/ui/avatar.tsx +115 -0
- package/src/components/chat/skins/base/ui/badge.tsx +51 -0
- package/src/components/chat/skins/base/ui/button.tsx +67 -0
- package/src/components/chat/skins/base/ui/command.tsx +185 -0
- package/src/components/chat/skins/base/ui/dialog.tsx +168 -0
- package/src/components/chat/skins/base/ui/dot-matrix.tsx +267 -0
- package/src/components/chat/skins/base/ui/popover.tsx +97 -0
- package/src/components/chat/skins/base/ui/skeleton.tsx +20 -0
- package/src/components/chat/skins/base/ui/textarea.tsx +24 -0
- package/src/components/chat/skins/base/ui/tooltip.tsx +73 -0
- package/src/components/chat/skins/base-assistant-ui/config-provider.tsx +90 -0
- package/src/components/chat/skins/base-assistant-ui/defaults.ts +419 -0
- package/src/components/chat/skins/base-assistant-ui/index.tsx +44 -0
- package/src/components/chat/skins/chatgpt.tsx +448 -0
- package/src/components/chat/skins/claude.tsx +380 -0
- package/src/components/chat/skins/digichat-composer-toolbar.tsx +151 -0
- package/src/components/chat/skins/digichat-context-meter-shares.ts +158 -0
- package/src/components/chat/skins/digichat-context-meter.tsx +243 -0
- package/src/components/chat/skins/digichat-meter-tone.ts +26 -0
- package/src/components/chat/skins/digichat-usage-meter.tsx +103 -0
- package/src/components/chat/skins/digichat.tsx +144 -0
- package/src/components/chat/skins/expo-react-native.tsx +29 -0
- package/src/components/chat/skins/gemini.tsx +322 -0
- package/src/components/chat/skins/grok-icon.tsx +34 -0
- package/src/components/chat/skins/grok.tsx +369 -0
- package/src/components/chat/skins/index.ts +46 -0
- package/src/components/chat/skins/perplexity.tsx +462 -0
- package/src/components/chat/skins/product-page-assistant/assistant-modal.tsx +73 -0
- package/src/components/chat/skins/product-page-assistant/index.tsx +19 -0
- package/src/components/chat/skins/product-page-assistant/product-dashboard.tsx +164 -0
- package/src/components/chat/skins/react-ink.tsx +97 -0
- package/src/components/chat/skins/thread-skin-host-contract.ts +102 -0
- package/src/components/chat/skins/thread-skin-view.tsx +156 -0
- package/src/components/chat/skins/thread-skins.ts +143 -0
- package/src/components/chat/skins/tooltip-icon-button.tsx +35 -0
- package/src/components/chat/skins/ui/dropdown-menu.tsx +272 -0
- package/src/components/chat/skins/webpage-assistant/assistant-config.ts +238 -0
- package/src/components/chat/skins/webpage-assistant/assistant-modal.tsx +78 -0
- package/src/components/chat/skins/webpage-assistant/config-provider.tsx +132 -0
- package/src/components/chat/skins/webpage-assistant/docs-app.tsx +106 -0
- package/src/components/chat/skins/webpage-assistant/docs-article.tsx +109 -0
- package/src/components/chat/skins/webpage-assistant/docs-assistant.tsx +73 -0
- package/src/components/chat/skins/webpage-assistant/docs-nav.tsx +81 -0
- package/src/components/chat/skins/webpage-assistant/host-ui.ts +79 -0
- package/src/components/chat/skins/webpage-assistant/index.tsx +12 -0
- package/src/components/chat/skins/webpage-assistant/markdown-page.tsx +11 -0
- package/src/components/chat/skins/webpage-assistant/pages.ts +9 -0
- package/src/components/chat/skins/webpage-assistant/types.ts +178 -0
- package/src/components/chat/skins/webpage-assistant/use-mobile.ts +19 -0
- package/src/components/chat/stock/SOURCE.md +90 -0
- package/src/components/chat/stock/artifacts-panel.tsx +305 -0
- package/src/components/chat/stock/attachment.aui.tsx +280 -0
- package/src/components/chat/stock/chat-notice.tsx +143 -0
- package/src/components/chat/stock/chat-private-mode.tsx +64 -0
- package/src/components/chat/stock/deploy-ui-context.tsx +89 -0
- package/src/components/chat/stock/embed-chat-prefs.tsx +471 -0
- package/src/components/chat/stock/file.tsx +265 -0
- package/src/components/chat/stock/follow-up-suggestions.aui.tsx +83 -0
- package/src/components/chat/stock/image.tsx +531 -0
- package/src/components/chat/stock/index.ts +129 -0
- package/src/components/chat/stock/json-view.tsx +140 -0
- package/src/components/chat/stock/markdown-text.tsx +319 -0
- package/src/components/chat/stock/message-error.aui.tsx +96 -0
- package/src/components/chat/stock/message-export-menu.tsx +156 -0
- package/src/components/chat/stock/palette-row-preview.tsx +26 -0
- package/src/components/chat/stock/reasoning.aui.tsx +120 -0
- package/src/components/chat/stock/reasoning.tsx +335 -0
- package/src/components/chat/stock/skin-chrome.tsx +81 -0
- package/src/components/chat/stock/skin-credit.tsx +63 -0
- package/src/components/chat/stock/skin-palette-bridge.tsx +235 -0
- package/src/components/chat/stock/skin-palette-context.ts +16 -0
- package/src/components/chat/stock/skin-runtime.tsx +52 -0
- package/src/components/chat/stock/skin-slash-palette.tsx +393 -0
- package/src/components/chat/stock/skin-types.ts +217 -0
- package/src/components/chat/stock/stock-chat-prefs-host.tsx +501 -0
- package/src/components/chat/stock/stock-send-gate.tsx +94 -0
- package/src/components/chat/stock/stock-shape.tsx +39 -0
- package/src/components/chat/stock/thread.aui.tsx +645 -0
- package/src/components/chat/stock/tool-display.ts +6 -0
- package/src/components/chat/stock/tool-fallback.aui.tsx +866 -0
- package/src/components/chat/stock/tool-group.aui.tsx +244 -0
- package/src/components/chat/stock/tool-surface.ts +120 -0
- package/src/components/chat/stock/tooltip-icon-button.tsx +49 -0
- package/src/components/chat/stock/ui/avatar.tsx +108 -0
- package/src/components/chat/stock/ui/button.tsx +81 -0
- package/src/components/chat/stock/ui/collapsible.tsx +21 -0
- package/src/components/chat/stock/ui/dialog.tsx +163 -0
- package/src/components/chat/stock/ui/skeleton.tsx +13 -0
- package/src/components/chat/stock/ui/textarea.tsx +20 -0
- package/src/components/chat/stock/ui/tooltip.tsx +68 -0
- package/src/components/chat/stock/use-attachment-src.ts +42 -0
- package/src/components/chat/stock/use-copy-to-clipboard.ts +29 -0
- package/src/components/chat/strip-model-boilerplate.ts +42 -0
- package/src/components/chat/suggestion-cycle.tsx +230 -0
- package/src/components/chat/suggestion-scroll-row.tsx +81 -0
- package/src/components/chat/trace-grouping/chain-group-by.ts +44 -0
- package/src/components/chat/trace-grouping/chain-state.ts +141 -0
- package/src/components/chat/trace-grouping/index.ts +32 -0
- package/src/components/chat/trace-grouping/tool-row.ts +74 -0
- package/src/components/chat/trace-grouping/use-deploy-work-disclosure.ts +35 -0
- package/src/components/chat/trace-grouping/use-work-chain.ts +103 -0
- package/src/components/chat/trace-i18n/core.ts +48 -0
- package/src/components/chat/trace-i18n/index.tsx +23 -0
- package/src/components/chat/trace-i18n/locales/en.ts +24 -0
- package/src/components/chat/trace-i18n/locales/fr.ts +28 -0
- package/src/components/chat/trace-i18n/types.ts +35 -0
- package/src/components/chat/trace-spacing.ts +249 -0
- package/src/components/chat/transcript/activity-view.ts +375 -0
- package/src/components/chat/transcript/chat-export.ts +133 -0
- package/src/components/chat/transcript/index.ts +10 -0
- package/src/components/chat/transcript/save-file.ts +209 -0
- package/src/components/chat/transcript/transcript-markdown.ts +428 -0
- package/src/components/chat/transcript/types.ts +81 -0
- package/src/components/chat/turn-outcome.ts +52 -0
- package/src/components/chat/use-warmup-phase.ts +18 -0
- package/src/components/chat/work-status-lead.tsx +49 -0
- package/src/components/chrome.tsx +264 -0
- package/src/components/command-palette/CommandPalette.tsx +404 -0
- package/src/components/command-palette/index.ts +6 -0
- package/src/components/contact/ContactMailto.tsx +112 -0
- package/src/components/contact/index.ts +5 -0
- package/src/components/conviction/ConvictionMeter.tsx +40 -0
- package/src/components/conviction/SignedConvictionBadge.tsx +26 -0
- package/src/components/conviction/index.ts +7 -0
- package/src/components/data-layout/BentoGrid.tsx +52 -0
- package/src/components/data-layout/CardRail.tsx +150 -0
- package/src/components/data-layout/DotMatrixStat.tsx +65 -0
- package/src/components/data-layout/FeatureCell.tsx +80 -0
- package/src/components/data-layout/MediaFrame.tsx +125 -0
- package/src/components/data-layout/ModuleGrid.tsx +735 -0
- package/src/components/data-layout/Odometer.tsx +149 -0
- package/src/components/data-layout/ProductFrame.tsx +79 -0
- package/src/components/data-layout/TestimonialWall.tsx +139 -0
- package/src/components/data-layout/index.ts +19 -0
- package/src/components/data-layout/treemap.ts +368 -0
- package/src/components/deck/DeckStack.tsx +243 -0
- package/src/components/desk/DataTable.tsx +373 -0
- package/src/components/desk/KpiGrid.tsx +80 -0
- package/src/components/desk/Sparkline.tsx +63 -0
- package/src/components/desk/StateBlock.tsx +132 -0
- package/src/components/desk/index.ts +18 -0
- package/src/components/diagrams/ArchitectureDiagram.tsx +350 -0
- package/src/components/diagrams/ArchitectureTour.tsx +912 -0
- package/src/components/diagrams/TerminalSchematic.tsx +192 -0
- package/src/components/diagrams/architecture-svg.tsx +384 -0
- package/src/components/diagrams/index.ts +30 -0
- package/src/components/diagrams/mermaid-theme.ts +115 -0
- package/src/components/diagrams/tour-camera.ts +171 -0
- package/src/components/docs/CodeTabs.tsx +90 -0
- package/src/components/docs/CopyCommand.tsx +151 -0
- package/src/components/docs/DocsLayout.tsx +197 -0
- package/src/components/docs/DocsSearch.tsx +97 -0
- package/src/components/docs/Endpoint.tsx +135 -0
- package/src/components/document/DocumentFrame.tsx +43 -0
- package/src/components/document/GlyphList.tsx +51 -0
- package/src/components/document/PageTitle.tsx +44 -0
- package/src/components/document/Prose.tsx +38 -0
- package/src/components/document/Section.tsx +55 -0
- package/src/components/document/index.ts +13 -0
- package/src/components/effects-chrome/AnnouncementBar.tsx +88 -0
- package/src/components/effects-chrome/HorizontalScrollTrack.tsx +461 -0
- package/src/components/effects-chrome/Pipeline.tsx +226 -0
- package/src/components/effects-chrome/RotatingPrompts.tsx +116 -0
- package/src/components/effects-chrome/StackingPanels.tsx +101 -0
- package/src/components/effects-chrome/TabStrip.tsx +232 -0
- package/src/components/effects-chrome/ToastStack.tsx +201 -0
- package/src/components/effects-chrome/horizontal-track-core.ts +70 -0
- package/src/components/effects-chrome/index.ts +35 -0
- package/src/components/emblems.tsx +188 -0
- package/src/components/faviconTheme.ts +23 -0
- package/src/components/figure/Figure.tsx +38 -0
- package/src/components/figure/index.ts +2 -0
- package/src/components/finance-charts/DrawdownPlot.tsx +76 -0
- package/src/components/finance-charts/EquityCurve.tsx +71 -0
- package/src/components/finance-charts/PriceChart.tsx +119 -0
- package/src/components/finance-charts/chart-host.tsx +236 -0
- package/src/components/finance-charts/chart-scale.ts +93 -0
- package/src/components/finance-charts/demo-data.ts +88 -0
- package/src/components/finance-charts/index.ts +46 -0
- package/src/components/finance-charts/lw-chart.tsx +292 -0
- package/src/components/finance-composites/MarketBar.tsx +243 -0
- package/src/components/finance-composites/OrderBook.tsx +133 -0
- package/src/components/finance-composites/PerformanceDashboard.tsx +185 -0
- package/src/components/finance-composites/SortableTable.tsx +144 -0
- package/src/components/finance-composites/StockTicker.tsx +65 -0
- package/src/components/finance-composites/SyncedTearsheet.tsx +226 -0
- package/src/components/finance-composites/index.ts +28 -0
- package/src/components/finance-tearsheet/KpiStrip.tsx +49 -0
- package/src/components/finance-tearsheet/LiveBadge.tsx +29 -0
- package/src/components/finance-tearsheet/ReturnsMatrix.tsx +321 -0
- package/src/components/finance-tearsheet/StrategyTearsheet.tsx +99 -0
- package/src/components/finance-tearsheet/TearsheetCard.tsx +54 -0
- package/src/components/finance-tearsheet/TradeLogTable.tsx +73 -0
- package/src/components/finance-tearsheet/charts.tsx +2624 -0
- package/src/components/finance-tearsheet/demo-data.ts +177 -0
- package/src/components/finance-tearsheet/format.ts +41 -0
- package/src/components/finance-tearsheet/index.ts +120 -0
- package/src/components/finance-tearsheet/print.ts +52 -0
- package/src/components/finance-tearsheet/risk-bands.ts +48 -0
- package/src/components/finance-tearsheet/stats.ts +35 -0
- package/src/components/finance-tearsheet/strategy-sheet-model.ts +238 -0
- package/src/components/finance-tearsheet/types.ts +58 -0
- package/src/components/footer/FooterCells.tsx +109 -0
- package/src/components/footer/index.ts +6 -0
- package/src/components/graph.tsx +158 -0
- package/src/components/icons.tsx +98 -0
- package/src/components/landing/PixelWordmark.tsx +36 -0
- package/src/components/logos.ts +39 -0
- package/src/components/marquee/Marquee.tsx +204 -0
- package/src/components/metrics/PerfMetrics.tsx +68 -0
- package/src/components/metrics/StatCounter.tsx +104 -0
- package/src/components/page-geometry.tsx +177 -0
- package/src/components/pricing/Pricing.tsx +174 -0
- package/src/components/pricing/PricingMatrix.tsx +219 -0
- package/src/components/prose/index.ts +2 -0
- package/src/components/prose/prose.tsx +86 -0
- package/src/components/repo-activity/RepoActivity.tsx +599 -0
- package/src/components/repo-activity/RepoHeatmap.tsx +225 -0
- package/src/components/repo-activity/demo.ts +201 -0
- package/src/components/repo-activity/fetch.ts +211 -0
- package/src/components/repo-activity/heatmap.ts +123 -0
- package/src/components/repo-activity/index.ts +28 -0
- package/src/components/repo-activity/types.ts +99 -0
- package/src/components/stages/NumberedStages.tsx +116 -0
- package/src/components/symbols/marks.tsx +116 -0
- package/src/components/symbols/terminal-lockup.tsx +136 -0
- package/src/components/symbols/terminal-marks.tsx +226 -0
- package/src/components/terminal/ChatResponseLoader.tsx +67 -0
- package/src/components/terminal/ContainerBootLoader.tsx +82 -0
- package/src/components/terminal/TerminalStepCaret.tsx +202 -0
- package/src/components/themeInit.ts +24 -0
- package/src/components/typography/MotionReveal.tsx +108 -0
- package/src/components/typography/TypewriterReveal.tsx +101 -0
- package/src/components/typography/WordReveal.tsx +143 -0
- package/src/data/modules.ts +378 -0
- package/src/data/subsystems.ts +101 -0
- package/src/index.ts +587 -0
- package/src/lib/base-path.ts +60 -0
- package/src/lib/cx.ts +25 -0
- package/src/lib/gloomberb.ts +69 -0
- package/src/lib/record.ts +19 -0
- package/src/lib/stub-payload.ts +183 -0
- package/src/lib/useBodyScrollLock.ts +44 -0
- package/src/lib/utils.ts +6 -0
- package/src/motion/primitives.tsx +105 -0
- package/src/motion/scroll-glide.ts +62 -0
- package/src/motion/scrolly-core.ts +38 -0
- package/src/motion/scrolly.tsx +95 -0
- package/src/navigation/HashScrollManager.tsx +167 -0
- package/src/navigation/hashScroll.ts +78 -0
- package/src/replay/browser.ts +280 -0
- package/src/replay/chat-export-run.ts +121 -0
- package/src/replay/export-format.ts +25 -0
- package/src/replay/export-mount.ts +32 -0
- package/src/replay/filename.ts +54 -0
- package/src/replay/index.ts +21 -0
- package/src/replay/redact-dom.ts +178 -0
- package/src/replay/redact.ts +113 -0
- package/src/replay/snapshot.ts +659 -0
- package/src/styles/account-auth.css +339 -0
- package/src/styles/brand-wordmark.css +11 -0
- package/src/styles/card-rail.css +120 -0
- package/src/styles/chat-aui.css +1143 -0
- package/src/styles/chat-core.css +469 -0
- package/src/styles/chat-digichat.css +2531 -0
- package/src/styles/chat-math.css +70 -0
- package/src/styles/chat-skin-palette.css +138 -0
- package/src/styles/chat-stock-menu.css +37 -0
- package/src/styles/chat-widgets.css +190 -0
- package/src/styles/command-palette.css +372 -0
- package/src/styles/controls-core.css +2261 -0
- package/src/styles/controls-overlay.css +603 -0
- package/src/styles/data-layout.css +288 -0
- package/src/styles/deck.css +141 -0
- package/src/styles/diagrams.css +1860 -0
- package/src/styles/digichat-app-theme.css +250 -0
- package/src/styles/digichat-boot-loader.css +487 -0
- package/src/styles/digichat-launcher.css +377 -0
- package/src/styles/docs.css +165 -0
- package/src/styles/effects-chrome.css +888 -0
- package/src/styles/finance-composites.css +214 -0
- package/src/styles/finance-tearsheet-overlay.css +90 -0
- package/src/styles/finance-tearsheet.css +945 -0
- package/src/styles/marquee.css +168 -0
- package/src/styles/metrics.css +82 -0
- package/src/styles/nav-shell.css +551 -0
- package/src/styles/pricing.css +79 -0
- package/src/styles/repo-activity.css +575 -0
- package/src/styles/stages.css +69 -0
- package/src/styles/terminal-loaders.css +122 -0
- package/src/styles/terminal-manifest.css +228 -0
- package/src/styles/web-theme.css +1007 -0
- package/src/styles/word-reveal.css +204 -0
- package/src/theme/apply-theme.ts +214 -0
- package/src/theme/index.ts +27 -0
- package/src/theme/palette-registry.ts +855 -0
- package/src/theme/tui-prefs.ts +64 -0
- package/src/ui/alert.tsx +78 -0
- package/src/ui/avatar.tsx +104 -0
- package/src/ui/badge.tsx +75 -0
- package/src/ui/breadcrumb.tsx +61 -0
- package/src/ui/button.tsx +67 -0
- package/src/ui/card.tsx +139 -0
- package/src/ui/checkbox.tsx +27 -0
- package/src/ui/collapsible.tsx +32 -0
- package/src/ui/date-pager.tsx +325 -0
- package/src/ui/dialog.tsx +157 -0
- package/src/ui/dropdown-menu.tsx +267 -0
- package/src/ui/empty-state.tsx +165 -0
- package/src/ui/field.tsx +104 -0
- package/src/ui/form.tsx +36 -0
- package/src/ui/icon-button.tsx +36 -0
- package/src/ui/index.ts +34 -0
- package/src/ui/input.tsx +33 -0
- package/src/ui/kbd.tsx +30 -0
- package/src/ui/label.tsx +32 -0
- package/src/ui/pager.tsx +119 -0
- package/src/ui/pagination.tsx +126 -0
- package/src/ui/radio-group.tsx +51 -0
- package/src/ui/search-bar.tsx +85 -0
- package/src/ui/segmented-control.tsx +76 -0
- package/src/ui/select.tsx +257 -0
- package/src/ui/separator.tsx +24 -0
- package/src/ui/sheet.tsx +141 -0
- package/src/ui/skeleton.tsx +76 -0
- package/src/ui/slider.tsx +76 -0
- package/src/ui/switch.tsx +31 -0
- package/src/ui/table.tsx +179 -0
- package/src/ui/tabs.tsx +89 -0
- package/src/ui/tags-input.tsx +168 -0
- package/src/ui/textarea.tsx +17 -0
- package/src/ui/tooltip.tsx +71 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { docsAssistantConfig } from "./assistant-config";
|
|
4
|
+
import { defaultBrandTheme, defaultDocsHostUi } from "./host-ui";
|
|
5
|
+
import type { BrandTheme, DocsAssistantConfig, DocsHostUiSpec } from "./types";
|
|
6
|
+
import { useSkinChrome } from "../../stock";
|
|
7
|
+
import {
|
|
8
|
+
createContext,
|
|
9
|
+
useContext,
|
|
10
|
+
useMemo,
|
|
11
|
+
type CSSProperties,
|
|
12
|
+
type ReactNode,
|
|
13
|
+
} from "react";
|
|
14
|
+
|
|
15
|
+
const defaultDocsConfig: {
|
|
16
|
+
hostUi: DocsHostUiSpec;
|
|
17
|
+
assistant: DocsAssistantConfig;
|
|
18
|
+
brandTheme: BrandTheme;
|
|
19
|
+
} = {
|
|
20
|
+
hostUi: defaultDocsHostUi,
|
|
21
|
+
assistant: docsAssistantConfig,
|
|
22
|
+
brandTheme: defaultBrandTheme,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const DocsConfigContext = createContext(defaultDocsConfig);
|
|
26
|
+
|
|
27
|
+
export function DocsConfigProvider({ children }: { children: ReactNode }) {
|
|
28
|
+
const chrome = useSkinChrome();
|
|
29
|
+
const config = useMemo(() => {
|
|
30
|
+
const title = chrome.title?.trim();
|
|
31
|
+
const welcome = chrome.welcome?.trim();
|
|
32
|
+
const placeholder = chrome.placeholder?.trim();
|
|
33
|
+
const hostUi = title
|
|
34
|
+
? {
|
|
35
|
+
...defaultDocsHostUi,
|
|
36
|
+
root: {
|
|
37
|
+
...defaultDocsHostUi.root,
|
|
38
|
+
props: {
|
|
39
|
+
...defaultDocsHostUi.root.props,
|
|
40
|
+
productName: title,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
: defaultDocsHostUi;
|
|
45
|
+
const brandTheme = chrome.accent
|
|
46
|
+
? { ...defaultBrandTheme, accent: chrome.accent.color }
|
|
47
|
+
: defaultBrandTheme;
|
|
48
|
+
const assistant = {
|
|
49
|
+
...docsAssistantConfig,
|
|
50
|
+
...(title ? { productName: title, assistantName: title } : {}),
|
|
51
|
+
welcome: {
|
|
52
|
+
...docsAssistantConfig.welcome,
|
|
53
|
+
...(welcome ? { headline: welcome } : {}),
|
|
54
|
+
},
|
|
55
|
+
labels: {
|
|
56
|
+
...docsAssistantConfig.labels,
|
|
57
|
+
...(placeholder
|
|
58
|
+
? { composerPlaceholder: placeholder }
|
|
59
|
+
: {}),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
return { hostUi, assistant, brandTheme };
|
|
63
|
+
}, [chrome]);
|
|
64
|
+
|
|
65
|
+
const theme = config.brandTheme;
|
|
66
|
+
const accentForeground = bestContrast(theme.accent);
|
|
67
|
+
const style = {
|
|
68
|
+
"--docs-accent": theme.accent,
|
|
69
|
+
"--docs-accent-foreground": accentForeground,
|
|
70
|
+
"--docs-accent-soft": colorMix(theme.accent, theme.surface, 0.12),
|
|
71
|
+
"--docs-accent-softer": colorMix(theme.accent, theme.surface, 0.06),
|
|
72
|
+
"--docs-surface": theme.surface,
|
|
73
|
+
"--docs-border": theme.border,
|
|
74
|
+
"--docs-muted": theme.mutedText,
|
|
75
|
+
"--docs-ring": theme.focusRing,
|
|
76
|
+
"--primary": theme.accent,
|
|
77
|
+
"--primary-foreground": accentForeground,
|
|
78
|
+
"--ring": theme.focusRing,
|
|
79
|
+
"--accent": colorMix(theme.accent, theme.surface, 0.12),
|
|
80
|
+
"--accent-foreground": accentForeground,
|
|
81
|
+
"--border": theme.border,
|
|
82
|
+
"--muted-foreground": theme.mutedText,
|
|
83
|
+
"--sidebar-primary": theme.accent,
|
|
84
|
+
"--sidebar-primary-foreground": accentForeground,
|
|
85
|
+
"--sidebar-accent": colorMix(theme.accent, theme.surface, 0.12),
|
|
86
|
+
"--sidebar-accent-foreground": accentForeground,
|
|
87
|
+
"--sidebar-border": theme.border,
|
|
88
|
+
"--sidebar-ring": theme.focusRing,
|
|
89
|
+
} as CSSProperties;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<DocsConfigContext.Provider value={config}>
|
|
93
|
+
<div className="h-full" style={style}>
|
|
94
|
+
{children}
|
|
95
|
+
</div>
|
|
96
|
+
</DocsConfigContext.Provider>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function useDocsConfig() {
|
|
101
|
+
return useContext(DocsConfigContext);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function colorMix(first: string, second: string, firstWeight: number) {
|
|
105
|
+
const a = parseHex(first);
|
|
106
|
+
const b = parseHex(second);
|
|
107
|
+
if (!a || !b) return first;
|
|
108
|
+
|
|
109
|
+
const mix = a.map((value, index) =>
|
|
110
|
+
Math.round(value * firstWeight + b[index] * (1 - firstWeight)),
|
|
111
|
+
);
|
|
112
|
+
return `#${mix.map((value) => value.toString(16).padStart(2, "0")).join("")}`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function bestContrast(hex: string) {
|
|
116
|
+
const rgb = parseHex(hex);
|
|
117
|
+
if (!rgb) return "#ffffff";
|
|
118
|
+
const luminance =
|
|
119
|
+
(0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]) / 255;
|
|
120
|
+
return luminance > 0.6 ? "#0f172a" : "#ffffff";
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function parseHex(hex: string) {
|
|
124
|
+
const match = /^#([0-9a-f]{6})$/i.exec(hex);
|
|
125
|
+
if (!match) return null;
|
|
126
|
+
const value = match[1];
|
|
127
|
+
return [
|
|
128
|
+
Number.parseInt(value.slice(0, 2), 16),
|
|
129
|
+
Number.parseInt(value.slice(2, 4), 16),
|
|
130
|
+
Number.parseInt(value.slice(4, 6), 16),
|
|
131
|
+
];
|
|
132
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { DocsArticle } from "./docs-article";
|
|
4
|
+
import { DocsAssistant } from "./docs-assistant";
|
|
5
|
+
import { DocsNav } from "./docs-nav";
|
|
6
|
+
import { useIsMobile } from "./use-mobile";
|
|
7
|
+
import { useDocsConfig } from "./config-provider";
|
|
8
|
+
import { getPageById } from "./pages";
|
|
9
|
+
import { BookOpenIcon, SearchIcon } from "lucide-react";
|
|
10
|
+
import { useEffect, useRef, useState } from "react";
|
|
11
|
+
|
|
12
|
+
export function DocsApp({ previewWarning }: { previewWarning?: string }) {
|
|
13
|
+
const { assistant, hostUi } = useDocsConfig();
|
|
14
|
+
const shell = hostUi.root.props;
|
|
15
|
+
const pages = shell.pages;
|
|
16
|
+
const isMobile = useIsMobile();
|
|
17
|
+
const desktopAssistantPlacement = shell.assistantPlacement ?? "sidebar";
|
|
18
|
+
const showAssistantAsModal = isMobile || desktopAssistantPlacement === "modal";
|
|
19
|
+
const showAssistantSidebar = !showAssistantAsModal;
|
|
20
|
+
const contentRef = useRef<HTMLElement>(null);
|
|
21
|
+
const defaultPageId = shell.defaultPageId;
|
|
22
|
+
const [selectedPageId, setSelectedPageId] = useState(defaultPageId);
|
|
23
|
+
const currentPage = getPageById(selectedPageId, pages, defaultPageId);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const readPageFromUrl = () => {
|
|
26
|
+
const pageId = new URLSearchParams(window.location.search).get("page");
|
|
27
|
+
if (pageId && pages.some((page) => page.id === pageId)) {
|
|
28
|
+
setSelectedPageId(pageId);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
readPageFromUrl();
|
|
33
|
+
window.addEventListener("popstate", readPageFromUrl);
|
|
34
|
+
return () => window.removeEventListener("popstate", readPageFromUrl);
|
|
35
|
+
}, [pages]);
|
|
36
|
+
|
|
37
|
+
const handleSelectPage = (pageId: string) => {
|
|
38
|
+
if (!pages.some((page) => page.id === pageId)) return;
|
|
39
|
+
setSelectedPageId(pageId);
|
|
40
|
+
const nextUrl = new URL(window.location.href);
|
|
41
|
+
nextUrl.searchParams.set("page", pageId);
|
|
42
|
+
window.history.replaceState(null, "", nextUrl);
|
|
43
|
+
requestAnimationFrame(() => {
|
|
44
|
+
contentRef.current?.scrollTo({ top: 0, behavior: "smooth" });
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div className="h-full overflow-hidden bg-[color-mix(in_oklab,var(--docs-accent)_4%,#f7f8fb)] text-foreground">
|
|
50
|
+
{previewWarning ? (
|
|
51
|
+
<div className="border-b border-amber-200 bg-amber-50 px-4 py-2 text-sm text-amber-900">
|
|
52
|
+
{previewWarning}
|
|
53
|
+
</div>
|
|
54
|
+
) : null}
|
|
55
|
+
<header className="sticky top-0 z-30 border-b bg-white/95 backdrop-blur">
|
|
56
|
+
<div className="flex h-14 items-center justify-between gap-4 px-4 lg:px-6">
|
|
57
|
+
<div className="flex min-w-0 items-center gap-3">
|
|
58
|
+
<div className="flex size-8 shrink-0 items-center justify-center rounded-md bg-[var(--docs-accent)] text-[var(--docs-accent-foreground)]">
|
|
59
|
+
<BookOpenIcon className="size-4" />
|
|
60
|
+
</div>
|
|
61
|
+
<div className="min-w-0">
|
|
62
|
+
<div className="truncate text-sm font-semibold">{shell.productName}</div>
|
|
63
|
+
<div className="truncate text-xs text-muted-foreground">{shell.docsName}</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div className="hidden min-w-48 items-center gap-2 rounded-md border border-[var(--docs-border)] bg-[var(--docs-accent-softer)] px-3 py-1.5 text-sm text-[var(--docs-muted)] md:flex">
|
|
67
|
+
<SearchIcon className="size-4 text-[var(--docs-accent)]" />
|
|
68
|
+
{assistant.labels.headerSearch}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</header>
|
|
72
|
+
|
|
73
|
+
<main
|
|
74
|
+
className={`grid h-[calc(100%-3.5rem)] grid-cols-1 overflow-hidden ${
|
|
75
|
+
showAssistantSidebar
|
|
76
|
+
? "md:grid-cols-[minmax(0,1fr)_410px] xl:grid-cols-[240px_minmax(0,1fr)_410px]"
|
|
77
|
+
: "xl:grid-cols-[240px_minmax(0,1fr)]"
|
|
78
|
+
}`}
|
|
79
|
+
>
|
|
80
|
+
<aside className="hidden h-full overflow-hidden border-r bg-white xl:block">
|
|
81
|
+
<DocsNav currentPageId={currentPage.id} onSelectPage={handleSelectPage} />
|
|
82
|
+
</aside>
|
|
83
|
+
<section ref={contentRef} className="min-w-0 overflow-y-auto">
|
|
84
|
+
<div className="border-b bg-white px-4 py-3 xl:hidden">
|
|
85
|
+
<DocsNav currentPageId={currentPage.id} onSelectPage={handleSelectPage} compact />
|
|
86
|
+
</div>
|
|
87
|
+
<DocsArticle key={currentPage.id} page={currentPage} onSelectPage={handleSelectPage} />
|
|
88
|
+
</section>
|
|
89
|
+
<aside
|
|
90
|
+
className={`${showAssistantSidebar ? "hidden md:block" : "hidden"} h-full min-h-0 overflow-hidden border-l bg-white`}
|
|
91
|
+
>
|
|
92
|
+
<DocsAssistant currentPage={currentPage} onSelectPage={handleSelectPage} mode="sidebar" />
|
|
93
|
+
</aside>
|
|
94
|
+
</main>
|
|
95
|
+
|
|
96
|
+
{showAssistantAsModal ? (
|
|
97
|
+
<DocsAssistant
|
|
98
|
+
currentPage={currentPage}
|
|
99
|
+
defaultOpen={!isMobile && desktopAssistantPlacement === "modal"}
|
|
100
|
+
onSelectPage={handleSelectPage}
|
|
101
|
+
mode="modal"
|
|
102
|
+
/>
|
|
103
|
+
) : null}
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { MarkdownPage } from "./markdown-page";
|
|
4
|
+
import { Button } from "../../stock/ui/button";
|
|
5
|
+
import { useDocsConfig } from "./config-provider";
|
|
6
|
+
import { getPageById } from "./pages";
|
|
7
|
+
import type { DocsPage } from "./types";
|
|
8
|
+
import { ArrowRightIcon, FileTextIcon } from "lucide-react";
|
|
9
|
+
|
|
10
|
+
export function DocsArticle({
|
|
11
|
+
page,
|
|
12
|
+
onSelectPage,
|
|
13
|
+
}: {
|
|
14
|
+
page: DocsPage;
|
|
15
|
+
onSelectPage: (pageId: string) => void;
|
|
16
|
+
}) {
|
|
17
|
+
const { hostUi } = useDocsConfig();
|
|
18
|
+
const related = page.relatedPageIds.map((pageId) =>
|
|
19
|
+
getPageById(pageId, hostUi.root.props.pages, hostUi.root.props.defaultPageId),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<article className="mx-auto max-w-4xl px-4 py-8 lg:px-10">
|
|
24
|
+
<PageHeader page={page} />
|
|
25
|
+
<MarkdownPage markdown={page.markdown} />
|
|
26
|
+
<RelatedPages related={related} onSelectPage={onSelectPage} />
|
|
27
|
+
<ArticleCta />
|
|
28
|
+
</article>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function PageHeader({ page }: { page: DocsPage }) {
|
|
33
|
+
const { assistant } = useDocsConfig();
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<div className="mb-6 flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
|
38
|
+
<span className="rounded-full border bg-white px-2.5 py-1">{page.section}</span>
|
|
39
|
+
<span className="rounded-full bg-[var(--docs-accent-soft)] px-2.5 py-1 text-[var(--docs-accent)]">
|
|
40
|
+
{assistant.labels.currentPage}: {page.title}
|
|
41
|
+
</span>
|
|
42
|
+
</div>
|
|
43
|
+
<h1 className="text-3xl font-semibold tracking-normal text-slate-950 md:text-4xl">
|
|
44
|
+
{page.title}
|
|
45
|
+
</h1>
|
|
46
|
+
<p className="mt-3 max-w-2xl text-base leading-7 text-muted-foreground">{page.description}</p>
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function RelatedPages({
|
|
52
|
+
related,
|
|
53
|
+
onSelectPage,
|
|
54
|
+
}: {
|
|
55
|
+
related: DocsPage[];
|
|
56
|
+
onSelectPage: (pageId: string) => void;
|
|
57
|
+
}) {
|
|
58
|
+
const { assistant } = useDocsConfig();
|
|
59
|
+
const uniqueRelated = related.filter(
|
|
60
|
+
(page, index, pages) => pages.findIndex((item) => item.id === page.id) === index,
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
if (uniqueRelated.length === 0) return null;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div className="mt-10 border-t pt-6">
|
|
67
|
+
<h2 className="mb-3 text-sm font-semibold text-slate-900">{assistant.labels.relatedPages}</h2>
|
|
68
|
+
<div className="grid gap-3">
|
|
69
|
+
{uniqueRelated.map((relatedPage) => (
|
|
70
|
+
<button
|
|
71
|
+
key={relatedPage.id}
|
|
72
|
+
type="button"
|
|
73
|
+
onClick={() => onSelectPage(relatedPage.id)}
|
|
74
|
+
className="rounded-lg border bg-white p-4 text-left transition-colors hover:border-[var(--docs-accent)] hover:bg-[var(--docs-accent-softer)]"
|
|
75
|
+
>
|
|
76
|
+
<div className="flex items-start gap-3">
|
|
77
|
+
<FileTextIcon className="mt-0.5 size-4 shrink-0 text-[var(--docs-accent)]" />
|
|
78
|
+
<div className="min-w-0">
|
|
79
|
+
<div className="font-medium">{relatedPage.title}</div>
|
|
80
|
+
<p className="mt-1 line-clamp-2 text-sm text-muted-foreground">
|
|
81
|
+
{relatedPage.description}
|
|
82
|
+
</p>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</button>
|
|
86
|
+
))}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function ArticleCta() {
|
|
93
|
+
const { assistant } = useDocsConfig();
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<div className="mt-10 rounded-lg border bg-white p-4">
|
|
97
|
+
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
98
|
+
<div>
|
|
99
|
+
<div className="font-medium">{assistant.labels.articleCtaTitle}</div>
|
|
100
|
+
<p className="text-sm text-muted-foreground">{assistant.labels.articleCtaBody}</p>
|
|
101
|
+
</div>
|
|
102
|
+
<Button variant="outline" className="w-full gap-1.5 sm:w-auto">
|
|
103
|
+
{assistant.labels.articleCtaAction}
|
|
104
|
+
<ArrowRightIcon className="size-4" />
|
|
105
|
+
</Button>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Thread } from "../../stock/thread.aui";
|
|
4
|
+
import { BotIcon } from "lucide-react";
|
|
5
|
+
import { AssistantModal } from "./assistant-modal";
|
|
6
|
+
import { useDocsConfig } from "./config-provider";
|
|
7
|
+
import type { DocsPage } from "./types";
|
|
8
|
+
|
|
9
|
+
export function DocsAssistant({
|
|
10
|
+
currentPage,
|
|
11
|
+
mode,
|
|
12
|
+
defaultOpen = false,
|
|
13
|
+
}: {
|
|
14
|
+
currentPage: DocsPage;
|
|
15
|
+
onSelectPage: (pageId: string) => void;
|
|
16
|
+
mode: "sidebar" | "modal";
|
|
17
|
+
defaultOpen?: boolean;
|
|
18
|
+
}) {
|
|
19
|
+
const { assistant } = useDocsConfig();
|
|
20
|
+
const thread = (
|
|
21
|
+
<Thread
|
|
22
|
+
components={{
|
|
23
|
+
Welcome: () => (
|
|
24
|
+
<div className="mb-4 px-4 text-center">
|
|
25
|
+
<h2 className="text-lg font-medium">{assistant.welcome.headline}</h2>
|
|
26
|
+
{assistant.welcome.body ? (
|
|
27
|
+
<p className="mt-1 text-sm text-muted-foreground">{assistant.welcome.body}</p>
|
|
28
|
+
) : null}
|
|
29
|
+
</div>
|
|
30
|
+
),
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
if (mode === "sidebar") {
|
|
36
|
+
return (
|
|
37
|
+
<div className="flex h-full flex-col">
|
|
38
|
+
<div className="border-b px-4 py-3">
|
|
39
|
+
<div className="flex items-center gap-2">
|
|
40
|
+
<div className="flex size-8 items-center justify-center rounded-md bg-[var(--docs-accent-soft)] text-[var(--docs-accent)]">
|
|
41
|
+
<BotIcon className="size-4" />
|
|
42
|
+
</div>
|
|
43
|
+
<div className="min-w-0">
|
|
44
|
+
<div className="truncate text-sm font-semibold">{assistant.assistantName}</div>
|
|
45
|
+
<div className="truncate text-xs text-muted-foreground">
|
|
46
|
+
{assistant.labels.currentPage}: {currentPage.title}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div className="min-h-0 flex-1">{thread}</div>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<AssistantModal
|
|
58
|
+
defaultOpen={defaultOpen}
|
|
59
|
+
tooltipClosed={assistant.assistantName}
|
|
60
|
+
tooltipOpen="Close assistant"
|
|
61
|
+
>
|
|
62
|
+
<div className="flex h-full flex-col">
|
|
63
|
+
<div className="border-b px-4 py-3">
|
|
64
|
+
<div className="text-sm font-semibold">{assistant.assistantName}</div>
|
|
65
|
+
<div className="truncate text-xs text-muted-foreground">
|
|
66
|
+
{assistant.labels.currentPage}: {currentPage.title}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div className="min-h-0 flex-1">{thread}</div>
|
|
70
|
+
</div>
|
|
71
|
+
</AssistantModal>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useDocsConfig } from "./config-provider";
|
|
4
|
+
import { cn } from "../../../../lib/utils";
|
|
5
|
+
|
|
6
|
+
export function DocsNav({
|
|
7
|
+
currentPageId,
|
|
8
|
+
onSelectPage,
|
|
9
|
+
compact = false,
|
|
10
|
+
}: {
|
|
11
|
+
currentPageId: string;
|
|
12
|
+
onSelectPage: (pageId: string) => void;
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
}) {
|
|
15
|
+
const { hostUi } = useDocsConfig();
|
|
16
|
+
const pages = hostUi.root.props.pages;
|
|
17
|
+
const selectPage = (pageId: string) => {
|
|
18
|
+
onSelectPage(pageId);
|
|
19
|
+
};
|
|
20
|
+
const navGroups =
|
|
21
|
+
hostUi.root.props.navGroups ??
|
|
22
|
+
Array.from(new Set(pages.map((page) => page.section))).map((section) => ({
|
|
23
|
+
label: section,
|
|
24
|
+
pageIds: pages.filter((page) => page.section === section).map((page) => page.id),
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
if (compact) {
|
|
28
|
+
return (
|
|
29
|
+
<select
|
|
30
|
+
className="w-full rounded-md border bg-white px-3 py-2 text-sm"
|
|
31
|
+
value={currentPageId}
|
|
32
|
+
onChange={(event) => selectPage(event.currentTarget.value)}
|
|
33
|
+
onInput={(event) => selectPage(event.currentTarget.value)}
|
|
34
|
+
aria-label="Select docs page"
|
|
35
|
+
>
|
|
36
|
+
{pages.map((page) => (
|
|
37
|
+
<option key={page.id} value={page.id}>
|
|
38
|
+
{page.section}: {page.title}
|
|
39
|
+
</option>
|
|
40
|
+
))}
|
|
41
|
+
</select>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<nav className="h-full overflow-y-auto px-4 py-5">
|
|
47
|
+
{navGroups.map((group) => {
|
|
48
|
+
const groupPages = group.pageIds
|
|
49
|
+
.map((pageId) => pages.find((page) => page.id === pageId))
|
|
50
|
+
.filter((page) => page !== undefined);
|
|
51
|
+
|
|
52
|
+
if (groupPages.length === 0) return null;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div key={group.label} className="mb-6">
|
|
56
|
+
<div className="mb-2 px-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground">
|
|
57
|
+
{group.label}
|
|
58
|
+
</div>
|
|
59
|
+
<div className="space-y-1">
|
|
60
|
+
{groupPages.map((page) => (
|
|
61
|
+
<button
|
|
62
|
+
key={page.id}
|
|
63
|
+
type="button"
|
|
64
|
+
onClick={() => selectPage(page.id)}
|
|
65
|
+
className={cn(
|
|
66
|
+
"block w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",
|
|
67
|
+
currentPageId === page.id
|
|
68
|
+
? "bg-[var(--docs-accent-soft)] font-medium text-[var(--docs-accent)]"
|
|
69
|
+
: "text-[var(--docs-muted)] hover:bg-[var(--docs-accent-softer)] hover:text-foreground",
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
{page.title}
|
|
73
|
+
</button>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
})}
|
|
79
|
+
</nav>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { BrandTheme, DocsHostUiSpec } from "./types";
|
|
2
|
+
|
|
3
|
+
export const defaultBrandTheme = {
|
|
4
|
+
"accent": "#0369a1",
|
|
5
|
+
"surface": "#ffffff",
|
|
6
|
+
"border": "#dbe3ea",
|
|
7
|
+
"mutedText": "#64748b",
|
|
8
|
+
"focusRing": "#38bdf8"
|
|
9
|
+
} satisfies BrandTheme;
|
|
10
|
+
|
|
11
|
+
export const defaultDocsHostUi: DocsHostUiSpec = {
|
|
12
|
+
"version": 1,
|
|
13
|
+
"root": {
|
|
14
|
+
"type": "ContentShell",
|
|
15
|
+
"props": {
|
|
16
|
+
"productName": "Northstar Docs",
|
|
17
|
+
"docsName": "Product Guides",
|
|
18
|
+
"defaultPageId": "guided-onboarding",
|
|
19
|
+
"pages": [
|
|
20
|
+
{
|
|
21
|
+
"id": "guided-onboarding",
|
|
22
|
+
"title": "Guided Onboarding",
|
|
23
|
+
"section": "Product guides",
|
|
24
|
+
"description": "Set up a workspace, invite teammates, and publish your first customer guide.",
|
|
25
|
+
"url": "/docs/guided-onboarding",
|
|
26
|
+
"markdown": "## Create a workspace\n\nNorthstar workspaces keep product guides, owners, and release notes organized by team.\n\n## Invite teammates\n\nInvite teammates as editors when they need to update docs, or viewers when they only need review access.\n\n## Publish the guide\n\nPublish your first guide after assigning an owner, choosing a collection, and checking the preview.",
|
|
27
|
+
"keywords": [
|
|
28
|
+
"onboarding",
|
|
29
|
+
"workspace",
|
|
30
|
+
"guide",
|
|
31
|
+
"publish",
|
|
32
|
+
"setup"
|
|
33
|
+
],
|
|
34
|
+
"relatedPageIds": [
|
|
35
|
+
"roles-and-permissions",
|
|
36
|
+
"release-notes"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "roles-and-permissions",
|
|
41
|
+
"title": "Roles and Permissions",
|
|
42
|
+
"section": "Product guides",
|
|
43
|
+
"description": "Choose editor, reviewer, and viewer roles for a documentation workspace.",
|
|
44
|
+
"url": "/docs/roles-and-permissions",
|
|
45
|
+
"markdown": "## Editors\n\nEditors can update guides, manage screenshots, and publish approved changes.\n\n## Reviewers\n\nReviewers can leave comments and request changes before a guide is released.\n\n## Viewers\n\nViewers can read internal guides without changing the source content.",
|
|
46
|
+
"keywords": [
|
|
47
|
+
"roles",
|
|
48
|
+
"permissions",
|
|
49
|
+
"teammates",
|
|
50
|
+
"workspace"
|
|
51
|
+
],
|
|
52
|
+
"relatedPageIds": [
|
|
53
|
+
"guided-onboarding",
|
|
54
|
+
"release-notes"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "release-notes",
|
|
59
|
+
"title": "Release Notes",
|
|
60
|
+
"section": "Product guides",
|
|
61
|
+
"description": "Prepare product updates and attach related docs before publishing.",
|
|
62
|
+
"url": "/docs/release-notes",
|
|
63
|
+
"markdown": "## Draft notes\n\nRelease notes summarize product changes and link readers to the guides they should read next.\n\n## Attach docs\n\nAttach related docs so support and customer success teams can answer follow-up questions quickly.\n\n## Publish updates\n\nSchedule release notes when launch timing matters across regions.",
|
|
64
|
+
"keywords": [
|
|
65
|
+
"release",
|
|
66
|
+
"notes",
|
|
67
|
+
"updates",
|
|
68
|
+
"launch"
|
|
69
|
+
],
|
|
70
|
+
"relatedPageIds": [
|
|
71
|
+
"guided-onboarding",
|
|
72
|
+
"roles-and-permissions"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"assistantPlacement": "sidebar"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
} satisfies DocsHostUiSpec;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import ReactMarkdown from "react-markdown";
|
|
4
|
+
|
|
5
|
+
export function MarkdownPage({ markdown }: { markdown: string }) {
|
|
6
|
+
return (
|
|
7
|
+
<div className="mt-8 text-slate-800 [&_a]:text-[var(--docs-accent)] [&_a]:underline [&_blockquote]:border-l-4 [&_blockquote]:border-[var(--docs-accent-soft)] [&_blockquote]:pl-4 [&_blockquote]:text-slate-600 [&_code]:rounded [&_code]:bg-slate-100 [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_h2]:mt-8 [&_h2]:mb-3 [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:text-slate-900 [&_h3]:mt-6 [&_h3]:mb-2 [&_h3]:text-lg [&_h3]:font-semibold [&_li]:my-1 [&_ol]:my-4 [&_ol]:list-decimal [&_ol]:pl-6 [&_p]:my-4 [&_p]:leading-7 [&_pre]:my-5 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-slate-950 [&_pre]:p-4 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-slate-50 [&_strong]:font-semibold [&_ul]:my-4 [&_ul]:list-disc [&_ul]:pl-6">
|
|
8
|
+
<ReactMarkdown>{markdown}</ReactMarkdown>
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DocsPage } from "./types";
|
|
2
|
+
|
|
3
|
+
export function getPageById(pageId: string | undefined, pages: DocsPage[], defaultPageId?: string) {
|
|
4
|
+
return (
|
|
5
|
+
pages.find((page) => page.id === pageId) ??
|
|
6
|
+
pages.find((page) => page.id === defaultPageId) ??
|
|
7
|
+
pages[0]
|
|
8
|
+
);
|
|
9
|
+
}
|