@agent-native/dispatch 0.1.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/README.md +220 -0
- package/dist/actions/approve-dispatch-change.d.ts +3 -0
- package/dist/actions/approve-dispatch-change.d.ts.map +1 -0
- package/dist/actions/approve-dispatch-change.js +11 -0
- package/dist/actions/approve-dispatch-change.js.map +1 -0
- package/dist/actions/approve-vault-request.d.ts +3 -0
- package/dist/actions/approve-vault-request.d.ts.map +1 -0
- package/dist/actions/approve-vault-request.js +16 -0
- package/dist/actions/approve-vault-request.js.map +1 -0
- package/dist/actions/create-link-token.d.ts +3 -0
- package/dist/actions/create-link-token.d.ts.map +1 -0
- package/dist/actions/create-link-token.js +11 -0
- package/dist/actions/create-link-token.js.map +1 -0
- package/dist/actions/create-vault-grant.d.ts +3 -0
- package/dist/actions/create-vault-grant.d.ts.map +1 -0
- package/dist/actions/create-vault-grant.js +14 -0
- package/dist/actions/create-vault-grant.js.map +1 -0
- package/dist/actions/create-vault-secret.d.ts +3 -0
- package/dist/actions/create-vault-secret.d.ts.map +1 -0
- package/dist/actions/create-vault-secret.js +20 -0
- package/dist/actions/create-vault-secret.js.map +1 -0
- package/dist/actions/create-workspace-resource-grant.d.ts +3 -0
- package/dist/actions/create-workspace-resource-grant.d.ts.map +1 -0
- package/dist/actions/create-workspace-resource-grant.js +14 -0
- package/dist/actions/create-workspace-resource-grant.js.map +1 -0
- package/dist/actions/create-workspace-resource.d.ts +3 -0
- package/dist/actions/create-workspace-resource.d.ts.map +1 -0
- package/dist/actions/create-workspace-resource.js +24 -0
- package/dist/actions/create-workspace-resource.js.map +1 -0
- package/dist/actions/delete-destination.d.ts +3 -0
- package/dist/actions/delete-destination.d.ts.map +1 -0
- package/dist/actions/delete-destination.js +11 -0
- package/dist/actions/delete-destination.js.map +1 -0
- package/dist/actions/delete-vault-secret.d.ts +3 -0
- package/dist/actions/delete-vault-secret.d.ts.map +1 -0
- package/dist/actions/delete-vault-secret.js +11 -0
- package/dist/actions/delete-vault-secret.js.map +1 -0
- package/dist/actions/delete-workspace-resource.d.ts +3 -0
- package/dist/actions/delete-workspace-resource.d.ts.map +1 -0
- package/dist/actions/delete-workspace-resource.js +11 -0
- package/dist/actions/delete-workspace-resource.js.map +1 -0
- package/dist/actions/deny-vault-request.d.ts +3 -0
- package/dist/actions/deny-vault-request.d.ts.map +1 -0
- package/dist/actions/deny-vault-request.js +12 -0
- package/dist/actions/deny-vault-request.js.map +1 -0
- package/dist/actions/get-app-creation-settings.d.ts +3 -0
- package/dist/actions/get-app-creation-settings.d.ts.map +1 -0
- package/dist/actions/get-app-creation-settings.js +10 -0
- package/dist/actions/get-app-creation-settings.js.map +1 -0
- package/dist/actions/get-dispatch-settings.d.ts +3 -0
- package/dist/actions/get-dispatch-settings.d.ts.map +1 -0
- package/dist/actions/get-dispatch-settings.js +10 -0
- package/dist/actions/get-dispatch-settings.js.map +1 -0
- package/dist/actions/get-workspace-info.d.ts +3 -0
- package/dist/actions/get-workspace-info.d.ts.map +1 -0
- package/dist/actions/get-workspace-info.js +10 -0
- package/dist/actions/get-workspace-info.js.map +1 -0
- package/dist/actions/grant-vault-secrets-to-app.d.ts +3 -0
- package/dist/actions/grant-vault-secrets-to-app.d.ts.map +1 -0
- package/dist/actions/grant-vault-secrets-to-app.js +19 -0
- package/dist/actions/grant-vault-secrets-to-app.js.map +1 -0
- package/dist/actions/index.d.ts +9 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +101 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/list-connected-agents.d.ts +3 -0
- package/dist/actions/list-connected-agents.d.ts.map +1 -0
- package/dist/actions/list-connected-agents.js +79 -0
- package/dist/actions/list-connected-agents.js.map +1 -0
- package/dist/actions/list-destinations.d.ts +3 -0
- package/dist/actions/list-destinations.d.ts.map +1 -0
- package/dist/actions/list-destinations.js +10 -0
- package/dist/actions/list-destinations.js.map +1 -0
- package/dist/actions/list-dispatch-approvals.d.ts +3 -0
- package/dist/actions/list-dispatch-approvals.d.ts.map +1 -0
- package/dist/actions/list-dispatch-approvals.js +10 -0
- package/dist/actions/list-dispatch-approvals.js.map +1 -0
- package/dist/actions/list-dispatch-audit.d.ts +3 -0
- package/dist/actions/list-dispatch-audit.d.ts.map +1 -0
- package/dist/actions/list-dispatch-audit.js +12 -0
- package/dist/actions/list-dispatch-audit.js.map +1 -0
- package/dist/actions/list-dispatch-overview.d.ts +3 -0
- package/dist/actions/list-dispatch-overview.d.ts.map +1 -0
- package/dist/actions/list-dispatch-overview.js +17 -0
- package/dist/actions/list-dispatch-overview.js.map +1 -0
- package/dist/actions/list-integrations-catalog.d.ts +3 -0
- package/dist/actions/list-integrations-catalog.d.ts.map +1 -0
- package/dist/actions/list-integrations-catalog.js +10 -0
- package/dist/actions/list-integrations-catalog.js.map +1 -0
- package/dist/actions/list-linked-identities.d.ts +3 -0
- package/dist/actions/list-linked-identities.d.ts.map +1 -0
- package/dist/actions/list-linked-identities.js +10 -0
- package/dist/actions/list-linked-identities.js.map +1 -0
- package/dist/actions/list-vault-audit.d.ts +3 -0
- package/dist/actions/list-vault-audit.d.ts.map +1 -0
- package/dist/actions/list-vault-audit.js +15 -0
- package/dist/actions/list-vault-audit.js.map +1 -0
- package/dist/actions/list-vault-grants.d.ts +3 -0
- package/dist/actions/list-vault-grants.d.ts.map +1 -0
- package/dist/actions/list-vault-grants.js +13 -0
- package/dist/actions/list-vault-grants.js.map +1 -0
- package/dist/actions/list-vault-requests.d.ts +3 -0
- package/dist/actions/list-vault-requests.d.ts.map +1 -0
- package/dist/actions/list-vault-requests.js +15 -0
- package/dist/actions/list-vault-requests.js.map +1 -0
- package/dist/actions/list-vault-secret-options.d.ts +3 -0
- package/dist/actions/list-vault-secret-options.d.ts.map +1 -0
- package/dist/actions/list-vault-secret-options.js +19 -0
- package/dist/actions/list-vault-secret-options.js.map +1 -0
- package/dist/actions/list-vault-secrets.d.ts +3 -0
- package/dist/actions/list-vault-secrets.d.ts.map +1 -0
- package/dist/actions/list-vault-secrets.js +25 -0
- package/dist/actions/list-vault-secrets.js.map +1 -0
- package/dist/actions/list-workspace-apps.d.ts +3 -0
- package/dist/actions/list-workspace-apps.d.ts.map +1 -0
- package/dist/actions/list-workspace-apps.js +24 -0
- package/dist/actions/list-workspace-apps.js.map +1 -0
- package/dist/actions/list-workspace-resource-grants.d.ts +3 -0
- package/dist/actions/list-workspace-resource-grants.d.ts.map +1 -0
- package/dist/actions/list-workspace-resource-grants.js +13 -0
- package/dist/actions/list-workspace-resource-grants.js.map +1 -0
- package/dist/actions/list-workspace-resources.d.ts +3 -0
- package/dist/actions/list-workspace-resources.d.ts.map +1 -0
- package/dist/actions/list-workspace-resources.js +15 -0
- package/dist/actions/list-workspace-resources.js.map +1 -0
- package/dist/actions/navigate.d.ts +16 -0
- package/dist/actions/navigate.d.ts.map +1 -0
- package/dist/actions/navigate.js +55 -0
- package/dist/actions/navigate.js.map +1 -0
- package/dist/actions/reject-dispatch-change.d.ts +3 -0
- package/dist/actions/reject-dispatch-change.d.ts.map +1 -0
- package/dist/actions/reject-dispatch-change.js +12 -0
- package/dist/actions/reject-dispatch-change.js.map +1 -0
- package/dist/actions/request-vault-secret.d.ts +3 -0
- package/dist/actions/request-vault-secret.d.ts.map +1 -0
- package/dist/actions/request-vault-secret.js +15 -0
- package/dist/actions/request-vault-secret.js.map +1 -0
- package/dist/actions/revoke-vault-grant.d.ts +3 -0
- package/dist/actions/revoke-vault-grant.d.ts.map +1 -0
- package/dist/actions/revoke-vault-grant.js +11 -0
- package/dist/actions/revoke-vault-grant.js.map +1 -0
- package/dist/actions/revoke-workspace-resource-grant.d.ts +3 -0
- package/dist/actions/revoke-workspace-resource-grant.d.ts.map +1 -0
- package/dist/actions/revoke-workspace-resource-grant.js +11 -0
- package/dist/actions/revoke-workspace-resource-grant.js.map +1 -0
- package/dist/actions/send-platform-message.d.ts +3 -0
- package/dist/actions/send-platform-message.d.ts.map +1 -0
- package/dist/actions/send-platform-message.js +73 -0
- package/dist/actions/send-platform-message.js.map +1 -0
- package/dist/actions/set-app-creation-settings.d.ts +3 -0
- package/dist/actions/set-app-creation-settings.d.ts.map +1 -0
- package/dist/actions/set-app-creation-settings.js +18 -0
- package/dist/actions/set-app-creation-settings.js.map +1 -0
- package/dist/actions/set-dispatch-approval-policy.d.ts +3 -0
- package/dist/actions/set-dispatch-approval-policy.d.ts.map +1 -0
- package/dist/actions/set-dispatch-approval-policy.js +19 -0
- package/dist/actions/set-dispatch-approval-policy.js.map +1 -0
- package/dist/actions/start-workspace-app-creation.d.ts +3 -0
- package/dist/actions/start-workspace-app-creation.d.ts.map +1 -0
- package/dist/actions/start-workspace-app-creation.js +31 -0
- package/dist/actions/start-workspace-app-creation.js.map +1 -0
- package/dist/actions/sync-vault-to-app.d.ts +3 -0
- package/dist/actions/sync-vault-to-app.d.ts.map +1 -0
- package/dist/actions/sync-vault-to-app.js +13 -0
- package/dist/actions/sync-vault-to-app.js.map +1 -0
- package/dist/actions/sync-workspace-resources-to-all.d.ts +3 -0
- package/dist/actions/sync-workspace-resources-to-all.d.ts.map +1 -0
- package/dist/actions/sync-workspace-resources-to-all.js +9 -0
- package/dist/actions/sync-workspace-resources-to-all.js.map +1 -0
- package/dist/actions/sync-workspace-resources-to-app.d.ts +3 -0
- package/dist/actions/sync-workspace-resources-to-app.d.ts.map +1 -0
- package/dist/actions/sync-workspace-resources-to-app.js +11 -0
- package/dist/actions/sync-workspace-resources-to-app.js.map +1 -0
- package/dist/actions/update-vault-secret.d.ts +3 -0
- package/dist/actions/update-vault-secret.d.ts.map +1 -0
- package/dist/actions/update-vault-secret.js +12 -0
- package/dist/actions/update-vault-secret.js.map +1 -0
- package/dist/actions/update-workspace-resource.d.ts +3 -0
- package/dist/actions/update-workspace-resource.d.ts.map +1 -0
- package/dist/actions/update-workspace-resource.js +18 -0
- package/dist/actions/update-workspace-resource.js.map +1 -0
- package/dist/actions/upsert-destination.d.ts +3 -0
- package/dist/actions/upsert-destination.d.ts.map +1 -0
- package/dist/actions/upsert-destination.js +26 -0
- package/dist/actions/upsert-destination.js.map +1 -0
- package/dist/actions/view-screen.d.ts +11 -0
- package/dist/actions/view-screen.d.ts.map +1 -0
- package/dist/actions/view-screen.js +68 -0
- package/dist/actions/view-screen.js.map +1 -0
- package/dist/components/agents-panel.d.ts +16 -0
- package/dist/components/agents-panel.d.ts.map +1 -0
- package/dist/components/agents-panel.js +64 -0
- package/dist/components/agents-panel.js.map +1 -0
- package/dist/components/app-keys-popover.d.ts +11 -0
- package/dist/components/app-keys-popover.d.ts.map +1 -0
- package/dist/components/app-keys-popover.js +84 -0
- package/dist/components/app-keys-popover.js.map +1 -0
- package/dist/components/create-app-popover.d.ts +24 -0
- package/dist/components/create-app-popover.d.ts.map +1 -0
- package/dist/components/create-app-popover.js +188 -0
- package/dist/components/create-app-popover.js.map +1 -0
- package/dist/components/dispatch-shell.d.ts +13 -0
- package/dist/components/dispatch-shell.d.ts.map +1 -0
- package/dist/components/dispatch-shell.js +15 -0
- package/dist/components/dispatch-shell.js.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +12 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/layout/Header.d.ts +5 -0
- package/dist/components/layout/Header.d.ts.map +1 -0
- package/dist/components/layout/Header.js +34 -0
- package/dist/components/layout/Header.js.map +1 -0
- package/dist/components/layout/HeaderActions.d.ts +18 -0
- package/dist/components/layout/HeaderActions.d.ts.map +1 -0
- package/dist/components/layout/HeaderActions.js +52 -0
- package/dist/components/layout/HeaderActions.js.map +1 -0
- package/dist/components/layout/Layout.d.ts +8 -0
- package/dist/components/layout/Layout.d.ts.map +1 -0
- package/dist/components/layout/Layout.js +70 -0
- package/dist/components/layout/Layout.js.map +1 -0
- package/dist/components/messaging-setup-panel.d.ts +2 -0
- package/dist/components/messaging-setup-panel.d.ts.map +1 -0
- package/dist/components/messaging-setup-panel.js +300 -0
- package/dist/components/messaging-setup-panel.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +14 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +27 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +23 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +4 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +12 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +21 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +24 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +34 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +41 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +17 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +99 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +80 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +131 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +9 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +6 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/command.d.ts +83 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +29 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +34 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +23 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +23 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +36 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +63 -0
- package/dist/components/ui/form.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +10 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +35 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +19 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +9 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +10 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +29 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +41 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +25 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +29 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +24 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +10 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +8 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +15 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +9 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +12 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +27 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +8 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +26 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +37 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +67 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +233 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +7 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +8 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +25 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +7 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +8 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +21 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +13 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +9 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toast.d.ts +16 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +34 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +10 -0
- package/dist/components/ui/toaster.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +21 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +26 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +11 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/use-toast.d.ts +3 -0
- package/dist/components/ui/use-toast.d.ts.map +1 -0
- package/dist/components/ui/use-toast.js +3 -0
- package/dist/components/ui/use-toast.js.map +1 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -0
- package/dist/db/index.d.ts +7 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +10 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +5 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +166 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/schema.d.ts +2344 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +148 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-navigation-state.d.ts +6 -0
- package/dist/hooks/use-navigation-state.d.ts.map +1 -0
- package/dist/hooks/use-navigation-state.js +129 -0
- package/dist/hooks/use-navigation-state.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +45 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +127 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +2 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/routes/index.d.ts +32 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +51 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/pages/_index.d.ts +15 -0
- package/dist/routes/pages/_index.d.ts.map +1 -0
- package/dist/routes/pages/_index.js +42 -0
- package/dist/routes/pages/_index.js.map +1 -0
- package/dist/routes/pages/agents.d.ts +5 -0
- package/dist/routes/pages/agents.d.ts.map +1 -0
- package/dist/routes/pages/agents.js +12 -0
- package/dist/routes/pages/agents.js.map +1 -0
- package/dist/routes/pages/approval.d.ts +5 -0
- package/dist/routes/pages/approval.d.ts.map +1 -0
- package/dist/routes/pages/approval.js +47 -0
- package/dist/routes/pages/approval.js.map +1 -0
- package/dist/routes/pages/approvals.d.ts +5 -0
- package/dist/routes/pages/approvals.d.ts.map +1 -0
- package/dist/routes/pages/approvals.js +48 -0
- package/dist/routes/pages/approvals.js.map +1 -0
- package/dist/routes/pages/apps.$appId.d.ts +5 -0
- package/dist/routes/pages/apps.$appId.d.ts.map +1 -0
- package/dist/routes/pages/apps.$appId.js +31 -0
- package/dist/routes/pages/apps.$appId.js.map +1 -0
- package/dist/routes/pages/apps.d.ts +5 -0
- package/dist/routes/pages/apps.d.ts.map +1 -0
- package/dist/routes/pages/apps.js +42 -0
- package/dist/routes/pages/apps.js.map +1 -0
- package/dist/routes/pages/audit.d.ts +5 -0
- package/dist/routes/pages/audit.d.ts.map +1 -0
- package/dist/routes/pages/audit.js +11 -0
- package/dist/routes/pages/audit.js.map +1 -0
- package/dist/routes/pages/destinations.d.ts +5 -0
- package/dist/routes/pages/destinations.d.ts.map +1 -0
- package/dist/routes/pages/destinations.js +80 -0
- package/dist/routes/pages/destinations.js.map +1 -0
- package/dist/routes/pages/identities.d.ts +5 -0
- package/dist/routes/pages/identities.d.ts.map +1 -0
- package/dist/routes/pages/identities.js +18 -0
- package/dist/routes/pages/identities.js.map +1 -0
- package/dist/routes/pages/integrations.d.ts +5 -0
- package/dist/routes/pages/integrations.d.ts.map +1 -0
- package/dist/routes/pages/integrations.js +46 -0
- package/dist/routes/pages/integrations.js.map +1 -0
- package/dist/routes/pages/messaging.d.ts +5 -0
- package/dist/routes/pages/messaging.d.ts.map +1 -0
- package/dist/routes/pages/messaging.js +10 -0
- package/dist/routes/pages/messaging.js.map +1 -0
- package/dist/routes/pages/new-app.d.ts +5 -0
- package/dist/routes/pages/new-app.d.ts.map +1 -0
- package/dist/routes/pages/new-app.js +10 -0
- package/dist/routes/pages/new-app.js.map +1 -0
- package/dist/routes/pages/overview.d.ts +5 -0
- package/dist/routes/pages/overview.d.ts.map +1 -0
- package/dist/routes/pages/overview.js +225 -0
- package/dist/routes/pages/overview.js.map +1 -0
- package/dist/routes/pages/team.d.ts +5 -0
- package/dist/routes/pages/team.d.ts.map +1 -0
- package/dist/routes/pages/team.js +10 -0
- package/dist/routes/pages/team.js.map +1 -0
- package/dist/routes/pages/tools.$id.d.ts +2 -0
- package/dist/routes/pages/tools.$id.d.ts.map +1 -0
- package/dist/routes/pages/tools.$id.js +6 -0
- package/dist/routes/pages/tools.$id.js.map +1 -0
- package/dist/routes/pages/tools._index.d.ts +2 -0
- package/dist/routes/pages/tools._index.d.ts.map +1 -0
- package/dist/routes/pages/tools._index.js +6 -0
- package/dist/routes/pages/tools._index.js.map +1 -0
- package/dist/routes/pages/vault.d.ts +5 -0
- package/dist/routes/pages/vault.d.ts.map +1 -0
- package/dist/routes/pages/vault.js +131 -0
- package/dist/routes/pages/vault.js.map +1 -0
- package/dist/routes/pages/workspace.d.ts +5 -0
- package/dist/routes/pages/workspace.d.ts.map +1 -0
- package/dist/routes/pages/workspace.js +149 -0
- package/dist/routes/pages/workspace.js.map +1 -0
- package/dist/server/index.d.ts +44 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +68 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/lib/app-creation-store.d.ts +102 -0
- package/dist/server/lib/app-creation-store.d.ts.map +1 -0
- package/dist/server/lib/app-creation-store.js +780 -0
- package/dist/server/lib/app-creation-store.js.map +1 -0
- package/dist/server/lib/dispatch-integrations.d.ts +10 -0
- package/dist/server/lib/dispatch-integrations.d.ts.map +1 -0
- package/dist/server/lib/dispatch-integrations.js +105 -0
- package/dist/server/lib/dispatch-integrations.js.map +1 -0
- package/dist/server/lib/dispatch-store.d.ts +313 -0
- package/dist/server/lib/dispatch-store.d.ts.map +1 -0
- package/dist/server/lib/dispatch-store.js +669 -0
- package/dist/server/lib/dispatch-store.js.map +1 -0
- package/dist/server/lib/env-config.d.ts +3 -0
- package/dist/server/lib/env-config.d.ts.map +1 -0
- package/dist/server/lib/env-config.js +43 -0
- package/dist/server/lib/env-config.js.map +1 -0
- package/dist/server/lib/pre-auth-routing.d.ts +2 -0
- package/dist/server/lib/pre-auth-routing.d.ts.map +1 -0
- package/dist/server/lib/pre-auth-routing.js +128 -0
- package/dist/server/lib/pre-auth-routing.js.map +1 -0
- package/dist/server/lib/vault-store.d.ts +270 -0
- package/dist/server/lib/vault-store.d.ts.map +1 -0
- package/dist/server/lib/vault-store.js +554 -0
- package/dist/server/lib/vault-store.js.map +1 -0
- package/dist/server/lib/workspace-resources-store.d.ts +165 -0
- package/dist/server/lib/workspace-resources-store.d.ts.map +1 -0
- package/dist/server/lib/workspace-resources-store.js +310 -0
- package/dist/server/lib/workspace-resources-store.js.map +1 -0
- package/dist/server/plugins/agent-chat.d.ts +3 -0
- package/dist/server/plugins/agent-chat.d.ts.map +1 -0
- package/dist/server/plugins/agent-chat.js +36 -0
- package/dist/server/plugins/agent-chat.js.map +1 -0
- package/dist/server/plugins/auth.d.ts +9 -0
- package/dist/server/plugins/auth.d.ts.map +1 -0
- package/dist/server/plugins/auth.js +30 -0
- package/dist/server/plugins/auth.js.map +1 -0
- package/dist/server/plugins/core-routes.d.ts +3 -0
- package/dist/server/plugins/core-routes.d.ts.map +1 -0
- package/dist/server/plugins/core-routes.js +6 -0
- package/dist/server/plugins/core-routes.js.map +1 -0
- package/dist/server/plugins/db.d.ts +3 -0
- package/dist/server/plugins/db.d.ts.map +1 -0
- package/dist/server/plugins/db.js +6 -0
- package/dist/server/plugins/db.js.map +1 -0
- package/dist/server/plugins/integrations.d.ts +8 -0
- package/dist/server/plugins/integrations.d.ts.map +1 -0
- package/dist/server/plugins/integrations.js +51 -0
- package/dist/server/plugins/integrations.js.map +1 -0
- package/package.json +103 -0
- package/src/actions/approve-dispatch-change.ts +11 -0
- package/src/actions/approve-vault-request.ts +23 -0
- package/src/actions/create-link-token.ts +12 -0
- package/src/actions/create-vault-grant.ts +15 -0
- package/src/actions/create-vault-secret.ts +21 -0
- package/src/actions/create-workspace-resource-grant.ts +15 -0
- package/src/actions/create-workspace-resource.ts +29 -0
- package/src/actions/delete-destination.ts +11 -0
- package/src/actions/delete-vault-secret.ts +12 -0
- package/src/actions/delete-workspace-resource.ts +12 -0
- package/src/actions/deny-vault-request.ts +12 -0
- package/src/actions/get-app-creation-settings.ts +11 -0
- package/src/actions/get-dispatch-settings.ts +10 -0
- package/src/actions/get-workspace-info.ts +11 -0
- package/src/actions/grant-vault-secrets-to-app.ts +20 -0
- package/src/actions/index.ts +102 -0
- package/src/actions/list-connected-agents.ts +103 -0
- package/src/actions/list-destinations.ts +10 -0
- package/src/actions/list-dispatch-approvals.ts +10 -0
- package/src/actions/list-dispatch-audit.ts +12 -0
- package/src/actions/list-dispatch-overview.ts +18 -0
- package/src/actions/list-integrations-catalog.ts +11 -0
- package/src/actions/list-linked-identities.ts +10 -0
- package/src/actions/list-vault-audit.ts +16 -0
- package/src/actions/list-vault-grants.ts +14 -0
- package/src/actions/list-vault-requests.ts +16 -0
- package/src/actions/list-vault-secret-options.ts +20 -0
- package/src/actions/list-vault-secrets.ts +26 -0
- package/src/actions/list-workspace-apps.ts +25 -0
- package/src/actions/list-workspace-resource-grants.ts +14 -0
- package/src/actions/list-workspace-resources.ts +16 -0
- package/src/actions/navigate.ts +55 -0
- package/src/actions/reject-dispatch-change.ts +12 -0
- package/src/actions/request-vault-secret.ts +16 -0
- package/src/actions/revoke-vault-grant.ts +11 -0
- package/src/actions/revoke-workspace-resource-grant.ts +15 -0
- package/src/actions/send-platform-message.ts +96 -0
- package/src/actions/set-app-creation-settings.ts +19 -0
- package/src/actions/set-dispatch-approval-policy.ts +24 -0
- package/src/actions/start-workspace-app-creation.ts +33 -0
- package/src/actions/sync-vault-to-app.ts +14 -0
- package/src/actions/sync-workspace-resources-to-all.ts +10 -0
- package/src/actions/sync-workspace-resources-to-app.ts +12 -0
- package/src/actions/update-vault-secret.ts +12 -0
- package/src/actions/update-workspace-resource.ts +19 -0
- package/src/actions/upsert-destination.ts +29 -0
- package/src/actions/view-screen.ts +78 -0
- package/src/components/agents-panel.tsx +262 -0
- package/src/components/app-keys-popover.tsx +231 -0
- package/src/components/create-app-popover.tsx +423 -0
- package/src/components/dispatch-shell.tsx +53 -0
- package/src/components/index.ts +11 -0
- package/src/components/layout/Header.tsx +69 -0
- package/src/components/layout/HeaderActions.tsx +84 -0
- package/src/components/layout/Layout.tsx +243 -0
- package/src/components/messaging-setup-panel.tsx +666 -0
- package/src/components/ui/accordion.tsx +56 -0
- package/src/components/ui/alert-dialog.tsx +139 -0
- package/src/components/ui/alert.tsx +59 -0
- package/src/components/ui/aspect-ratio.tsx +5 -0
- package/src/components/ui/avatar.tsx +48 -0
- package/src/components/ui/badge.tsx +37 -0
- package/src/components/ui/breadcrumb.tsx +115 -0
- package/src/components/ui/button.tsx +57 -0
- package/src/components/ui/calendar.tsx +68 -0
- package/src/components/ui/card.tsx +86 -0
- package/src/components/ui/carousel.tsx +260 -0
- package/src/components/ui/chart.tsx +375 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/command.tsx +154 -0
- package/src/components/ui/context-menu.tsx +198 -0
- package/src/components/ui/dialog.tsx +120 -0
- package/src/components/ui/drawer.tsx +116 -0
- package/src/components/ui/dropdown-menu.tsx +198 -0
- package/src/components/ui/form.tsx +177 -0
- package/src/components/ui/hover-card.tsx +27 -0
- package/src/components/ui/input-otp.tsx +69 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/menubar.tsx +235 -0
- package/src/components/ui/navigation-menu.tsx +128 -0
- package/src/components/ui/pagination.tsx +121 -0
- package/src/components/ui/popover.tsx +29 -0
- package/src/components/ui/progress.tsx +26 -0
- package/src/components/ui/radio-group.tsx +42 -0
- package/src/components/ui/resizable.tsx +43 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.tsx +158 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +778 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +26 -0
- package/src/components/ui/sonner.tsx +58 -0
- package/src/components/ui/spinner.tsx +17 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/table.tsx +117 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.tsx +23 -0
- package/src/components/ui/toast.tsx +127 -0
- package/src/components/ui/toaster.tsx +33 -0
- package/src/components/ui/toggle-group.tsx +59 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +28 -0
- package/src/components/ui/use-toast.ts +3 -0
- package/src/config.ts +35 -0
- package/src/db/index.ts +12 -0
- package/src/db/migrations.ts +165 -0
- package/src/db/schema.ts +160 -0
- package/src/hooks/use-mobile.tsx +21 -0
- package/src/hooks/use-navigation-state.ts +132 -0
- package/src/hooks/use-toast.ts +188 -0
- package/src/index.ts +19 -0
- package/src/lib/utils.ts +1 -0
- package/src/routes/index.ts +51 -0
- package/src/routes/pages/_index.tsx +51 -0
- package/src/routes/pages/agents.tsx +23 -0
- package/src/routes/pages/approval.tsx +243 -0
- package/src/routes/pages/approvals.tsx +157 -0
- package/src/routes/pages/apps.$appId.tsx +134 -0
- package/src/routes/pages/apps.tsx +163 -0
- package/src/routes/pages/audit.tsx +41 -0
- package/src/routes/pages/destinations.tsx +253 -0
- package/src/routes/pages/identities.tsx +91 -0
- package/src/routes/pages/integrations.tsx +278 -0
- package/src/routes/pages/messaging.tsx +17 -0
- package/src/routes/pages/new-app.tsx +17 -0
- package/src/routes/pages/overview.tsx +792 -0
- package/src/routes/pages/team.tsx +23 -0
- package/src/routes/pages/tools.$id.tsx +5 -0
- package/src/routes/pages/tools._index.tsx +5 -0
- package/src/routes/pages/vault.tsx +617 -0
- package/src/routes/pages/workspace.tsx +598 -0
- package/src/server/index.ts +78 -0
- package/src/server/lib/app-creation-store.ts +996 -0
- package/src/server/lib/dispatch-integrations.ts +125 -0
- package/src/server/lib/dispatch-store.ts +889 -0
- package/src/server/lib/env-config.ts +44 -0
- package/src/server/lib/pre-auth-routing.ts +150 -0
- package/src/server/lib/vault-store.ts +811 -0
- package/src/server/lib/workspace-resources-store.ts +445 -0
- package/src/server/plugins/agent-chat.ts +36 -0
- package/src/server/plugins/auth.ts +34 -0
- package/src/server/plugins/core-routes.ts +6 -0
- package/src/server/plugins/db.ts +6 -0
- package/src/server/plugins/integrations.ts +59 -0
|
@@ -0,0 +1,778 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { VariantProps, cva } from "class-variance-authority";
|
|
4
|
+
import { IconLayoutSidebar } from "@tabler/icons-react";
|
|
5
|
+
|
|
6
|
+
import { useIsMobile } from "@/hooks/use-mobile";
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
8
|
+
import { Button } from "@/components/ui/button";
|
|
9
|
+
import { Input } from "@/components/ui/input";
|
|
10
|
+
import { Separator } from "@/components/ui/separator";
|
|
11
|
+
import {
|
|
12
|
+
Sheet,
|
|
13
|
+
SheetContent,
|
|
14
|
+
SheetDescription,
|
|
15
|
+
SheetTitle,
|
|
16
|
+
} from "@/components/ui/sheet";
|
|
17
|
+
import { Skeleton } from "@/components/ui/skeleton";
|
|
18
|
+
import {
|
|
19
|
+
Tooltip,
|
|
20
|
+
TooltipContent,
|
|
21
|
+
TooltipProvider,
|
|
22
|
+
TooltipTrigger,
|
|
23
|
+
} from "@/components/ui/tooltip";
|
|
24
|
+
|
|
25
|
+
const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
26
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
27
|
+
const SIDEBAR_WIDTH = "16rem";
|
|
28
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
29
|
+
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
30
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
31
|
+
|
|
32
|
+
type SidebarContext = {
|
|
33
|
+
state: "expanded" | "collapsed";
|
|
34
|
+
open: boolean;
|
|
35
|
+
setOpen: (open: boolean) => void;
|
|
36
|
+
openMobile: boolean;
|
|
37
|
+
setOpenMobile: (open: boolean) => void;
|
|
38
|
+
isMobile: boolean;
|
|
39
|
+
toggleSidebar: () => void;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const SidebarContext = React.createContext<SidebarContext | null>(null);
|
|
43
|
+
|
|
44
|
+
function useSidebar() {
|
|
45
|
+
const context = React.useContext(SidebarContext);
|
|
46
|
+
if (!context) {
|
|
47
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return context;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const SidebarProvider = React.forwardRef<
|
|
54
|
+
HTMLDivElement,
|
|
55
|
+
React.ComponentProps<"div"> & {
|
|
56
|
+
defaultOpen?: boolean;
|
|
57
|
+
open?: boolean;
|
|
58
|
+
onOpenChange?: (open: boolean) => void;
|
|
59
|
+
}
|
|
60
|
+
>(
|
|
61
|
+
(
|
|
62
|
+
{
|
|
63
|
+
defaultOpen = true,
|
|
64
|
+
open: openProp,
|
|
65
|
+
onOpenChange: setOpenProp,
|
|
66
|
+
className,
|
|
67
|
+
style,
|
|
68
|
+
children,
|
|
69
|
+
...props
|
|
70
|
+
},
|
|
71
|
+
ref,
|
|
72
|
+
) => {
|
|
73
|
+
const isMobile = useIsMobile();
|
|
74
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
75
|
+
|
|
76
|
+
// This is the internal state of the sidebar.
|
|
77
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
78
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
79
|
+
const open = openProp ?? _open;
|
|
80
|
+
const setOpen = React.useCallback(
|
|
81
|
+
(value: boolean | ((value: boolean) => boolean)) => {
|
|
82
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
83
|
+
if (setOpenProp) {
|
|
84
|
+
setOpenProp(openState);
|
|
85
|
+
} else {
|
|
86
|
+
_setOpen(openState);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// This sets the cookie to keep the sidebar state.
|
|
90
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
91
|
+
},
|
|
92
|
+
[setOpenProp, open],
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
// Helper to toggle the sidebar.
|
|
96
|
+
const toggleSidebar = React.useCallback(() => {
|
|
97
|
+
return isMobile
|
|
98
|
+
? setOpenMobile((open) => !open)
|
|
99
|
+
: setOpen((open) => !open);
|
|
100
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
101
|
+
|
|
102
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
103
|
+
React.useEffect(() => {
|
|
104
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
105
|
+
if (
|
|
106
|
+
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
107
|
+
(event.metaKey || event.ctrlKey)
|
|
108
|
+
) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
toggleSidebar();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
115
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
116
|
+
}, [toggleSidebar]);
|
|
117
|
+
|
|
118
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
119
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
120
|
+
const state = open ? "expanded" : "collapsed";
|
|
121
|
+
|
|
122
|
+
const contextValue = React.useMemo<SidebarContext>(
|
|
123
|
+
() => ({
|
|
124
|
+
state,
|
|
125
|
+
open,
|
|
126
|
+
setOpen,
|
|
127
|
+
isMobile,
|
|
128
|
+
openMobile,
|
|
129
|
+
setOpenMobile,
|
|
130
|
+
toggleSidebar,
|
|
131
|
+
}),
|
|
132
|
+
[
|
|
133
|
+
state,
|
|
134
|
+
open,
|
|
135
|
+
setOpen,
|
|
136
|
+
isMobile,
|
|
137
|
+
openMobile,
|
|
138
|
+
setOpenMobile,
|
|
139
|
+
toggleSidebar,
|
|
140
|
+
],
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<SidebarContext.Provider value={contextValue}>
|
|
145
|
+
<TooltipProvider delayDuration={0}>
|
|
146
|
+
<div
|
|
147
|
+
style={
|
|
148
|
+
{
|
|
149
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
150
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
151
|
+
...style,
|
|
152
|
+
} as React.CSSProperties
|
|
153
|
+
}
|
|
154
|
+
className={cn(
|
|
155
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
|
|
156
|
+
className,
|
|
157
|
+
)}
|
|
158
|
+
ref={ref}
|
|
159
|
+
{...props}
|
|
160
|
+
>
|
|
161
|
+
{children}
|
|
162
|
+
</div>
|
|
163
|
+
</TooltipProvider>
|
|
164
|
+
</SidebarContext.Provider>
|
|
165
|
+
);
|
|
166
|
+
},
|
|
167
|
+
);
|
|
168
|
+
SidebarProvider.displayName = "SidebarProvider";
|
|
169
|
+
|
|
170
|
+
const Sidebar = React.forwardRef<
|
|
171
|
+
HTMLDivElement,
|
|
172
|
+
React.ComponentProps<"div"> & {
|
|
173
|
+
side?: "left" | "right";
|
|
174
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
175
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
176
|
+
}
|
|
177
|
+
>(
|
|
178
|
+
(
|
|
179
|
+
{
|
|
180
|
+
side = "left",
|
|
181
|
+
variant = "sidebar",
|
|
182
|
+
collapsible = "offcanvas",
|
|
183
|
+
className,
|
|
184
|
+
children,
|
|
185
|
+
...props
|
|
186
|
+
},
|
|
187
|
+
ref,
|
|
188
|
+
) => {
|
|
189
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
190
|
+
|
|
191
|
+
if (collapsible === "none") {
|
|
192
|
+
return (
|
|
193
|
+
<div
|
|
194
|
+
className={cn(
|
|
195
|
+
"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
|
|
196
|
+
className,
|
|
197
|
+
)}
|
|
198
|
+
ref={ref}
|
|
199
|
+
{...props}
|
|
200
|
+
>
|
|
201
|
+
{children}
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (isMobile) {
|
|
207
|
+
return (
|
|
208
|
+
<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
|
|
209
|
+
<SheetContent
|
|
210
|
+
data-sidebar="sidebar"
|
|
211
|
+
data-mobile="true"
|
|
212
|
+
className="w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
|
|
213
|
+
style={
|
|
214
|
+
{
|
|
215
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
216
|
+
} as React.CSSProperties
|
|
217
|
+
}
|
|
218
|
+
side={side}
|
|
219
|
+
>
|
|
220
|
+
<SheetTitle className="sr-only">Sidebar</SheetTitle>
|
|
221
|
+
<SheetDescription className="sr-only">
|
|
222
|
+
Mobile sidebar navigation
|
|
223
|
+
</SheetDescription>
|
|
224
|
+
<div className="flex h-full w-full flex-col">{children}</div>
|
|
225
|
+
</SheetContent>
|
|
226
|
+
</Sheet>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<div
|
|
232
|
+
ref={ref}
|
|
233
|
+
className="group peer hidden md:block text-sidebar-foreground"
|
|
234
|
+
data-state={state}
|
|
235
|
+
data-collapsible={state === "collapsed" ? collapsible : ""}
|
|
236
|
+
data-variant={variant}
|
|
237
|
+
data-side={side}
|
|
238
|
+
>
|
|
239
|
+
{/* This is what handles the sidebar gap on desktop */}
|
|
240
|
+
<div
|
|
241
|
+
className={cn(
|
|
242
|
+
"duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear",
|
|
243
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
244
|
+
"group-data-[side=right]:rotate-180",
|
|
245
|
+
variant === "floating" || variant === "inset"
|
|
246
|
+
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]"
|
|
247
|
+
: "group-data-[collapsible=icon]:w-[--sidebar-width-icon]",
|
|
248
|
+
)}
|
|
249
|
+
/>
|
|
250
|
+
<div
|
|
251
|
+
className={cn(
|
|
252
|
+
"duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",
|
|
253
|
+
side === "left"
|
|
254
|
+
? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
|
|
255
|
+
: "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
256
|
+
// Adjust the padding for floating and inset variants.
|
|
257
|
+
variant === "floating" || variant === "inset"
|
|
258
|
+
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]"
|
|
259
|
+
: "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
260
|
+
className,
|
|
261
|
+
)}
|
|
262
|
+
{...props}
|
|
263
|
+
>
|
|
264
|
+
<div
|
|
265
|
+
data-sidebar="sidebar"
|
|
266
|
+
className="flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow"
|
|
267
|
+
>
|
|
268
|
+
{children}
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
);
|
|
273
|
+
},
|
|
274
|
+
);
|
|
275
|
+
Sidebar.displayName = "Sidebar";
|
|
276
|
+
|
|
277
|
+
const SidebarTrigger = React.forwardRef<
|
|
278
|
+
React.ElementRef<typeof Button>,
|
|
279
|
+
React.ComponentProps<typeof Button>
|
|
280
|
+
>(({ className, onClick, ...props }, ref) => {
|
|
281
|
+
const { toggleSidebar } = useSidebar();
|
|
282
|
+
|
|
283
|
+
return (
|
|
284
|
+
<Button
|
|
285
|
+
ref={ref}
|
|
286
|
+
data-sidebar="trigger"
|
|
287
|
+
variant="ghost"
|
|
288
|
+
size="icon"
|
|
289
|
+
className={cn("h-7 w-7", className)}
|
|
290
|
+
onClick={(event) => {
|
|
291
|
+
onClick?.(event);
|
|
292
|
+
toggleSidebar();
|
|
293
|
+
}}
|
|
294
|
+
{...props}
|
|
295
|
+
>
|
|
296
|
+
<IconLayoutSidebar />
|
|
297
|
+
<span className="sr-only">Toggle Sidebar</span>
|
|
298
|
+
</Button>
|
|
299
|
+
);
|
|
300
|
+
});
|
|
301
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
302
|
+
|
|
303
|
+
const SidebarRail = React.forwardRef<
|
|
304
|
+
HTMLButtonElement,
|
|
305
|
+
React.ComponentProps<"button">
|
|
306
|
+
>(({ className, ...props }, ref) => {
|
|
307
|
+
const { toggleSidebar } = useSidebar();
|
|
308
|
+
|
|
309
|
+
return (
|
|
310
|
+
<button
|
|
311
|
+
ref={ref}
|
|
312
|
+
data-sidebar="rail"
|
|
313
|
+
aria-label="Toggle Sidebar"
|
|
314
|
+
tabIndex={-1}
|
|
315
|
+
onClick={toggleSidebar}
|
|
316
|
+
title="Toggle Sidebar"
|
|
317
|
+
className={cn(
|
|
318
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
319
|
+
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
320
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
321
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
|
|
322
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
323
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
324
|
+
className,
|
|
325
|
+
)}
|
|
326
|
+
{...props}
|
|
327
|
+
/>
|
|
328
|
+
);
|
|
329
|
+
});
|
|
330
|
+
SidebarRail.displayName = "SidebarRail";
|
|
331
|
+
|
|
332
|
+
const SidebarInset = React.forwardRef<
|
|
333
|
+
HTMLDivElement,
|
|
334
|
+
React.ComponentProps<"main">
|
|
335
|
+
>(({ className, ...props }, ref) => {
|
|
336
|
+
return (
|
|
337
|
+
<main
|
|
338
|
+
ref={ref}
|
|
339
|
+
className={cn(
|
|
340
|
+
"relative flex min-h-svh flex-1 flex-col bg-background",
|
|
341
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
|
|
342
|
+
className,
|
|
343
|
+
)}
|
|
344
|
+
{...props}
|
|
345
|
+
/>
|
|
346
|
+
);
|
|
347
|
+
});
|
|
348
|
+
SidebarInset.displayName = "SidebarInset";
|
|
349
|
+
|
|
350
|
+
const SidebarInput = React.forwardRef<
|
|
351
|
+
React.ElementRef<typeof Input>,
|
|
352
|
+
React.ComponentProps<typeof Input>
|
|
353
|
+
>(({ className, ...props }, ref) => {
|
|
354
|
+
return (
|
|
355
|
+
<Input
|
|
356
|
+
ref={ref}
|
|
357
|
+
data-sidebar="input"
|
|
358
|
+
className={cn(
|
|
359
|
+
"h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
|
|
360
|
+
className,
|
|
361
|
+
)}
|
|
362
|
+
{...props}
|
|
363
|
+
/>
|
|
364
|
+
);
|
|
365
|
+
});
|
|
366
|
+
SidebarInput.displayName = "SidebarInput";
|
|
367
|
+
|
|
368
|
+
const SidebarHeader = React.forwardRef<
|
|
369
|
+
HTMLDivElement,
|
|
370
|
+
React.ComponentProps<"div">
|
|
371
|
+
>(({ className, ...props }, ref) => {
|
|
372
|
+
return (
|
|
373
|
+
<div
|
|
374
|
+
ref={ref}
|
|
375
|
+
data-sidebar="header"
|
|
376
|
+
className={cn("flex flex-col gap-2 p-2", className)}
|
|
377
|
+
{...props}
|
|
378
|
+
/>
|
|
379
|
+
);
|
|
380
|
+
});
|
|
381
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
382
|
+
|
|
383
|
+
const SidebarFooter = React.forwardRef<
|
|
384
|
+
HTMLDivElement,
|
|
385
|
+
React.ComponentProps<"div">
|
|
386
|
+
>(({ className, ...props }, ref) => {
|
|
387
|
+
return (
|
|
388
|
+
<div
|
|
389
|
+
ref={ref}
|
|
390
|
+
data-sidebar="footer"
|
|
391
|
+
className={cn("flex flex-col gap-2 p-2", className)}
|
|
392
|
+
{...props}
|
|
393
|
+
/>
|
|
394
|
+
);
|
|
395
|
+
});
|
|
396
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
397
|
+
|
|
398
|
+
const SidebarSeparator = React.forwardRef<
|
|
399
|
+
React.ElementRef<typeof Separator>,
|
|
400
|
+
React.ComponentProps<typeof Separator>
|
|
401
|
+
>(({ className, ...props }, ref) => {
|
|
402
|
+
return (
|
|
403
|
+
<Separator
|
|
404
|
+
ref={ref}
|
|
405
|
+
data-sidebar="separator"
|
|
406
|
+
className={cn("mx-2 w-auto bg-sidebar-border", className)}
|
|
407
|
+
{...props}
|
|
408
|
+
/>
|
|
409
|
+
);
|
|
410
|
+
});
|
|
411
|
+
SidebarSeparator.displayName = "SidebarSeparator";
|
|
412
|
+
|
|
413
|
+
const SidebarContent = React.forwardRef<
|
|
414
|
+
HTMLDivElement,
|
|
415
|
+
React.ComponentProps<"div">
|
|
416
|
+
>(({ className, ...props }, ref) => {
|
|
417
|
+
return (
|
|
418
|
+
<div
|
|
419
|
+
ref={ref}
|
|
420
|
+
data-sidebar="content"
|
|
421
|
+
className={cn(
|
|
422
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
423
|
+
className,
|
|
424
|
+
)}
|
|
425
|
+
{...props}
|
|
426
|
+
/>
|
|
427
|
+
);
|
|
428
|
+
});
|
|
429
|
+
SidebarContent.displayName = "SidebarContent";
|
|
430
|
+
|
|
431
|
+
const SidebarGroup = React.forwardRef<
|
|
432
|
+
HTMLDivElement,
|
|
433
|
+
React.ComponentProps<"div">
|
|
434
|
+
>(({ className, ...props }, ref) => {
|
|
435
|
+
return (
|
|
436
|
+
<div
|
|
437
|
+
ref={ref}
|
|
438
|
+
data-sidebar="group"
|
|
439
|
+
className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
|
|
440
|
+
{...props}
|
|
441
|
+
/>
|
|
442
|
+
);
|
|
443
|
+
});
|
|
444
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
445
|
+
|
|
446
|
+
const SidebarGroupLabel = React.forwardRef<
|
|
447
|
+
HTMLDivElement,
|
|
448
|
+
React.ComponentProps<"div"> & { asChild?: boolean }
|
|
449
|
+
>(({ className, asChild = false, ...props }, ref) => {
|
|
450
|
+
const Comp = asChild ? Slot : "div";
|
|
451
|
+
|
|
452
|
+
return (
|
|
453
|
+
<Comp
|
|
454
|
+
ref={ref}
|
|
455
|
+
data-sidebar="group-label"
|
|
456
|
+
className={cn(
|
|
457
|
+
"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
458
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
459
|
+
className,
|
|
460
|
+
)}
|
|
461
|
+
{...props}
|
|
462
|
+
/>
|
|
463
|
+
);
|
|
464
|
+
});
|
|
465
|
+
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
466
|
+
|
|
467
|
+
const SidebarGroupAction = React.forwardRef<
|
|
468
|
+
HTMLButtonElement,
|
|
469
|
+
React.ComponentProps<"button"> & { asChild?: boolean }
|
|
470
|
+
>(({ className, asChild = false, ...props }, ref) => {
|
|
471
|
+
const Comp = asChild ? Slot : "button";
|
|
472
|
+
|
|
473
|
+
return (
|
|
474
|
+
<Comp
|
|
475
|
+
ref={ref}
|
|
476
|
+
data-sidebar="group-action"
|
|
477
|
+
className={cn(
|
|
478
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
479
|
+
// Increases the hit area of the button on mobile.
|
|
480
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
481
|
+
"group-data-[collapsible=icon]:hidden",
|
|
482
|
+
className,
|
|
483
|
+
)}
|
|
484
|
+
{...props}
|
|
485
|
+
/>
|
|
486
|
+
);
|
|
487
|
+
});
|
|
488
|
+
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
489
|
+
|
|
490
|
+
const SidebarGroupContent = React.forwardRef<
|
|
491
|
+
HTMLDivElement,
|
|
492
|
+
React.ComponentProps<"div">
|
|
493
|
+
>(({ className, ...props }, ref) => (
|
|
494
|
+
<div
|
|
495
|
+
ref={ref}
|
|
496
|
+
data-sidebar="group-content"
|
|
497
|
+
className={cn("w-full text-sm", className)}
|
|
498
|
+
{...props}
|
|
499
|
+
/>
|
|
500
|
+
));
|
|
501
|
+
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
502
|
+
|
|
503
|
+
const SidebarMenu = React.forwardRef<
|
|
504
|
+
HTMLUListElement,
|
|
505
|
+
React.ComponentProps<"ul">
|
|
506
|
+
>(({ className, ...props }, ref) => (
|
|
507
|
+
<ul
|
|
508
|
+
ref={ref}
|
|
509
|
+
data-sidebar="menu"
|
|
510
|
+
className={cn("flex w-full min-w-0 flex-col gap-1", className)}
|
|
511
|
+
{...props}
|
|
512
|
+
/>
|
|
513
|
+
));
|
|
514
|
+
SidebarMenu.displayName = "SidebarMenu";
|
|
515
|
+
|
|
516
|
+
const SidebarMenuItem = React.forwardRef<
|
|
517
|
+
HTMLLIElement,
|
|
518
|
+
React.ComponentProps<"li">
|
|
519
|
+
>(({ className, ...props }, ref) => (
|
|
520
|
+
<li
|
|
521
|
+
ref={ref}
|
|
522
|
+
data-sidebar="menu-item"
|
|
523
|
+
className={cn("group/menu-item relative", className)}
|
|
524
|
+
{...props}
|
|
525
|
+
/>
|
|
526
|
+
));
|
|
527
|
+
SidebarMenuItem.displayName = "SidebarMenuItem";
|
|
528
|
+
|
|
529
|
+
const sidebarMenuButtonVariants = cva(
|
|
530
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
531
|
+
{
|
|
532
|
+
variants: {
|
|
533
|
+
variant: {
|
|
534
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
535
|
+
outline:
|
|
536
|
+
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
|
|
537
|
+
},
|
|
538
|
+
size: {
|
|
539
|
+
default: "h-8 text-sm",
|
|
540
|
+
sm: "h-7 text-xs",
|
|
541
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0",
|
|
542
|
+
},
|
|
543
|
+
},
|
|
544
|
+
defaultVariants: {
|
|
545
|
+
variant: "default",
|
|
546
|
+
size: "default",
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
);
|
|
550
|
+
|
|
551
|
+
const SidebarMenuButton = React.forwardRef<
|
|
552
|
+
HTMLButtonElement,
|
|
553
|
+
React.ComponentProps<"button"> & {
|
|
554
|
+
asChild?: boolean;
|
|
555
|
+
isActive?: boolean;
|
|
556
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
557
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>
|
|
558
|
+
>(
|
|
559
|
+
(
|
|
560
|
+
{
|
|
561
|
+
asChild = false,
|
|
562
|
+
isActive = false,
|
|
563
|
+
variant = "default",
|
|
564
|
+
size = "default",
|
|
565
|
+
tooltip,
|
|
566
|
+
className,
|
|
567
|
+
...props
|
|
568
|
+
},
|
|
569
|
+
ref,
|
|
570
|
+
) => {
|
|
571
|
+
const Comp = asChild ? Slot : "button";
|
|
572
|
+
const { isMobile, state } = useSidebar();
|
|
573
|
+
|
|
574
|
+
const button = (
|
|
575
|
+
<Comp
|
|
576
|
+
ref={ref}
|
|
577
|
+
data-sidebar="menu-button"
|
|
578
|
+
data-size={size}
|
|
579
|
+
data-active={isActive}
|
|
580
|
+
className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
|
|
581
|
+
{...props}
|
|
582
|
+
/>
|
|
583
|
+
);
|
|
584
|
+
|
|
585
|
+
if (!tooltip) {
|
|
586
|
+
return button;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
if (typeof tooltip === "string") {
|
|
590
|
+
tooltip = {
|
|
591
|
+
children: tooltip,
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
return (
|
|
596
|
+
<Tooltip>
|
|
597
|
+
<TooltipTrigger asChild>{button}</TooltipTrigger>
|
|
598
|
+
<TooltipContent
|
|
599
|
+
side="right"
|
|
600
|
+
align="center"
|
|
601
|
+
hidden={state !== "collapsed" || isMobile}
|
|
602
|
+
{...tooltip}
|
|
603
|
+
/>
|
|
604
|
+
</Tooltip>
|
|
605
|
+
);
|
|
606
|
+
},
|
|
607
|
+
);
|
|
608
|
+
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
609
|
+
|
|
610
|
+
const SidebarMenuAction = React.forwardRef<
|
|
611
|
+
HTMLButtonElement,
|
|
612
|
+
React.ComponentProps<"button"> & {
|
|
613
|
+
asChild?: boolean;
|
|
614
|
+
showOnHover?: boolean;
|
|
615
|
+
}
|
|
616
|
+
>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
617
|
+
const Comp = asChild ? Slot : "button";
|
|
618
|
+
|
|
619
|
+
return (
|
|
620
|
+
<Comp
|
|
621
|
+
ref={ref}
|
|
622
|
+
data-sidebar="menu-action"
|
|
623
|
+
className={cn(
|
|
624
|
+
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
|
625
|
+
// Increases the hit area of the button on mobile.
|
|
626
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
627
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
628
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
629
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
630
|
+
"group-data-[collapsible=icon]:hidden",
|
|
631
|
+
showOnHover &&
|
|
632
|
+
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
|
|
633
|
+
className,
|
|
634
|
+
)}
|
|
635
|
+
{...props}
|
|
636
|
+
/>
|
|
637
|
+
);
|
|
638
|
+
});
|
|
639
|
+
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
640
|
+
|
|
641
|
+
const SidebarMenuBadge = React.forwardRef<
|
|
642
|
+
HTMLDivElement,
|
|
643
|
+
React.ComponentProps<"div">
|
|
644
|
+
>(({ className, ...props }, ref) => (
|
|
645
|
+
<div
|
|
646
|
+
ref={ref}
|
|
647
|
+
data-sidebar="menu-badge"
|
|
648
|
+
className={cn(
|
|
649
|
+
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none",
|
|
650
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
651
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
652
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
653
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
654
|
+
"group-data-[collapsible=icon]:hidden",
|
|
655
|
+
className,
|
|
656
|
+
)}
|
|
657
|
+
{...props}
|
|
658
|
+
/>
|
|
659
|
+
));
|
|
660
|
+
SidebarMenuBadge.displayName = "SidebarMenuBadge";
|
|
661
|
+
|
|
662
|
+
const SidebarMenuSkeleton = React.forwardRef<
|
|
663
|
+
HTMLDivElement,
|
|
664
|
+
React.ComponentProps<"div"> & {
|
|
665
|
+
showIcon?: boolean;
|
|
666
|
+
}
|
|
667
|
+
>(({ className, showIcon = false, ...props }, ref) => {
|
|
668
|
+
// Random width between 50 to 90%.
|
|
669
|
+
const width = React.useMemo(() => {
|
|
670
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
671
|
+
}, []);
|
|
672
|
+
|
|
673
|
+
return (
|
|
674
|
+
<div
|
|
675
|
+
ref={ref}
|
|
676
|
+
data-sidebar="menu-skeleton"
|
|
677
|
+
className={cn("rounded-md h-8 flex gap-2 px-2 items-center", className)}
|
|
678
|
+
{...props}
|
|
679
|
+
>
|
|
680
|
+
{showIcon && (
|
|
681
|
+
<Skeleton
|
|
682
|
+
className="size-4 rounded-md"
|
|
683
|
+
data-sidebar="menu-skeleton-icon"
|
|
684
|
+
/>
|
|
685
|
+
)}
|
|
686
|
+
<Skeleton
|
|
687
|
+
className="h-4 flex-1 max-w-[--skeleton-width]"
|
|
688
|
+
data-sidebar="menu-skeleton-text"
|
|
689
|
+
style={
|
|
690
|
+
{
|
|
691
|
+
"--skeleton-width": width,
|
|
692
|
+
} as React.CSSProperties
|
|
693
|
+
}
|
|
694
|
+
/>
|
|
695
|
+
</div>
|
|
696
|
+
);
|
|
697
|
+
});
|
|
698
|
+
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
699
|
+
|
|
700
|
+
const SidebarMenuSub = React.forwardRef<
|
|
701
|
+
HTMLUListElement,
|
|
702
|
+
React.ComponentProps<"ul">
|
|
703
|
+
>(({ className, ...props }, ref) => (
|
|
704
|
+
<ul
|
|
705
|
+
ref={ref}
|
|
706
|
+
data-sidebar="menu-sub"
|
|
707
|
+
className={cn(
|
|
708
|
+
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",
|
|
709
|
+
"group-data-[collapsible=icon]:hidden",
|
|
710
|
+
className,
|
|
711
|
+
)}
|
|
712
|
+
{...props}
|
|
713
|
+
/>
|
|
714
|
+
));
|
|
715
|
+
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
716
|
+
|
|
717
|
+
const SidebarMenuSubItem = React.forwardRef<
|
|
718
|
+
HTMLLIElement,
|
|
719
|
+
React.ComponentProps<"li">
|
|
720
|
+
>(({ ...props }, ref) => <li ref={ref} {...props} />);
|
|
721
|
+
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
722
|
+
|
|
723
|
+
const SidebarMenuSubButton = React.forwardRef<
|
|
724
|
+
HTMLAnchorElement,
|
|
725
|
+
React.ComponentProps<"a"> & {
|
|
726
|
+
asChild?: boolean;
|
|
727
|
+
size?: "sm" | "md";
|
|
728
|
+
isActive?: boolean;
|
|
729
|
+
}
|
|
730
|
+
>(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
731
|
+
const Comp = asChild ? Slot : "a";
|
|
732
|
+
|
|
733
|
+
return (
|
|
734
|
+
<Comp
|
|
735
|
+
ref={ref}
|
|
736
|
+
data-sidebar="menu-sub-button"
|
|
737
|
+
data-size={size}
|
|
738
|
+
data-active={isActive}
|
|
739
|
+
className={cn(
|
|
740
|
+
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
|
|
741
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
742
|
+
size === "sm" && "text-xs",
|
|
743
|
+
size === "md" && "text-sm",
|
|
744
|
+
"group-data-[collapsible=icon]:hidden",
|
|
745
|
+
className,
|
|
746
|
+
)}
|
|
747
|
+
{...props}
|
|
748
|
+
/>
|
|
749
|
+
);
|
|
750
|
+
});
|
|
751
|
+
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
752
|
+
|
|
753
|
+
export {
|
|
754
|
+
Sidebar,
|
|
755
|
+
SidebarContent,
|
|
756
|
+
SidebarFooter,
|
|
757
|
+
SidebarGroup,
|
|
758
|
+
SidebarGroupAction,
|
|
759
|
+
SidebarGroupContent,
|
|
760
|
+
SidebarGroupLabel,
|
|
761
|
+
SidebarHeader,
|
|
762
|
+
SidebarInput,
|
|
763
|
+
SidebarInset,
|
|
764
|
+
SidebarMenu,
|
|
765
|
+
SidebarMenuAction,
|
|
766
|
+
SidebarMenuBadge,
|
|
767
|
+
SidebarMenuButton,
|
|
768
|
+
SidebarMenuItem,
|
|
769
|
+
SidebarMenuSkeleton,
|
|
770
|
+
SidebarMenuSub,
|
|
771
|
+
SidebarMenuSubButton,
|
|
772
|
+
SidebarMenuSubItem,
|
|
773
|
+
SidebarProvider,
|
|
774
|
+
SidebarRail,
|
|
775
|
+
SidebarSeparator,
|
|
776
|
+
SidebarTrigger,
|
|
777
|
+
useSidebar,
|
|
778
|
+
};
|