@processfocus/runtime-local 0.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +28 -0
- package/README.md +290 -0
- package/dist/authentication-server.mjs +188 -0
- package/dist/chunk-2sb4v2sx.js +70 -0
- package/dist/chunk-9weqs8n8.js +56031 -0
- package/dist/chunk-mvkr77wp.js +54113 -0
- package/dist/chunk-tkn4cnc8.js +453 -0
- package/dist/chunk-vpsm84e8.js +85 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/app-icons/[...path]/route.ts +63 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/health/page.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/public-form-branding/[...path]/route.ts +95 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/actions.ts +248 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/delegations-client.tsx +751 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/page.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/client-index.tsx +375 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/client.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/client.tsx +73 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/page.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/process-state/page.tsx +22 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/[executionId]/page.tsx +11 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/[executionId]/process-state/page.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/abandon-execution-dialog.tsx +137 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/execution-card-menu.tsx +233 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/layout.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/page.tsx +1549 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-dialog.tsx +91 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-modal-client.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-page-client.tsx +31 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-route-fallback.tsx +18 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/restart-execution-feedback.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/layout.tsx +129 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/client.tsx +215 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/page.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/list-page-client.tsx +678 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/loading.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/page.tsx +228 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-create-form.tsx +147 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-item-edit-form.tsx +246 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/metric-control-url-state.ts +71 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-deleted-callback.ts +22 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-item-detail.ts +315 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/client.tsx +259 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/page.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/layout.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-detail-title.ts +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-refresh.ts +26 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/utils.ts +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/loading.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/org-chart/org-chart-client.tsx +74 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/org-chart/page.tsx +120 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/page.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/actions.ts +188 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/page.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/passkeys-client.tsx +320 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/client.tsx +152 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/page.tsx +41 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/client.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/process-form-actions.tsx +105 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/process-submit-button.tsx +81 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/start-process-form.tsx +282 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/layout.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/lib/mobile-process-catalog.ts +28 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/lib/start-process-actions.ts +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/loading.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/page.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/processes-client.tsx +504 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/client.tsx +153 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/page.tsx +39 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/loading.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/page.tsx +131 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/process-documentation.tsx +209 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/use-workflow-auto-refresh.ts +120 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-flow.tsx +319 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-form-preview-sheet.tsx +98 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/loading.tsx +1 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/page.tsx +100 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/access-handbook.tsx +110 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/authorization-loading.tsx +25 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/authorization-tabs.tsx +47 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-authorize.ts +261 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-helpers.ts +17 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-source.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-types.ts +79 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/evaluate-cedar.ts +43 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/explorer.tsx +526 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/layout.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/load-cedar.ts +174 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/load-handbook.ts +390 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/org-data.ts +70 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/[invitationId]/page.tsx +22 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/invitation-detail-client.tsx +594 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/invitation-detail-skeleton.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/new/page.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations-table.tsx +186 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/page.tsx +69 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/providers-table.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/roles-table.tsx +62 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/settings-client.tsx +244 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/client.tsx +329 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/page.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/tokens/page.tsx +39 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users-table.tsx +82 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/error.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/not-found.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/page.tsx +84 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/stats-data-fetcher.tsx +93 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/client.tsx +143 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/page.tsx +50 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/complete/[...stepPath]/client.tsx +131 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/complete/[...stepPath]/page.tsx +50 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/complete-todo-form.tsx +172 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/public-completion-correction-form.tsx +233 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/todo-form-actions.tsx +26 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/correct/[...stepPath]/page.tsx +58 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/layout.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/lib/mobile-todo-list.ts +154 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/page.tsx +1317 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/callback/route.ts +259 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/delegation/route.ts +127 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/login/route.ts +49 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/logout/route.ts +33 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/auth-options/route.ts +79 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/auth-verify/route.ts +142 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/register/route.ts +103 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/register-verify/route.ts +136 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/registration-session/route.ts +129 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/start/route.ts +153 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/refresh/route.ts +122 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/switch-role/route.ts +177 -0
- package/dist/dashboard-source/apps/frontend/app/api/dev/import-completed/route.ts +22 -0
- package/dist/dashboard-source/apps/frontend/app/api/dev/import-events/route.ts +38 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/lookup/route.ts +266 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/submit/route.ts +118 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/test-host/route.ts +125 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/calendar-slots/route.ts +44 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/complete/route.ts +56 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/lookup/route.ts +61 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/request-fresh-link/route.ts +41 -0
- package/dist/dashboard-source/apps/frontend/app/api/revalidate/route.ts +61 -0
- package/dist/dashboard-source/apps/frontend/app/app-shell.tsx +100 -0
- package/dist/dashboard-source/apps/frontend/app/cli-auth/route.ts +261 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/embed-client.tsx +393 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/loading.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/page.tsx +51 -0
- package/dist/dashboard-source/apps/frontend/app/embed/embedded.css +48 -0
- package/dist/dashboard-source/apps/frontend/app/embed/layout.tsx +15 -0
- package/dist/dashboard-source/apps/frontend/app/global.css +13 -0
- package/dist/dashboard-source/apps/frontend/app/layout.tsx +102 -0
- package/dist/dashboard-source/apps/frontend/app/login/layout.tsx +9 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-button.tsx +35 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-form-content.tsx +117 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-form.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/app/login/page.tsx +52 -0
- package/dist/dashboard-source/apps/frontend/app/login/passkey-button.tsx +226 -0
- package/dist/dashboard-source/apps/frontend/app/login/secret-login-form.tsx +91 -0
- package/dist/dashboard-source/apps/frontend/app/manifest.ts +7 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/error.tsx +63 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/layout.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/page.tsx +129 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-card.tsx +42 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-context.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-html.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-todo-client.tsx +553 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-todo-state-content.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/app/public.css +33 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/layout.tsx +49 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/page.tsx +36 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/register-passkey-client.tsx +292 -0
- package/dist/dashboard-source/apps/frontend/app/theme.css +117 -0
- package/dist/dashboard-source/apps/frontend/components/DashboardSection.tsx +693 -0
- package/dist/dashboard-source/apps/frontend/components/Header.tsx +481 -0
- package/dist/dashboard-source/apps/frontend/components/OrgUnitNode.tsx +41 -0
- package/dist/dashboard-source/apps/frontend/components/app-sidebar.tsx +245 -0
- package/dist/dashboard-source/apps/frontend/components/auth-provider.tsx +158 -0
- package/dist/dashboard-source/apps/frontend/components/collections/collection-table-card.tsx +218 -0
- package/dist/dashboard-source/apps/frontend/components/collections/collection-table-header-row.tsx +97 -0
- package/dist/dashboard-source/apps/frontend/components/config-provider.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/copy-button.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/components/dashboard-activity.tsx +35 -0
- package/dist/dashboard-source/apps/frontend/components/dashboard-skeleton.tsx +17 -0
- package/dist/dashboard-source/apps/frontend/components/delegation-expiry.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/components/feature-permissions-provider.tsx +28 -0
- package/dist/dashboard-source/apps/frontend/components/form-dialog-content.tsx +66 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-host.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-identify.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-provider.tsx +55 -0
- package/dist/dashboard-source/apps/frontend/components/journey-timeline.tsx +378 -0
- package/dist/dashboard-source/apps/frontend/components/mobile-home-switchboard.tsx +98 -0
- package/dist/dashboard-source/apps/frontend/components/mocks-provider.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/notification-bell.tsx +137 -0
- package/dist/dashboard-source/apps/frontend/components/org-settings-provider.tsx +26 -0
- package/dist/dashboard-source/apps/frontend/components/process-workflow-link.tsx +36 -0
- package/dist/dashboard-source/apps/frontend/components/session-reissue.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/components/sidebar-lists.tsx +89 -0
- package/dist/dashboard-source/apps/frontend/components/sidebar-stats-views.tsx +65 -0
- package/dist/dashboard-source/apps/frontend/components/theme-provider.tsx +132 -0
- package/dist/dashboard-source/apps/frontend/components/todo-count-badge.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/components/token-refresh-scheduler.tsx +304 -0
- package/dist/dashboard-source/apps/frontend/components/ui/checkbox.tsx +31 -0
- package/dist/dashboard-source/apps/frontend/components/ui/dialog.tsx +142 -0
- package/dist/dashboard-source/apps/frontend/components/ui/dropdown-menu.tsx +256 -0
- package/dist/dashboard-source/apps/frontend/components/ui/input.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/components/ui/pagination.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/components/ui/sheet.tsx +138 -0
- package/dist/dashboard-source/apps/frontend/components/ui/sidebar.tsx +741 -0
- package/dist/dashboard-source/apps/frontend/components/ui/skeleton.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/components/ui/tab-pill.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/components/ui/table.tsx +115 -0
- package/dist/dashboard-source/apps/frontend/components/ui/tooltip.tsx +60 -0
- package/dist/dashboard-source/apps/frontend/components/without-waiting-badge.tsx +24 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/step-node.tsx +116 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/swimlane-node.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/workflow-edge.tsx +172 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-process-save.ts +189 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-state.ts +79 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-form-metadata.ts +74 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-mobile.ts +27 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-notification-preference.ts +246 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-processes-query.ts +56 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-weekly-execution-stats.ts +101 -0
- package/dist/dashboard-source/apps/frontend/index.d.ts +12 -0
- package/dist/dashboard-source/apps/frontend/instrumentation.node.ts +25 -0
- package/dist/dashboard-source/apps/frontend/instrumentation.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/app-icons-metadata.ts +66 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/adapter.ts +128 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/client.ts +355 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/config.ts +18 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/reconnect-registry.ts +34 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/act-on-behalf-menu.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/callback-error.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/client-session.ts +32 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/client.ts +46 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/config.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/delegations.ts +62 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/issuer.ts +164 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/jwt.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/logout.ts +35 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/passkeys-menu.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/passkeys.ts +117 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/providers.ts +52 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/realtime-session-token.ts +62 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/reauthentication-state.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/redirect.ts +105 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/secret-login-presentation.ts +33 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session-cache-scope.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session-role.ts +6 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session.ts +277 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/ssr-session.ts +76 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/verify-passkey.ts +95 -0
- package/dist/dashboard-source/apps/frontend/lib/authorization-tabs.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/cedar-highlight.ts +116 -0
- package/dist/dashboard-source/apps/frontend/lib/client-plugin-error-reporting.ts +28 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/collection-provider-factory.tsx +1119 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/collection-provider-scope.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/database-error-ui.tsx +61 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/draft-process-execution-collection-provider.tsx +32 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/draft-process-execution.ts +161 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/execution-collection-provider.tsx +42 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/execution.ts +215 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/graphql-stream.ts +123 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/process-collection-provider.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/process.ts +123 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/replication-factory.ts +394 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/replication-registry.ts +196 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-database-name.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-lifecycle.ts +368 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-provider.tsx +577 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/todo-collection-provider.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/todo.ts +133 -0
- package/dist/dashboard-source/apps/frontend/lib/current-provider-user.ts +30 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/frontend-port-file.ts +41 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-events.ts +21 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-query-invalidation.tsx +62 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-refresh.ts +40 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/error-boundary.tsx +84 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/index.ts +31 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/params.ts +57 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/run-effect.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/runtime.ts +168 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/access-token.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/authorization.ts +206 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/form-validation.ts +36 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/graphql.ts +94 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/index.ts +21 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-manifest-store.ts +20 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-manifest.ts +152 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-request-origin.ts +39 -0
- package/dist/dashboard-source/apps/frontend/lib/errors/get-display-error-message.ts +22 -0
- package/dist/dashboard-source/apps/frontend/lib/execution-menu-actions-registry.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/feature-permissions.ts +13 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-boot-health.tsx +161 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-client-plugin-registry.ts +45 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-manifest-store.ts +214 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-manifest.ts +74 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-plugin-loaders.ts +191 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/fragment-masking.ts +87 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/gql.ts +292 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/graphql.ts +443 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/index.ts +2 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-consumer.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-error-reporting.ts +268 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-provider.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/dashboard-activity.ts +7 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/dependent-lookup-query.ts +78 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/endpoint.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/execution-queries.ts +70 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/file-upload-provider.tsx +82 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/graphql-identifiers.ts +10 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/list-queries.ts +327 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/lookup-provider.tsx +81 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/org-chart-operations.ts +63 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/org-chart-queries.ts +67 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/provider-user-queries.ts +65 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/queries.ts +80 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/server-client.ts +15 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/settings-queries.ts +634 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/stats-views-server.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/stats-views.ts +33 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/user-queries.ts +138 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-operations.ts +54 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-queries.ts +50 -0
- package/dist/dashboard-source/apps/frontend/lib/mobile-home-view-model.ts +74 -0
- package/dist/dashboard-source/apps/frontend/lib/mobile-shell-policy.ts +124 -0
- package/dist/dashboard-source/apps/frontend/lib/mock-data.ts +364 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/notification-preference.ts +251 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/todo-notification-observer.ts +178 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/todo-notifications-runtime.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/use-todo-notifications.tsx +103 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-data.ts +50 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-depth-config.ts +71 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-layout.ts +149 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-types.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/org-identity.ts +57 -0
- package/dist/dashboard-source/apps/frontend/lib/organisation-plugin-loaders.ts +13 -0
- package/dist/dashboard-source/apps/frontend/lib/organisation-plugin-preparation.ts +2 -0
- package/dist/dashboard-source/apps/frontend/lib/plugins-client.tsx +99 -0
- package/dist/dashboard-source/apps/frontend/lib/plugins.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-form-runtime.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-graphql-errors.ts +45 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-model.ts +200 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-server.ts +209 -0
- package/dist/dashboard-source/apps/frontend/lib/query-client.ts +41 -0
- package/dist/dashboard-source/apps/frontend/lib/restart-execution-action.ts +76 -0
- package/dist/dashboard-source/apps/frontend/lib/runtime-config.ts +23 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/constants.ts +5 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/otlp-config.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/register-otel.ts +308 -0
- package/dist/dashboard-source/apps/frontend/lib/theme.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/todo-types.ts +64 -0
- package/dist/dashboard-source/apps/frontend/lib/todo-utils.ts +144 -0
- package/dist/dashboard-source/apps/frontend/lib/types/org-identity.ts +7 -0
- package/dist/dashboard-source/apps/frontend/lib/utils.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/constants.ts +118 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/edge-routing.ts +195 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/form-preview.ts +8 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/layout.ts +878 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/types.ts +63 -0
- package/dist/dashboard-source/apps/frontend/next.config.ts +238 -0
- package/dist/dashboard-source/apps/frontend/package.json +71 -0
- package/dist/dashboard-source/apps/frontend/postcss.config.mjs +5 -0
- package/dist/dashboard-source/apps/frontend/proxy.ts +293 -0
- package/dist/dashboard-source/apps/frontend/public/.gitkeep +0 -0
- package/dist/dashboard-source/apps/frontend/public/favicon.ico +0 -0
- package/dist/dashboard-source/apps/frontend/public/processfocus-embed.js +553 -0
- package/dist/dashboard-source/apps/frontend/tsconfig.json +35 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/index.ts +7 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/auth-local-cedar.ts +1397 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/cedar-reload-notifier.ts +18 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/config-base.ts +346 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/policy-watcher.ts +172 -0
- package/dist/dashboard-source/modules/auth-policy/src/index.ts +4 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/auth-policy.ts +263 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/current-principal.ts +34 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/errors.ts +47 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/types.ts +595 -0
- package/dist/dashboard-source/modules/auth-session/src/index.ts +22 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/issuer-url.ts +192 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/realtime-recipient.ts +76 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/session-cache-scope.ts +24 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/subjects.ts +54 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/url.ts +2 -0
- package/dist/dashboard-source/modules/aws-common/src/index.ts +3 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/acm.ts +50 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/otlp-config.ts +66 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/runtime-ssm.ts +28 -0
- package/dist/dashboard-source/modules/effect-json-logger/src/index.ts +1 -0
- package/dist/dashboard-source/modules/effect-json-logger/src/lib/effect-json-logger.ts +65 -0
- package/dist/dashboard-source/modules/form/src/hooks/use-local-storage.ts +78 -0
- package/dist/dashboard-source/modules/form/src/index.ts +20 -0
- package/dist/dashboard-source/modules/form/src/lib/ajv-standard-schema.ts +152 -0
- package/dist/dashboard-source/modules/form/src/lib/client-components-to-form.tsx +1421 -0
- package/dist/dashboard-source/modules/form/src/lib/friendly-validation-message.ts +85 -0
- package/dist/dashboard-source/modules/form/src/lib/lookup-context.tsx +58 -0
- package/dist/dashboard-source/modules/form/src/lib/plugin-registry.ts +34 -0
- package/dist/dashboard-source/modules/form/src/lib/walker.tsx +1554 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/client-form-definition.ts +440 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/plugin-registry.ts +13 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/types.ts +336 -0
- package/dist/dashboard-source/modules/form-rule/src/index.ts +21 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/evaluator.ts +531 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/paths.ts +102 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/types.ts +121 -0
- package/dist/dashboard-source/modules/form-schema/src/index.ts +8 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/annotation-helpers.ts +44 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/deferred-value.ts +21 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/email.ts +50 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/field-count.ts +82 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-annotations.ts +58 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-schema.ts +975 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/phone.ts +60 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/property-signature.ts +45 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/endpoint.ts +137 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/index.ts +11 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/port-files.ts +219 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/index.ts +2 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/browser-plugin-artifact.ts +201 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/frontend-manifest.ts +408 -0
- package/dist/dashboard-source/modules/frontend-plugin-host/src/index.ts +29 -0
- package/dist/dashboard-source/modules/frontend-plugin-host/src/lib/frontend-plugin-host.ts +288 -0
- package/dist/dashboard-source/modules/openauth/src/client.ts +1045 -0
- package/dist/dashboard-source/modules/openauth/src/error.ts +140 -0
- package/dist/dashboard-source/modules/openauth/src/pkce.ts +40 -0
- package/dist/dashboard-source/modules/openauth/src/random.ts +24 -0
- package/dist/dashboard-source/modules/openauth/src/subject.ts +132 -0
- package/dist/dashboard-source/modules/openauth/src/util.ts +13 -0
- package/dist/dashboard-source/modules/request-time/src/index.ts +1 -0
- package/dist/dashboard-source/modules/request-time/src/lib/request-time.ts +30 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/draft-process-execution-schema.json +45 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/execution-schema.json +217 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/process-schema.json +77 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/todo-schema.json +94 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/index.ts +2 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/rxdb-collections.ts +181 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/to-rxdb-schema.ts +166 -0
- package/dist/dashboard-source/modules/shadcn-components/src/index.ts +60 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/boolean-field.tsx +73 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/calendar-slot-field.tsx +808 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-field.tsx +127 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/field-set.tsx +14 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/file-field.tsx +321 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/file-upload-context.tsx +45 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/form-context.tsx +19 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/lookup-field.tsx +394 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/radio-field.tsx +96 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/select-field.tsx +106 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/text-field.tsx +245 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/button.tsx +63 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/checkbox.tsx +31 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/command.tsx +101 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/field.tsx +275 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/input.tsx +29 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/label.tsx +23 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/popover.tsx +31 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/separator.tsx +27 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/textarea.tsx +19 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/utils/utils.ts +4 -0
- package/dist/dashboard-source.json +70 -0
- package/dist/graphql-server.mjs +1319 -0
- package/dist/job-worker.mjs +989 -0
- package/dist/main.mjs +495 -0
- package/dist/prepare-dashboard.mjs +35 -0
- package/dist/resources/cedar/policies.cedar +315 -0
- package/dist/resources/cedar/schema.cedarschema +276 -0
- package/dist/resources/graphql-schema/rxdb.graphql +401 -0
- package/dist/resources/graphql-schema/system.graphql +1200 -0
- package/package.json +98 -0
|
@@ -0,0 +1,741 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
4
|
+
import { type VariantProps, cva } from "class-variance-authority"
|
|
5
|
+
import { PanelLeftIcon } from "lucide-react"
|
|
6
|
+
import * as React from "react"
|
|
7
|
+
import { Button, Input, Separator } from "../../../../modules/shadcn-components/src/index.ts"
|
|
8
|
+
import {
|
|
9
|
+
Sheet,
|
|
10
|
+
SheetContent,
|
|
11
|
+
SheetDescription,
|
|
12
|
+
SheetHeader,
|
|
13
|
+
SheetTitle,
|
|
14
|
+
} from "@/components/ui/sheet"
|
|
15
|
+
import { Skeleton } from "@/components/ui/skeleton"
|
|
16
|
+
import {
|
|
17
|
+
Tooltip,
|
|
18
|
+
TooltipContent,
|
|
19
|
+
TooltipProvider,
|
|
20
|
+
TooltipTrigger,
|
|
21
|
+
} from "@/components/ui/tooltip"
|
|
22
|
+
import { useIsMobile } from "@/hooks/use-mobile"
|
|
23
|
+
import { cn } from "@/lib/utils"
|
|
24
|
+
|
|
25
|
+
const SIDEBAR_COOKIE_NAME = "sidebar_state"
|
|
26
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
|
27
|
+
const SIDEBAR_WIDTH = "18rem"
|
|
28
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem"
|
|
29
|
+
const SIDEBAR_WIDTH_ICON = "3rem"
|
|
30
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b"
|
|
31
|
+
|
|
32
|
+
type SidebarContextProps = {
|
|
33
|
+
state: "expanded" | "collapsed"
|
|
34
|
+
open: boolean
|
|
35
|
+
setOpen: (open: boolean) => void
|
|
36
|
+
openMobile: boolean
|
|
37
|
+
setOpenMobile: (open: boolean) => void
|
|
38
|
+
closeMobileSidebar: () => void
|
|
39
|
+
isMobile: boolean
|
|
40
|
+
toggleSidebar: () => void
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const SidebarContext = React.createContext<SidebarContextProps | null>(null)
|
|
44
|
+
|
|
45
|
+
function useSidebar() {
|
|
46
|
+
const context = React.useContext(SidebarContext)
|
|
47
|
+
if (!context) {
|
|
48
|
+
throw new Error("useSidebar must be used within a SidebarProvider.")
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return context
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function SidebarProvider({
|
|
55
|
+
defaultOpen = true,
|
|
56
|
+
open: openProp,
|
|
57
|
+
onOpenChange: setOpenProp,
|
|
58
|
+
className,
|
|
59
|
+
style,
|
|
60
|
+
children,
|
|
61
|
+
...props
|
|
62
|
+
}: React.ComponentProps<"div"> & {
|
|
63
|
+
defaultOpen?: boolean
|
|
64
|
+
open?: boolean
|
|
65
|
+
onOpenChange?: (open: boolean) => void
|
|
66
|
+
}) {
|
|
67
|
+
const isMobile = useIsMobile()
|
|
68
|
+
const [openMobile, setOpenMobile] = React.useState(false)
|
|
69
|
+
|
|
70
|
+
// This is the internal state of the sidebar.
|
|
71
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
72
|
+
const [_open, _setOpen] = React.useState(defaultOpen)
|
|
73
|
+
const open = openProp ?? _open
|
|
74
|
+
const setOpen = React.useCallback(
|
|
75
|
+
(value: boolean | ((value: boolean) => boolean)) => {
|
|
76
|
+
const openState = typeof value === "function" ? value(open) : value
|
|
77
|
+
if (setOpenProp) {
|
|
78
|
+
setOpenProp(openState)
|
|
79
|
+
} else {
|
|
80
|
+
_setOpen(openState)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// This sets the cookie to keep the sidebar state.
|
|
84
|
+
// biome-ignore lint/suspicious/noDocumentCookie: simple cookie for sidebar state
|
|
85
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
|
|
86
|
+
},
|
|
87
|
+
[setOpenProp, open],
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
// Helper to toggle the sidebar.
|
|
91
|
+
const toggleSidebar = React.useCallback(() => {
|
|
92
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open)
|
|
93
|
+
}, [isMobile, setOpen])
|
|
94
|
+
|
|
95
|
+
const closeMobileSidebar = React.useCallback(() => {
|
|
96
|
+
if (isMobile) {
|
|
97
|
+
setOpenMobile(false)
|
|
98
|
+
}
|
|
99
|
+
}, [isMobile])
|
|
100
|
+
|
|
101
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
104
|
+
if (
|
|
105
|
+
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
106
|
+
(event.metaKey || event.ctrlKey)
|
|
107
|
+
) {
|
|
108
|
+
event.preventDefault()
|
|
109
|
+
toggleSidebar()
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
window.addEventListener("keydown", handleKeyDown)
|
|
114
|
+
return () => window.removeEventListener("keydown", handleKeyDown)
|
|
115
|
+
}, [toggleSidebar])
|
|
116
|
+
|
|
117
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
118
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
119
|
+
const state = open ? "expanded" : "collapsed"
|
|
120
|
+
|
|
121
|
+
const contextValue = React.useMemo<SidebarContextProps>(
|
|
122
|
+
() => ({
|
|
123
|
+
state,
|
|
124
|
+
open,
|
|
125
|
+
setOpen,
|
|
126
|
+
isMobile,
|
|
127
|
+
openMobile,
|
|
128
|
+
setOpenMobile,
|
|
129
|
+
closeMobileSidebar,
|
|
130
|
+
toggleSidebar,
|
|
131
|
+
}),
|
|
132
|
+
[
|
|
133
|
+
state,
|
|
134
|
+
open,
|
|
135
|
+
setOpen,
|
|
136
|
+
isMobile,
|
|
137
|
+
openMobile,
|
|
138
|
+
closeMobileSidebar,
|
|
139
|
+
toggleSidebar,
|
|
140
|
+
],
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<SidebarContext.Provider value={contextValue}>
|
|
145
|
+
<TooltipProvider delayDuration={0}>
|
|
146
|
+
<div
|
|
147
|
+
data-slot="sidebar-wrapper"
|
|
148
|
+
style={
|
|
149
|
+
{
|
|
150
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
151
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
152
|
+
...style,
|
|
153
|
+
} as React.CSSProperties
|
|
154
|
+
}
|
|
155
|
+
className={cn(
|
|
156
|
+
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
|
|
157
|
+
className,
|
|
158
|
+
)}
|
|
159
|
+
{...props}
|
|
160
|
+
>
|
|
161
|
+
{children}
|
|
162
|
+
</div>
|
|
163
|
+
</TooltipProvider>
|
|
164
|
+
</SidebarContext.Provider>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function Sidebar({
|
|
169
|
+
side = "left",
|
|
170
|
+
variant = "sidebar",
|
|
171
|
+
collapsible = "offcanvas",
|
|
172
|
+
className,
|
|
173
|
+
children,
|
|
174
|
+
...props
|
|
175
|
+
}: React.ComponentProps<"div"> & {
|
|
176
|
+
side?: "left" | "right"
|
|
177
|
+
variant?: "sidebar" | "floating" | "inset"
|
|
178
|
+
collapsible?: "offcanvas" | "icon" | "none"
|
|
179
|
+
}) {
|
|
180
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
|
|
181
|
+
|
|
182
|
+
if (collapsible === "none") {
|
|
183
|
+
return (
|
|
184
|
+
<div
|
|
185
|
+
data-slot="sidebar"
|
|
186
|
+
className={cn(
|
|
187
|
+
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
188
|
+
className,
|
|
189
|
+
)}
|
|
190
|
+
{...props}
|
|
191
|
+
>
|
|
192
|
+
{children}
|
|
193
|
+
</div>
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (isMobile) {
|
|
198
|
+
return (
|
|
199
|
+
<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
|
|
200
|
+
<SheetContent
|
|
201
|
+
data-sidebar="sidebar"
|
|
202
|
+
data-slot="sidebar"
|
|
203
|
+
data-mobile="true"
|
|
204
|
+
data-testid="mobile-sidebar"
|
|
205
|
+
className="w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
|
|
206
|
+
style={
|
|
207
|
+
{
|
|
208
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
209
|
+
} as React.CSSProperties
|
|
210
|
+
}
|
|
211
|
+
side={side}
|
|
212
|
+
>
|
|
213
|
+
<SheetHeader className="sr-only">
|
|
214
|
+
<SheetTitle>Sidebar</SheetTitle>
|
|
215
|
+
<SheetDescription>Displays the mobile sidebar.</SheetDescription>
|
|
216
|
+
</SheetHeader>
|
|
217
|
+
<div className="flex h-full w-full flex-col">{children}</div>
|
|
218
|
+
</SheetContent>
|
|
219
|
+
</Sheet>
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return (
|
|
224
|
+
<aside
|
|
225
|
+
className="group peer hidden text-sidebar-foreground md:block"
|
|
226
|
+
data-state={state}
|
|
227
|
+
data-collapsible={state === "collapsed" ? collapsible : ""}
|
|
228
|
+
data-variant={variant}
|
|
229
|
+
data-side={side}
|
|
230
|
+
data-slot="sidebar"
|
|
231
|
+
>
|
|
232
|
+
{/* This is what handles the sidebar gap on desktop */}
|
|
233
|
+
<div
|
|
234
|
+
data-slot="sidebar-gap"
|
|
235
|
+
className={cn(
|
|
236
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
237
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
238
|
+
"group-data-[side=right]:rotate-180",
|
|
239
|
+
variant === "floating" || variant === "inset"
|
|
240
|
+
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
|
|
241
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)",
|
|
242
|
+
)}
|
|
243
|
+
/>
|
|
244
|
+
<div
|
|
245
|
+
data-slot="sidebar-container"
|
|
246
|
+
className={cn(
|
|
247
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
248
|
+
side === "left"
|
|
249
|
+
? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
|
|
250
|
+
: "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
251
|
+
// Adjust the padding for floating and inset variants.
|
|
252
|
+
variant === "floating" || variant === "inset"
|
|
253
|
+
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
|
|
254
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
255
|
+
className,
|
|
256
|
+
)}
|
|
257
|
+
{...props}
|
|
258
|
+
>
|
|
259
|
+
<div
|
|
260
|
+
data-sidebar="sidebar"
|
|
261
|
+
data-slot="sidebar-inner"
|
|
262
|
+
className="flex h-full w-full flex-col bg-sidebar px-5 py-4 group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm"
|
|
263
|
+
>
|
|
264
|
+
{children}
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
</aside>
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function SidebarTrigger({
|
|
272
|
+
className,
|
|
273
|
+
onClick,
|
|
274
|
+
...props
|
|
275
|
+
}: React.ComponentProps<typeof Button>) {
|
|
276
|
+
const { toggleSidebar } = useSidebar()
|
|
277
|
+
|
|
278
|
+
return (
|
|
279
|
+
<Button
|
|
280
|
+
data-sidebar="trigger"
|
|
281
|
+
data-slot="sidebar-trigger"
|
|
282
|
+
variant="ghost"
|
|
283
|
+
size="icon"
|
|
284
|
+
className={cn("size-7", className)}
|
|
285
|
+
onClick={(event) => {
|
|
286
|
+
onClick?.(event)
|
|
287
|
+
toggleSidebar()
|
|
288
|
+
}}
|
|
289
|
+
{...props}
|
|
290
|
+
>
|
|
291
|
+
<PanelLeftIcon />
|
|
292
|
+
<span className="sr-only">Toggle Sidebar</span>
|
|
293
|
+
</Button>
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
|
|
298
|
+
const { toggleSidebar } = useSidebar()
|
|
299
|
+
|
|
300
|
+
return (
|
|
301
|
+
<button
|
|
302
|
+
data-sidebar="rail"
|
|
303
|
+
data-slot="sidebar-rail"
|
|
304
|
+
aria-label="Toggle Sidebar"
|
|
305
|
+
tabIndex={-1}
|
|
306
|
+
onClick={toggleSidebar}
|
|
307
|
+
title="Toggle Sidebar"
|
|
308
|
+
className={cn(
|
|
309
|
+
"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
|
|
310
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
311
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
312
|
+
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
313
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
314
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
315
|
+
className,
|
|
316
|
+
)}
|
|
317
|
+
{...props}
|
|
318
|
+
/>
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
|
|
323
|
+
return (
|
|
324
|
+
<main
|
|
325
|
+
data-slot="sidebar-inset"
|
|
326
|
+
className={cn(
|
|
327
|
+
"bg-background relative flex w-full flex-1 flex-col",
|
|
328
|
+
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
329
|
+
className,
|
|
330
|
+
)}
|
|
331
|
+
{...props}
|
|
332
|
+
/>
|
|
333
|
+
)
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function SidebarInput({
|
|
337
|
+
className,
|
|
338
|
+
...props
|
|
339
|
+
}: React.ComponentProps<typeof Input>) {
|
|
340
|
+
return (
|
|
341
|
+
<Input
|
|
342
|
+
data-slot="sidebar-input"
|
|
343
|
+
data-sidebar="input"
|
|
344
|
+
className={cn("bg-background h-8 w-full shadow-none", className)}
|
|
345
|
+
{...props}
|
|
346
|
+
/>
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
351
|
+
return (
|
|
352
|
+
<div
|
|
353
|
+
data-slot="sidebar-header"
|
|
354
|
+
data-sidebar="header"
|
|
355
|
+
className={cn("flex flex-col gap-2 p-2", className)}
|
|
356
|
+
{...props}
|
|
357
|
+
/>
|
|
358
|
+
)
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
362
|
+
return (
|
|
363
|
+
<div
|
|
364
|
+
data-slot="sidebar-footer"
|
|
365
|
+
data-sidebar="footer"
|
|
366
|
+
className={cn("flex flex-col gap-2 p-2", className)}
|
|
367
|
+
{...props}
|
|
368
|
+
/>
|
|
369
|
+
)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function SidebarSeparator({
|
|
373
|
+
className,
|
|
374
|
+
...props
|
|
375
|
+
}: React.ComponentProps<typeof Separator>) {
|
|
376
|
+
return (
|
|
377
|
+
<Separator
|
|
378
|
+
data-slot="sidebar-separator"
|
|
379
|
+
data-sidebar="separator"
|
|
380
|
+
className={cn("bg-sidebar-border mx-2 w-auto", className)}
|
|
381
|
+
{...props}
|
|
382
|
+
/>
|
|
383
|
+
)
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
387
|
+
return (
|
|
388
|
+
<div
|
|
389
|
+
data-slot="sidebar-content"
|
|
390
|
+
data-sidebar="content"
|
|
391
|
+
className={cn(
|
|
392
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
393
|
+
className,
|
|
394
|
+
)}
|
|
395
|
+
{...props}
|
|
396
|
+
/>
|
|
397
|
+
)
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
401
|
+
return (
|
|
402
|
+
<div
|
|
403
|
+
data-slot="sidebar-group"
|
|
404
|
+
data-sidebar="group"
|
|
405
|
+
className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
|
|
406
|
+
{...props}
|
|
407
|
+
/>
|
|
408
|
+
)
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function SidebarGroupLabel({
|
|
412
|
+
className,
|
|
413
|
+
asChild = false,
|
|
414
|
+
...props
|
|
415
|
+
}: React.ComponentProps<"div"> & { asChild?: boolean }) {
|
|
416
|
+
const Comp = asChild ? Slot : "div"
|
|
417
|
+
|
|
418
|
+
return (
|
|
419
|
+
<Comp
|
|
420
|
+
data-slot="sidebar-group-label"
|
|
421
|
+
data-sidebar="group-label"
|
|
422
|
+
className={cn(
|
|
423
|
+
"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
424
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
425
|
+
className,
|
|
426
|
+
)}
|
|
427
|
+
{...props}
|
|
428
|
+
/>
|
|
429
|
+
)
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
function SidebarGroupAction({
|
|
433
|
+
className,
|
|
434
|
+
asChild = false,
|
|
435
|
+
...props
|
|
436
|
+
}: React.ComponentProps<"button"> & { asChild?: boolean }) {
|
|
437
|
+
const Comp = asChild ? Slot : "button"
|
|
438
|
+
|
|
439
|
+
return (
|
|
440
|
+
<Comp
|
|
441
|
+
data-slot="sidebar-group-action"
|
|
442
|
+
data-sidebar="group-action"
|
|
443
|
+
className={cn(
|
|
444
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
445
|
+
// Increases the hit area of the button on mobile.
|
|
446
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
447
|
+
"group-data-[collapsible=icon]:hidden",
|
|
448
|
+
className,
|
|
449
|
+
)}
|
|
450
|
+
{...props}
|
|
451
|
+
/>
|
|
452
|
+
)
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
function SidebarGroupContent({
|
|
456
|
+
className,
|
|
457
|
+
...props
|
|
458
|
+
}: React.ComponentProps<"div">) {
|
|
459
|
+
return (
|
|
460
|
+
<div
|
|
461
|
+
data-slot="sidebar-group-content"
|
|
462
|
+
data-sidebar="group-content"
|
|
463
|
+
className={cn("w-full text-sm", className)}
|
|
464
|
+
{...props}
|
|
465
|
+
/>
|
|
466
|
+
)
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
|
|
470
|
+
return (
|
|
471
|
+
<ul
|
|
472
|
+
data-slot="sidebar-menu"
|
|
473
|
+
data-sidebar="menu"
|
|
474
|
+
className={cn("flex w-full min-w-0 flex-col gap-1", className)}
|
|
475
|
+
{...props}
|
|
476
|
+
/>
|
|
477
|
+
)
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
481
|
+
return (
|
|
482
|
+
<li
|
|
483
|
+
data-slot="sidebar-menu-item"
|
|
484
|
+
data-sidebar="menu-item"
|
|
485
|
+
className={cn("group/menu-item relative", className)}
|
|
486
|
+
{...props}
|
|
487
|
+
/>
|
|
488
|
+
)
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const sidebarMenuButtonVariants = cva(
|
|
492
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! 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 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
493
|
+
{
|
|
494
|
+
variants: {
|
|
495
|
+
variant: {
|
|
496
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
497
|
+
outline:
|
|
498
|
+
"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))]",
|
|
499
|
+
},
|
|
500
|
+
size: {
|
|
501
|
+
default: "h-8 text-sm",
|
|
502
|
+
sm: "h-7 text-xs",
|
|
503
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
defaultVariants: {
|
|
507
|
+
variant: "default",
|
|
508
|
+
size: "default",
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
function SidebarMenuButton({
|
|
514
|
+
asChild = false,
|
|
515
|
+
isActive = false,
|
|
516
|
+
variant = "default",
|
|
517
|
+
size = "default",
|
|
518
|
+
tooltip,
|
|
519
|
+
className,
|
|
520
|
+
...props
|
|
521
|
+
}: React.ComponentProps<"button"> & {
|
|
522
|
+
asChild?: boolean
|
|
523
|
+
isActive?: boolean
|
|
524
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>
|
|
525
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>) {
|
|
526
|
+
const Comp = asChild ? Slot : "button"
|
|
527
|
+
const { isMobile, state } = useSidebar()
|
|
528
|
+
|
|
529
|
+
const button = (
|
|
530
|
+
<Comp
|
|
531
|
+
data-slot="sidebar-menu-button"
|
|
532
|
+
data-sidebar="menu-button"
|
|
533
|
+
data-size={size}
|
|
534
|
+
data-active={isActive}
|
|
535
|
+
className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
|
|
536
|
+
{...props}
|
|
537
|
+
/>
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
if (!tooltip) {
|
|
541
|
+
return button
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
if (typeof tooltip === "string") {
|
|
545
|
+
tooltip = {
|
|
546
|
+
children: tooltip,
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
return (
|
|
551
|
+
<Tooltip>
|
|
552
|
+
<TooltipTrigger asChild>{button}</TooltipTrigger>
|
|
553
|
+
<TooltipContent
|
|
554
|
+
side="right"
|
|
555
|
+
align="center"
|
|
556
|
+
hidden={state !== "collapsed" || isMobile}
|
|
557
|
+
{...tooltip}
|
|
558
|
+
/>
|
|
559
|
+
</Tooltip>
|
|
560
|
+
)
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
function SidebarMenuAction({
|
|
564
|
+
className,
|
|
565
|
+
asChild = false,
|
|
566
|
+
showOnHover = false,
|
|
567
|
+
...props
|
|
568
|
+
}: React.ComponentProps<"button"> & {
|
|
569
|
+
asChild?: boolean
|
|
570
|
+
showOnHover?: boolean
|
|
571
|
+
}) {
|
|
572
|
+
const Comp = asChild ? Slot : "button"
|
|
573
|
+
|
|
574
|
+
return (
|
|
575
|
+
<Comp
|
|
576
|
+
data-slot="sidebar-menu-action"
|
|
577
|
+
data-sidebar="menu-action"
|
|
578
|
+
className={cn(
|
|
579
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
580
|
+
// Increases the hit area of the button on mobile.
|
|
581
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
582
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
583
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
584
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
585
|
+
"group-data-[collapsible=icon]:hidden",
|
|
586
|
+
showOnHover &&
|
|
587
|
+
"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
|
|
588
|
+
className,
|
|
589
|
+
)}
|
|
590
|
+
{...props}
|
|
591
|
+
/>
|
|
592
|
+
)
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function SidebarMenuBadge({
|
|
596
|
+
className,
|
|
597
|
+
...props
|
|
598
|
+
}: React.ComponentProps<"div">) {
|
|
599
|
+
return (
|
|
600
|
+
<div
|
|
601
|
+
data-slot="sidebar-menu-badge"
|
|
602
|
+
data-sidebar="menu-badge"
|
|
603
|
+
className={cn(
|
|
604
|
+
"text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
|
|
605
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
606
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
607
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
608
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
609
|
+
"group-data-[collapsible=icon]:hidden",
|
|
610
|
+
className,
|
|
611
|
+
)}
|
|
612
|
+
{...props}
|
|
613
|
+
/>
|
|
614
|
+
)
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
function SidebarMenuSkeleton({
|
|
618
|
+
className,
|
|
619
|
+
showIcon = false,
|
|
620
|
+
...props
|
|
621
|
+
}: React.ComponentProps<"div"> & {
|
|
622
|
+
showIcon?: boolean
|
|
623
|
+
}) {
|
|
624
|
+
// Random width between 50 to 90%.
|
|
625
|
+
const [width] = React.useState(
|
|
626
|
+
() => `${Math.floor(Math.random() * 40) + 50}%`,
|
|
627
|
+
)
|
|
628
|
+
|
|
629
|
+
return (
|
|
630
|
+
<div
|
|
631
|
+
data-slot="sidebar-menu-skeleton"
|
|
632
|
+
data-sidebar="menu-skeleton"
|
|
633
|
+
className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
|
|
634
|
+
{...props}
|
|
635
|
+
>
|
|
636
|
+
{showIcon && (
|
|
637
|
+
<Skeleton
|
|
638
|
+
className="size-4 rounded-md"
|
|
639
|
+
data-sidebar="menu-skeleton-icon"
|
|
640
|
+
/>
|
|
641
|
+
)}
|
|
642
|
+
<Skeleton
|
|
643
|
+
className="h-4 max-w-(--skeleton-width) flex-1"
|
|
644
|
+
data-sidebar="menu-skeleton-text"
|
|
645
|
+
style={
|
|
646
|
+
{
|
|
647
|
+
"--skeleton-width": width,
|
|
648
|
+
} as React.CSSProperties
|
|
649
|
+
}
|
|
650
|
+
/>
|
|
651
|
+
</div>
|
|
652
|
+
)
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
|
|
656
|
+
return (
|
|
657
|
+
<ul
|
|
658
|
+
data-slot="sidebar-menu-sub"
|
|
659
|
+
data-sidebar="menu-sub"
|
|
660
|
+
className={cn(
|
|
661
|
+
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
|
|
662
|
+
"group-data-[collapsible=icon]:hidden",
|
|
663
|
+
className,
|
|
664
|
+
)}
|
|
665
|
+
{...props}
|
|
666
|
+
/>
|
|
667
|
+
)
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
function SidebarMenuSubItem({
|
|
671
|
+
className,
|
|
672
|
+
...props
|
|
673
|
+
}: React.ComponentProps<"li">) {
|
|
674
|
+
return (
|
|
675
|
+
<li
|
|
676
|
+
data-slot="sidebar-menu-sub-item"
|
|
677
|
+
data-sidebar="menu-sub-item"
|
|
678
|
+
className={cn("group/menu-sub-item relative", className)}
|
|
679
|
+
{...props}
|
|
680
|
+
/>
|
|
681
|
+
)
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function SidebarMenuSubButton({
|
|
685
|
+
asChild = false,
|
|
686
|
+
size = "md",
|
|
687
|
+
isActive = false,
|
|
688
|
+
className,
|
|
689
|
+
...props
|
|
690
|
+
}: React.ComponentProps<"a"> & {
|
|
691
|
+
asChild?: boolean
|
|
692
|
+
size?: "sm" | "md"
|
|
693
|
+
isActive?: boolean
|
|
694
|
+
}) {
|
|
695
|
+
const Comp = asChild ? Slot : "a"
|
|
696
|
+
|
|
697
|
+
return (
|
|
698
|
+
<Comp
|
|
699
|
+
data-slot="sidebar-menu-sub-button"
|
|
700
|
+
data-sidebar="menu-sub-button"
|
|
701
|
+
data-size={size}
|
|
702
|
+
data-active={isActive}
|
|
703
|
+
className={cn(
|
|
704
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 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",
|
|
705
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
706
|
+
size === "sm" && "text-xs",
|
|
707
|
+
size === "md" && "text-sm",
|
|
708
|
+
"group-data-[collapsible=icon]:hidden",
|
|
709
|
+
className,
|
|
710
|
+
)}
|
|
711
|
+
{...props}
|
|
712
|
+
/>
|
|
713
|
+
)
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export {
|
|
717
|
+
Sidebar,
|
|
718
|
+
SidebarContent,
|
|
719
|
+
SidebarFooter,
|
|
720
|
+
SidebarGroup,
|
|
721
|
+
SidebarGroupAction,
|
|
722
|
+
SidebarGroupContent,
|
|
723
|
+
SidebarGroupLabel,
|
|
724
|
+
SidebarHeader,
|
|
725
|
+
SidebarInput,
|
|
726
|
+
SidebarInset,
|
|
727
|
+
SidebarMenu,
|
|
728
|
+
SidebarMenuAction,
|
|
729
|
+
SidebarMenuBadge,
|
|
730
|
+
SidebarMenuButton,
|
|
731
|
+
SidebarMenuItem,
|
|
732
|
+
SidebarMenuSkeleton,
|
|
733
|
+
SidebarMenuSub,
|
|
734
|
+
SidebarMenuSubButton,
|
|
735
|
+
SidebarMenuSubItem,
|
|
736
|
+
SidebarProvider,
|
|
737
|
+
SidebarRail,
|
|
738
|
+
SidebarSeparator,
|
|
739
|
+
SidebarTrigger,
|
|
740
|
+
useSidebar,
|
|
741
|
+
}
|