@agent-native/core 0.117.2 → 0.118.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/corpus/README.md +3 -3
- package/corpus/core/CHANGELOG.md +30 -0
- package/corpus/core/docs/content/custom-design-system.mdx +445 -0
- package/corpus/core/docs/content/toolkit-ui.mdx +16 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/types.ts +1 -0
- package/corpus/core/src/agent/types.ts +1 -1
- package/corpus/core/src/client/AgentPanel.tsx +90 -107
- package/corpus/core/src/client/AssistantChat.tsx +30 -13
- package/corpus/core/src/client/CommandMenu.tsx +68 -178
- package/corpus/core/src/client/agent-chat-adapter.ts +3 -1
- package/corpus/core/src/client/app-providers.tsx +1 -1
- package/corpus/core/src/client/chat/message-components.tsx +116 -10
- package/corpus/core/src/client/chat/tool-call-display.tsx +26 -5
- package/corpus/core/src/client/chat/widgets/InlineExtensionWidget.tsx +14 -40
- package/corpus/core/src/client/components/ui/message-scroller.tsx +15 -1
- package/corpus/core/src/client/i18n.tsx +22 -0
- package/corpus/core/src/client/index.ts +17 -0
- package/corpus/core/src/client/org/TeamPage.tsx +257 -153
- package/corpus/core/src/client/progress/RunsTray.tsx +89 -88
- package/corpus/core/src/client/resources/McpConnectionSuggestion.tsx +5 -2
- package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +34 -13
- package/corpus/core/src/client/resources/mcp-integration-catalog.ts +13 -0
- package/corpus/core/src/client/settings/DemoModeSection.tsx +6 -18
- package/corpus/core/src/client/settings/SecretsSection.tsx +97 -52
- package/corpus/core/src/client/settings/SettingsPanel.tsx +202 -246
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +23 -2
- package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +7 -18
- package/corpus/core/src/client/settings/index.ts +7 -0
- package/corpus/core/src/client/settings/useSettingsPanelController.ts +155 -0
- package/corpus/core/src/client/setup-connections/BuilderConnectCard.tsx +116 -51
- package/corpus/core/src/client/setup-connections/index.ts +10 -0
- package/corpus/core/src/client/setup-connections/useBuilderConnectCardController.ts +82 -0
- package/corpus/core/src/client/sharing/ShareButton.tsx +64 -586
- package/corpus/core/src/client/sharing/ShareDialog.tsx +299 -633
- package/corpus/core/src/client/sharing/index.ts +42 -0
- package/corpus/core/src/client/sharing/share-controller-helpers.ts +318 -0
- package/corpus/core/src/client/sharing/useShareButtonController.ts +600 -0
- package/corpus/core/src/client/sharing/useShareDialogController.ts +559 -0
- package/corpus/core/src/client/sse-event-processor.ts +23 -0
- package/corpus/core/src/client/tool-display.ts +71 -0
- package/corpus/core/src/client/use-agent-engine-configured.ts +12 -19
- package/corpus/core/src/client/use-chat-threads.ts +33 -12
- package/corpus/core/src/localization/default-messages.ts +5 -0
- package/corpus/core/src/mcp-client/oauth-routes.ts +16 -2
- package/corpus/core/src/scripts/call-agent.ts +5 -1
- package/corpus/core/src/server/realtime-voice.ts +1 -1
- package/corpus/core/src/styles/agent-native.css +0 -24
- package/corpus/core/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/core/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/core/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/core/src/templates/default/app/components/ui/toolkit-provider.tsx +10 -0
- package/corpus/core/src/templates/default/app/design-system.ts +3 -0
- package/corpus/core/src/templates/default/app/root.tsx +5 -2
- package/corpus/core/src/templates/default/package.json +1 -0
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/core/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/core/src/vite/client.ts +39 -0
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/analytics/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/analytics/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/analytics/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/analytics/app/design-system.ts +3 -0
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/assets/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/assets/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/assets/app/components/ui/alert.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/assets/app/design-system.ts +3 -0
- package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +26 -30
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/brain/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/brain/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/brain/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/brain/app/design-system.ts +3 -0
- package/corpus/templates/brain/app/routes/sources.tsx +8 -8
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/calendar/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/calendar/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/calendar/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/calendar/app/design-system.ts +3 -0
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/chat/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/chat/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/chat/app/design-system.ts +3 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/clips/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/clips/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/clips/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/clips/app/design-system.ts +3 -0
- package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
- package/corpus/templates/clips/changelog/2026-07-22-fixed-windows-recordings-aborting-during-the-countdown.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-22-permissions-and-rewind-controls-are-now-grouped-with-clearer.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-22-the-desktop-popover-opens-centered-under-the-menu-bar-icon-o.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +86 -82
- package/corpus/templates/clips/desktop/src/styles.css +13 -0
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +10 -1
- package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +37 -2
- package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +18 -0
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/content/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/content/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +41 -59
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +41 -41
- package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +2 -1
- package/corpus/templates/content/app/components/editor/database/ListView.tsx +2 -1
- package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +9 -9
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +7 -7
- package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +11 -11
- package/corpus/templates/content/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/content/app/components/ui/collapsible.tsx +1 -0
- package/corpus/templates/content/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/content/app/design-system.ts +3 -0
- package/corpus/templates/content/app/global.css +29 -3
- package/corpus/templates/content/changelog/2026-07-22-page-actions-are-grouped-into-the-three-dots-menu-for-a-clea.md +6 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/crm/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/crm/app/components/crm/CreateCrmRecordDialog.tsx +10 -10
- package/corpus/templates/crm/app/components/crm/CrmDashboardPanel.tsx +1 -6
- package/corpus/templates/crm/app/components/crm/CrmSignalsPanel.tsx +3 -2
- package/corpus/templates/crm/app/components/crm/IntelligenceSettings.tsx +13 -12
- package/corpus/templates/crm/app/components/crm/RecordActions.tsx +17 -17
- package/corpus/templates/crm/app/components/crm/RecordGrid.tsx +8 -8
- package/corpus/templates/crm/app/components/crm/RecordWorkspace.tsx +3 -8
- package/corpus/templates/crm/app/components/crm/SavedViewDataProgram.tsx +2 -1
- package/corpus/templates/crm/app/components/crm/Surface.tsx +3 -2
- package/corpus/templates/crm/app/components/crm/WorkOverview.tsx +2 -2
- package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +7 -7
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +1 -1
- package/corpus/templates/crm/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/button.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/card.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/input.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/label.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/select.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/table.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/crm/app/components/ui/toolkit-provider.tsx +17 -0
- package/corpus/templates/crm/app/design-system.ts +3 -0
- package/corpus/templates/crm/app/root.tsx +9 -6
- package/corpus/templates/crm/app/routes/dashboard.tsx +1 -1
- package/corpus/templates/crm/app/routes/proposals.tsx +13 -13
- package/corpus/templates/crm/app/routes/setup.tsx +9 -9
- package/corpus/templates/crm/app/routes/tasks.tsx +14 -14
- package/corpus/templates/crm/app/routes/views.tsx +16 -16
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/design/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/design/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +8 -8
- package/corpus/templates/design/app/components/ui/command.tsx +1 -0
- package/corpus/templates/design/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/design/app/design-system.ts +3 -0
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/dispatch/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/dispatch/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/dispatch/app/components/ui/button.tsx +1 -0
- package/corpus/templates/dispatch/app/components/ui/toolkit-provider.tsx +17 -0
- package/corpus/templates/dispatch/app/design-system.ts +3 -0
- package/corpus/templates/dispatch/app/root.tsx +10 -7
- package/corpus/templates/dispatch/package.json +1 -0
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/forms/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/forms/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/forms/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/forms/app/design-system.ts +3 -0
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/macros/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/macros/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/macros/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/macros/app/design-system.ts +3 -0
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/mail/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/mail/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +134 -93
- package/corpus/templates/mail/app/components/email/email-iframe-document.ts +8 -2
- package/corpus/templates/mail/app/components/ui/textarea.tsx +1 -21
- package/corpus/templates/mail/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/mail/app/design-system.ts +3 -0
- package/corpus/templates/mail/changelog/2026-07-22-email-messages-no-longer-flash-with-an-unstyled-page-while-l.md +6 -0
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/plan/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/plan/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +1 -1
- package/corpus/templates/plan/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/plan/app/design-system.ts +3 -0
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/slides/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/slides/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/slides/app/components/ui/toolkit-provider.tsx +6 -1
- package/corpus/templates/slides/app/design-system.ts +3 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/corpus/templates/tasks/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +22 -2
- package/corpus/templates/tasks/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/corpus/templates/tasks/app/components/ui/toolkit-provider.tsx +17 -0
- package/corpus/templates/tasks/app/design-system.ts +3 -0
- package/corpus/templates/tasks/app/root.tsx +5 -2
- package/corpus/toolkit/CHANGELOG.md +14 -0
- package/corpus/toolkit/agent-native.eject.json +71 -0
- package/corpus/toolkit/package.json +31 -1
- package/corpus/toolkit/src/chat-history/ChatHistoryRail.tsx +100 -39
- package/corpus/toolkit/src/chat-history/index.ts +9 -0
- package/corpus/toolkit/src/chat-history/useChatHistoryRailController.ts +76 -0
- package/corpus/toolkit/src/chat-history.css +2 -0
- package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +11 -8
- package/corpus/toolkit/src/composer/PromptComposer.tsx +27 -6
- package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +107 -22
- package/corpus/toolkit/src/conformance/__fixtures__/css-in-js-adapter.tsx +401 -0
- package/corpus/toolkit/src/conformance/index.ts +3 -0
- package/corpus/toolkit/src/conformance/runner.tsx +710 -0
- package/corpus/toolkit/src/conformance/types.ts +45 -0
- package/corpus/toolkit/src/conformance/version.ts +22 -0
- package/corpus/toolkit/src/design-system/components.tsx +146 -0
- package/corpus/toolkit/src/design-system/context.tsx +31 -0
- package/corpus/toolkit/src/design-system/default-adapter.tsx +915 -0
- package/corpus/toolkit/src/design-system/definition.ts +14 -0
- package/corpus/toolkit/src/design-system/error-boundary.tsx +37 -0
- package/corpus/toolkit/src/design-system/index.ts +7 -0
- package/corpus/toolkit/src/design-system/theme.ts +145 -0
- package/corpus/toolkit/src/design-system/types.ts +363 -0
- package/corpus/toolkit/src/provider.tsx +98 -5
- package/corpus/toolkit/src/ui/button.tsx +95 -6
- package/corpus/toolkit/src/ui/dialog.tsx +48 -23
- package/corpus/toolkit/src/ui/popover.tsx +16 -2
- package/corpus/toolkit/src/ui/select.tsx +7 -3
- package/corpus/toolkit/src/ui/sidebar.tsx +47 -48
- package/corpus/toolkit/src/ui/tooltip.tsx +7 -3
- package/dist/a2a/types.d.ts +1 -1
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +14 -14
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +26 -15
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +18 -106
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +2 -1
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/app-providers.d.ts.map +1 -1
- package/dist/client/app-providers.js +1 -1
- package/dist/client/app-providers.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +9 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +62 -7
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +20 -5
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/widgets/InlineExtensionWidget.d.ts.map +1 -1
- package/dist/client/chat/widgets/InlineExtensionWidget.js +9 -12
- package/dist/client/chat/widgets/InlineExtensionWidget.js.map +1 -1
- package/dist/client/components/ui/message-scroller.d.ts +1 -1
- package/dist/client/components/ui/message-scroller.d.ts.map +1 -1
- package/dist/client/components/ui/message-scroller.js +4 -3
- package/dist/client/components/ui/message-scroller.js.map +1 -1
- package/dist/client/i18n.d.ts.map +1 -1
- package/dist/client/i18n.js +9 -0
- package/dist/client/i18n.js.map +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/org/TeamPage.d.ts.map +1 -1
- package/dist/client/org/TeamPage.js +41 -33
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/progress/RunsTray.d.ts.map +1 -1
- package/dist/client/progress/RunsTray.js +9 -10
- package/dist/client/progress/RunsTray.js.map +1 -1
- package/dist/client/resources/McpConnectionSuggestion.d.ts.map +1 -1
- package/dist/client/resources/McpConnectionSuggestion.js +5 -4
- package/dist/client/resources/McpConnectionSuggestion.js.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.js +10 -8
- package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.d.ts +1 -0
- package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.js +13 -0
- package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
- package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
- package/dist/client/settings/DemoModeSection.js +2 -5
- package/dist/client/settings/DemoModeSection.js.map +1 -1
- package/dist/client/settings/SecretsSection.d.ts.map +1 -1
- package/dist/client/settings/SecretsSection.js +18 -6
- package/dist/client/settings/SecretsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +52 -117
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +16 -1
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +2 -5
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
- package/dist/client/settings/index.d.ts +1 -0
- package/dist/client/settings/index.d.ts.map +1 -1
- package/dist/client/settings/index.js +1 -0
- package/dist/client/settings/index.js.map +1 -1
- package/dist/client/settings/useSettingsPanelController.d.ts +22 -0
- package/dist/client/settings/useSettingsPanelController.d.ts.map +1 -0
- package/dist/client/settings/useSettingsPanelController.js +103 -0
- package/dist/client/settings/useSettingsPanelController.js.map +1 -0
- package/dist/client/setup-connections/BuilderConnectCard.d.ts +14 -6
- package/dist/client/setup-connections/BuilderConnectCard.d.ts.map +1 -1
- package/dist/client/setup-connections/BuilderConnectCard.js +24 -16
- package/dist/client/setup-connections/BuilderConnectCard.js.map +1 -1
- package/dist/client/setup-connections/index.d.ts +2 -1
- package/dist/client/setup-connections/index.d.ts.map +1 -1
- package/dist/client/setup-connections/index.js +2 -1
- package/dist/client/setup-connections/index.js.map +1 -1
- package/dist/client/setup-connections/useBuilderConnectCardController.d.ts +34 -0
- package/dist/client/setup-connections/useBuilderConnectCardController.d.ts.map +1 -0
- package/dist/client/setup-connections/useBuilderConnectCardController.js +39 -0
- package/dist/client/setup-connections/useBuilderConnectCardController.js.map +1 -0
- package/dist/client/sharing/ShareButton.d.ts +2 -1
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +17 -463
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareDialog.d.ts +6 -6
- package/dist/client/sharing/ShareDialog.d.ts.map +1 -1
- package/dist/client/sharing/ShareDialog.js +69 -283
- package/dist/client/sharing/ShareDialog.js.map +1 -1
- package/dist/client/sharing/index.d.ts +3 -0
- package/dist/client/sharing/index.d.ts.map +1 -1
- package/dist/client/sharing/index.js +3 -0
- package/dist/client/sharing/index.js.map +1 -1
- package/dist/client/sharing/share-controller-helpers.d.ts +70 -0
- package/dist/client/sharing/share-controller-helpers.d.ts.map +1 -0
- package/dist/client/sharing/share-controller-helpers.js +224 -0
- package/dist/client/sharing/share-controller-helpers.js.map +1 -0
- package/dist/client/sharing/useShareButtonController.d.ts +91 -0
- package/dist/client/sharing/useShareButtonController.d.ts.map +1 -0
- package/dist/client/sharing/useShareButtonController.js +397 -0
- package/dist/client/sharing/useShareButtonController.js.map +1 -0
- package/dist/client/sharing/useShareDialogController.d.ts +109 -0
- package/dist/client/sharing/useShareDialogController.d.ts.map +1 -0
- package/dist/client/sharing/useShareDialogController.js +348 -0
- package/dist/client/sharing/useShareDialogController.js.map +1 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +21 -0
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/tool-display.d.ts +16 -0
- package/dist/client/tool-display.d.ts.map +1 -1
- package/dist/client/tool-display.js +52 -0
- package/dist/client/tool-display.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts +3 -2
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +7 -19
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +21 -8
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/localization/default-messages.d.ts +4 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +4 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/oauth-routes.d.ts +2 -0
- package/dist/mcp-client/oauth-routes.d.ts.map +1 -1
- package/dist/mcp-client/oauth-routes.js +12 -2
- package/dist/mcp-client/oauth-routes.js.map +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +5 -1
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/realtime-voice.js +1 -1
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/styles/agent-native.css +0 -24
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/dist/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +22 -2
- package/dist/templates/chat/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/dist/templates/chat/app/components/ui/toolkit-provider.tsx +6 -1
- package/dist/templates/chat/app/design-system.ts +3 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/dist/templates/default/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +22 -2
- package/dist/templates/default/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/dist/templates/default/app/components/ui/toolkit-provider.tsx +10 -0
- package/dist/templates/default/app/design-system.ts +3 -0
- package/dist/templates/default/app/root.tsx +5 -2
- package/dist/templates/default/package.json +1 -0
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/dist/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/dist/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +22 -2
- package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/dist/vite/client.d.ts +3 -0
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +31 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/custom-design-system.mdx +445 -0
- package/docs/content/toolkit-ui.mdx +16 -0
- package/package.json +2 -2
- package/src/a2a/types.ts +1 -0
- package/src/agent/types.ts +1 -1
- package/src/client/AgentPanel.tsx +90 -107
- package/src/client/AssistantChat.tsx +30 -13
- package/src/client/CommandMenu.tsx +68 -178
- package/src/client/agent-chat-adapter.ts +3 -1
- package/src/client/app-providers.tsx +1 -1
- package/src/client/chat/message-components.tsx +116 -10
- package/src/client/chat/tool-call-display.tsx +26 -5
- package/src/client/chat/widgets/InlineExtensionWidget.tsx +14 -40
- package/src/client/components/ui/message-scroller.tsx +15 -1
- package/src/client/i18n.tsx +22 -0
- package/src/client/index.ts +17 -0
- package/src/client/org/TeamPage.tsx +257 -153
- package/src/client/progress/RunsTray.tsx +89 -88
- package/src/client/resources/McpConnectionSuggestion.tsx +5 -2
- package/src/client/resources/McpIntegrationDialog.tsx +34 -13
- package/src/client/resources/mcp-integration-catalog.ts +13 -0
- package/src/client/settings/DemoModeSection.tsx +6 -18
- package/src/client/settings/SecretsSection.tsx +97 -52
- package/src/client/settings/SettingsPanel.tsx +202 -246
- package/src/client/settings/SettingsTabsPage.tsx +23 -2
- package/src/client/settings/VoiceTranscriptionSection.tsx +7 -18
- package/src/client/settings/index.ts +7 -0
- package/src/client/settings/useSettingsPanelController.ts +155 -0
- package/src/client/setup-connections/BuilderConnectCard.tsx +116 -51
- package/src/client/setup-connections/index.ts +10 -0
- package/src/client/setup-connections/useBuilderConnectCardController.ts +82 -0
- package/src/client/sharing/ShareButton.tsx +64 -586
- package/src/client/sharing/ShareDialog.tsx +299 -633
- package/src/client/sharing/index.ts +42 -0
- package/src/client/sharing/share-controller-helpers.ts +318 -0
- package/src/client/sharing/useShareButtonController.ts +600 -0
- package/src/client/sharing/useShareDialogController.ts +559 -0
- package/src/client/sse-event-processor.ts +23 -0
- package/src/client/tool-display.ts +71 -0
- package/src/client/use-agent-engine-configured.ts +12 -19
- package/src/client/use-chat-threads.ts +33 -12
- package/src/localization/default-messages.ts +5 -0
- package/src/mcp-client/oauth-routes.ts +16 -2
- package/src/scripts/call-agent.ts +5 -1
- package/src/server/realtime-voice.ts +1 -1
- package/src/styles/agent-native.css +0 -24
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/src/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +22 -2
- package/src/templates/chat/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/src/templates/chat/app/components/ui/toolkit-provider.tsx +6 -1
- package/src/templates/chat/app/design-system.ts +3 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +22 -2
- package/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/src/templates/default/app/components/ui/toolkit-provider.tsx +10 -0
- package/src/templates/default/app/design-system.ts +3 -0
- package/src/templates/default/app/root.tsx +5 -2
- package/src/templates/default/package.json +1 -0
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
- package/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +86 -11
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +22 -2
- package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +28 -4
- package/src/vite/client.ts +39 -0
- package/corpus/templates/analytics/app/components/ui/calendar.tsx +0 -70
- package/corpus/templates/analytics/app/components/ui/chart.tsx +0 -386
- package/corpus/templates/calendar/app/components/ui/sonner.tsx +0 -58
- package/corpus/templates/forms/app/components/ui/calendar.tsx +0 -214
- package/corpus/templates/forms/app/components/ui/chart.tsx +0 -379
- package/corpus/templates/forms/app/components/ui/command.tsx +0 -153
- package/corpus/templates/forms/app/components/ui/context-menu.tsx +0 -198
- package/corpus/templates/forms/app/components/ui/menubar.tsx +0 -254
- package/corpus/templates/macros/app/components/ui/menubar.tsx +0 -238
- package/corpus/templates/macros/app/components/ui/progress.tsx +0 -26
- package/corpus/templates/mail/app/components/ui/calendar.tsx +0 -211
- package/corpus/templates/mail/app/components/ui/chart.tsx +0 -379
- package/corpus/templates/mail/app/components/ui/command.tsx +0 -153
- package/corpus/templates/mail/app/components/ui/context-menu.tsx +0 -198
- package/corpus/templates/mail/app/components/ui/menubar.tsx +0 -254
- package/corpus/templates/tasks/app/components/ui/accordion.tsx +0 -56
- package/corpus/templates/tasks/app/components/ui/aspect-ratio.tsx +0 -5
- package/corpus/templates/tasks/app/components/ui/breadcrumb.tsx +0 -115
- package/corpus/templates/tasks/app/components/ui/calendar.tsx +0 -70
- package/corpus/templates/tasks/app/components/ui/carousel.tsx +0 -260
- package/corpus/templates/tasks/app/components/ui/chart.tsx +0 -379
- package/corpus/templates/tasks/app/components/ui/form.tsx +0 -177
- package/corpus/templates/tasks/app/components/ui/hover-card.tsx +0 -27
- package/corpus/templates/tasks/app/components/ui/input-otp.tsx +0 -69
- package/corpus/templates/tasks/app/components/ui/menubar.tsx +0 -254
- package/corpus/templates/tasks/app/components/ui/navigation-menu.tsx +0 -128
- package/corpus/templates/tasks/app/components/ui/pagination.tsx +0 -121
- package/corpus/templates/tasks/app/components/ui/resizable.tsx +0 -43
- package/corpus/templates/tasks/app/components/ui/sidebar.tsx +0 -782
- package/corpus/templates/tasks/app/components/ui/toggle.tsx +0 -43
|
@@ -57,10 +57,26 @@ Default to Apple/Linear-level restraint: make the primary workflow obvious, then
|
|
|
57
57
|
|
|
58
58
|
## Agent-Native UI Rules
|
|
59
59
|
|
|
60
|
-
- Agent-native apps use React
|
|
61
|
-
|
|
60
|
+
- Agent-native apps use React and Vite. The default adapter uses Tailwind CSS,
|
|
61
|
+
shadcn/ui, and `@tabler/icons-react`, but an app may register a different
|
|
62
|
+
company design system in `app/design-system.ts`.
|
|
63
|
+
- **Use the app's design-system seam for standard UI.** Inspect
|
|
64
|
+
`app/design-system.ts`, `ToolkitProvider`, and the local UI adapter directory
|
|
65
|
+
before choosing a primitive. Use shadcn primitives when they are the active
|
|
66
|
+
adapter; use the registered company components when they are not.
|
|
62
67
|
- **When touching shadcn/ui components, also read `shadcn-ui` if it exists.** That skill covers `components.json`, CLI docs, component composition, theming, and registry workflows.
|
|
63
68
|
- Check `app/components/ui/` before importing a shadcn component. If a primitive is missing, add it from the app root with `pnpm dlx shadcn@latest add <component>`, then review the generated file.
|
|
69
|
+
- Pages, routes, and domain components must import controls through the app's
|
|
70
|
+
local adapter path, usually `@/components/ui/*`. Never import
|
|
71
|
+
`@agent-native/toolkit/ui/*` directly in app product code.
|
|
72
|
+
- Toolkit/Core feature presentation flows through the semantic components from
|
|
73
|
+
`@agent-native/toolkit/design-system`. Their props express intent, emphasis,
|
|
74
|
+
size, controlled values, and behavior; they do not require Tailwind, CVA, or
|
|
75
|
+
`className`.
|
|
76
|
+
- For deeper feature customization, consume the feature-level headless
|
|
77
|
+
controller through its product render slot. The same controller must power
|
|
78
|
+
the default and custom views. Eject the smallest supported unit only after
|
|
79
|
+
tokens, semantic components, controllers, and slots are insufficient.
|
|
64
80
|
- Do not build custom dropdowns, menus, popovers, modals, or confirmations with manual absolute positioning and click-outside effects.
|
|
65
81
|
- Never use browser dialogs (`window.alert`, `window.confirm`, `window.prompt`). Use `AlertDialog`, `Dialog`, or app-specific confirmation UI.
|
|
66
82
|
- Use Tabler icons for all first-party UI icons. Do not add Lucide, Heroicons, inline SVG icon sets, or emoji icons.
|
|
@@ -103,10 +119,14 @@ For substantial frontend work:
|
|
|
103
119
|
2. Start the dev server when the app needs one.
|
|
104
120
|
3. Verify with browser screenshots at desktop and mobile widths.
|
|
105
121
|
4. Check interactive states: hover, focus, loading, empty, error, and destructive confirmations.
|
|
122
|
+
5. When registering or changing a company adapter, run
|
|
123
|
+
`@agent-native/toolkit/conformance`, including mixed-overlay focus,
|
|
124
|
+
`portalContainer`, and z-index stacking checks.
|
|
106
125
|
|
|
107
126
|
## Related Skills
|
|
108
127
|
|
|
109
128
|
- **shadcn-ui** — shadcn CLI, component docs, composition rules, theming, and registries
|
|
129
|
+
- **customizing-agent-native** — Design-system registration, feature controllers, product slots, conformance, and ejection
|
|
110
130
|
- **self-modifying-code** — The agent can edit source code to apply design changes
|
|
111
131
|
- **storing-data** — All data lives in SQL; use actions for data access
|
|
112
132
|
- **actions** — `useActionQuery`/`useActionMutation` hooks for frontend data fetching
|
|
@@ -17,10 +17,33 @@ This skill keeps shadcn/ui work project-aware. Components are source files in th
|
|
|
17
17
|
## First Steps
|
|
18
18
|
|
|
19
19
|
1. Work from the app root that owns `components.json`.
|
|
20
|
-
2.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
2. In an Agent Native app, inspect `app/design-system.ts` and
|
|
21
|
+
`ToolkitProvider` before choosing a primitive. A registered company design
|
|
22
|
+
system takes precedence over the default shadcn adapter.
|
|
23
|
+
3. Run `pnpm dlx shadcn@latest info --json` when you need current project context: framework, Tailwind version, aliases, icon library, installed components, and resolved paths.
|
|
24
|
+
4. Use the actual aliases from `components.json` or `shadcn info`; do not assume `@/components/ui` if the project says otherwise.
|
|
25
|
+
5. Check `app/components/ui/` or the resolved `ui` path before importing a component.
|
|
26
|
+
6. For unfamiliar components, run `pnpm dlx shadcn@latest docs <component>` and read the returned docs or examples before coding.
|
|
27
|
+
|
|
28
|
+
## Agent Native Adapter Rule
|
|
29
|
+
|
|
30
|
+
Pages, routes, and domain components import controls through the app's local UI
|
|
31
|
+
adapter layer. Never import `@agent-native/toolkit/ui/*` directly in app product
|
|
32
|
+
code. Direct imports bypass `app/design-system.ts` and make Toolkit/Core
|
|
33
|
+
surfaces use different controls from the app.
|
|
34
|
+
|
|
35
|
+
When shadcn is the app's adapter, add or update the local primitive and keep
|
|
36
|
+
product code on that local import. When a company design system is registered,
|
|
37
|
+
adapt its components to the semantic contracts from
|
|
38
|
+
`@agent-native/toolkit/design-system`; do not recreate a parallel shadcn
|
|
39
|
+
surface. The semantic API is styling-runtime agnostic, so do not require
|
|
40
|
+
Tailwind, CVA, or `className` in customer adapters.
|
|
41
|
+
|
|
42
|
+
For shared Toolkit features, customize presentation through semantic
|
|
43
|
+
components, a feature-level controller, and product-level render slots. Keep
|
|
44
|
+
the same controller for default and custom views. Use the conformance kit for
|
|
45
|
+
behavior components whose focus, portal, keyboard, dismissal, or stacking
|
|
46
|
+
behavior comes from the company design system.
|
|
24
47
|
|
|
25
48
|
## Adding Or Updating Components
|
|
26
49
|
|
|
@@ -91,5 +114,6 @@ Do not wrap triggers in extra divs just to place a Button or Link inside them.
|
|
|
91
114
|
## Related Skills
|
|
92
115
|
|
|
93
116
|
- **frontend-design** — Product UX, visual direction, responsive polish, and verification
|
|
117
|
+
- **customizing-agent-native** — Registered design systems, controllers, slots, conformance, and ejection
|
|
94
118
|
- **actions** — Data fetching and mutation patterns for agent-native apps
|
|
95
119
|
- **security** — User data, forms, external input, and action safety
|
package/src/vite/client.ts
CHANGED
|
@@ -5,6 +5,10 @@ import { createRequire, syncBuiltinESMExports } from "module";
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
|
|
8
|
+
import {
|
|
9
|
+
renderDesignSystemThemeCss,
|
|
10
|
+
type DesignSystemTheme,
|
|
11
|
+
} from "@agent-native/toolkit/design-system/theme";
|
|
8
12
|
import type {
|
|
9
13
|
ConfigEnv,
|
|
10
14
|
HotUpdateOptions,
|
|
@@ -1342,6 +1346,8 @@ export interface ClientConfigOptions {
|
|
|
1342
1346
|
logLevel?: UserConfig["logLevel"];
|
|
1343
1347
|
/** Additional Vite plugins */
|
|
1344
1348
|
plugins?: any[];
|
|
1349
|
+
/** Static design tokens emitted into the client build. */
|
|
1350
|
+
designSystemTheme?: DesignSystemTheme;
|
|
1345
1351
|
/** Nitro plugin options (preset, srcDir, etc) */
|
|
1346
1352
|
nitro?: NitroOptions;
|
|
1347
1353
|
/** Override resolve aliases */
|
|
@@ -2459,6 +2465,38 @@ function createTailwindPlugin(options: Pick<ClientConfigOptions, "tailwind">) {
|
|
|
2459
2465
|
}
|
|
2460
2466
|
}
|
|
2461
2467
|
|
|
2468
|
+
const DESIGN_SYSTEM_THEME_MODULE_ID = "virtual:agent-native-theme.css";
|
|
2469
|
+
const RESOLVED_DESIGN_SYSTEM_THEME_MODULE_ID = `\0${DESIGN_SYSTEM_THEME_MODULE_ID}`;
|
|
2470
|
+
|
|
2471
|
+
function createDesignSystemThemePlugin(
|
|
2472
|
+
theme: DesignSystemTheme | undefined,
|
|
2473
|
+
): Plugin | null {
|
|
2474
|
+
if (!theme) return null;
|
|
2475
|
+
const css = renderDesignSystemThemeCss(theme);
|
|
2476
|
+
|
|
2477
|
+
return {
|
|
2478
|
+
name: "agent-native-design-system-theme",
|
|
2479
|
+
resolveId(id) {
|
|
2480
|
+
if (id === DESIGN_SYSTEM_THEME_MODULE_ID) {
|
|
2481
|
+
return RESOLVED_DESIGN_SYSTEM_THEME_MODULE_ID;
|
|
2482
|
+
}
|
|
2483
|
+
},
|
|
2484
|
+
load(id) {
|
|
2485
|
+
if (id === RESOLVED_DESIGN_SYSTEM_THEME_MODULE_ID) return css;
|
|
2486
|
+
},
|
|
2487
|
+
transformIndexHtml() {
|
|
2488
|
+
return [
|
|
2489
|
+
{
|
|
2490
|
+
tag: "style",
|
|
2491
|
+
attrs: { "data-agent-native-theme": "" },
|
|
2492
|
+
children: css,
|
|
2493
|
+
injectTo: "head",
|
|
2494
|
+
},
|
|
2495
|
+
];
|
|
2496
|
+
},
|
|
2497
|
+
};
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2462
2500
|
function getConfiguredAppBasePath(): { appBasePath: string; base: string } {
|
|
2463
2501
|
// APP_BASE_PATH lets this app be mounted under a prefix (e.g. "/mail") as
|
|
2464
2502
|
// part of a unified workspace deploy. Defaults to "/" for standalone apps.
|
|
@@ -2665,6 +2703,7 @@ function createAgentNativePlugins(
|
|
|
2665
2703
|
? [nitroPlugin]
|
|
2666
2704
|
: []),
|
|
2667
2705
|
includeReactTransform ? createReactTransformPlugin() : null,
|
|
2706
|
+
createDesignSystemThemePlugin(options.designSystemTheme),
|
|
2668
2707
|
createTailwindPlugin(options),
|
|
2669
2708
|
].filter(Boolean);
|
|
2670
2709
|
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { DayPicker } from "react-day-picker";
|
|
4
|
-
|
|
5
|
-
import { buttonVariants } from "@/components/ui/button";
|
|
6
|
-
import { cn } from "@/lib/utils";
|
|
7
|
-
|
|
8
|
-
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
9
|
-
|
|
10
|
-
function Calendar({
|
|
11
|
-
className,
|
|
12
|
-
classNames,
|
|
13
|
-
showOutsideDays = true,
|
|
14
|
-
...props
|
|
15
|
-
}: CalendarProps) {
|
|
16
|
-
return (
|
|
17
|
-
<DayPicker
|
|
18
|
-
showOutsideDays={showOutsideDays}
|
|
19
|
-
className={cn("p-3", className)}
|
|
20
|
-
classNames={{
|
|
21
|
-
months: "flex flex-col sm:flex-row gap-4",
|
|
22
|
-
month: "flex flex-col gap-4",
|
|
23
|
-
month_caption: "flex justify-center pt-1 relative items-center h-7",
|
|
24
|
-
caption_label: "text-sm font-medium",
|
|
25
|
-
nav: "flex items-center gap-1",
|
|
26
|
-
button_previous: cn(
|
|
27
|
-
buttonVariants({ variant: "outline" }),
|
|
28
|
-
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 absolute start-1 top-1 z-10",
|
|
29
|
-
),
|
|
30
|
-
button_next: cn(
|
|
31
|
-
buttonVariants({ variant: "outline" }),
|
|
32
|
-
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 absolute end-1 top-1 z-10",
|
|
33
|
-
),
|
|
34
|
-
month_grid: "w-full border-collapse",
|
|
35
|
-
weekdays: "flex",
|
|
36
|
-
weekday:
|
|
37
|
-
"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem] text-center",
|
|
38
|
-
week: "flex w-full mt-2",
|
|
39
|
-
day: "h-9 w-9 text-center text-sm p-0 relative",
|
|
40
|
-
day_button: cn(
|
|
41
|
-
buttonVariants({ variant: "ghost" }),
|
|
42
|
-
"h-9 w-9 p-0 font-normal aria-selected:opacity-100",
|
|
43
|
-
),
|
|
44
|
-
selected:
|
|
45
|
-
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground rounded-md",
|
|
46
|
-
today: "bg-accent text-accent-foreground rounded-md",
|
|
47
|
-
outside: "text-muted-foreground opacity-50",
|
|
48
|
-
disabled: "text-muted-foreground opacity-50",
|
|
49
|
-
hidden: "invisible",
|
|
50
|
-
range_start: "rounded-s-md",
|
|
51
|
-
range_end: "rounded-e-md",
|
|
52
|
-
range_middle:
|
|
53
|
-
"aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
54
|
-
...classNames,
|
|
55
|
-
}}
|
|
56
|
-
components={{
|
|
57
|
-
Chevron: (props) => {
|
|
58
|
-
if (props.orientation === "left") {
|
|
59
|
-
return <IconChevronLeft className="h-4 w-4 rtl:-scale-x-100" />;
|
|
60
|
-
}
|
|
61
|
-
return <IconChevronRight className="h-4 w-4 rtl:-scale-x-100" />;
|
|
62
|
-
},
|
|
63
|
-
}}
|
|
64
|
-
{...props}
|
|
65
|
-
/>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
Calendar.displayName = "Calendar";
|
|
69
|
-
|
|
70
|
-
export { Calendar };
|
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as RechartsPrimitive from "recharts";
|
|
3
|
-
|
|
4
|
-
import { useChartTooltipFlip } from "@/hooks/use-chart-tooltip-flip";
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
8
|
-
const THEMES = { light: "", dark: ".dark" } as const;
|
|
9
|
-
|
|
10
|
-
export type ChartConfig = {
|
|
11
|
-
[k in string]: {
|
|
12
|
-
label?: React.ReactNode;
|
|
13
|
-
icon?: React.ComponentType;
|
|
14
|
-
} & (
|
|
15
|
-
| { color?: string; theme?: never }
|
|
16
|
-
| { color?: never; theme: Record<keyof typeof THEMES, string> }
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
type ChartContextProps = {
|
|
21
|
-
config: ChartConfig;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const ChartContext = React.createContext<ChartContextProps | null>(null);
|
|
25
|
-
|
|
26
|
-
function useChart() {
|
|
27
|
-
const context = React.useContext(ChartContext);
|
|
28
|
-
|
|
29
|
-
if (!context) {
|
|
30
|
-
throw new Error("useChart must be used within a <ChartContainer />");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return context;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const ChartContainer = React.forwardRef<
|
|
37
|
-
HTMLDivElement,
|
|
38
|
-
React.ComponentProps<"div"> & {
|
|
39
|
-
config: ChartConfig;
|
|
40
|
-
children: React.ComponentProps<
|
|
41
|
-
typeof RechartsPrimitive.ResponsiveContainer
|
|
42
|
-
>["children"];
|
|
43
|
-
}
|
|
44
|
-
>(({ id, className, children, config, ...props }, ref) => {
|
|
45
|
-
const uniqueId = React.useId();
|
|
46
|
-
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<ChartContext.Provider value={{ config }}>
|
|
50
|
-
<div
|
|
51
|
-
data-chart={chartId}
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn(
|
|
54
|
-
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
|
|
55
|
-
className,
|
|
56
|
-
)}
|
|
57
|
-
{...props}
|
|
58
|
-
>
|
|
59
|
-
<ChartStyle id={chartId} config={config} />
|
|
60
|
-
<RechartsPrimitive.ResponsiveContainer>
|
|
61
|
-
{children}
|
|
62
|
-
</RechartsPrimitive.ResponsiveContainer>
|
|
63
|
-
</div>
|
|
64
|
-
</ChartContext.Provider>
|
|
65
|
-
);
|
|
66
|
-
});
|
|
67
|
-
ChartContainer.displayName = "Chart";
|
|
68
|
-
|
|
69
|
-
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
70
|
-
const colorConfig = Object.entries(config).filter(
|
|
71
|
-
([_, config]) => config.theme || config.color,
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
if (!colorConfig.length) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<style
|
|
80
|
-
dangerouslySetInnerHTML={{
|
|
81
|
-
__html: Object.entries(THEMES)
|
|
82
|
-
.map(
|
|
83
|
-
([theme, prefix]) => `
|
|
84
|
-
${prefix} [data-chart=${id}] {
|
|
85
|
-
${colorConfig
|
|
86
|
-
.map(([key, itemConfig]) => {
|
|
87
|
-
const color =
|
|
88
|
-
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
|
89
|
-
itemConfig.color;
|
|
90
|
-
return color ? ` --color-${key}: ${color};` : null;
|
|
91
|
-
})
|
|
92
|
-
.join("\n")}
|
|
93
|
-
}
|
|
94
|
-
`,
|
|
95
|
-
)
|
|
96
|
-
.join("\n"),
|
|
97
|
-
}}
|
|
98
|
-
/>
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
103
|
-
|
|
104
|
-
const ChartTooltipContent = React.forwardRef<
|
|
105
|
-
HTMLDivElement,
|
|
106
|
-
RechartsPrimitive.TooltipProps<string | number, string> &
|
|
107
|
-
React.ComponentProps<"div"> & {
|
|
108
|
-
active?: boolean;
|
|
109
|
-
payload?: ReadonlyArray<
|
|
110
|
-
RechartsPrimitive.TooltipPayloadEntry<string | number, string>
|
|
111
|
-
>;
|
|
112
|
-
label?: React.ReactNode;
|
|
113
|
-
hideLabel?: boolean;
|
|
114
|
-
hideIndicator?: boolean;
|
|
115
|
-
indicator?: "line" | "dot" | "dashed";
|
|
116
|
-
nameKey?: string;
|
|
117
|
-
labelKey?: string;
|
|
118
|
-
}
|
|
119
|
-
>(
|
|
120
|
-
(
|
|
121
|
-
{
|
|
122
|
-
active,
|
|
123
|
-
payload,
|
|
124
|
-
className,
|
|
125
|
-
indicator = "dot",
|
|
126
|
-
hideLabel = false,
|
|
127
|
-
hideIndicator = false,
|
|
128
|
-
label,
|
|
129
|
-
labelFormatter,
|
|
130
|
-
labelClassName,
|
|
131
|
-
formatter,
|
|
132
|
-
color,
|
|
133
|
-
nameKey,
|
|
134
|
-
labelKey,
|
|
135
|
-
},
|
|
136
|
-
ref,
|
|
137
|
-
) => {
|
|
138
|
-
const { config } = useChart();
|
|
139
|
-
const flipRef = useChartTooltipFlip<HTMLDivElement>(active);
|
|
140
|
-
const setRefs = React.useCallback(
|
|
141
|
-
(node: HTMLDivElement | null) => {
|
|
142
|
-
flipRef.current = node;
|
|
143
|
-
if (typeof ref === "function") ref(node);
|
|
144
|
-
else if (ref)
|
|
145
|
-
(ref as React.MutableRefObject<HTMLDivElement | null>).current = node;
|
|
146
|
-
},
|
|
147
|
-
[ref, flipRef],
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
const tooltipLabel = React.useMemo(() => {
|
|
151
|
-
if (hideLabel || !payload?.length) {
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const [item] = payload;
|
|
156
|
-
const key = `${labelKey || item.dataKey || item.name || "value"}`;
|
|
157
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
158
|
-
const value =
|
|
159
|
-
!labelKey && typeof label === "string"
|
|
160
|
-
? config[label as keyof typeof config]?.label || label
|
|
161
|
-
: itemConfig?.label;
|
|
162
|
-
|
|
163
|
-
if (labelFormatter) {
|
|
164
|
-
return (
|
|
165
|
-
<div className={cn("font-medium", labelClassName)}>
|
|
166
|
-
{labelFormatter(value, payload)}
|
|
167
|
-
</div>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (!value) {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return <div className={cn("font-medium", labelClassName)}>{value}</div>;
|
|
176
|
-
}, [
|
|
177
|
-
label,
|
|
178
|
-
labelFormatter,
|
|
179
|
-
payload,
|
|
180
|
-
hideLabel,
|
|
181
|
-
labelClassName,
|
|
182
|
-
config,
|
|
183
|
-
labelKey,
|
|
184
|
-
]);
|
|
185
|
-
|
|
186
|
-
if (!active || !payload?.length) {
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
191
|
-
|
|
192
|
-
return (
|
|
193
|
-
<div
|
|
194
|
-
ref={setRefs}
|
|
195
|
-
className={cn(
|
|
196
|
-
"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
|
|
197
|
-
className,
|
|
198
|
-
)}
|
|
199
|
-
>
|
|
200
|
-
{!nestLabel ? tooltipLabel : null}
|
|
201
|
-
<div className="grid gap-1.5">
|
|
202
|
-
{payload.map((item, index) => {
|
|
203
|
-
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
204
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
205
|
-
const indicatorColor = color || item.payload.fill || item.color;
|
|
206
|
-
|
|
207
|
-
return (
|
|
208
|
-
<div
|
|
209
|
-
key={key}
|
|
210
|
-
className={cn(
|
|
211
|
-
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
212
|
-
indicator === "dot" && "items-center",
|
|
213
|
-
)}
|
|
214
|
-
>
|
|
215
|
-
{formatter && item?.value !== undefined && item.name ? (
|
|
216
|
-
formatter(item.value, item.name, item, index, item.payload)
|
|
217
|
-
) : (
|
|
218
|
-
<>
|
|
219
|
-
{itemConfig?.icon ? (
|
|
220
|
-
<itemConfig.icon />
|
|
221
|
-
) : (
|
|
222
|
-
!hideIndicator && (
|
|
223
|
-
<div
|
|
224
|
-
className={cn(
|
|
225
|
-
"shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",
|
|
226
|
-
{
|
|
227
|
-
"h-2.5 w-2.5": indicator === "dot",
|
|
228
|
-
"w-1": indicator === "line",
|
|
229
|
-
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
230
|
-
indicator === "dashed",
|
|
231
|
-
"my-0.5": nestLabel && indicator === "dashed",
|
|
232
|
-
},
|
|
233
|
-
)}
|
|
234
|
-
style={
|
|
235
|
-
{
|
|
236
|
-
"--color-bg": indicatorColor,
|
|
237
|
-
"--color-border": indicatorColor,
|
|
238
|
-
} as React.CSSProperties
|
|
239
|
-
}
|
|
240
|
-
/>
|
|
241
|
-
)
|
|
242
|
-
)}
|
|
243
|
-
<div
|
|
244
|
-
className={cn(
|
|
245
|
-
"flex flex-1 justify-between leading-none",
|
|
246
|
-
nestLabel ? "items-end" : "items-center",
|
|
247
|
-
)}
|
|
248
|
-
>
|
|
249
|
-
<div className="grid gap-1.5">
|
|
250
|
-
{nestLabel ? tooltipLabel : null}
|
|
251
|
-
<span className="text-muted-foreground">
|
|
252
|
-
{itemConfig?.label || item.name}
|
|
253
|
-
</span>
|
|
254
|
-
</div>
|
|
255
|
-
{item.value && (
|
|
256
|
-
<span className="font-mono font-medium tabular-nums text-foreground">
|
|
257
|
-
{item.value.toLocaleString()}
|
|
258
|
-
</span>
|
|
259
|
-
)}
|
|
260
|
-
</div>
|
|
261
|
-
</>
|
|
262
|
-
)}
|
|
263
|
-
</div>
|
|
264
|
-
);
|
|
265
|
-
})}
|
|
266
|
-
</div>
|
|
267
|
-
</div>
|
|
268
|
-
);
|
|
269
|
-
},
|
|
270
|
-
);
|
|
271
|
-
ChartTooltipContent.displayName = "ChartTooltip";
|
|
272
|
-
|
|
273
|
-
const ChartLegend = RechartsPrimitive.Legend;
|
|
274
|
-
|
|
275
|
-
const ChartLegendContent = React.forwardRef<
|
|
276
|
-
HTMLDivElement,
|
|
277
|
-
React.ComponentProps<"div"> & {
|
|
278
|
-
payload?: Array<{
|
|
279
|
-
value: string;
|
|
280
|
-
color?: string;
|
|
281
|
-
dataKey?: string | number;
|
|
282
|
-
type?: string;
|
|
283
|
-
}>;
|
|
284
|
-
verticalAlign?: "top" | "bottom";
|
|
285
|
-
} & {
|
|
286
|
-
hideIcon?: boolean;
|
|
287
|
-
nameKey?: string;
|
|
288
|
-
}
|
|
289
|
-
>(
|
|
290
|
-
(
|
|
291
|
-
{ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey },
|
|
292
|
-
ref,
|
|
293
|
-
) => {
|
|
294
|
-
const { config } = useChart();
|
|
295
|
-
|
|
296
|
-
if (!payload?.length) {
|
|
297
|
-
return null;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
return (
|
|
301
|
-
<div
|
|
302
|
-
ref={ref}
|
|
303
|
-
className={cn(
|
|
304
|
-
"flex items-center justify-center gap-4",
|
|
305
|
-
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
306
|
-
className,
|
|
307
|
-
)}
|
|
308
|
-
>
|
|
309
|
-
{payload.map((item) => {
|
|
310
|
-
const key = `${nameKey || item.dataKey || "value"}`;
|
|
311
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
312
|
-
|
|
313
|
-
return (
|
|
314
|
-
<div
|
|
315
|
-
key={item.value}
|
|
316
|
-
className={cn(
|
|
317
|
-
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground",
|
|
318
|
-
)}
|
|
319
|
-
>
|
|
320
|
-
{itemConfig?.icon && !hideIcon ? (
|
|
321
|
-
<itemConfig.icon />
|
|
322
|
-
) : (
|
|
323
|
-
<div
|
|
324
|
-
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
325
|
-
style={{
|
|
326
|
-
backgroundColor: item.color,
|
|
327
|
-
}}
|
|
328
|
-
/>
|
|
329
|
-
)}
|
|
330
|
-
{itemConfig?.label}
|
|
331
|
-
</div>
|
|
332
|
-
);
|
|
333
|
-
})}
|
|
334
|
-
</div>
|
|
335
|
-
);
|
|
336
|
-
},
|
|
337
|
-
);
|
|
338
|
-
ChartLegendContent.displayName = "ChartLegend";
|
|
339
|
-
|
|
340
|
-
// Helper to extract item config from a payload.
|
|
341
|
-
function getPayloadConfigFromPayload(
|
|
342
|
-
config: ChartConfig,
|
|
343
|
-
payload: unknown,
|
|
344
|
-
key: string,
|
|
345
|
-
) {
|
|
346
|
-
if (typeof payload !== "object" || payload === null) {
|
|
347
|
-
return undefined;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
const payloadPayload =
|
|
351
|
-
"payload" in payload &&
|
|
352
|
-
typeof payload.payload === "object" &&
|
|
353
|
-
payload.payload !== null
|
|
354
|
-
? payload.payload
|
|
355
|
-
: undefined;
|
|
356
|
-
|
|
357
|
-
let configLabelKey: string = key;
|
|
358
|
-
|
|
359
|
-
if (
|
|
360
|
-
key in payload &&
|
|
361
|
-
typeof payload[key as keyof typeof payload] === "string"
|
|
362
|
-
) {
|
|
363
|
-
configLabelKey = payload[key as keyof typeof payload] as string;
|
|
364
|
-
} else if (
|
|
365
|
-
payloadPayload &&
|
|
366
|
-
key in payloadPayload &&
|
|
367
|
-
typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
|
|
368
|
-
) {
|
|
369
|
-
configLabelKey = payloadPayload[
|
|
370
|
-
key as keyof typeof payloadPayload
|
|
371
|
-
] as string;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
return configLabelKey in config
|
|
375
|
-
? config[configLabelKey]
|
|
376
|
-
: config[key as keyof typeof config];
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export {
|
|
380
|
-
ChartContainer,
|
|
381
|
-
ChartTooltip,
|
|
382
|
-
ChartTooltipContent,
|
|
383
|
-
ChartLegend,
|
|
384
|
-
ChartLegendContent,
|
|
385
|
-
ChartStyle,
|
|
386
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { useTheme } from "next-themes";
|
|
2
|
-
import { Toaster as Sonner } from "sonner";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils";
|
|
5
|
-
|
|
6
|
-
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
7
|
-
|
|
8
|
-
const toastWidthClasses =
|
|
9
|
-
"group-[.toaster]:!w-[var(--width)] group-[.toaster]:!min-w-[min(20rem,calc(100vw_-_2rem))] group-[.toaster]:!max-w-[var(--width)] group-[.toaster]:!gap-3 group-[.toaster]:!break-normal";
|
|
10
|
-
const toastContentClasses =
|
|
11
|
-
"group-[.toast]:!min-w-[min(16rem,calc(100vw_-_14rem))] group-[.toast]:!flex-1 group-[.toast]:!basis-auto group-[.toast]:break-words";
|
|
12
|
-
const toastButtonClasses =
|
|
13
|
-
"group-[.toast]:!shrink-0 group-[.toast]:!whitespace-nowrap";
|
|
14
|
-
|
|
15
|
-
const Toaster = ({ className, toastOptions, ...props }: ToasterProps) => {
|
|
16
|
-
const { theme = "system" } = useTheme();
|
|
17
|
-
const classNames = toastOptions?.classNames;
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Sonner
|
|
21
|
-
theme={theme as ToasterProps["theme"]}
|
|
22
|
-
className={cn(
|
|
23
|
-
"toaster group [--width:min(36rem,calc(100vw_-_2rem))]",
|
|
24
|
-
className,
|
|
25
|
-
)}
|
|
26
|
-
toastOptions={{
|
|
27
|
-
...toastOptions,
|
|
28
|
-
classNames: {
|
|
29
|
-
...classNames,
|
|
30
|
-
toast: cn(
|
|
31
|
-
toastWidthClasses,
|
|
32
|
-
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
33
|
-
classNames?.toast,
|
|
34
|
-
),
|
|
35
|
-
title: cn("group-[.toast]:break-words", classNames?.title),
|
|
36
|
-
description: cn(
|
|
37
|
-
"group-[.toast]:break-words group-[.toast]:text-muted-foreground",
|
|
38
|
-
classNames?.description,
|
|
39
|
-
),
|
|
40
|
-
content: cn(toastContentClasses, classNames?.content),
|
|
41
|
-
actionButton: cn(
|
|
42
|
-
toastButtonClasses,
|
|
43
|
-
"group-[.toast]:!bg-transparent group-[.toast]:!text-[hsl(210,80%,65%)] group-[.toast]:!text-[13px] group-[.toast]:!font-bold group-[.toast]:!tracking-normal group-[.toast]:!px-0 group-[.toast]:!ms-4 group-[.toast]:hover:!text-[hsl(210,80%,75%)]",
|
|
44
|
-
classNames?.actionButton,
|
|
45
|
-
),
|
|
46
|
-
cancelButton: cn(
|
|
47
|
-
toastButtonClasses,
|
|
48
|
-
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
49
|
-
classNames?.cancelButton,
|
|
50
|
-
),
|
|
51
|
-
},
|
|
52
|
-
}}
|
|
53
|
-
{...props}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export { Toaster };
|