orcheo-studio 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bumpversion.cfg +14 -0
- package/.eslintrc +1 -0
- package/CHANGELOG.md +32 -0
- package/README.md +60 -0
- package/bin/orcheo-studio.js +39 -0
- package/components.json +21 -0
- package/dist/assets/arc-BbeTokFd.js +1 -0
- package/dist/assets/architectureDiagram-VXUJARFQ-CN00R9LC.js +36 -0
- package/dist/assets/avatar-01-CIAd4XAq.svg +1 -0
- package/dist/assets/avatar-02-BkgLJWQZ.svg +1 -0
- package/dist/assets/avatar-03-DVVcnD3b.svg +1 -0
- package/dist/assets/avatar-04-ydqFTDdh.svg +1 -0
- package/dist/assets/avatar-05-CSIhgJow.svg +1 -0
- package/dist/assets/avatar-06-B-h1Nz9Y.svg +1 -0
- package/dist/assets/avatar-07-BgkDZuBW.svg +1 -0
- package/dist/assets/avatar-08-C5KZjVH6.svg +1 -0
- package/dist/assets/avatar-09-2EGeSlPh.svg +1 -0
- package/dist/assets/avatar-10-DRf4ZGD2.svg +1 -0
- package/dist/assets/avatar-11-CEzBCpib.svg +1 -0
- package/dist/assets/avatar-12-COVngNEy.svg +1 -0
- package/dist/assets/avatar-13-D1i1tZVO.svg +1 -0
- package/dist/assets/avatar-14-B68CNAEs.svg +1 -0
- package/dist/assets/avatar-15-B9NsRNUX.svg +1 -0
- package/dist/assets/avatar-16-DQ_JJRGR.svg +1 -0
- package/dist/assets/avatar-17-DfDJkGv5.svg +1 -0
- package/dist/assets/avatar-18-BuxiqOaJ.svg +1 -0
- package/dist/assets/avatar-19-C2mJfrwW.svg +1 -0
- package/dist/assets/avatar-20-DPE_yE1a.svg +1 -0
- package/dist/assets/avatar-21-DbB0Lj6t.svg +1 -0
- package/dist/assets/blockDiagram-VD42YOAC-BPpieIRz.js +122 -0
- package/dist/assets/c4Diagram-YG6GDRKO-DAhuY1fj.js +10 -0
- package/dist/assets/channel-DtVQHWfl.js +1 -0
- package/dist/assets/chunk-4BX2VUAB-7RJQCroR.js +1 -0
- package/dist/assets/chunk-55IACEB6-CEN5yOA_.js +1 -0
- package/dist/assets/chunk-B4BG7PRW-vdlAz_3Q.js +165 -0
- package/dist/assets/chunk-DI55MBZ5-BTmKjGVg.js +220 -0
- package/dist/assets/chunk-FMBD7UC4-CwWvFfrg.js +15 -0
- package/dist/assets/chunk-QN33PNHL-XH90lUUN.js +1 -0
- package/dist/assets/chunk-QZHKN3VN-DMoMVES0.js +1 -0
- package/dist/assets/chunk-TZMSLE5B-Bx2XTXDY.js +1 -0
- package/dist/assets/classDiagram-2ON5EDUG-pw6P8q-u.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-pw6P8q-u.js +1 -0
- package/dist/assets/clone-DJq6GzHg.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-DS1MNwZB.js +1 -0
- package/dist/assets/cytoscape.esm-BQaXIfA_.js +331 -0
- package/dist/assets/dagre-6UL2VRFP-DdklXSXB.js +4 -0
- package/dist/assets/defaultLocale-C4B-KCzX.js +1 -0
- package/dist/assets/diagram-PSM6KHXK-BKBo8pqg.js +24 -0
- package/dist/assets/diagram-QEK2KX5R-DaavZhFO.js +43 -0
- package/dist/assets/diagram-S2PKOQOG-DkTwknYd.js +24 -0
- package/dist/assets/erDiagram-Q2GNP2WA-ClR5qEsI.js +60 -0
- package/dist/assets/flowDiagram-NV44I4VS-Cxt_sJHB.js +162 -0
- package/dist/assets/ganttDiagram-JELNMOA3-CIbs3JPJ.js +267 -0
- package/dist/assets/gitGraphDiagram-V2S2FVAM-DmqLh_uo.js +65 -0
- package/dist/assets/graph-zo28rS-a.js +1 -0
- package/dist/assets/index-B0_h2wCA.css +1 -0
- package/dist/assets/index-Be29_rJf.js +775 -0
- package/dist/assets/infoDiagram-HS3SLOUP-D9_rMkAf.js +2 -0
- package/dist/assets/init-Gi6I4Gst.js +1 -0
- package/dist/assets/isUndefined-C59bc74c.js +1 -0
- package/dist/assets/journeyDiagram-XKPGCS4Q-4ZuggLXE.js +139 -0
- package/dist/assets/kanban-definition-3W4ZIXB7-BQDNrhHL.js +89 -0
- package/dist/assets/katex-CBSAILhF.js +261 -0
- package/dist/assets/layout-CXbNm-Yo.js +1 -0
- package/dist/assets/linear-DQWATg1F.js +1 -0
- package/dist/assets/min-DJjRzMm8.js +1 -0
- package/dist/assets/mindmap-definition-VGOIOE7T-DiZQmsHT.js +68 -0
- package/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/assets/pieDiagram-ADFJNKIX-Bkju7jCD.js +30 -0
- package/dist/assets/quadrantDiagram-AYHSOK5B-CIB47UvU.js +7 -0
- package/dist/assets/requirementDiagram-UZGBJVZJ-BSB3uACk.js +64 -0
- package/dist/assets/sankeyDiagram-TZEHDZUN-rB8wD2kd.js +10 -0
- package/dist/assets/sequenceDiagram-WL72ISMW-Cd9s3Q_1.js +145 -0
- package/dist/assets/stateDiagram-FKZM4ZOC-zAxtjcM9.js +1 -0
- package/dist/assets/stateDiagram-v2-4FDKWEC3-C4DctH65.js +1 -0
- package/dist/assets/timeline-definition-IT6M3QCI-Et89F1F3.js +61 -0
- package/dist/assets/treemap-GDKQZRPO-6mZVX2Gv.js +162 -0
- package/dist/assets/xychartDiagram-PRI3JC2R-CgyY8dNz.js +7 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +19 -0
- package/dist/robots.txt +2 -0
- package/eslint.config.js +49 -0
- package/index.html +18 -0
- package/package.json +183 -0
- package/postcss.config.js +6 -0
- package/public/favicon.ico +0 -0
- package/public/robots.txt +2 -0
- package/src/App.tsx +115 -0
- package/src/assets/avatars/avatar-01.svg +1 -0
- package/src/assets/avatars/avatar-02.svg +1 -0
- package/src/assets/avatars/avatar-03.svg +1 -0
- package/src/assets/avatars/avatar-04.svg +1 -0
- package/src/assets/avatars/avatar-05.svg +1 -0
- package/src/assets/avatars/avatar-06.svg +1 -0
- package/src/assets/avatars/avatar-07.svg +1 -0
- package/src/assets/avatars/avatar-08.svg +1 -0
- package/src/assets/avatars/avatar-09.svg +1 -0
- package/src/assets/avatars/avatar-10.svg +1 -0
- package/src/assets/avatars/avatar-11.svg +1 -0
- package/src/assets/avatars/avatar-12.svg +1 -0
- package/src/assets/avatars/avatar-13.svg +1 -0
- package/src/assets/avatars/avatar-14.svg +1 -0
- package/src/assets/avatars/avatar-15.svg +1 -0
- package/src/assets/avatars/avatar-16.svg +1 -0
- package/src/assets/avatars/avatar-17.svg +1 -0
- package/src/assets/avatars/avatar-18.svg +1 -0
- package/src/assets/avatars/avatar-19.svg +1 -0
- package/src/assets/avatars/avatar-20.svg +1 -0
- package/src/assets/avatars/avatar-21.svg +1 -0
- package/src/assets/avatars/index.ts +99 -0
- package/src/design-system/ui/alert-dialog.tsx +141 -0
- package/src/design-system/ui/alert.tsx +59 -0
- package/src/design-system/ui/avatar.tsx +51 -0
- package/src/design-system/ui/badge.tsx +38 -0
- package/src/design-system/ui/button.tsx +59 -0
- package/src/design-system/ui/card.tsx +83 -0
- package/src/design-system/ui/dialog.tsx +122 -0
- package/src/design-system/ui/dropdown-menu.tsx +201 -0
- package/src/design-system/ui/input.tsx +22 -0
- package/src/design-system/ui/label.tsx +26 -0
- package/src/design-system/ui/scroll-area.tsx +48 -0
- package/src/design-system/ui/select.tsx +159 -0
- package/src/design-system/ui/separator.tsx +31 -0
- package/src/design-system/ui/sheet.tsx +141 -0
- package/src/design-system/ui/skeleton.tsx +15 -0
- package/src/design-system/ui/switch.tsx +29 -0
- package/src/design-system/ui/table.tsx +120 -0
- package/src/design-system/ui/tabs.tsx +55 -0
- package/src/design-system/ui/textarea.tsx +22 -0
- package/src/design-system/ui/toast.tsx +132 -0
- package/src/design-system/ui/toaster.tsx +35 -0
- package/src/design-system/ui/toggle-group.tsx +61 -0
- package/src/design-system/ui/toggle.tsx +46 -0
- package/src/design-system/ui/tooltip.tsx +32 -0
- package/src/features/MODULES.md +199 -0
- package/src/features/account/components/settings/appearance-settings-tab.tsx +24 -0
- package/src/features/account/components/theme-settings.tsx +70 -0
- package/src/features/account/components/use-theme-preferences.ts +106 -0
- package/src/features/account/pages/profile/components/profile-general-tab.tsx +89 -0
- package/src/features/account/pages/profile/types.ts +7 -0
- package/src/features/account/pages/profile.tsx +71 -0
- package/src/features/account/pages/service-tokens.tsx +522 -0
- package/src/features/account/pages/settings.tsx +42 -0
- package/src/features/account/pages/workspace-management.tsx +63 -0
- package/src/features/account/pages/workspace-members.tsx +335 -0
- package/src/features/auth/components/auto-login.tsx +51 -0
- package/src/features/auth/components/require-auth.tsx +56 -0
- package/src/features/auth/lib/auth-session.ts +448 -0
- package/src/features/auth/lib/oidc-client.ts +565 -0
- package/src/features/auth/pages/login.tsx +24 -0
- package/src/features/auth/pages/oauth-callback.tsx +63 -0
- package/src/features/chatkit/components/chatkit-surface.tsx +60 -0
- package/src/features/chatkit/components/public-chat-config.ts +70 -0
- package/src/features/chatkit/components/public-chat-error-boundary.tsx +74 -0
- package/src/features/chatkit/components/public-chat-widget.tsx +150 -0
- package/src/features/chatkit/components/studio-chat-bubble.tsx +451 -0
- package/src/features/chatkit/lib/chatkit-attachments.ts +31 -0
- package/src/features/chatkit/lib/chatkit-client.ts +195 -0
- package/src/features/chatkit/lib/chatkit-theme.ts +20 -0
- package/src/features/chatkit/lib/telemetry.ts +29 -0
- package/src/features/chatkit/lib/workflow-session.ts +70 -0
- package/src/features/chatkit/pages/public-chat.tsx +445 -0
- package/src/features/shared/components/chat-interface-options.ts +325 -0
- package/src/features/shared/components/chat-interface.types.ts +47 -0
- package/src/features/shared/components/top-navigation/account-menu.tsx +172 -0
- package/src/features/shared/components/top-navigation/active-workspace-indicator.tsx +280 -0
- package/src/features/shared/components/top-navigation/studio-brand.tsx +59 -0
- package/src/features/shared/components/top-navigation/top-navigation-types.ts +22 -0
- package/src/features/shared/components/top-navigation/version-status.tsx +280 -0
- package/src/features/shared/components/top-navigation.tsx +42 -0
- package/src/features/shared/components/workspace-bootstrap-gate.tsx +235 -0
- package/src/features/workflow/components/dialogs/add-credential-dialog.tsx +245 -0
- package/src/features/workflow/components/dialogs/confirm-delete-workflow-dialog.tsx +52 -0
- package/src/features/workflow/components/dialogs/credential-access-badge.tsx +34 -0
- package/src/features/workflow/components/dialogs/credential-status-badge.tsx +45 -0
- package/src/features/workflow/components/dialogs/credentials-table.tsx +453 -0
- package/src/features/workflow/components/dialogs/credentials-vault.tsx +85 -0
- package/src/features/workflow/components/dialogs/edit-credential-dialog.tsx +264 -0
- package/src/features/workflow/components/dialogs/update-workflow-dialog.tsx +214 -0
- package/src/features/workflow/components/dialogs/upload-workflow-dialog.tsx +288 -0
- package/src/features/workflow/components/forms/schema-config-form.tsx +41 -0
- package/src/features/workflow/components/layouts/sidebar-layout.tsx +288 -0
- package/src/features/workflow/components/layouts/use-sidebar-resize.ts +164 -0
- package/src/features/workflow/components/layouts/workflow-page-layout.tsx +69 -0
- package/src/features/workflow/components/panels/json-object-field.tsx +138 -0
- package/src/features/workflow/components/panels/rjsf-basic-widgets.tsx +21 -0
- package/src/features/workflow/components/panels/rjsf-input-widgets.tsx +105 -0
- package/src/features/workflow/components/panels/rjsf-templates.tsx +147 -0
- package/src/features/workflow/components/panels/rjsf-text-widgets.tsx +139 -0
- package/src/features/workflow/components/panels/rjsf-theme.tsx +10 -0
- package/src/features/workflow/components/panels/schema-dnd.ts +79 -0
- package/src/features/workflow/components/panels/workflow-diff-dialog.tsx +207 -0
- package/src/features/workflow/components/panels/workflow-history-filters.tsx +62 -0
- package/src/features/workflow/components/panels/workflow-history-footer.tsx +28 -0
- package/src/features/workflow/components/panels/workflow-history-header.tsx +47 -0
- package/src/features/workflow/components/panels/workflow-history-table.tsx +148 -0
- package/src/features/workflow/components/panels/workflow-history.tsx +150 -0
- package/src/features/workflow/components/panels/workflow-tabs.tsx +29 -0
- package/src/features/workflow/components/trace/agent-prism/Avatar.tsx +146 -0
- package/src/features/workflow/components/trace/agent-prism/Badge.tsx +95 -0
- package/src/features/workflow/components/trace/agent-prism/BrandLogo.tsx +102 -0
- package/src/features/workflow/components/trace/agent-prism/Button.tsx +124 -0
- package/src/features/workflow/components/trace/agent-prism/CollapseAndExpandControls.tsx +45 -0
- package/src/features/workflow/components/trace/agent-prism/CollapsibleSection.tsx +124 -0
- package/src/features/workflow/components/trace/agent-prism/CopyButton.tsx +63 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsView.tsx +146 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewAttributesTab.tsx +125 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewContentViewer.tsx +51 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewHeader.tsx +100 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewInputOutputTab.tsx +401 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewJsonOutput.tsx +33 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewRawDataTab.tsx +27 -0
- package/src/features/workflow/components/trace/agent-prism/IconButton.tsx +75 -0
- package/src/features/workflow/components/trace/agent-prism/PriceBadge.tsx +14 -0
- package/src/features/workflow/components/trace/agent-prism/SearchInput.tsx +17 -0
- package/src/features/workflow/components/trace/agent-prism/SpanBadge.tsx +54 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCard.tsx +480 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardBadges.tsx +23 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardConnector.tsx +36 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardTimeline.tsx +60 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardToggle.tsx +39 -0
- package/src/features/workflow/components/trace/agent-prism/SpanStatus.tsx +80 -0
- package/src/features/workflow/components/trace/agent-prism/TabSelector.tsx +35 -0
- package/src/features/workflow/components/trace/agent-prism/Tabs.tsx +140 -0
- package/src/features/workflow/components/trace/agent-prism/TextInput.tsx +143 -0
- package/src/features/workflow/components/trace/agent-prism/TimestampBadge.tsx +22 -0
- package/src/features/workflow/components/trace/agent-prism/TokensBadge.tsx +27 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceList.tsx +123 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceListItem.tsx +86 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceListItemHeader.tsx +37 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewer.tsx +208 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerDesktopLayout.tsx +99 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerMobileLayout.tsx +103 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerPlaceholder.tsx +5 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerSearchAndControls.tsx +30 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerTreeViewContainer.tsx +76 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/useTraceSelection.ts +186 -0
- package/src/features/workflow/components/trace/agent-prism/TreeView.tsx +73 -0
- package/src/features/workflow/components/trace/agent-prism/index.ts +7 -0
- package/src/features/workflow/components/trace/agent-prism/shared.ts +170 -0
- package/src/features/workflow/components/trace/agent-prism/theme/index.ts +101 -0
- package/src/features/workflow/components/trace/agent-prism/theme/theme.css +247 -0
- package/src/features/workflow/data/templates/assets/vibe-agent/config.json +5 -0
- package/src/features/workflow/data/templates/candidate-badges.ts +138 -0
- package/src/features/workflow/data/templates/index.ts +29 -0
- package/src/features/workflow/data/templates/template-definition.ts +77 -0
- package/src/features/workflow/data/templates/template-owner.ts +7 -0
- package/src/features/workflow/data/workflow-data.ts +8 -0
- package/src/features/workflow/data/workflow-types.ts +57 -0
- package/src/features/workflow/lib/mermaid-renderer.ts +334 -0
- package/src/features/workflow/lib/workflow-diff.ts +191 -0
- package/src/features/workflow/lib/workflow-execution-builders.ts +103 -0
- package/src/features/workflow/lib/workflow-execution-formatters.ts +145 -0
- package/src/features/workflow/lib/workflow-execution-storage.ts +63 -0
- package/src/features/workflow/lib/workflow-execution.types.ts +80 -0
- package/src/features/workflow/lib/workflow-storage-api.ts +581 -0
- package/src/features/workflow/lib/workflow-storage-helpers.ts +373 -0
- package/src/features/workflow/lib/workflow-storage-versioning.ts +127 -0
- package/src/features/workflow/lib/workflow-storage.constants.ts +21 -0
- package/src/features/workflow/lib/workflow-storage.ts +482 -0
- package/src/features/workflow/lib/workflow-storage.types.ts +261 -0
- package/src/features/workflow/pages/workflow/components/settings-tab-content.tsx +428 -0
- package/src/features/workflow/pages/workflow/components/trace-tab-content.tsx +183 -0
- package/src/features/workflow/pages/workflow/components/workflow-config-sheet.tsx +207 -0
- package/src/features/workflow/pages/workflow/components/workflow-config-sheet.utils.ts +275 -0
- package/src/features/workflow/pages/workflow/components/workflow-layout.tsx +143 -0
- package/src/features/workflow/pages/workflow/components/workflow-tab-content.tsx +766 -0
- package/src/features/workflow/pages/workflow/handlers/credentials.ts +338 -0
- package/src/features/workflow/pages/workflow/helpers/execution.ts +39 -0
- package/src/features/workflow/pages/workflow/helpers/trace.ts +838 -0
- package/src/features/workflow/pages/workflow/helpers/types.ts +28 -0
- package/src/features/workflow/pages/workflow/hooks/controller/build-layout-props.ts +171 -0
- package/src/features/workflow/pages/workflow/hooks/controller/use-workflow-controller.ts +19 -0
- package/src/features/workflow/pages/workflow/hooks/controller/use-workflow-core.ts +84 -0
- package/src/features/workflow/pages/workflow/hooks/controller/use-workflow-execution-controller.ts +167 -0
- package/src/features/workflow/pages/workflow/hooks/controller/use-workflow-lifecycle.ts +37 -0
- package/src/features/workflow/pages/workflow/hooks/controller/use-workflow-resources.ts +57 -0
- package/src/features/workflow/pages/workflow/hooks/execution-log-helpers.ts +75 -0
- package/src/features/workflow/pages/workflow/hooks/execution-node-status.ts +46 -0
- package/src/features/workflow/pages/workflow/hooks/execution-record-updater.ts +119 -0
- package/src/features/workflow/pages/workflow/hooks/execution-record.ts +31 -0
- package/src/features/workflow/pages/workflow/hooks/execution-runtime-updates.ts +96 -0
- package/src/features/workflow/pages/workflow/hooks/use-execution-trace.ts +512 -0
- package/src/features/workflow/pages/workflow/hooks/use-execution-updates.ts +125 -0
- package/src/features/workflow/pages/workflow/hooks/use-pause-workflow.ts +70 -0
- package/src/features/workflow/pages/workflow/hooks/use-studio-ui-state.ts +10 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-chat.ts +212 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-credential-readiness.ts +72 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-credentials.ts +167 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-execution-state.ts +20 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-listeners.ts +182 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-loader.ts +236 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-metadata-state.ts +56 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-saver.ts +191 -0
- package/src/features/workflow/pages/workflow/hooks/use-workflow-storage-listener.ts +81 -0
- package/src/features/workflow/pages/workflow/hooks/workflow-runner-websocket.ts +150 -0
- package/src/features/workflow/pages/workflow-gallery/types.ts +3 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery-actions.ts +223 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery-state.ts +206 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery.ts +14 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-card-size.ts +8 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-card.tsx +327 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-gallery-tabs.tsx +173 -0
- package/src/features/workflow/pages/workflow-gallery.tsx +96 -0
- package/src/features/workflow/pages/workflow.tsx +119 -0
- package/src/features/workflow/types/credential-vault.ts +52 -0
- package/src/hooks/browser-context-provider.tsx +19 -0
- package/src/hooks/use-browser-context.ts +188 -0
- package/src/hooks/use-color-scheme.ts +77 -0
- package/src/hooks/use-credential-vault.ts +442 -0
- package/src/hooks/use-page-context.ts +39 -0
- package/src/hooks/use-toast.ts +182 -0
- package/src/hooks/use-uploads-allowed.ts +28 -0
- package/src/index.css +95 -0
- package/src/lib/api.ts +445 -0
- package/src/lib/auth-fetch.ts +35 -0
- package/src/lib/config.ts +102 -0
- package/src/lib/theme.ts +109 -0
- package/src/lib/utils.ts +6 -0
- package/src/lib/workspace-routing.ts +67 -0
- package/src/lib/workspace-session.ts +66 -0
- package/src/lib/workspace-slug.ts +10 -0
- package/src/main.tsx +28 -0
- package/src/vite-env.d.ts +17 -0
- package/tailwind.config.js +153 -0
- package/tsconfig.app.json +30 -0
- package/tsconfig.json +16 -0
- package/tsconfig.node.json +21 -0
- package/vite.config.ts +122 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
|
+
import { X } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
import { cn } from "@/lib/utils";
|
|
9
|
+
|
|
10
|
+
const ToastProvider = ToastPrimitives.Provider;
|
|
11
|
+
|
|
12
|
+
const ToastViewport = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof ToastPrimitives.Viewport>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
|
|
15
|
+
>(({ className, ...props }, ref) => (
|
|
16
|
+
<ToastPrimitives.Viewport
|
|
17
|
+
ref={ref}
|
|
18
|
+
className={cn(
|
|
19
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
));
|
|
25
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
26
|
+
|
|
27
|
+
const toastVariants = cva(
|
|
28
|
+
"group pointer-events-auto relative flex w-full select-text items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
variant: {
|
|
32
|
+
default: "border bg-background text-foreground",
|
|
33
|
+
destructive:
|
|
34
|
+
"destructive group border-destructive bg-destructive text-destructive-foreground",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "default",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const Toast = React.forwardRef<
|
|
44
|
+
React.ElementRef<typeof ToastPrimitives.Root>,
|
|
45
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
|
46
|
+
VariantProps<typeof toastVariants>
|
|
47
|
+
>(({ className, variant, ...props }, ref) => {
|
|
48
|
+
return (
|
|
49
|
+
<ToastPrimitives.Root
|
|
50
|
+
ref={ref}
|
|
51
|
+
className={cn(toastVariants({ variant }), className)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
57
|
+
|
|
58
|
+
const ToastAction = React.forwardRef<
|
|
59
|
+
React.ElementRef<typeof ToastPrimitives.Action>,
|
|
60
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
|
|
61
|
+
>(({ className, ...props }, ref) => (
|
|
62
|
+
<ToastPrimitives.Action
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn(
|
|
65
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
66
|
+
className,
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
));
|
|
71
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
72
|
+
|
|
73
|
+
const ToastClose = React.forwardRef<
|
|
74
|
+
React.ElementRef<typeof ToastPrimitives.Close>,
|
|
75
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
|
|
76
|
+
>(({ className, ...props }, ref) => (
|
|
77
|
+
<ToastPrimitives.Close
|
|
78
|
+
ref={ref}
|
|
79
|
+
className={cn(
|
|
80
|
+
"absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
81
|
+
className,
|
|
82
|
+
)}
|
|
83
|
+
toast-close=""
|
|
84
|
+
{...props}
|
|
85
|
+
>
|
|
86
|
+
<X className="h-4 w-4" />
|
|
87
|
+
</ToastPrimitives.Close>
|
|
88
|
+
));
|
|
89
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
90
|
+
|
|
91
|
+
const ToastTitle = React.forwardRef<
|
|
92
|
+
React.ElementRef<typeof ToastPrimitives.Title>,
|
|
93
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
|
|
94
|
+
>(({ className, ...props }, ref) => (
|
|
95
|
+
<ToastPrimitives.Title
|
|
96
|
+
ref={ref}
|
|
97
|
+
className={cn(
|
|
98
|
+
"select-text text-sm font-semibold [&+div]:text-xs",
|
|
99
|
+
className,
|
|
100
|
+
)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
));
|
|
104
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
105
|
+
|
|
106
|
+
const ToastDescription = React.forwardRef<
|
|
107
|
+
React.ElementRef<typeof ToastPrimitives.Description>,
|
|
108
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
|
|
109
|
+
>(({ className, ...props }, ref) => (
|
|
110
|
+
<ToastPrimitives.Description
|
|
111
|
+
ref={ref}
|
|
112
|
+
className={cn("select-text text-sm opacity-90", className)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
));
|
|
116
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
117
|
+
|
|
118
|
+
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
119
|
+
|
|
120
|
+
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
121
|
+
|
|
122
|
+
export {
|
|
123
|
+
type ToastProps,
|
|
124
|
+
type ToastActionElement,
|
|
125
|
+
ToastProvider,
|
|
126
|
+
ToastViewport,
|
|
127
|
+
Toast,
|
|
128
|
+
ToastTitle,
|
|
129
|
+
ToastDescription,
|
|
130
|
+
ToastClose,
|
|
131
|
+
ToastAction,
|
|
132
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useToast } from "@/hooks/use-toast";
|
|
4
|
+
import {
|
|
5
|
+
Toast,
|
|
6
|
+
ToastClose,
|
|
7
|
+
ToastDescription,
|
|
8
|
+
ToastProvider,
|
|
9
|
+
ToastTitle,
|
|
10
|
+
ToastViewport,
|
|
11
|
+
} from "@/design-system/ui/toast";
|
|
12
|
+
|
|
13
|
+
export function Toaster() {
|
|
14
|
+
const { toasts } = useToast();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<ToastProvider>
|
|
18
|
+
{toasts.map(function ({ id, title, description, action, ...props }) {
|
|
19
|
+
return (
|
|
20
|
+
<Toast key={id} {...props}>
|
|
21
|
+
<div className="grid gap-1">
|
|
22
|
+
{title && <ToastTitle>{title}</ToastTitle>}
|
|
23
|
+
{description && (
|
|
24
|
+
<ToastDescription>{description}</ToastDescription>
|
|
25
|
+
)}
|
|
26
|
+
</div>
|
|
27
|
+
{action}
|
|
28
|
+
<ToastClose />
|
|
29
|
+
</Toast>
|
|
30
|
+
);
|
|
31
|
+
})}
|
|
32
|
+
<ToastViewport />
|
|
33
|
+
</ToastProvider>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5
|
+
import { type VariantProps } from "class-variance-authority";
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
8
|
+
import { toggleVariants } from "@/design-system/ui/toggle";
|
|
9
|
+
|
|
10
|
+
const ToggleGroupContext = React.createContext<
|
|
11
|
+
VariantProps<typeof toggleVariants>
|
|
12
|
+
>({
|
|
13
|
+
size: "default",
|
|
14
|
+
variant: "default",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const ToggleGroup = React.forwardRef<
|
|
18
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
|
19
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
|
20
|
+
VariantProps<typeof toggleVariants>
|
|
21
|
+
>(({ className, variant, size, children, ...props }, ref) => (
|
|
22
|
+
<ToggleGroupPrimitive.Root
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn("flex items-center justify-center gap-1", className)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
28
|
+
{children}
|
|
29
|
+
</ToggleGroupContext.Provider>
|
|
30
|
+
</ToggleGroupPrimitive.Root>
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
34
|
+
|
|
35
|
+
const ToggleGroupItem = React.forwardRef<
|
|
36
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
|
38
|
+
VariantProps<typeof toggleVariants>
|
|
39
|
+
>(({ className, children, variant, size, ...props }, ref) => {
|
|
40
|
+
const context = React.useContext(ToggleGroupContext);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<ToggleGroupPrimitive.Item
|
|
44
|
+
ref={ref}
|
|
45
|
+
className={cn(
|
|
46
|
+
toggleVariants({
|
|
47
|
+
variant: context.variant || variant,
|
|
48
|
+
size: context.size || size,
|
|
49
|
+
}),
|
|
50
|
+
className,
|
|
51
|
+
)}
|
|
52
|
+
{...props}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</ToggleGroupPrimitive.Item>
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
60
|
+
|
|
61
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
8
|
+
|
|
9
|
+
const toggleVariants = cva(
|
|
10
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "bg-transparent",
|
|
15
|
+
outline:
|
|
16
|
+
"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "h-9 px-2 min-w-9",
|
|
20
|
+
sm: "h-8 px-1.5 min-w-8",
|
|
21
|
+
lg: "h-10 px-2.5 min-w-10",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const Toggle = React.forwardRef<
|
|
32
|
+
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
33
|
+
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
34
|
+
VariantProps<typeof toggleVariants>
|
|
35
|
+
>(({ className, variant, size, ...props }, ref) => (
|
|
36
|
+
<TogglePrimitive.Root
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
));
|
|
42
|
+
|
|
43
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
44
|
+
|
|
45
|
+
// eslint-disable-next-line react-refresh/only-export-components
|
|
46
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
9
|
+
|
|
10
|
+
const Tooltip = TooltipPrimitive.Root;
|
|
11
|
+
|
|
12
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
13
|
+
|
|
14
|
+
const TooltipContent = React.forwardRef<
|
|
15
|
+
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
16
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
17
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
18
|
+
<TooltipPrimitive.Portal>
|
|
19
|
+
<TooltipPrimitive.Content
|
|
20
|
+
ref={ref}
|
|
21
|
+
sideOffset={sideOffset}
|
|
22
|
+
className={cn(
|
|
23
|
+
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
</TooltipPrimitive.Portal>
|
|
29
|
+
));
|
|
30
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
31
|
+
|
|
32
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Studio Feature Modules
|
|
2
|
+
|
|
3
|
+
Each row corresponds to one source script (test files excluded).
|
|
4
|
+
|
|
5
|
+
| Module path (relative to `features/`) | Purpose |
|
|
6
|
+
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
|
7
|
+
| **account** | |
|
|
8
|
+
| `account/components/settings/agent-settings-tab.tsx` | Settings tab for managing external agent integrations (Claude Code, Codex, Gemini) and their login sessions. |
|
|
9
|
+
| `account/components/settings/appearance-settings-tab.tsx` | Settings tab for theme selection (light / dark / system). |
|
|
10
|
+
| `account/components/settings/theme-settings.tsx` | Button group UI for picking light, dark, or system theme. |
|
|
11
|
+
| `account/components/use-theme-preferences.ts` | Hook that reads and persists user theme, accent-colour, reduced-motion, and high-contrast preferences. |
|
|
12
|
+
| `account/pages/profile/profile-general-tab.tsx` | Profile tab displaying user avatar, name, email, role, and join date. |
|
|
13
|
+
| `account/pages/profile/types.ts` | `ProfileUser` interface (name, email, avatar, role, optional joinDate). |
|
|
14
|
+
| `account/pages/profile.tsx` | Profile page that composes the general-info tab and any additional settings tabs. |
|
|
15
|
+
| `account/pages/settings.tsx` | Settings page with tabs for agent integrations and appearance preferences. |
|
|
16
|
+
| `account/pages/workspace-members.tsx` | Tab content for listing and managing workspace members with role-based access control. |
|
|
17
|
+
| `account/pages/service-tokens.tsx` | Tab content for creating, rotating, and revoking workspace-scoped API keys used by the Orcheo SDK. |
|
|
18
|
+
| `account/pages/workspace-management.tsx` | Workspace Management page with tabs for members, external agents, and API keys. |
|
|
19
|
+
| `account/components/external-agents-section.tsx` | Section for connecting and managing per-workspace external agent CLIs (Claude Code, Codex, Gemini). |
|
|
20
|
+
| **auth** | |
|
|
21
|
+
| `auth/components/auto-login.tsx` | Initiates an OIDC login redirect automatically, forwarding org / invitation / hint query params. |
|
|
22
|
+
| `auth/components/require-auth.tsx` | Route guard that verifies auth state and refreshes tokens before rendering protected children. |
|
|
23
|
+
| `auth/lib/auth-session.ts` | Manages JWT tokens, user profile, and session state in `localStorage`; supports SSO. |
|
|
24
|
+
| `auth/lib/oidc-client.ts` | OIDC/OAuth2 client handling PKCE flow, token exchange, and session management. |
|
|
25
|
+
| `auth/pages/login.tsx` | Login page that parses invite-context params and mounts `AutoLogin`. |
|
|
26
|
+
| `auth/pages/oauth-callback.tsx` | OAuth callback handler that completes OIDC login, stores tokens, and redirects to the intended URL. |
|
|
27
|
+
| **chatkit** | |
|
|
28
|
+
| `chatkit/components/studio-chat-bubble.tsx` | Floating chat-bubble component for the workflow page, positioned above the React Flow minimap. |
|
|
29
|
+
| `chatkit/components/chatkit-surface.tsx` | Wrapper around the ChatKit library that handles custom action dispatching and error reporting. |
|
|
30
|
+
| `chatkit/components/public-chat-config.ts` | Builds ChatKit start-screen prompt and model-option configuration from workflow settings. |
|
|
31
|
+
| `chatkit/components/public-chat-error-boundary.tsx` | Error boundary that catches and gracefully displays errors inside the public chat widget. |
|
|
32
|
+
| `chatkit/components/public-chat-widget.tsx` | Public-facing ChatKit widget that wires up theme, auth, and workflow configuration. |
|
|
33
|
+
| `chatkit/lib/chatkit-client.ts` | HTTP client for ChatKit API requests with error handling and domain-key management. |
|
|
34
|
+
| `chatkit/lib/chatkit-theme.ts` | Builds a ChatKit UI theme from the current light/dark colour-scheme preference. |
|
|
35
|
+
| `chatkit/lib/telemetry.ts` | Dispatches telemetry events for ChatKit interactions (open, close, success, failure). |
|
|
36
|
+
| `chatkit/lib/workflow-session.ts` | Manages ChatKit workflow client-secrets with automatic refresh and retry logic. |
|
|
37
|
+
| `chatkit/pages/public-chat.tsx` | Public shareable chat page for a workflow, with theme switching and workflow metadata display. |
|
|
38
|
+
| **shared** | |
|
|
39
|
+
| `shared/components/chat-interface-options.ts` | Builds ChatKit initialisation options (API endpoint, auth, model config). |
|
|
40
|
+
| `shared/components/chat-interface.types.ts` | `ChatInterface` props and `ChatParticipant` types. |
|
|
41
|
+
| `shared/components/top-navigation/account-menu.tsx` | Dropdown menu for account settings, credentials, profile, workspace members, and logout. |
|
|
42
|
+
| `shared/components/top-navigation/active-workspace-indicator.tsx` | Displays the active workspace name and lets the user switch between workspaces. |
|
|
43
|
+
| `shared/components/top-navigation/studio-brand.tsx` | Brand logo linking to the gallery, with a beta status badge. |
|
|
44
|
+
| `shared/components/top-navigation/top-navigation-types.ts` | `TopNavigation` props interface (credentials, credential handlers). |
|
|
45
|
+
| `shared/components/top-navigation.tsx` | Top navigation bar: brand, workspace selector, version status, and account menu. |
|
|
46
|
+
| `shared/components/top-navigation/version-status.tsx` | Checks for and displays available Studio version updates, with result caching. |
|
|
47
|
+
| `shared/components/workspace-bootstrap-gate.tsx` | Ensures the user has at least one workspace, creating a default one if necessary, before rendering children. |
|
|
48
|
+
| **vibe** | |
|
|
49
|
+
| `vibe/components/vibe-authenticated-layout.tsx` | Main authenticated layout for Vibe: resizable sidebar with workspace bootstrap gate. |
|
|
50
|
+
| `vibe/components/vibe-sidebar.tsx` | Sidebar component for the Vibe agent-chat interface, including provider selection and chat surface. |
|
|
51
|
+
| `vibe/constants.ts` | Constants for Vibe sidebar dimensions, agent tag, workflow name, and participant metadata. |
|
|
52
|
+
| `vibe/context/vibe-context.ts` | React context definition for Vibe state (open status, providers, workflow ID, context string). |
|
|
53
|
+
| `vibe/context/vibe-provider.tsx` | Context provider managing Vibe state: agent list, workflow provisioning, and page context. |
|
|
54
|
+
| `vibe/hooks/use-vibe-agents.ts` | Fetches and caches external agent provider status with polling and transient-error handling. |
|
|
55
|
+
| `vibe/hooks/use-vibe-chat.ts` | Manages the Vibe chat session lifecycle including client-secret refresh and retry logic. |
|
|
56
|
+
| `vibe/hooks/use-vibe-context-string.ts` | Builds the context string that describes the user's current page location for the Vibe AI. |
|
|
57
|
+
| `vibe/hooks/use-vibe-workflow.ts` | Manages Vibe agent workflow provisioning, template synchronisation, and workspace storage. |
|
|
58
|
+
| `vibe/lib/vibe-models.ts` | Builds ChatKit model options for the Vibe composer based on available external agent providers. |
|
|
59
|
+
| **workflow / dialogs** | |
|
|
60
|
+
| `workflow/components/dialogs/add-credential-dialog.tsx` | Dialog for creating a new credential (name, provider, access level, secret). |
|
|
61
|
+
| `workflow/components/dialogs/confirm-delete-workflow-dialog.tsx` | Confirmation dialog for permanently deleting a workflow. |
|
|
62
|
+
| `workflow/components/dialogs/credential-access-badge.tsx` | Badge showing a credential's access level (scoped vs. shared). |
|
|
63
|
+
| `workflow/components/dialogs/credential-status-badge.tsx` | Badge indicating a credential's health status (healthy / unhealthy / unknown). |
|
|
64
|
+
| `workflow/components/dialogs/credentials-table.tsx` | Table listing credentials with status, access level, and edit/delete/reveal-secret actions. |
|
|
65
|
+
| `workflow/components/dialogs/credentials-vault.tsx` | Full credentials-vault UI: search, add, edit, and delete credentials. |
|
|
66
|
+
| `workflow/components/dialogs/edit-credential-dialog.tsx` | Dialog for editing an existing credential's name, provider, access level, and secrets. |
|
|
67
|
+
| `workflow/components/dialogs/update-workflow-dialog.tsx` | Dialog for uploading a new version of a workflow's script and configuration files. |
|
|
68
|
+
| `workflow/components/dialogs/upload-workflow-dialog.tsx` | Dialog for uploading a brand-new workflow with script and configuration files. |
|
|
69
|
+
| **workflow / forms & layouts** | |
|
|
70
|
+
| `workflow/components/forms/schema-config-form.tsx` | RJSF form wrapper for workflow runtime configuration, using custom widgets and templates. |
|
|
71
|
+
| `workflow/components/layouts/sidebar-layout.tsx` | Resizable two-panel layout with collapsible sidebar. |
|
|
72
|
+
| `workflow/components/layouts/use-sidebar-resize.ts` | Hook that handles sidebar drag-resize with min/max width constraints. |
|
|
73
|
+
| `workflow/components/layouts/workflow-page-layout.tsx` | Generic page scaffold with optional header and main-content areas. |
|
|
74
|
+
| **workflow / panels (RJSF & history)** | |
|
|
75
|
+
| `workflow/components/panels/rjsf-basic-widgets.tsx` | RJSF widgets for basic input types: text, number, checkbox, and select. |
|
|
76
|
+
| `workflow/components/panels/rjsf-input-widgets.tsx` | Primitive RJSF input widgets: number, checkbox, and select. |
|
|
77
|
+
| `workflow/components/panels/rjsf-templates.tsx` | RJSF field and array item templates controlling form layout and styling. |
|
|
78
|
+
| `workflow/components/panels/rjsf-text-widgets.tsx` | Text RJSF widgets (input, textarea) with schema drag-and-drop field insertion. |
|
|
79
|
+
| `workflow/components/panels/rjsf-theme.tsx` | RJSF theme wiring together custom widgets, templates, and validator. |
|
|
80
|
+
| `workflow/components/panels/schema-dnd.ts` | Drag-and-drop utilities for inserting `{{field}}` references from schema into text inputs. |
|
|
81
|
+
| `workflow/components/panels/workflow-diff-dialog.tsx` | Dialog that displays a human-readable diff between two workflow versions. |
|
|
82
|
+
| `workflow/components/panels/workflow-history-filters.tsx` | Filter bar for the workflow history panel (text search, version picker). |
|
|
83
|
+
| `workflow/components/panels/workflow-history-footer.tsx` | Pagination footer for the workflow version history list. |
|
|
84
|
+
| `workflow/components/panels/workflow-history-header.tsx` | Header with "Restore" and "Compare" buttons for the workflow history panel. |
|
|
85
|
+
| `workflow/components/panels/workflow-history-table.tsx` | Table of workflow versions with status badges, change summaries, and row selection. |
|
|
86
|
+
| `workflow/components/panels/workflow-history.tsx` | Assembled workflow history panel: filters, table, diff dialog, and restore action. |
|
|
87
|
+
| `workflow/components/panels/workflow-tabs.tsx` | Tab bar for switching between the workflow editor, trace, and settings views. |
|
|
88
|
+
| **workflow / trace components (agent-prism)** | |
|
|
89
|
+
| `workflow/components/trace/agent-prism/Avatar.tsx` | Avatar component for trace span categories with configurable sizes. |
|
|
90
|
+
| `workflow/components/trace/agent-prism/Badge.tsx` | Badge component for trace span attributes with optional icon. |
|
|
91
|
+
| `workflow/components/trace/agent-prism/BrandLogo.tsx` | Brand logo used inside the trace viewer. |
|
|
92
|
+
| `workflow/components/trace/agent-prism/Button.tsx` | Generic button used across trace viewer components. |
|
|
93
|
+
| `workflow/components/trace/agent-prism/CollapseAndExpandControls.tsx` | Controls for collapsing / expanding all trace tree nodes at once. |
|
|
94
|
+
| `workflow/components/trace/agent-prism/CollapsibleSection.tsx` | Reusable collapsible section wrapper for trace detail panels. |
|
|
95
|
+
| `workflow/components/trace/agent-prism/CopyButton.tsx` | Button that copies text content to the clipboard. |
|
|
96
|
+
| `workflow/components/trace/agent-prism/IconButton.tsx` | Icon-only button primitive used across the trace viewer. |
|
|
97
|
+
| `workflow/components/trace/agent-prism/PriceBadge.tsx` | Badge showing the cost of a trace span. |
|
|
98
|
+
| `workflow/components/trace/agent-prism/SearchInput.tsx` | Search input for filtering trace spans. |
|
|
99
|
+
| `workflow/components/trace/agent-prism/SpanBadge.tsx` | Badge that labels a span type or category. |
|
|
100
|
+
| `workflow/components/trace/agent-prism/SpanStatus.tsx` | Visual indicator for a span's execution status. |
|
|
101
|
+
| `workflow/components/trace/agent-prism/TabSelector.tsx` | Tab-selector control for the trace detail view panes. |
|
|
102
|
+
| `workflow/components/trace/agent-prism/Tabs.tsx` | Tabs container for the trace detail view. |
|
|
103
|
+
| `workflow/components/trace/agent-prism/TextInput.tsx` | Text input primitive used inside trace viewer forms. |
|
|
104
|
+
| `workflow/components/trace/agent-prism/TimestampBadge.tsx` | Badge displaying a span's start time or duration. |
|
|
105
|
+
| `workflow/components/trace/agent-prism/TokensBadge.tsx` | Badge showing LLM token counts for a span. |
|
|
106
|
+
| `workflow/components/trace/agent-prism/TreeView.tsx` | Recursive tree view component for rendering the span hierarchy. |
|
|
107
|
+
| `workflow/components/trace/agent-prism/DetailsView/DetailsView.tsx` | Container for the trace span detail panel with tabbed sub-views. |
|
|
108
|
+
| `workflow/components/trace/agent-prism/DetailsView/DetailsViewAttributesTab.tsx` | Attributes tab showing key/value metadata for a span. |
|
|
109
|
+
| `workflow/components/trace/agent-prism/DetailsView/DetailsViewContentViewer.tsx` | Generic content viewer for rendering span input/output data. |
|
|
110
|
+
| `workflow/components/trace/agent-prism/DetailsView/DetailsViewHeader.tsx` | Header for the span detail panel showing span name and status. |
|
|
111
|
+
| `workflow/components/trace/agent-prism/DetailsView/DetailsViewInputOutputTab.tsx` | Input/output tab rendering a span's request and response data. |
|
|
112
|
+
| `workflow/components/trace/agent-prism/DetailsView/DetailsViewJsonOutput.tsx` | JSON renderer used to display span output in the detail panel. |
|
|
113
|
+
| `workflow/components/trace/agent-prism/DetailsView/DetailsViewRawDataTab.tsx` | Raw-data tab showing the full unprocessed span payload. |
|
|
114
|
+
| `workflow/components/trace/agent-prism/SpanCard/SpanCard.tsx` | Card component that renders a single trace span inside the tree view. |
|
|
115
|
+
| `workflow/components/trace/agent-prism/SpanCard/SpanCardBadges.tsx` | Badge row on a span card (status, tokens, cost, duration). |
|
|
116
|
+
| `workflow/components/trace/agent-prism/SpanCard/SpanCardConnector.tsx` | Vertical connector line linking parent and child span cards in the tree. |
|
|
117
|
+
| `workflow/components/trace/agent-prism/SpanCard/SpanCardTimeline.tsx` | Horizontal timeline bar visualising a span's position and duration. |
|
|
118
|
+
| `workflow/components/trace/agent-prism/SpanCard/SpanCardToggle.tsx` | Expand/collapse toggle button on a span card. |
|
|
119
|
+
| `workflow/components/trace/agent-prism/TraceList/TraceList.tsx` | List of all traces for a workflow execution. |
|
|
120
|
+
| `workflow/components/trace/agent-prism/TraceList/TraceListItem.tsx` | Individual item in the trace list. |
|
|
121
|
+
| `workflow/components/trace/agent-prism/TraceList/TraceListItemHeader.tsx` | Header row for a trace list item (name, status, timestamp). |
|
|
122
|
+
| `workflow/components/trace/agent-prism/TraceViewer/TraceViewer.tsx` | Top-level trace viewer component integrating tree, detail, and search. |
|
|
123
|
+
| `workflow/components/trace/agent-prism/TraceViewer/TraceViewerDesktopLayout.tsx` | Desktop two-column layout for the trace viewer. |
|
|
124
|
+
| `workflow/components/trace/agent-prism/TraceViewer/TraceViewerMobileLayout.tsx` | Mobile single-column layout for the trace viewer. |
|
|
125
|
+
| `workflow/components/trace/agent-prism/TraceViewer/TraceViewerPlaceholder.tsx` | Empty-state placeholder shown when no trace is selected. |
|
|
126
|
+
| `workflow/components/trace/agent-prism/TraceViewer/TraceViewerSearchAndControls.tsx` | Search bar and collapse/expand controls for the trace viewer. |
|
|
127
|
+
| `workflow/components/trace/agent-prism/TraceViewer/TraceViewerTreeViewContainer.tsx` | Scrollable container wrapping the span tree view. |
|
|
128
|
+
| `workflow/components/trace/agent-prism/TraceViewer/useTraceSelection.ts` | Hook managing which trace and span are currently selected in the viewer. |
|
|
129
|
+
| `workflow/components/trace/agent-prism/index.ts` | Public barrel export for the agent-prism trace viewer library. |
|
|
130
|
+
| `workflow/components/trace/agent-prism/shared.ts` | Shared utilities and constants used across agent-prism components. |
|
|
131
|
+
| `workflow/components/trace/agent-prism/theme/index.ts` | Theme tokens and configuration for the agent-prism trace viewer. |
|
|
132
|
+
| **workflow / data & templates** | |
|
|
133
|
+
| `workflow/data/templates/candidate-badges.ts` | Types and utilities for workflow template candidate definitions. |
|
|
134
|
+
| `workflow/data/templates/index.ts` | Barrel export for the templates module. |
|
|
135
|
+
| `workflow/data/templates/template-definition.ts` | `WorkflowTemplate` type and related metadata types. |
|
|
136
|
+
| `workflow/data/templates/template-owner.ts` | Default template-owner constant. |
|
|
137
|
+
| `workflow/data/templates/vibe-agent.ts` | Built-in Vibe agent workflow template configuration. |
|
|
138
|
+
| `workflow/data/workflow-data.ts` | Re-exports for workflow data and templates. |
|
|
139
|
+
| `workflow/data/workflow-types.ts` | Types for workflow node structures, edges, and metadata. |
|
|
140
|
+
| **workflow / library** | |
|
|
141
|
+
| `workflow/lib/mermaid-renderer.ts` | Renders workflow graphs as Mermaid diagrams with multi-level caching. |
|
|
142
|
+
| `workflow/lib/workflow-diff.ts` | Computes a human-readable diff between two workflow versions. |
|
|
143
|
+
| `workflow/lib/workflow-execution-builders.ts` | Converts raw API execution responses into typed `WorkflowExecution` models. |
|
|
144
|
+
| `workflow/lib/workflow-execution-formatters.ts` | Formats execution status codes and timestamps for display. |
|
|
145
|
+
| `workflow/lib/workflow-execution-storage.ts` | Fetches workflow execution history from the backend API. |
|
|
146
|
+
| `workflow/lib/workflow-execution.types.ts` | Types for workflow executions and run-history records. |
|
|
147
|
+
| `workflow/lib/workflow-storage-api.ts` | API client for workflow CRUD, publishing, and scheduling operations. |
|
|
148
|
+
| `workflow/lib/workflow-storage-helpers.ts` | Helper utilities for normalising and transforming workflow storage payloads. |
|
|
149
|
+
| `workflow/lib/workflow-storage-versioning.ts` | Manages workflow version history and template-synchronisation logic. |
|
|
150
|
+
| `workflow/lib/workflow-storage.ts` | Main workflow storage façade: load, save, delete, and list workflows. |
|
|
151
|
+
| `workflow/lib/workflow-storage.constants.ts` | Constants shared across workflow storage modules. |
|
|
152
|
+
| `workflow/lib/workflow-storage.types.ts` | Types for stored workflow records and API request/response shapes. |
|
|
153
|
+
| **workflow / workflow page** | |
|
|
154
|
+
| `workflow/pages/workflow/components/settings-tab-content.tsx` | Settings tab: workflow metadata display, version history, and listener controls. |
|
|
155
|
+
| `workflow/pages/workflow/components/trace-tab-content.tsx` | Trace tab: renders execution traces using the agent-prism trace viewer. |
|
|
156
|
+
| `workflow/pages/workflow/components/workflow-layout.tsx` | Top-level workflow layout composing the tab bar, navigation, and chat bubble. |
|
|
157
|
+
| `workflow/pages/workflow/components/workflow-config-sheet.tsx` | Slide-over sheet for editing workflow runtime parameters and tags. |
|
|
158
|
+
| `workflow/pages/workflow/components/workflow-config-sheet.utils.ts` | Schema inference and form-data conversion utilities for the config sheet. |
|
|
159
|
+
| `workflow/pages/workflow/components/workflow-tab-content.tsx` | Workflow editor tab: React Flow workflow view, publish/schedule controls, and Mermaid preview. |
|
|
160
|
+
| `workflow/pages/workflow/handlers/credentials.ts` | Event handlers for credential add, update, delete, and secret-reveal operations. |
|
|
161
|
+
| `workflow/pages/workflow/helpers/execution.ts` | Utility functions for normalising execution status values. |
|
|
162
|
+
| `workflow/pages/workflow/helpers/trace.ts` | Transforms raw trace data and computes span display metadata. |
|
|
163
|
+
| `workflow/pages/workflow/helpers/types.ts` | Shared types for execution and trace data used across workflow helpers/hooks. |
|
|
164
|
+
| `workflow/pages/workflow/hooks/controller/build-layout-props.ts` | Assembles the full layout-props object from core, resource, and execution sub-hooks. |
|
|
165
|
+
| `workflow/pages/workflow/hooks/controller/use-workflow-controller.ts` | Main controller hook that composes all workflow sub-hooks into a single interface. |
|
|
166
|
+
| `workflow/pages/workflow/hooks/controller/use-workflow-core.ts` | Core hook managing metadata, execution, UI, WebSocket, and chat state. |
|
|
167
|
+
| `workflow/pages/workflow/hooks/controller/use-workflow-execution-controller.ts` | Handles workflow run triggering, status polling, and trace updates. |
|
|
168
|
+
| `workflow/pages/workflow/hooks/controller/use-workflow-lifecycle.ts` | Wires loader and storage-listener hooks into the workflow lifecycle. |
|
|
169
|
+
| `workflow/pages/workflow/hooks/controller/use-workflow-resources.ts` | Composes credential management, listener, and auto-save hooks. |
|
|
170
|
+
| `workflow/pages/workflow/hooks/execution-log-helpers.ts` | Formats raw execution log lines for display. |
|
|
171
|
+
| `workflow/pages/workflow/hooks/execution-node-status.ts` | Derives per-node status indicators from the current execution record. |
|
|
172
|
+
| `workflow/pages/workflow/hooks/execution-record-updater.ts` | Logic for merging incremental execution updates into the execution record. |
|
|
173
|
+
| `workflow/pages/workflow/hooks/execution-record.ts` | Creates the initial execution record structure when a run starts. |
|
|
174
|
+
| `workflow/pages/workflow/hooks/execution-runtime-updates.ts` | Applies real-time runtime updates to the workflow execution state. |
|
|
175
|
+
| `workflow/pages/workflow/hooks/use-studio-ui-state.ts` | Manages active-tab and sidebar-visibility UI state for the workflow page. |
|
|
176
|
+
| `workflow/pages/workflow/hooks/use-execution-trace.ts` | Hook that fetches and stores the execution trace for the current run. |
|
|
177
|
+
| `workflow/pages/workflow/hooks/use-execution-updates.ts` | Subscribes to WebSocket execution events and forwards them to state. |
|
|
178
|
+
| `workflow/pages/workflow/hooks/use-pause-workflow.ts` | Hook exposing a pause action for an in-progress workflow execution. |
|
|
179
|
+
| `workflow/pages/workflow/hooks/use-workflow-chat.ts` | Manages the workflow-specific ChatKit session lifecycle. |
|
|
180
|
+
| `workflow/pages/workflow/hooks/use-workflow-credentials.ts` | Hook for loading and mutating workflow-scoped credentials. |
|
|
181
|
+
| `workflow/pages/workflow/hooks/use-workflow-execution-state.ts` | Central state container for the current workflow execution. |
|
|
182
|
+
| `workflow/pages/workflow/hooks/use-workflow-listeners.ts` | Manages workflow event listeners (webhooks / triggers). |
|
|
183
|
+
| `workflow/pages/workflow/hooks/use-workflow-loader.ts` | Loads workflow metadata, definition, and execution history on mount. |
|
|
184
|
+
| `workflow/pages/workflow/hooks/use-workflow-metadata-state.ts` | State and mutators for workflow name, description, tags, and version info. |
|
|
185
|
+
| `workflow/pages/workflow/hooks/use-workflow-saver.ts` | Auto-saves workflow changes on a debounced schedule. |
|
|
186
|
+
| `workflow/pages/workflow/hooks/use-workflow-storage-listener.ts` | Listens for external (cross-tab / server-push) workflow storage updates. |
|
|
187
|
+
| `workflow/pages/workflow/hooks/workflow-runner-websocket.ts` | Creates and configures the WebSocket connection for live execution updates. |
|
|
188
|
+
| `workflow/pages/workflow.tsx` | Top-level workflow page page that integrates the layout with the controller hook. |
|
|
189
|
+
| **workflow / gallery page** | |
|
|
190
|
+
| `workflow/pages/workflow-gallery/types.ts` | Types for gallery tab identifiers and gallery component state. |
|
|
191
|
+
| `workflow/pages/workflow-gallery/use-workflow-gallery-actions.ts` | Gallery action handlers: import workflow, delete workflow, export workflow. |
|
|
192
|
+
| `workflow/pages/workflow-gallery/use-workflow-gallery-state.ts` | Hook managing gallery state: workflow list, search query, and active tab. |
|
|
193
|
+
| `workflow/pages/workflow-gallery/use-workflow-gallery.ts` | Composed hook combining gallery state and action hooks. |
|
|
194
|
+
| `workflow/pages/workflow-gallery/workflow-card-size.ts` | CSS utility class for the workflow card aspect-ratio. |
|
|
195
|
+
| `workflow/pages/workflow-gallery/workflow-card.tsx` | Workflow card component with open, use-template, export, and delete actions. |
|
|
196
|
+
| `workflow/pages/workflow-gallery/workflow-gallery-tabs.tsx` | Tab bar switching between user workflows and templates, with a search input. |
|
|
197
|
+
| `workflow/pages/workflow-gallery.tsx` | Main workflow gallery page. |
|
|
198
|
+
| **workflow / types** | |
|
|
199
|
+
| `workflow/types/credential-vault.ts` | Types for the credential vault: access-level enum, health-status enum, input/output shapes. |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Card,
|
|
3
|
+
CardContent,
|
|
4
|
+
CardDescription,
|
|
5
|
+
CardHeader,
|
|
6
|
+
CardTitle,
|
|
7
|
+
} from "@/design-system/ui/card";
|
|
8
|
+
import ThemeSettings from "@features/account/components/theme-settings";
|
|
9
|
+
|
|
10
|
+
const AppearanceSettingsTab = () => (
|
|
11
|
+
<Card>
|
|
12
|
+
<CardHeader>
|
|
13
|
+
<CardTitle>Theme</CardTitle>
|
|
14
|
+
<CardDescription>
|
|
15
|
+
Choose how the application should look in light, dark, or system mode.
|
|
16
|
+
</CardDescription>
|
|
17
|
+
</CardHeader>
|
|
18
|
+
<CardContent>
|
|
19
|
+
<ThemeSettings />
|
|
20
|
+
</CardContent>
|
|
21
|
+
</Card>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default AppearanceSettingsTab;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Check, Monitor, Moon, Sun } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
import { Button } from "@/design-system/ui/button";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
import { useThemePreferences } from "./use-theme-preferences";
|
|
8
|
+
|
|
9
|
+
interface ThemeSettingsProps {
|
|
10
|
+
onThemeChange?: (theme: "light" | "dark" | "system") => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function ThemeSettings({
|
|
15
|
+
onThemeChange,
|
|
16
|
+
className,
|
|
17
|
+
}: ThemeSettingsProps) {
|
|
18
|
+
const { setTheme, theme } = useThemePreferences({
|
|
19
|
+
onThemeChange,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div className={cn("grid grid-cols-1 gap-2 sm:grid-cols-3", className)}>
|
|
24
|
+
<ThemeCard
|
|
25
|
+
label="Light"
|
|
26
|
+
icon={<Sun className="h-6 w-6" />}
|
|
27
|
+
isActive={theme === "light"}
|
|
28
|
+
onClick={() => setTheme("light")}
|
|
29
|
+
/>
|
|
30
|
+
<ThemeCard
|
|
31
|
+
label="Dark"
|
|
32
|
+
icon={<Moon className="h-6 w-6" />}
|
|
33
|
+
isActive={theme === "dark"}
|
|
34
|
+
onClick={() => setTheme("dark")}
|
|
35
|
+
/>
|
|
36
|
+
<ThemeCard
|
|
37
|
+
label="System"
|
|
38
|
+
icon={<Monitor className="h-6 w-6" />}
|
|
39
|
+
isActive={theme === "system"}
|
|
40
|
+
onClick={() => setTheme("system")}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface ThemeCardProps {
|
|
47
|
+
label: string;
|
|
48
|
+
icon: React.ReactNode;
|
|
49
|
+
isActive: boolean;
|
|
50
|
+
onClick: () => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const ThemeCard: React.FC<ThemeCardProps> = ({
|
|
54
|
+
icon,
|
|
55
|
+
isActive,
|
|
56
|
+
label,
|
|
57
|
+
onClick,
|
|
58
|
+
}) => (
|
|
59
|
+
<Button
|
|
60
|
+
variant={isActive ? "default" : "outline"}
|
|
61
|
+
className="relative flex h-24 flex-col items-center justify-center gap-2"
|
|
62
|
+
onClick={onClick}
|
|
63
|
+
>
|
|
64
|
+
{icon}
|
|
65
|
+
<span>{label}</span>
|
|
66
|
+
{isActive && (
|
|
67
|
+
<Check className="absolute top-2 right-2 h-4 w-4 text-primary-foreground" />
|
|
68
|
+
)}
|
|
69
|
+
</Button>
|
|
70
|
+
);
|