@larkup/workspace-app 0.0.0-stage → 0.2.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/LICENSE +176 -0
- package/README.md +4 -2
- package/assets/github.svg +3 -0
- package/assets/icons/Confluence.png +0 -0
- package/assets/icons/Instagram.png +0 -0
- package/assets/icons/Northflank.png +0 -0
- package/assets/icons/Salesforce.png +0 -0
- package/assets/icons/agentskills.png +0 -0
- package/assets/icons/airtable.png +0 -0
- package/assets/icons/asana.png +0 -0
- package/assets/icons/ashby.png +0 -0
- package/assets/icons/audio.png +0 -0
- package/assets/icons/aws-kendra.png +0 -0
- package/assets/icons/aws.svg +38 -0
- package/assets/icons/azure-ai-search.png +0 -0
- package/assets/icons/azure.svg +1 -0
- package/assets/icons/bigquery.png +0 -0
- package/assets/icons/bing.png +0 -0
- package/assets/icons/bitbucket.png +0 -0
- package/assets/icons/brave.png +0 -0
- package/assets/icons/browserbase.png +0 -0
- package/assets/icons/calendly.png +0 -0
- package/assets/icons/chroma.png +0 -0
- package/assets/icons/cloudflare.png +0 -0
- package/assets/icons/cohere.svg +30 -0
- package/assets/icons/databricks.png +0 -0
- package/assets/icons/daytonaio.png +0 -0
- package/assets/icons/daytonaio2.png +0 -0
- package/assets/icons/deepgram.png +0 -0
- package/assets/icons/deepl.png +0 -0
- package/assets/icons/digital-ocean.webp +0 -0
- package/assets/icons/discord.png +0 -0
- package/assets/icons/e2b-2.png +0 -0
- package/assets/icons/e2b.png +0 -0
- package/assets/icons/elevenlabs.png +0 -0
- package/assets/icons/email.png +0 -0
- package/assets/icons/exa.png +0 -0
- package/assets/icons/excel.png +0 -0
- package/assets/icons/fal.png +0 -0
- package/assets/icons/firecrawl.png +0 -0
- package/assets/icons/firecrawl2.png +0 -0
- package/assets/icons/flyio.jpeg +0 -0
- package/assets/icons/gcp.svg +1 -0
- package/assets/icons/gemini.svg +1 -0
- package/assets/icons/gmail.png +0 -0
- package/assets/icons/google-analytics.png +0 -0
- package/assets/icons/google-calender.png +0 -0
- package/assets/icons/google-docs.png +0 -0
- package/assets/icons/google-drive.png +0 -0
- package/assets/icons/google-maps.png +0 -0
- package/assets/icons/google-meet.png +0 -0
- package/assets/icons/google-sheets.png +0 -0
- package/assets/icons/google-slides.png +0 -0
- package/assets/icons/google-tasks.png +0 -0
- package/assets/icons/google.png +0 -0
- package/assets/icons/grok.png +0 -0
- package/assets/icons/hubspot.png +0 -0
- package/assets/icons/image.png +0 -0
- package/assets/icons/jina.svg +1 -0
- package/assets/icons/jira.png +0 -0
- package/assets/icons/lancedb2.png +0 -0
- package/assets/icons/linear.png +0 -0
- package/assets/icons/linux.png +0 -0
- package/assets/icons/looker.png +0 -0
- package/assets/icons/luma.png +0 -0
- package/assets/icons/mac.png +0 -0
- package/assets/icons/markdown.png +0 -0
- package/assets/icons/mcp.png +0 -0
- package/assets/icons/mcp.svg +1 -0
- package/assets/icons/messenger.svg +1 -0
- package/assets/icons/microsoft-intra.png +0 -0
- package/assets/icons/microsoft-onenote.png +0 -0
- package/assets/icons/microsoft-planner.png +0 -0
- package/assets/icons/microsoft-teams.png +0 -0
- package/assets/icons/miro.png +0 -0
- package/assets/icons/mistral.svg +469 -0
- package/assets/icons/modal.png +0 -0
- package/assets/icons/ngrok.png +0 -0
- package/assets/icons/nomic.png +0 -0
- package/assets/icons/onedrive.png +0 -0
- package/assets/icons/openai.svg +1 -0
- package/assets/icons/outlook-calendar.png +0 -0
- package/assets/icons/outlook-email.png +0 -0
- package/assets/icons/outlook.png +0 -0
- package/assets/icons/pdf.png +0 -0
- package/assets/icons/personio.png +0 -0
- package/assets/icons/pgvector2.png +0 -0
- package/assets/icons/phone.png +0 -0
- package/assets/icons/pinecone.png +0 -0
- package/assets/icons/pipedrive.png +0 -0
- package/assets/icons/power-pi.png +0 -0
- package/assets/icons/pylon.png +0 -0
- package/assets/icons/python.png +0 -0
- package/assets/icons/qdrant.svg +35 -0
- package/assets/icons/revai.png +0 -0
- package/assets/icons/revai.svg +1 -0
- package/assets/icons/sap.png +0 -0
- package/assets/icons/serpapi.svg +34 -0
- package/assets/icons/serper.png +0 -0
- package/assets/icons/servicenow.png +0 -0
- package/assets/icons/sharepoint.png +0 -0
- package/assets/icons/slack.png +0 -0
- package/assets/icons/snowflake.png +0 -0
- package/assets/icons/statistia.png +0 -0
- package/assets/icons/stripe.png +0 -0
- package/assets/icons/supabase.png +0 -0
- package/assets/icons/tableau.png +0 -0
- package/assets/icons/tavily.png +0 -0
- package/assets/icons/telegram.png +0 -0
- package/assets/icons/typescript.png +0 -0
- package/assets/icons/vercel copy.svg +1 -0
- package/assets/icons/vercel.svg +1 -0
- package/assets/icons/vertex-ai.png +0 -0
- package/assets/icons/video.png +0 -0
- package/assets/icons/voyage-light.png +0 -0
- package/assets/icons/weaviate.webp +0 -0
- package/assets/icons/webcontainers.svg +11 -0
- package/assets/icons/webhook.png +0 -0
- package/assets/icons/whatsapp copy.png +0 -0
- package/assets/icons/whatsapp.png +0 -0
- package/assets/icons/windows.png +0 -0
- package/assets/icons/word.png +0 -0
- package/assets/icons/zendesk.png +0 -0
- package/assets/icons/zoom.png +0 -0
- package/assets/notion-white.png +0 -0
- package/assets/notion.png +0 -0
- package/dist-types/asset-server.d.ts +3 -0
- package/dist-types/asset-server.d.ts.map +1 -0
- package/dist-types/components/alerts/generic-alert.d.ts +15 -0
- package/dist-types/components/alerts/generic-alert.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/doc-editor-provider.d.ts +62 -0
- package/dist-types/components/chat/canvas/doc-editor-provider.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/document-canvas.d.ts +7 -0
- package/dist-types/components/chat/canvas/document-canvas.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/document-field.d.ts +13 -0
- package/dist-types/components/chat/canvas/document-field.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/document-viewer.d.ts +2 -0
- package/dist-types/components/chat/canvas/document-viewer.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/file-attachment-button.d.ts +9 -0
- package/dist-types/components/chat/canvas/file-attachment-button.d.ts.map +1 -0
- package/dist-types/components/chat/chat-workspace.d.ts +4 -0
- package/dist-types/components/chat/chat-workspace.d.ts.map +1 -0
- package/dist-types/components/chat/message-actions.d.ts +11 -0
- package/dist-types/components/chat/message-actions.d.ts.map +1 -0
- package/dist-types/components/chat/message-item.d.ts +20 -0
- package/dist-types/components/chat/message-item.d.ts.map +1 -0
- package/dist-types/components/chat/message-queue.d.ts +15 -0
- package/dist-types/components/chat/message-queue.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-chart.d.ts +6 -0
- package/dist-types/components/chat/tools/chat-chart.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-citations.d.ts +32 -0
- package/dist-types/components/chat/tools/chat-citations.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-data-table.d.ts +14 -0
- package/dist-types/components/chat/tools/chat-data-table.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-file-export.d.ts +5 -0
- package/dist-types/components/chat/tools/chat-file-export.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-media-preview.d.ts +35 -0
- package/dist-types/components/chat/tools/chat-media-preview.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-sandbox-result.d.ts +17 -0
- package/dist-types/components/chat/tools/chat-sandbox-result.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-signature-request.d.ts +13 -0
- package/dist-types/components/chat/tools/chat-signature-request.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-tabs.d.ts +17 -0
- package/dist-types/components/chat/tools/chat-tabs.d.ts.map +1 -0
- package/dist-types/components/chat/tools/corpus-data-result.d.ts +36 -0
- package/dist-types/components/chat/tools/corpus-data-result.d.ts.map +1 -0
- package/dist-types/components/chat/tools/knowledge-base-result.d.ts +14 -0
- package/dist-types/components/chat/tools/knowledge-base-result.d.ts.map +1 -0
- package/dist-types/components/chat/tools/visual-placement-modal.d.ts +23 -0
- package/dist-types/components/chat/tools/visual-placement-modal.d.ts.map +1 -0
- package/dist-types/components/configure/custom-model-modal.d.ts +13 -0
- package/dist-types/components/configure/custom-model-modal.d.ts.map +1 -0
- package/dist-types/components/configure/store-fields.d.ts +11 -0
- package/dist-types/components/configure/store-fields.d.ts.map +1 -0
- package/dist-types/components/data/corpus-panel.d.ts +12 -0
- package/dist-types/components/data/corpus-panel.d.ts.map +1 -0
- package/dist-types/components/data/data-entry-mode-switch.d.ts +13 -0
- package/dist-types/components/data/data-entry-mode-switch.d.ts.map +1 -0
- package/dist-types/components/data/data-primary-action.d.ts +7 -0
- package/dist-types/components/data/data-primary-action.d.ts.map +1 -0
- package/dist-types/components/data/data-workspace.d.ts +6 -0
- package/dist-types/components/data/data-workspace.d.ts.map +1 -0
- package/dist-types/components/data/groups-panel.d.ts +5 -0
- package/dist-types/components/data/groups-panel.d.ts.map +1 -0
- package/dist-types/components/data/integration-resources-panel.d.ts +9 -0
- package/dist-types/components/data/integration-resources-panel.d.ts.map +1 -0
- package/dist-types/components/data/integrations-panel.d.ts +5 -0
- package/dist-types/components/data/integrations-panel.d.ts.map +1 -0
- package/dist-types/components/data/jobs-panel.d.ts +6 -0
- package/dist-types/components/data/jobs-panel.d.ts.map +1 -0
- package/dist-types/components/data/jobs-tracking-button.d.ts +2 -0
- package/dist-types/components/data/jobs-tracking-button.d.ts.map +1 -0
- package/dist-types/components/data/live-media-progress.d.ts +9 -0
- package/dist-types/components/data/live-media-progress.d.ts.map +1 -0
- package/dist-types/components/data/media-indexing-jobs-panel.d.ts +34 -0
- package/dist-types/components/data/media-indexing-jobs-panel.d.ts.map +1 -0
- package/dist-types/components/data/media-panel.d.ts +58 -0
- package/dist-types/components/data/media-panel.d.ts.map +1 -0
- package/dist-types/components/data/notion-panel.d.ts +6 -0
- package/dist-types/components/data/notion-panel.d.ts.map +1 -0
- package/dist-types/components/data/paste-panel.d.ts +7 -0
- package/dist-types/components/data/paste-panel.d.ts.map +1 -0
- package/dist-types/components/data/project-data-page.d.ts +3 -0
- package/dist-types/components/data/project-data-page.d.ts.map +1 -0
- package/dist-types/components/data/scrape-panel.d.ts +9 -0
- package/dist-types/components/data/scrape-panel.d.ts.map +1 -0
- package/dist-types/components/data/tabular-preview.d.ts +10 -0
- package/dist-types/components/data/tabular-preview.d.ts.map +1 -0
- package/dist-types/components/data/tool-indexing-dialog.d.ts +54 -0
- package/dist-types/components/data/tool-indexing-dialog.d.ts.map +1 -0
- package/dist-types/components/data/upload-panel.d.ts +7 -0
- package/dist-types/components/data/upload-panel.d.ts.map +1 -0
- package/dist-types/components/data/web-crawler-status.d.ts +3 -0
- package/dist-types/components/data/web-crawler-status.d.ts.map +1 -0
- package/dist-types/components/projects/project-form-dialog.d.ts +10 -0
- package/dist-types/components/projects/project-form-dialog.d.ts.map +1 -0
- package/dist-types/components/projects/project-provider.d.ts +34 -0
- package/dist-types/components/projects/project-provider.d.ts.map +1 -0
- package/dist-types/components/settings/general/agent-customization-section.d.ts +2 -0
- package/dist-types/components/settings/general/agent-customization-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/mcp-connections-section.d.ts +2 -0
- package/dist-types/components/settings/general/mcp-connections-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/model-combobox.d.ts +24 -0
- package/dist-types/components/settings/general/model-combobox.d.ts.map +1 -0
- package/dist-types/components/settings/general/models-section.d.ts +2 -0
- package/dist-types/components/settings/general/models-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/sandbox-section.d.ts +7 -0
- package/dist-types/components/settings/general/sandbox-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/search-scraping-section.d.ts +2 -0
- package/dist-types/components/settings/general/search-scraping-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/storage-indexing-section.d.ts +2 -0
- package/dist-types/components/settings/general/storage-indexing-section.d.ts.map +1 -0
- package/dist-types/components/ui/alert-dialog.d.ts +19 -0
- package/dist-types/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist-types/components/ui/alert.d.ts +11 -0
- package/dist-types/components/ui/alert.d.ts.map +1 -0
- package/dist-types/components/ui/badge.d.ts +8 -0
- package/dist-types/components/ui/badge.d.ts.map +1 -0
- package/dist-types/components/ui/card.d.ts +2 -0
- package/dist-types/components/ui/card.d.ts.map +1 -0
- package/dist-types/components/ui/checkbox.d.ts +4 -0
- package/dist-types/components/ui/checkbox.d.ts.map +1 -0
- package/dist-types/components/ui/collapsible.d.ts +6 -0
- package/dist-types/components/ui/collapsible.d.ts.map +1 -0
- package/dist-types/components/ui/command.d.ts +20 -0
- package/dist-types/components/ui/command.d.ts.map +1 -0
- package/dist-types/components/ui/dialog.d.ts +18 -0
- package/dist-types/components/ui/dialog.d.ts.map +1 -0
- package/dist-types/components/ui/dropdown-menu.d.ts +30 -0
- package/dist-types/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist-types/components/ui/input-group.d.ts +19 -0
- package/dist-types/components/ui/input-group.d.ts.map +1 -0
- package/dist-types/components/ui/input.d.ts +4 -0
- package/dist-types/components/ui/input.d.ts.map +1 -0
- package/dist-types/components/ui/line-tabs.d.ts +15 -0
- package/dist-types/components/ui/line-tabs.d.ts.map +1 -0
- package/dist-types/components/ui/popover.d.ts +10 -0
- package/dist-types/components/ui/popover.d.ts.map +1 -0
- package/dist-types/components/ui/progress.d.ts +8 -0
- package/dist-types/components/ui/progress.d.ts.map +1 -0
- package/dist-types/components/ui/scroll-area.d.ts +6 -0
- package/dist-types/components/ui/scroll-area.d.ts.map +1 -0
- package/dist-types/components/ui/sheet.d.ts +15 -0
- package/dist-types/components/ui/sheet.d.ts.map +1 -0
- package/dist-types/components/ui/slider.d.ts +4 -0
- package/dist-types/components/ui/slider.d.ts.map +1 -0
- package/dist-types/components/ui/switch.d.ts +6 -0
- package/dist-types/components/ui/switch.d.ts.map +1 -0
- package/dist-types/components/ui/table.d.ts +2 -0
- package/dist-types/components/ui/table.d.ts.map +1 -0
- package/dist-types/components/ui/tabs.d.ts +11 -0
- package/dist-types/components/ui/tabs.d.ts.map +1 -0
- package/dist-types/components/ui/textarea.d.ts +2 -0
- package/dist-types/components/ui/textarea.d.ts.map +1 -0
- package/dist-types/components/ui/tooltip.d.ts +7 -0
- package/dist-types/components/ui/tooltip.d.ts.map +1 -0
- package/dist-types/hooks/use-copy-to-clipboard.d.ts +5 -0
- package/dist-types/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist-types/hooks/use-integration-auth.d.ts +10 -0
- package/dist-types/hooks/use-integration-auth.d.ts.map +1 -0
- package/dist-types/hooks/use-live-media-progress.d.ts +14 -0
- package/dist-types/hooks/use-live-media-progress.d.ts.map +1 -0
- package/dist-types/hooks/use-notion-auth.d.ts +9 -0
- package/dist-types/hooks/use-notion-auth.d.ts.map +1 -0
- package/dist-types/host.d.ts +20 -0
- package/dist-types/host.d.ts.map +1 -0
- package/dist-types/lib/browser-cache.d.ts +7 -0
- package/dist-types/lib/browser-cache.d.ts.map +1 -0
- package/dist-types/lib/chat/chart-config.d.ts +2 -0
- package/dist-types/lib/chat/chart-config.d.ts.map +1 -0
- package/dist-types/lib/chat/data-export.d.ts +2 -0
- package/dist-types/lib/chat/data-export.d.ts.map +1 -0
- package/dist-types/lib/chat/live-tool-progress.d.ts +44 -0
- package/dist-types/lib/chat/live-tool-progress.d.ts.map +1 -0
- package/dist-types/lib/chat/message-feedback.d.ts +2 -0
- package/dist-types/lib/chat/message-feedback.d.ts.map +1 -0
- package/dist-types/lib/chat/table-presentation.d.ts +2 -0
- package/dist-types/lib/chat/table-presentation.d.ts.map +1 -0
- package/dist-types/lib/chat/tool-output.d.ts +3 -0
- package/dist-types/lib/chat/tool-output.d.ts.map +1 -0
- package/dist-types/lib/chat-supporting-clip.d.ts +11 -0
- package/dist-types/lib/chat-supporting-clip.d.ts.map +1 -0
- package/dist-types/lib/constants/stores.d.ts +6 -0
- package/dist-types/lib/constants/stores.d.ts.map +1 -0
- package/dist-types/lib/constants/tools.d.ts +27 -0
- package/dist-types/lib/constants/tools.d.ts.map +1 -0
- package/dist-types/lib/error-formatter.d.ts +2 -0
- package/dist-types/lib/error-formatter.d.ts.map +1 -0
- package/dist-types/lib/jobs-client.d.ts +7 -0
- package/dist-types/lib/jobs-client.d.ts.map +1 -0
- package/dist-types/lib/media/pdf.d.ts +6 -0
- package/dist-types/lib/media/pdf.d.ts.map +1 -0
- package/dist-types/lib/media/progress.d.ts +61 -0
- package/dist-types/lib/media/progress.d.ts.map +1 -0
- package/dist-types/lib/media/source-selection.d.ts +10 -0
- package/dist-types/lib/media/source-selection.d.ts.map +1 -0
- package/dist-types/lib/media/tool-indexing-estimate.d.ts +13 -0
- package/dist-types/lib/media/tool-indexing-estimate.d.ts.map +1 -0
- package/dist-types/lib/media/video-intelligence-capacity.d.ts +2 -0
- package/dist-types/lib/media/video-intelligence-capacity.d.ts.map +1 -0
- package/dist-types/lib/media/video-runtime-scope.d.ts +2 -0
- package/dist-types/lib/media/video-runtime-scope.d.ts.map +1 -0
- package/dist-types/lib/shared/error-formatter.d.ts +2 -0
- package/dist-types/lib/shared/error-formatter.d.ts.map +1 -0
- package/dist-types/lib/utils.d.ts +3 -0
- package/dist-types/lib/utils.d.ts.map +1 -0
- package/dist-types/storage.d.ts +5 -0
- package/dist-types/storage.d.ts.map +1 -0
- package/dist-types/store/chat-store.d.ts +19 -0
- package/dist-types/store/chat-store.d.ts.map +1 -0
- package/dist-types/store/scrape-store.d.ts +42 -0
- package/dist-types/store/scrape-store.d.ts.map +1 -0
- package/package.json +579 -3
- package/scripts/build-assets.mjs +12 -0
- package/src/asset-data.json +1 -0
- package/src/asset-server.ts +19 -0
- package/src/components/alerts/generic-alert.tsx +76 -0
- package/src/components/chat/canvas/doc-editor-provider.tsx +338 -0
- package/src/components/chat/canvas/document-canvas.tsx +98 -0
- package/src/components/chat/canvas/document-field.tsx +167 -0
- package/src/components/chat/canvas/document-viewer.tsx +446 -0
- package/src/components/chat/canvas/file-attachment-button.tsx +88 -0
- package/src/components/chat/chat-workspace.tsx +1552 -0
- package/src/components/chat/message-actions.tsx +96 -0
- package/src/components/chat/message-item.tsx +1398 -0
- package/src/components/chat/message-queue.tsx +86 -0
- package/src/components/chat/tools/chat-chart.tsx +558 -0
- package/src/components/chat/tools/chat-citations.tsx +152 -0
- package/src/components/chat/tools/chat-data-table.tsx +373 -0
- package/src/components/chat/tools/chat-file-export.tsx +49 -0
- package/src/components/chat/tools/chat-media-preview.tsx +466 -0
- package/src/components/chat/tools/chat-sandbox-result.tsx +130 -0
- package/src/components/chat/tools/chat-signature-request.tsx +810 -0
- package/src/components/chat/tools/chat-tabs.tsx +59 -0
- package/src/components/chat/tools/corpus-data-result.tsx +194 -0
- package/src/components/chat/tools/knowledge-base-result.tsx +345 -0
- package/src/components/chat/tools/visual-placement-modal.tsx +308 -0
- package/src/components/configure/custom-model-modal.tsx +209 -0
- package/src/components/configure/store-fields.tsx +129 -0
- package/src/components/data/corpus-panel.tsx +1223 -0
- package/src/components/data/data-entry-mode-switch.tsx +53 -0
- package/src/components/data/data-primary-action.ts +6 -0
- package/src/components/data/data-workspace.tsx +623 -0
- package/src/components/data/groups-panel.tsx +530 -0
- package/src/components/data/integration-resources-panel.tsx +282 -0
- package/src/components/data/integrations-panel.tsx +392 -0
- package/src/components/data/jobs-panel.tsx +490 -0
- package/src/components/data/jobs-tracking-button.tsx +224 -0
- package/src/components/data/live-media-progress.tsx +79 -0
- package/src/components/data/media-indexing-jobs-panel.tsx +190 -0
- package/src/components/data/media-panel.tsx +2905 -0
- package/src/components/data/notion-panel.tsx +408 -0
- package/src/components/data/paste-panel.tsx +82 -0
- package/src/components/data/project-data-page.tsx +55 -0
- package/src/components/data/scrape-panel.tsx +1290 -0
- package/src/components/data/tabular-preview.tsx +205 -0
- package/src/components/data/tool-indexing-dialog.tsx +210 -0
- package/src/components/data/upload-panel.tsx +1313 -0
- package/src/components/data/web-crawler-status.tsx +132 -0
- package/src/components/projects/project-form-dialog.tsx +97 -0
- package/src/components/projects/project-provider.tsx +143 -0
- package/src/components/settings/general/agent-customization-section.tsx +620 -0
- package/src/components/settings/general/mcp-connections-section.tsx +907 -0
- package/src/components/settings/general/model-combobox.tsx +235 -0
- package/src/components/settings/general/models-section.tsx +909 -0
- package/src/components/settings/general/sandbox-section.tsx +394 -0
- package/src/components/settings/general/search-scraping-section.tsx +757 -0
- package/src/components/settings/general/storage-indexing-section.tsx +394 -0
- package/src/components/ui/alert-dialog.tsx +162 -0
- package/src/components/ui/alert.tsx +69 -0
- package/src/components/ui/badge.tsx +49 -0
- package/src/components/ui/card.tsx +9 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/collapsible.tsx +17 -0
- package/src/components/ui/command.tsx +175 -0
- package/src/components/ui/dialog.tsx +138 -0
- package/src/components/ui/dropdown-menu.tsx +267 -0
- package/src/components/ui/input-group.tsx +146 -0
- package/src/components/ui/input.tsx +19 -0
- package/src/components/ui/line-tabs.tsx +49 -0
- package/src/components/ui/popover.tsx +77 -0
- package/src/components/ui/progress.tsx +66 -0
- package/src/components/ui/scroll-area.tsx +51 -0
- package/src/components/ui/sheet.tsx +125 -0
- package/src/components/ui/slider.tsx +52 -0
- package/src/components/ui/switch.tsx +32 -0
- package/src/components/ui/table.tsx +10 -0
- package/src/components/ui/tabs.tsx +77 -0
- package/src/components/ui/textarea.tsx +1 -0
- package/src/components/ui/tooltip.tsx +54 -0
- package/src/hooks/use-copy-to-clipboard.ts +25 -0
- package/src/hooks/use-integration-auth.ts +39 -0
- package/src/hooks/use-live-media-progress.ts +71 -0
- package/src/hooks/use-notion-auth.ts +66 -0
- package/src/host.ts +55 -0
- package/src/lib/browser-cache.ts +17 -0
- package/src/lib/chat/chart-config.ts +1 -0
- package/src/lib/chat/data-export.ts +1 -0
- package/src/lib/chat/live-tool-progress.ts +69 -0
- package/src/lib/chat/message-feedback.ts +1 -0
- package/src/lib/chat/table-presentation.ts +1 -0
- package/src/lib/chat/tool-output.ts +14 -0
- package/src/lib/chat-supporting-clip.ts +16 -0
- package/src/lib/constants/stores.ts +12 -0
- package/src/lib/constants/tools.ts +178 -0
- package/src/lib/error-formatter.ts +30 -0
- package/src/lib/jobs-client.ts +27 -0
- package/src/lib/media/pdf.ts +57 -0
- package/src/lib/media/progress.ts +209 -0
- package/src/lib/media/source-selection.ts +47 -0
- package/src/lib/media/tool-indexing-estimate.ts +39 -0
- package/src/lib/media/video-intelligence-capacity.ts +1 -0
- package/src/lib/media/video-runtime-scope.ts +1 -0
- package/src/lib/shared/error-formatter.ts +1 -0
- package/src/lib/utils.ts +6 -0
- package/src/source.css +1 -0
- package/src/storage.ts +16 -0
- package/src/store/chat-store.ts +19 -0
- package/src/store/scrape-store.ts +76 -0
- package/src/styles.d.ts +1 -0
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { workspaceCapabilities, workspaceUrl, workspaceFetch as fetch } from '../../../host';
|
|
4
|
+
import { useState, useEffect } from 'react';
|
|
5
|
+
import useSWR from 'swr';
|
|
6
|
+
import { Loader2, Save, Database, Clock, Layers } from 'lucide-react';
|
|
7
|
+
import { Button } from '@larkup/workspace-ui/button';
|
|
8
|
+
import { Label } from '@larkup/workspace-ui/label';
|
|
9
|
+
import { cn } from '@larkup/workspace-app/lib/utils';
|
|
10
|
+
import { Select, SelectContent, SelectItem, SelectTrigger } from '@larkup/workspace-ui/select';
|
|
11
|
+
import {
|
|
12
|
+
Card,
|
|
13
|
+
CardContent,
|
|
14
|
+
CardDescription,
|
|
15
|
+
CardHeader,
|
|
16
|
+
CardTitle,
|
|
17
|
+
CardFooter,
|
|
18
|
+
} from '@larkup/workspace-app/components/ui/card';
|
|
19
|
+
import {
|
|
20
|
+
AlertDialog,
|
|
21
|
+
AlertDialogAction,
|
|
22
|
+
AlertDialogCancel,
|
|
23
|
+
AlertDialogContent,
|
|
24
|
+
AlertDialogDescription,
|
|
25
|
+
AlertDialogFooter,
|
|
26
|
+
AlertDialogHeader,
|
|
27
|
+
AlertDialogTitle,
|
|
28
|
+
} from '@larkup/workspace-app/components/ui/alert-dialog';
|
|
29
|
+
import { toast } from 'sonner';
|
|
30
|
+
import { useProject } from '@larkup/workspace-app/components/projects/project-provider';
|
|
31
|
+
import { ProviderIcon } from '@larkup/workspace-ui/provider-icon';
|
|
32
|
+
import {
|
|
33
|
+
VECTOR_STORE_LIST,
|
|
34
|
+
getVectorStore,
|
|
35
|
+
validateStoreConfig,
|
|
36
|
+
} from '@larkup/vector-stores/registry';
|
|
37
|
+
import { StoreFields } from '@larkup/workspace-app/components/configure/store-fields';
|
|
38
|
+
import type { RagConfig, VectorStoreId, IndexType } from '@larkup/core/types';
|
|
39
|
+
|
|
40
|
+
const INDEX_TYPES: { value: IndexType; label: string; description: string }[] = [
|
|
41
|
+
{
|
|
42
|
+
value: 'hybrid',
|
|
43
|
+
label: 'Hybrid',
|
|
44
|
+
description: 'Combines semantic understanding with keyword matching for best results.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: 'semantic',
|
|
48
|
+
label: 'Semantic',
|
|
49
|
+
description: 'Uses embeddings to find conceptually similar content.',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: 'lexical',
|
|
53
|
+
label: 'Lexical',
|
|
54
|
+
description: 'Traditional keyword-based search using BM25 scoring.',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
const fetcher = (url: string) => fetch(url).then((r) => r.json() as Promise<{ config: RagConfig }>);
|
|
59
|
+
|
|
60
|
+
import { STORE_META } from '@larkup/workspace-app/lib/constants/stores';
|
|
61
|
+
|
|
62
|
+
export function StorageSection() {
|
|
63
|
+
const { activeProject } = useProject();
|
|
64
|
+
const serverId = activeProject?.id;
|
|
65
|
+
|
|
66
|
+
const configUrl = serverId
|
|
67
|
+
? workspaceUrl(`/api/config?serverId=${encodeURIComponent(serverId)}`)
|
|
68
|
+
: workspaceUrl('/api/config');
|
|
69
|
+
const { data, isLoading, mutate } = useSWR(configUrl, fetcher);
|
|
70
|
+
|
|
71
|
+
const [form, setForm] = useState<Partial<RagConfig>>({});
|
|
72
|
+
const [saving, setSaving] = useState(false);
|
|
73
|
+
const [errors, setErrors] = useState<Record<string, string>>({});
|
|
74
|
+
const [pendingStore, setPendingStore] = useState<VectorStoreId | null>(null);
|
|
75
|
+
const [storageChangeOpen, setStorageChangeOpen] = useState(false);
|
|
76
|
+
const [clearKnowledgeBase, setClearKnowledgeBase] = useState(false);
|
|
77
|
+
|
|
78
|
+
const { data: indexData } = useSWR(workspaceUrl('/api/index'), (url: string) =>
|
|
79
|
+
fetch(url).then((r) => r.json()),
|
|
80
|
+
);
|
|
81
|
+
const indexedRun = indexData?.run?.status === 'completed' ? indexData.run : null;
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (data?.config) {
|
|
85
|
+
setForm(data.config);
|
|
86
|
+
}
|
|
87
|
+
}, [data]);
|
|
88
|
+
|
|
89
|
+
const dirty = JSON.stringify(form) !== JSON.stringify(data?.config ?? {});
|
|
90
|
+
|
|
91
|
+
const clearError = (key: string) => {
|
|
92
|
+
if (errors[key]) {
|
|
93
|
+
setErrors((prev) => {
|
|
94
|
+
const next = { ...prev };
|
|
95
|
+
delete next[key];
|
|
96
|
+
return next;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const setStoreValue = (key: string, value: string) => {
|
|
102
|
+
setForm((f) => ({
|
|
103
|
+
...f,
|
|
104
|
+
storeConfig: { ...f.storeConfig, [key]: value },
|
|
105
|
+
}));
|
|
106
|
+
clearError(key);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const selectStore = (id: VectorStoreId) => {
|
|
110
|
+
setForm((f) => ({ ...f, vectorStore: id, storeConfig: {} }));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
function requestStoreChange(id: VectorStoreId) {
|
|
114
|
+
if (!data?.config || id === form.vectorStore) return;
|
|
115
|
+
setPendingStore(id);
|
|
116
|
+
setClearKnowledgeBase(false);
|
|
117
|
+
setStorageChangeOpen(true);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async function confirmStoreChange() {
|
|
121
|
+
if (!pendingStore) return;
|
|
122
|
+
if (clearKnowledgeBase) {
|
|
123
|
+
try {
|
|
124
|
+
const response = await fetch(workspaceUrl('/api/documents'), { method: 'DELETE' });
|
|
125
|
+
if (!response.ok) throw new Error('Could not clear the knowledge base.');
|
|
126
|
+
toast.success('Knowledge base cleared.');
|
|
127
|
+
} catch (error) {
|
|
128
|
+
toast.error(error instanceof Error ? error.message : 'Could not clear the knowledge base.');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
selectStore(pendingStore);
|
|
133
|
+
setStorageChangeOpen(false);
|
|
134
|
+
setPendingStore(null);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function handleStructuralChangeBlock() {
|
|
138
|
+
toast('Cannot modify configuration', {
|
|
139
|
+
description:
|
|
140
|
+
'This project already has indexed data. You must create a new project to change this setting.',
|
|
141
|
+
duration: Number.POSITIVE_INFINITY,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async function handleSave() {
|
|
146
|
+
if (!data?.config) return;
|
|
147
|
+
|
|
148
|
+
let hasError = false;
|
|
149
|
+
const newErrors: Record<string, string> = {};
|
|
150
|
+
|
|
151
|
+
if (form.vectorStore && !workspaceCapabilities().managedStorage) {
|
|
152
|
+
const store = getVectorStore(form.vectorStore);
|
|
153
|
+
if (store) {
|
|
154
|
+
const storeErrs = validateStoreConfig(
|
|
155
|
+
store,
|
|
156
|
+
form.storeConfig || {},
|
|
157
|
+
form.indexType || 'hybrid',
|
|
158
|
+
);
|
|
159
|
+
if (Object.keys(storeErrs).length > 0) {
|
|
160
|
+
Object.assign(newErrors, storeErrs);
|
|
161
|
+
hasError = true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
setErrors(newErrors);
|
|
167
|
+
if (hasError) {
|
|
168
|
+
toast.error('Please fill in all required fields', {
|
|
169
|
+
duration: Number.POSITIVE_INFINITY,
|
|
170
|
+
});
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
setSaving(true);
|
|
175
|
+
try {
|
|
176
|
+
const merged = { ...data.config, ...form };
|
|
177
|
+
const res = await fetch(configUrl, {
|
|
178
|
+
method: 'PUT',
|
|
179
|
+
headers: { 'Content-Type': 'application/json' },
|
|
180
|
+
body: JSON.stringify(merged),
|
|
181
|
+
});
|
|
182
|
+
const json = await res.json();
|
|
183
|
+
if (!res.ok) throw new Error(json.error ?? 'Failed to save');
|
|
184
|
+
await mutate(json, { revalidate: false });
|
|
185
|
+
toast.success('Storage settings saved', {
|
|
186
|
+
duration: Number.POSITIVE_INFINITY,
|
|
187
|
+
});
|
|
188
|
+
} catch (err) {
|
|
189
|
+
toast.error(err instanceof Error ? err.message : 'Failed to save', {
|
|
190
|
+
duration: Number.POSITIVE_INFINITY,
|
|
191
|
+
});
|
|
192
|
+
} finally {
|
|
193
|
+
setSaving(false);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (isLoading) {
|
|
198
|
+
return (
|
|
199
|
+
<div className="flex h-40 items-center justify-center">
|
|
200
|
+
<Loader2 className="size-5 animate-spin text-muted-foreground" />
|
|
201
|
+
</div>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<div className="space-y-6">
|
|
207
|
+
<div>
|
|
208
|
+
<h2 className="text-lg font-semibold tracking-tight">Storage</h2>
|
|
209
|
+
<p className="text-sm text-muted-foreground mt-1">
|
|
210
|
+
Where your processed data is stored and indexed.
|
|
211
|
+
</p>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
<Card>
|
|
215
|
+
<CardHeader className="pb-3">
|
|
216
|
+
<CardTitle className="flex items-center gap-2 text-sm">
|
|
217
|
+
<Layers className="size-3.5 text-primary" />
|
|
218
|
+
Indexing Strategy
|
|
219
|
+
</CardTitle>
|
|
220
|
+
<CardDescription className="text-xs">
|
|
221
|
+
How your documents are indexed for retrieval.
|
|
222
|
+
</CardDescription>
|
|
223
|
+
</CardHeader>
|
|
224
|
+
<CardContent className="space-y-4">
|
|
225
|
+
<div className="space-y-2">
|
|
226
|
+
<Label className="text-xs">Strategy</Label>
|
|
227
|
+
<Select
|
|
228
|
+
value={form.indexType || 'hybrid'}
|
|
229
|
+
onValueChange={(v) => {
|
|
230
|
+
if (indexedRun && data?.config && v !== data.config.indexType) {
|
|
231
|
+
handleStructuralChangeBlock();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
setForm((f) => ({ ...f, indexType: v as IndexType }));
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
<SelectTrigger className="w-full">
|
|
238
|
+
<span className="font-medium text-sm">
|
|
239
|
+
{INDEX_TYPES.find((t) => t.value === (form.indexType || 'hybrid'))?.label ??
|
|
240
|
+
'Select strategy…'}
|
|
241
|
+
</span>
|
|
242
|
+
</SelectTrigger>
|
|
243
|
+
<SelectContent>
|
|
244
|
+
{INDEX_TYPES.map((t) => (
|
|
245
|
+
<SelectItem key={t.value} value={t.value}>
|
|
246
|
+
<span className="flex flex-col gap-0.5">
|
|
247
|
+
<span className="font-medium text-sm">{t.label}</span>
|
|
248
|
+
<span className="text-xs text-muted-foreground">{t.description}</span>
|
|
249
|
+
</span>
|
|
250
|
+
</SelectItem>
|
|
251
|
+
))}
|
|
252
|
+
</SelectContent>
|
|
253
|
+
</Select>
|
|
254
|
+
</div>
|
|
255
|
+
</CardContent>
|
|
256
|
+
</Card>
|
|
257
|
+
|
|
258
|
+
<Card>
|
|
259
|
+
<CardHeader className="pb-3">
|
|
260
|
+
<CardTitle className="flex items-center gap-2 text-sm">
|
|
261
|
+
<Database className="size-3.5 text-primary" />
|
|
262
|
+
Storage Engine
|
|
263
|
+
</CardTitle>
|
|
264
|
+
<CardDescription className="text-xs">
|
|
265
|
+
Configure your vector database connection.
|
|
266
|
+
</CardDescription>
|
|
267
|
+
</CardHeader>
|
|
268
|
+
<CardContent className="space-y-5">
|
|
269
|
+
<div className="space-y-2">
|
|
270
|
+
<Label className="text-xs">Storage Engine</Label>
|
|
271
|
+
<Select
|
|
272
|
+
value={form.vectorStore || ''}
|
|
273
|
+
onValueChange={(v) => {
|
|
274
|
+
requestStoreChange(v as VectorStoreId);
|
|
275
|
+
}}
|
|
276
|
+
>
|
|
277
|
+
<SelectTrigger className="w-full">
|
|
278
|
+
{form.vectorStore ? (
|
|
279
|
+
<span className="flex items-center gap-2.5">
|
|
280
|
+
<ProviderIcon
|
|
281
|
+
src={STORE_META[form.vectorStore]?.iconSrc ?? ''}
|
|
282
|
+
alt={getVectorStore(form.vectorStore)?.label ?? form.vectorStore}
|
|
283
|
+
pillBg={STORE_META[form.vectorStore]?.pillBg ?? undefined}
|
|
284
|
+
size={16}
|
|
285
|
+
/>
|
|
286
|
+
<span className="font-medium text-sm">
|
|
287
|
+
{getVectorStore(form.vectorStore)?.label ?? form.vectorStore}
|
|
288
|
+
</span>
|
|
289
|
+
</span>
|
|
290
|
+
) : (
|
|
291
|
+
<span className="text-muted-foreground">Select storage engine…</span>
|
|
292
|
+
)}
|
|
293
|
+
</SelectTrigger>
|
|
294
|
+
<SelectContent>
|
|
295
|
+
{VECTOR_STORE_LIST.filter(
|
|
296
|
+
(store) =>
|
|
297
|
+
!workspaceCapabilities().vectorStores ||
|
|
298
|
+
workspaceCapabilities().vectorStores!.includes(store.id),
|
|
299
|
+
).map((s) => {
|
|
300
|
+
const meta = STORE_META[s.id];
|
|
301
|
+
const isComingSoon = s.installStatus === 'coming-soon';
|
|
302
|
+
return (
|
|
303
|
+
<SelectItem
|
|
304
|
+
key={s.id}
|
|
305
|
+
value={s.id}
|
|
306
|
+
disabled={isComingSoon}
|
|
307
|
+
className={isComingSoon ? 'opacity-50' : ''}
|
|
308
|
+
>
|
|
309
|
+
<span className="flex items-center gap-2.5 w-full">
|
|
310
|
+
{meta && (
|
|
311
|
+
<ProviderIcon
|
|
312
|
+
src={meta.iconSrc}
|
|
313
|
+
alt={s.label}
|
|
314
|
+
pillBg={meta.pillBg ?? undefined}
|
|
315
|
+
size={16}
|
|
316
|
+
/>
|
|
317
|
+
)}
|
|
318
|
+
<span className="flex items-center gap-2">
|
|
319
|
+
<span className="font-medium text-sm">{s.label}</span>
|
|
320
|
+
{isComingSoon && (
|
|
321
|
+
<span className="h-3.5 px-1 text-[9px] font-medium shrink-0 text-muted-foreground border rounded-full flex items-center bg-transparent">
|
|
322
|
+
<Clock className="size-2.5 mr-0.5" />
|
|
323
|
+
Coming Soon
|
|
324
|
+
</span>
|
|
325
|
+
)}
|
|
326
|
+
</span>
|
|
327
|
+
</span>
|
|
328
|
+
</SelectItem>
|
|
329
|
+
);
|
|
330
|
+
})}
|
|
331
|
+
</SelectContent>
|
|
332
|
+
</Select>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
{form.vectorStore && !workspaceCapabilities().managedStorage && (
|
|
336
|
+
<div className="border-t pt-4">
|
|
337
|
+
<StoreFields
|
|
338
|
+
store={getVectorStore(form.vectorStore)}
|
|
339
|
+
values={form.storeConfig || {}}
|
|
340
|
+
errors={errors}
|
|
341
|
+
onChange={setStoreValue}
|
|
342
|
+
indexType={form.indexType || 'hybrid'}
|
|
343
|
+
/>
|
|
344
|
+
</div>
|
|
345
|
+
)}
|
|
346
|
+
</CardContent>
|
|
347
|
+
<CardFooter className="flex justify-end pt-4 border-t">
|
|
348
|
+
<Button
|
|
349
|
+
size="lg"
|
|
350
|
+
disabled={saving || !dirty}
|
|
351
|
+
onClick={handleSave}
|
|
352
|
+
className="gap-1.5 px-4"
|
|
353
|
+
>
|
|
354
|
+
{saving ? <Loader2 className="size-3.5 animate-spin" /> : <Save className="size-3.5" />}
|
|
355
|
+
Save
|
|
356
|
+
</Button>
|
|
357
|
+
</CardFooter>
|
|
358
|
+
</Card>
|
|
359
|
+
|
|
360
|
+
<AlertDialog open={storageChangeOpen} onOpenChange={setStorageChangeOpen}>
|
|
361
|
+
<AlertDialogContent>
|
|
362
|
+
<AlertDialogHeader>
|
|
363
|
+
<AlertDialogTitle>Change vector storage?</AlertDialogTitle>
|
|
364
|
+
<AlertDialogDescription>
|
|
365
|
+
Your existing indexed vectors stay in the current storage engine and will not be
|
|
366
|
+
available after this change. Keep the knowledge base to re-index it in the new store,
|
|
367
|
+
or clear it intentionally below.
|
|
368
|
+
</AlertDialogDescription>
|
|
369
|
+
</AlertDialogHeader>
|
|
370
|
+
<label className="flex cursor-pointer items-start gap-3 rounded-md border p-3 text-sm">
|
|
371
|
+
<input
|
|
372
|
+
type="checkbox"
|
|
373
|
+
className="mt-0.5"
|
|
374
|
+
checked={clearKnowledgeBase}
|
|
375
|
+
onChange={(event) => setClearKnowledgeBase(event.target.checked)}
|
|
376
|
+
/>
|
|
377
|
+
<span>
|
|
378
|
+
<span className="font-medium">Clear knowledge base</span>
|
|
379
|
+
<span className="block text-xs text-muted-foreground">
|
|
380
|
+
Permanently remove documents and the current vector index before changing storage.
|
|
381
|
+
</span>
|
|
382
|
+
</span>
|
|
383
|
+
</label>
|
|
384
|
+
<AlertDialogFooter>
|
|
385
|
+
<AlertDialogCancel onClick={() => setPendingStore(null)}>Cancel</AlertDialogCancel>
|
|
386
|
+
<AlertDialogAction onClick={confirmStoreChange}>
|
|
387
|
+
{clearKnowledgeBase ? 'Clear and change storage' : 'Keep documents and continue'}
|
|
388
|
+
</AlertDialogAction>
|
|
389
|
+
</AlertDialogFooter>
|
|
390
|
+
</AlertDialogContent>
|
|
391
|
+
</AlertDialog>
|
|
392
|
+
</div>
|
|
393
|
+
);
|
|
394
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
|
|
5
|
+
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { Button } from '@larkup/workspace-ui/button';
|
|
8
|
+
|
|
9
|
+
function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
|
|
10
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
|
|
14
|
+
return <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
|
|
18
|
+
return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.Backdrop.Props) {
|
|
22
|
+
return (
|
|
23
|
+
<AlertDialogPrimitive.Backdrop
|
|
24
|
+
data-slot="alert-dialog-overlay"
|
|
25
|
+
className={cn(
|
|
26
|
+
'fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function AlertDialogContent({
|
|
35
|
+
className,
|
|
36
|
+
size = 'default',
|
|
37
|
+
...props
|
|
38
|
+
}: AlertDialogPrimitive.Popup.Props & {
|
|
39
|
+
size?: 'default' | 'sm';
|
|
40
|
+
}) {
|
|
41
|
+
return (
|
|
42
|
+
<AlertDialogPortal>
|
|
43
|
+
<AlertDialogOverlay />
|
|
44
|
+
<AlertDialogPrimitive.Popup
|
|
45
|
+
data-slot="alert-dialog-content"
|
|
46
|
+
data-size={size}
|
|
47
|
+
className={cn(
|
|
48
|
+
'group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
49
|
+
className,
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
</AlertDialogPortal>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
data-slot="alert-dialog-header"
|
|
61
|
+
className={cn(
|
|
62
|
+
'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
71
|
+
return (
|
|
72
|
+
<div
|
|
73
|
+
data-slot="alert-dialog-footer"
|
|
74
|
+
className={cn(
|
|
75
|
+
'-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end',
|
|
76
|
+
className,
|
|
77
|
+
)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function AlertDialogMedia({ className, ...props }: React.ComponentProps<'div'>) {
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
data-slot="alert-dialog-media"
|
|
87
|
+
className={cn(
|
|
88
|
+
"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
|
|
89
|
+
className,
|
|
90
|
+
)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function AlertDialogTitle({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
100
|
+
return (
|
|
101
|
+
<AlertDialogPrimitive.Title
|
|
102
|
+
data-slot="alert-dialog-title"
|
|
103
|
+
className={cn(
|
|
104
|
+
'font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',
|
|
105
|
+
className,
|
|
106
|
+
)}
|
|
107
|
+
{...props}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function AlertDialogDescription({
|
|
113
|
+
className,
|
|
114
|
+
...props
|
|
115
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
116
|
+
return (
|
|
117
|
+
<AlertDialogPrimitive.Description
|
|
118
|
+
data-slot="alert-dialog-description"
|
|
119
|
+
className={cn(
|
|
120
|
+
'text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',
|
|
121
|
+
className,
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>) {
|
|
129
|
+
return <Button data-slot="alert-dialog-action" className={cn(className)} {...props} />;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function AlertDialogCancel({
|
|
133
|
+
className,
|
|
134
|
+
variant = 'outline',
|
|
135
|
+
size = 'default',
|
|
136
|
+
...props
|
|
137
|
+
}: AlertDialogPrimitive.Close.Props &
|
|
138
|
+
Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
|
|
139
|
+
return (
|
|
140
|
+
<AlertDialogPrimitive.Close
|
|
141
|
+
data-slot="alert-dialog-cancel"
|
|
142
|
+
className={cn(className)}
|
|
143
|
+
render={<Button variant={variant} size={size} />}
|
|
144
|
+
{...props}
|
|
145
|
+
/>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
AlertDialog,
|
|
151
|
+
AlertDialogAction,
|
|
152
|
+
AlertDialogCancel,
|
|
153
|
+
AlertDialogContent,
|
|
154
|
+
AlertDialogDescription,
|
|
155
|
+
AlertDialogFooter,
|
|
156
|
+
AlertDialogHeader,
|
|
157
|
+
AlertDialogMedia,
|
|
158
|
+
AlertDialogOverlay,
|
|
159
|
+
AlertDialogPortal,
|
|
160
|
+
AlertDialogTitle,
|
|
161
|
+
AlertDialogTrigger,
|
|
162
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: 'bg-card text-card-foreground',
|
|
12
|
+
destructive:
|
|
13
|
+
'bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: 'default',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
function Alert({
|
|
23
|
+
className,
|
|
24
|
+
variant,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>) {
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
data-slot="alert"
|
|
30
|
+
role="alert"
|
|
31
|
+
className={cn(alertVariants({ variant }), className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
data-slot="alert-title"
|
|
41
|
+
className={cn(
|
|
42
|
+
'font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function AlertDescription({ className, ...props }: React.ComponentProps<'div'>) {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
data-slot="alert-description"
|
|
54
|
+
className={cn(
|
|
55
|
+
'text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4',
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function AlertAction({ className, ...props }: React.ComponentProps<'div'>) {
|
|
64
|
+
return (
|
|
65
|
+
<div data-slot="alert-action" className={cn('absolute top-2 right-2', className)} {...props} />
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
|
|
7
|
+
const badgeVariants = cva(
|
|
8
|
+
'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
|
|
13
|
+
secondary: 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',
|
|
14
|
+
destructive:
|
|
15
|
+
'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',
|
|
16
|
+
outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
|
|
17
|
+
ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
|
|
18
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: 'default',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
function Badge({
|
|
28
|
+
className,
|
|
29
|
+
variant = 'default',
|
|
30
|
+
render,
|
|
31
|
+
...props
|
|
32
|
+
}: useRender.ComponentProps<'span'> & VariantProps<typeof badgeVariants>) {
|
|
33
|
+
return useRender({
|
|
34
|
+
defaultTagName: 'span',
|
|
35
|
+
props: mergeProps<'span'>(
|
|
36
|
+
{
|
|
37
|
+
className: cn(badgeVariants({ variant }), className),
|
|
38
|
+
},
|
|
39
|
+
props,
|
|
40
|
+
),
|
|
41
|
+
render,
|
|
42
|
+
state: {
|
|
43
|
+
slot: 'badge',
|
|
44
|
+
variant,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { Badge, badgeVariants };
|