@devxcrew/react-ui 0.0.0-stage → 0.1.7
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 +85 -2
- package/package.json +105 -4
- package/src/blocks/agent-chat-workspace/agent-chat-workspace.tsx +162 -0
- package/src/blocks/agent-chat-workspace/index.ts +2 -0
- package/src/blocks/agent-provider-settings/agent-provider-settings.tsx +183 -0
- package/src/blocks/agent-provider-settings/index.ts +2 -0
- package/src/blocks/agent-task-workspace/agent-task-workspace.tsx +48 -0
- package/src/blocks/agent-task-workspace/index.ts +2 -0
- package/src/blocks/analysis-context/analysis-context.tsx +6 -0
- package/src/blocks/analysis-context/index.ts +1 -0
- package/src/blocks/app-header/app-header.tsx +159 -0
- package/src/blocks/app-header/index.ts +2 -0
- package/src/blocks/archived-chat-workspace/archived-chat-workspace.tsx +29 -0
- package/src/blocks/archived-chat-workspace/index.ts +2 -0
- package/src/blocks/auth/README.md +32 -0
- package/src/blocks/auth/admin-login-page.tsx +15 -0
- package/src/blocks/auth/admin-password-forgot-page.tsx +5 -0
- package/src/blocks/auth/auth-page-layout.tsx +90 -0
- package/src/blocks/auth/client-login-page.tsx +20 -0
- package/src/blocks/auth/client-password-forgot-page.tsx +5 -0
- package/src/blocks/auth/identity-management-desk.tsx +530 -0
- package/src/blocks/auth/index.ts +12 -0
- package/src/blocks/auth/login-page.tsx +206 -0
- package/src/blocks/auth/password-forgot-page.tsx +60 -0
- package/src/blocks/auth/portal-pages.tsx +32 -0
- package/src/blocks/auth/privileged-desk.tsx +55 -0
- package/src/blocks/auth/register-page.tsx +117 -0
- package/src/blocks/auth/session-boundary.tsx +296 -0
- package/src/blocks/auth/super-admin-login-page.tsx +15 -0
- package/src/blocks/auth/super-admin-password-forgot-page.tsx +5 -0
- package/src/blocks/blog/blog-card.tsx +156 -0
- package/src/blocks/blog/blog-reader.tsx +175 -0
- package/src/blocks/blog/blog-types.ts +47 -0
- package/src/blocks/blog/index.ts +3 -0
- package/src/blocks/chat-composer/chat-composer.tsx +140 -0
- package/src/blocks/chat-composer/index.ts +1 -0
- package/src/blocks/chat-history/chat-history.tsx +59 -0
- package/src/blocks/chat-history/index.ts +1 -0
- package/src/blocks/chat-response-progress/chat-response-progress.tsx +34 -0
- package/src/blocks/chat-response-progress/index.ts +2 -0
- package/src/blocks/chat-runtime-controls/chat-runtime-controls.tsx +56 -0
- package/src/blocks/chat-runtime-controls/index.ts +2 -0
- package/src/blocks/chat-runtime-trace/chat-runtime-trace.tsx +71 -0
- package/src/blocks/chat-runtime-trace/index.ts +2 -0
- package/src/blocks/codex-connection-settings/codex-connection-settings.tsx +42 -0
- package/src/blocks/codex-connection-settings/index.ts +1 -0
- package/src/blocks/dropzone/dropzone-file-item.tsx +113 -0
- package/src/blocks/dropzone/dropzone-types.ts +32 -0
- package/src/blocks/dropzone/dropzone.tsx +216 -0
- package/src/blocks/dropzone/index.ts +3 -0
- package/src/blocks/ecommerce/cart/cart-drawer.tsx +228 -0
- package/src/blocks/ecommerce/cart/cart-types.ts +27 -0
- package/src/blocks/ecommerce/cart/index.ts +2 -0
- package/src/blocks/ecommerce/categories/categories-types.ts +23 -0
- package/src/blocks/ecommerce/categories/category-showcase.tsx +125 -0
- package/src/blocks/ecommerce/categories/index.ts +2 -0
- package/src/blocks/ecommerce/checkout/checkout-types.ts +48 -0
- package/src/blocks/ecommerce/checkout/checkout-wizard.tsx +468 -0
- package/src/blocks/ecommerce/checkout/index.ts +2 -0
- package/src/blocks/ecommerce/comparison/comparison-types.ts +28 -0
- package/src/blocks/ecommerce/comparison/index.ts +2 -0
- package/src/blocks/ecommerce/comparison/product-comparison.tsx +174 -0
- package/src/blocks/ecommerce/coupon-wallet/coupon-wallet-types.ts +21 -0
- package/src/blocks/ecommerce/coupon-wallet/coupon-wallet.tsx +154 -0
- package/src/blocks/ecommerce/coupon-wallet/index.ts +2 -0
- package/src/blocks/ecommerce/delivery-tracker/delivery-tracker-types.ts +20 -0
- package/src/blocks/ecommerce/delivery-tracker/delivery-tracker.tsx +169 -0
- package/src/blocks/ecommerce/delivery-tracker/index.ts +2 -0
- package/src/blocks/ecommerce/index.ts +12 -0
- package/src/blocks/ecommerce/payment-methods/index.ts +2 -0
- package/src/blocks/ecommerce/payment-methods/payment-method-selector.tsx +224 -0
- package/src/blocks/ecommerce/payment-methods/payment-methods-types.ts +21 -0
- package/src/blocks/ecommerce/price-history/index.ts +2 -0
- package/src/blocks/ecommerce/price-history/price-history-chart.tsx +217 -0
- package/src/blocks/ecommerce/price-history/price-history-types.ts +16 -0
- package/src/blocks/ecommerce/reviews/index.ts +2 -0
- package/src/blocks/ecommerce/reviews/reviews-section.tsx +309 -0
- package/src/blocks/ecommerce/reviews/reviews-types.ts +26 -0
- package/src/blocks/ecommerce/wishlist/index.ts +2 -0
- package/src/blocks/ecommerce/wishlist/wishlist-grid.tsx +149 -0
- package/src/blocks/ecommerce/wishlist/wishlist-types.ts +19 -0
- package/src/blocks/execution-status/README.md +25 -0
- package/src/blocks/execution-status/execution-status.tsx +135 -0
- package/src/blocks/execution-status/index.ts +2 -0
- package/src/blocks/file-tree/file-icons.tsx +84 -0
- package/src/blocks/file-tree/file-tree-node.tsx +158 -0
- package/src/blocks/file-tree/file-tree-types.ts +33 -0
- package/src/blocks/file-tree/file-tree.tsx +163 -0
- package/src/blocks/file-tree/index.ts +5 -0
- package/src/blocks/filter-builder/filter-builder.tsx +169 -0
- package/src/blocks/filter-builder/filter-row.tsx +164 -0
- package/src/blocks/filter-builder/filter-types.ts +61 -0
- package/src/blocks/filter-builder/index.ts +12 -0
- package/src/blocks/footer/footer-types.ts +35 -0
- package/src/blocks/footer/index.ts +2 -0
- package/src/blocks/footer/site-footer.tsx +212 -0
- package/src/blocks/form/form-block.tsx +113 -0
- package/src/blocks/form/form-lookup-field.tsx +60 -0
- package/src/blocks/form/index.ts +4 -0
- package/src/blocks/handover-stack/handover-stack.tsx +41 -0
- package/src/blocks/handover-stack/index.ts +1 -0
- package/src/blocks/idea-handover/idea-handover-readiness.ts +41 -0
- package/src/blocks/idea-handover/idea-handover-workspace.tsx +150 -0
- package/src/blocks/idea-handover/index.ts +4 -0
- package/src/blocks/kanban/index.ts +11 -0
- package/src/blocks/kanban/kanban-board.tsx +146 -0
- package/src/blocks/kanban/kanban-card.tsx +149 -0
- package/src/blocks/kanban/kanban-column.tsx +102 -0
- package/src/blocks/kanban/kanban-types.ts +38 -0
- package/src/blocks/loader/global-loader.tsx +90 -0
- package/src/blocks/loader/index.ts +1 -0
- package/src/blocks/mascot/README.md +21 -0
- package/src/blocks/mascot/index.ts +2 -0
- package/src/blocks/mascot/mascot.tsx +202 -0
- package/src/blocks/master-list/README.md +21 -0
- package/src/blocks/master-list/index.ts +12 -0
- package/src/blocks/master-list/master-form.tsx +157 -0
- package/src/blocks/master-list/master-list-desk.tsx +370 -0
- package/src/blocks/master-list/master-list.tsx +189 -0
- package/src/blocks/master-list/types.ts +18 -0
- package/src/blocks/mermaid-preview/index.ts +1 -0
- package/src/blocks/mermaid-preview/mermaid-preview.tsx +164 -0
- package/src/blocks/notifications/README.md +7 -0
- package/src/blocks/notifications/index.ts +1 -0
- package/src/blocks/notifications/notification-center-page.tsx +73 -0
- package/src/blocks/pricing/index.ts +7 -0
- package/src/blocks/pricing/pricing-table.tsx +173 -0
- package/src/blocks/pricing/pricing-types.ts +34 -0
- package/src/blocks/product-card/index.ts +2 -0
- package/src/blocks/product-card/product-card-types.ts +35 -0
- package/src/blocks/product-card/product-card.tsx +183 -0
- package/src/blocks/table/data-table-block.tsx +313 -0
- package/src/blocks/table/data-table-filter-menu.tsx +48 -0
- package/src/blocks/table/data-table-icon-menu-trigger.tsx +44 -0
- package/src/blocks/table/data-table-menu-content.tsx +32 -0
- package/src/blocks/table/data-table-pagination.tsx +149 -0
- package/src/blocks/table/data-table-row-actions.tsx +53 -0
- package/src/blocks/table/data-table-status.tsx +42 -0
- package/src/blocks/table/data-table-toolbar.tsx +124 -0
- package/src/blocks/table/data-table-totals.tsx +31 -0
- package/src/blocks/table/index.ts +13 -0
- package/src/blocks/workspace/index.ts +19 -0
- package/src/blocks/workspace/workspace-action-card.tsx +73 -0
- package/src/blocks/workspace/workspace-application-header.tsx +67 -0
- package/src/blocks/workspace/workspace-entity-card.tsx +48 -0
- package/src/blocks/workspace/workspace-health-summary.tsx +15 -0
- package/src/blocks/workspace/workspace-metric-card.tsx +97 -0
- package/src/blocks/workspace/workspace-page-header.tsx +43 -0
- package/src/blocks/workspace/workspace-publish-status.tsx +15 -0
- package/src/blocks/workspace/workspace-route-checklist.tsx +28 -0
- package/src/blocks/workspace/workspace-runtime-status.tsx +48 -0
- package/src/blocks/workspace/workspace-section-card.tsx +42 -0
- package/src/components/accordion.tsx +65 -0
- package/src/components/alert-dialog.tsx +160 -0
- package/src/components/alert.tsx +68 -0
- package/src/components/aspect-ratio.tsx +22 -0
- package/src/components/attachment.tsx +195 -0
- package/src/components/avatar.tsx +90 -0
- package/src/components/badge.tsx +55 -0
- package/src/components/breadcrumb.tsx +100 -0
- package/src/components/bubble.tsx +123 -0
- package/src/components/button-group.tsx +79 -0
- package/src/components/button.tsx +71 -0
- package/src/components/calendar.tsx +185 -0
- package/src/components/card.tsx +100 -0
- package/src/components/carousel.tsx +229 -0
- package/src/components/chart.tsx +338 -0
- package/src/components/checkbox.tsx +27 -0
- package/src/components/collapsible.tsx +15 -0
- package/src/components/combobox.tsx +269 -0
- package/src/components/command.tsx +181 -0
- package/src/components/compact-model-switcher.tsx +128 -0
- package/src/components/context-menu.tsx +244 -0
- package/src/components/dialog.tsx +138 -0
- package/src/components/direction.tsx +1 -0
- package/src/components/drawer.tsx +208 -0
- package/src/components/dropdown-menu.tsx +257 -0
- package/src/components/empty.tsx +93 -0
- package/src/components/field.tsx +232 -0
- package/src/components/hover-card.tsx +45 -0
- package/src/components/input-group.tsx +146 -0
- package/src/components/input-otp.tsx +83 -0
- package/src/components/input.tsx +19 -0
- package/src/components/item.tsx +188 -0
- package/src/components/kbd.tsx +26 -0
- package/src/components/label.tsx +17 -0
- package/src/components/markdown-content.tsx +113 -0
- package/src/components/marker.tsx +67 -0
- package/src/components/menubar.tsx +267 -0
- package/src/components/message-scroller.tsx +91 -0
- package/src/components/message.tsx +84 -0
- package/src/components/native-select.tsx +54 -0
- package/src/components/navigation-menu.tsx +160 -0
- package/src/components/pagination.tsx +118 -0
- package/src/components/popover.tsx +74 -0
- package/src/components/progress.tsx +82 -0
- package/src/components/questionnaire.tsx +150 -0
- package/src/components/radio-group.tsx +35 -0
- package/src/components/resizable.tsx +41 -0
- package/src/components/rich-text-editor.tsx +604 -0
- package/src/components/scroll-area.tsx +47 -0
- package/src/components/select.tsx +189 -0
- package/src/components/separator.tsx +18 -0
- package/src/components/sheet.tsx +125 -0
- package/src/components/sidebar.tsx +693 -0
- package/src/components/skeleton.tsx +13 -0
- package/src/components/slider.tsx +51 -0
- package/src/components/sonner.tsx +45 -0
- package/src/components/sparkline.tsx +231 -0
- package/src/components/spinner.tsx +20 -0
- package/src/components/status-badge.tsx +114 -0
- package/src/components/switch.tsx +31 -0
- package/src/components/table.tsx +91 -0
- package/src/components/tabs.tsx +72 -0
- package/src/components/textarea.tsx +17 -0
- package/src/components/toast.tsx +222 -0
- package/src/components/toggle-group.tsx +85 -0
- package/src/components/toggle.tsx +42 -0
- package/src/components/tooltip.tsx +53 -0
- package/src/design-system/README.md +55 -0
- package/src/design-system/action-intents.ts +21 -0
- package/src/design-system/agent-manifest.ts +83 -0
- package/src/design-system/block-registry.ts +272 -0
- package/src/design-system/component-registry.ts +142 -0
- package/src/design-system/contracts.ts +69 -0
- package/src/design-system/defaults.ts +3 -0
- package/src/design-system/index.ts +29 -0
- package/src/design-system/mcp-server.ts +156 -0
- package/src/design-system/page-registry.ts +74 -0
- package/src/design-system/selection.ts +67 -0
- package/src/design-system/template-registry.ts +33 -0
- package/src/features/interface-topology/index.ts +14 -0
- package/src/features/interface-topology/interface-topology.types.ts +40 -0
- package/src/features/interface-topology/topology-control.tsx +18 -0
- package/src/features/interface-topology/topology-inspector.tsx +228 -0
- package/src/features/interface-topology/topology-marker.tsx +47 -0
- package/src/features/interface-topology/topology-region.tsx +44 -0
- package/src/features/interface-topology/use-interface-topology.ts +178 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-scroll-follow.ts +22 -0
- package/src/index.ts +11 -0
- package/src/layouts/README.md +65 -0
- package/src/layouts/agent-workspace/agent-activity-rail.tsx +101 -0
- package/src/layouts/agent-workspace/agent-workspace.tsx +27 -0
- package/src/layouts/agent-workspace/agent-workspace.types.ts +28 -0
- package/src/layouts/agent-workspace/index.ts +7 -0
- package/src/layouts/blog-header/blog-header-types.ts +25 -0
- package/src/layouts/blog-header/blog-header.tsx +172 -0
- package/src/layouts/blog-header/index.ts +2 -0
- package/src/layouts/documentation-workspace/README.md +8 -0
- package/src/layouts/documentation-workspace/documentation-workspace.tsx +34 -0
- package/src/layouts/documentation-workspace/index.ts +1 -0
- package/src/layouts/ecommerce-header/ecommerce-actions.tsx +89 -0
- package/src/layouts/ecommerce-header/ecommerce-announcement.tsx +43 -0
- package/src/layouts/ecommerce-header/ecommerce-drawer.tsx +97 -0
- package/src/layouts/ecommerce-header/ecommerce-header-types.ts +59 -0
- package/src/layouts/ecommerce-header/ecommerce-header.tsx +47 -0
- package/src/layouts/ecommerce-header/ecommerce-navigation.tsx +98 -0
- package/src/layouts/ecommerce-header/ecommerce-search.tsx +86 -0
- package/src/layouts/ecommerce-header/index.ts +2 -0
- package/src/layouts/main-workspace/index.ts +28 -0
- package/src/layouts/mdi/index.ts +1 -0
- package/src/layouts/mdi/mdi.tsx +20 -0
- package/src/layouts/mdi-main/index.ts +27 -0
- package/src/layouts/mdi-main/mdi-app-catalog.generated.ts +159 -0
- package/src/layouts/mdi-main/mdi-app-catalog.ts +76 -0
- package/src/layouts/mdi-main/mdi-app-switcher.tsx +107 -0
- package/src/layouts/mdi-main/mdi-feature-settings.tsx +135 -0
- package/src/layouts/mdi-main/mdi-global-search.tsx +192 -0
- package/src/layouts/mdi-main/mdi-main.tsx +241 -0
- package/src/layouts/mdi-main/mdi-notifications-menu.tsx +197 -0
- package/src/layouts/mdi-main/mdi-profile-menu.tsx +79 -0
- package/src/layouts/mdi-main/mdi-sidebar-navigation.tsx +226 -0
- package/src/layouts/mdi-main/mdi-sidebar.tsx +110 -0
- package/src/layouts/mdi-main/mdi-status-bar.tsx +26 -0
- package/src/layouts/mdi-main/mdi-top-menu-control.ts +4 -0
- package/src/layouts/mdi-main/mdi-top-menu.tsx +117 -0
- package/src/layouts/mdi-main/mdi-topology.tsx +297 -0
- package/src/layouts/mdi-main/mdi-tweak-panel.tsx +104 -0
- package/src/layouts/mdi-main/mdi-types.ts +131 -0
- package/src/layouts/mdi-main/use-mdi-features.ts +36 -0
- package/src/layouts/mdi-main/use-mdi-sidebar-state.ts +59 -0
- package/src/layouts/site-header/announcement-bar.tsx +55 -0
- package/src/layouts/site-header/category-strip.tsx +41 -0
- package/src/layouts/site-header/index.ts +16 -0
- package/src/layouts/site-header/main-navbar.tsx +179 -0
- package/src/layouts/site-header/mobile-drawer.tsx +140 -0
- package/src/layouts/site-header/site-header-types.ts +63 -0
- package/src/layouts/site-header/site-header.tsx +58 -0
- package/src/lib/random-id.ts +19 -0
- package/src/lib/utils.ts +6 -0
- package/src/providers/pdf-provider.ts +137 -0
- package/src/styles/globals.css +374 -0
- package/src/templates/README.md +12 -0
- package/src/templates/dashboard-01/components/app-sidebar.tsx +177 -0
- package/src/templates/dashboard-01/components/chart-area-interactive.tsx +276 -0
- package/src/templates/dashboard-01/components/data-table-cell-viewer.tsx +213 -0
- package/src/templates/dashboard-01/components/data-table.tsx +577 -0
- package/src/templates/dashboard-01/components/nav-documents.tsx +79 -0
- package/src/templates/dashboard-01/components/nav-main.tsx +55 -0
- package/src/templates/dashboard-01/components/nav-secondary.tsx +39 -0
- package/src/templates/dashboard-01/components/nav-user.tsx +97 -0
- package/src/templates/dashboard-01/components/section-cards.tsx +99 -0
- package/src/templates/dashboard-01/components/site-header.tsx +14 -0
- package/src/templates/dashboard-01/data.json +614 -0
- package/src/templates/dashboard-01/index.ts +7 -0
- package/src/templates/documentation-sidebar/app-sidebar.tsx +95 -0
- package/src/templates/documentation-sidebar/index.ts +2 -0
- package/src/templates/sidebar-07/components/app-sidebar.tsx +175 -0
- package/src/templates/sidebar-07/components/nav-main.tsx +64 -0
- package/src/templates/sidebar-07/components/nav-projects.tsx +79 -0
- package/src/templates/sidebar-07/components/nav-user.tsx +105 -0
- package/src/templates/sidebar-07/components/team-switcher.tsx +94 -0
- package/src/templates/sidebar-07/index.ts +1 -0
- package/src/templates/ui-page/index.ts +7 -0
- package/src/templates/ui-page/ui-browser-frame.tsx +27 -0
- package/src/templates/ui-page/ui-template-code.tsx +48 -0
- package/src/templates/ui-page/ui-template-header.tsx +87 -0
- package/src/templates/ui-page/ui-template-navigation.tsx +60 -0
- package/src/templates/ui-page/ui-template-page.tsx +97 -0
- package/src/theme/index.ts +12 -0
- package/src/theme/theme-config.ts +30 -0
- package/src/theme/theme-provider.tsx +142 -0
- package/src/theme/theme-selector.tsx +75 -0
- package/src/tokens/index.ts +15 -0
- package/src/vite-env.d.ts +3 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { BoxesIcon, FilesIcon, LayoutDashboardIcon, MessageSquareIcon } from "lucide-react";
|
|
2
|
+
import { useEffect, useMemo, useState, type CSSProperties } from "react";
|
|
3
|
+
|
|
4
|
+
import { SidebarInset, SidebarProvider } from "@devxcrew/react-ui/components/sidebar";
|
|
5
|
+
import { Toaster } from "@devxcrew/react-ui/components/toast";
|
|
6
|
+
import { cn } from "@devxcrew/react-ui/lib/utils";
|
|
7
|
+
import {
|
|
8
|
+
TopologyInspectionControl,
|
|
9
|
+
TopologyInspector,
|
|
10
|
+
TopologyMarker,
|
|
11
|
+
useInterfaceTopology,
|
|
12
|
+
} from "../../features/interface-topology";
|
|
13
|
+
import { ThemeProvider } from "../../theme";
|
|
14
|
+
import { AgentActivityRail, AgentWorkspace } from "../agent-workspace";
|
|
15
|
+
import { WorkspaceApplicationHeader } from "../../blocks/workspace/workspace-application-header";
|
|
16
|
+
|
|
17
|
+
import { createDefaultMdiApps } from "./mdi-app-catalog";
|
|
18
|
+
import { MdiFeatureSettings } from "./mdi-feature-settings";
|
|
19
|
+
import { MdiSidebar } from "./mdi-sidebar";
|
|
20
|
+
import { MdiStatusBar } from "./mdi-status-bar";
|
|
21
|
+
import { MdiTopMenu } from "./mdi-top-menu";
|
|
22
|
+
import { mdiTopologySections, MdiTopologyProvider } from "./mdi-topology";
|
|
23
|
+
import type { MainWorkspaceProps, MdiNavigationSection, MdiUser } from "./mdi-types";
|
|
24
|
+
import { useMdiFeatures } from "./use-mdi-features";
|
|
25
|
+
|
|
26
|
+
const defaultNavigation: MdiNavigationSection[] = [
|
|
27
|
+
{
|
|
28
|
+
label: "Workspace",
|
|
29
|
+
items: [
|
|
30
|
+
{ active: true, icon: LayoutDashboardIcon, label: "Overview" },
|
|
31
|
+
{ icon: FilesIcon, label: "Documents" },
|
|
32
|
+
{ icon: MessageSquareIcon, label: "Messages" },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const defaultUser: MdiUser = {
|
|
38
|
+
initials: "C",
|
|
39
|
+
name: "Workspace user",
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export function MainWorkspace({
|
|
43
|
+
agentWorkspace,
|
|
44
|
+
applicationIcon = BoxesIcon,
|
|
45
|
+
applicationLogoUrl,
|
|
46
|
+
applicationId = "platform",
|
|
47
|
+
applicationName = "Workspace",
|
|
48
|
+
applicationHeaderStart,
|
|
49
|
+
applicationHeaderEnd,
|
|
50
|
+
applicationHeaderMeta,
|
|
51
|
+
applicationHeaderBelow,
|
|
52
|
+
applicationHeaderStatus,
|
|
53
|
+
applicationHeaderTitle,
|
|
54
|
+
showApplicationIdentity = true,
|
|
55
|
+
showApplicationHeader = false,
|
|
56
|
+
showWorkspaceTitleInHeader = true,
|
|
57
|
+
apps,
|
|
58
|
+
children,
|
|
59
|
+
contentClassName,
|
|
60
|
+
defaultFeatures,
|
|
61
|
+
requiredFeatures,
|
|
62
|
+
defaultSidebarOpen = true,
|
|
63
|
+
deskRegionId,
|
|
64
|
+
embedded = false,
|
|
65
|
+
navigation = defaultNavigation,
|
|
66
|
+
notificationCount = 1,
|
|
67
|
+
notifications = [],
|
|
68
|
+
primaryAction = { icon: LayoutDashboardIcon, label: "Overview" },
|
|
69
|
+
searchPlaceholder = `Search ${applicationName}`,
|
|
70
|
+
searchValue,
|
|
71
|
+
settingsContent,
|
|
72
|
+
showMdiOverview = false,
|
|
73
|
+
showTopologyTools = true,
|
|
74
|
+
sidebarContent,
|
|
75
|
+
sidebarContentClassName,
|
|
76
|
+
sidebarFooter,
|
|
77
|
+
sidebarFooterClassName,
|
|
78
|
+
sidebarStateKey,
|
|
79
|
+
statusLabel = "Ready",
|
|
80
|
+
statusEnd,
|
|
81
|
+
topologySections = [],
|
|
82
|
+
user = defaultUser,
|
|
83
|
+
workspaceTitle = "MDI Workspace",
|
|
84
|
+
onSearchChange,
|
|
85
|
+
}: MainWorkspaceProps) {
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (!embedded) document.title = applicationName;
|
|
88
|
+
}, [applicationName, embedded]);
|
|
89
|
+
|
|
90
|
+
const [savedFeatures, setFeature] = useMdiFeatures(applicationId, defaultFeatures);
|
|
91
|
+
const features = { ...savedFeatures, ...requiredFeatures };
|
|
92
|
+
const [view, setView] = useState<"settings" | "workspace">("workspace");
|
|
93
|
+
const topologyDesks = useMemo(
|
|
94
|
+
() => [
|
|
95
|
+
...(showMdiOverview ? [{ id: "mdi-overview", name: "MDI Overview", sections: mdiTopologySections }] : []),
|
|
96
|
+
...(topologySections.length
|
|
97
|
+
? [{ id: `${applicationId}-desk`, name: workspaceTitle, sections: topologySections }]
|
|
98
|
+
: []),
|
|
99
|
+
],
|
|
100
|
+
[applicationId, showMdiOverview, topologySections, workspaceTitle],
|
|
101
|
+
);
|
|
102
|
+
const topology = useInterfaceTopology(topologyDesks);
|
|
103
|
+
const applicationApps = apps ?? createDefaultMdiApps(applicationId);
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<ThemeProvider>
|
|
107
|
+
<Toaster>
|
|
108
|
+
<MdiTopologyProvider value={topology}>
|
|
109
|
+
<SidebarProvider
|
|
110
|
+
defaultOpen={defaultSidebarOpen}
|
|
111
|
+
className={cn(
|
|
112
|
+
"min-h-0 flex-col gap-px overflow-hidden bg-background text-foreground",
|
|
113
|
+
embedded ? "h-full" : "h-svh",
|
|
114
|
+
)}
|
|
115
|
+
style={
|
|
116
|
+
{
|
|
117
|
+
"--sidebar-width": "16rem",
|
|
118
|
+
"--sidebar-left-offset":
|
|
119
|
+
agentWorkspace && view === "workspace" && features.primaryActivityRail ? "3.5rem" : "0rem",
|
|
120
|
+
} as CSSProperties
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
{features.topMenu ? (
|
|
124
|
+
<MdiTopMenu
|
|
125
|
+
applicationIcon={applicationIcon}
|
|
126
|
+
applicationLogoUrl={applicationLogoUrl}
|
|
127
|
+
applicationName={applicationName}
|
|
128
|
+
apps={applicationApps}
|
|
129
|
+
features={features}
|
|
130
|
+
notificationCount={notificationCount}
|
|
131
|
+
notifications={notifications}
|
|
132
|
+
navigation={navigation}
|
|
133
|
+
searchPlaceholder={searchPlaceholder}
|
|
134
|
+
searchValue={searchValue}
|
|
135
|
+
user={user}
|
|
136
|
+
onSearchChange={onSearchChange}
|
|
137
|
+
/>
|
|
138
|
+
) : null}
|
|
139
|
+
|
|
140
|
+
<div
|
|
141
|
+
className={cn(
|
|
142
|
+
"relative flex min-h-0 flex-1 overflow-hidden border-t border-border",
|
|
143
|
+
deskRegionId && topology.highlightClassName(deskRegionId),
|
|
144
|
+
)}
|
|
145
|
+
{...(deskRegionId ? topology.regionProps(deskRegionId) : {})}
|
|
146
|
+
>
|
|
147
|
+
{deskRegionId ? <TopologyMarker id={deskRegionId} topology={topology} /> : null}
|
|
148
|
+
{view === "workspace" && agentWorkspace ? (
|
|
149
|
+
<AgentActivityRail
|
|
150
|
+
rail={agentWorkspace.primaryRail}
|
|
151
|
+
side="left"
|
|
152
|
+
visible={features.primaryActivityRail}
|
|
153
|
+
/>
|
|
154
|
+
) : null}
|
|
155
|
+
{view === "workspace" ? (
|
|
156
|
+
<MdiSidebar
|
|
157
|
+
navigation={navigation}
|
|
158
|
+
onOpenFeatures={() => setView("settings")}
|
|
159
|
+
primaryAction={primaryAction}
|
|
160
|
+
sidebarContent={sidebarContent}
|
|
161
|
+
sidebarContentClassName={sidebarContentClassName}
|
|
162
|
+
sidebarFooter={sidebarFooter}
|
|
163
|
+
sidebarFooterClassName={sidebarFooterClassName}
|
|
164
|
+
stateKey={sidebarStateKey}
|
|
165
|
+
/>
|
|
166
|
+
) : null}
|
|
167
|
+
<SidebarInset className="min-h-0 min-w-0 overflow-hidden">
|
|
168
|
+
<main
|
|
169
|
+
className={cn(
|
|
170
|
+
"workspace-scrollbar-slim relative flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto bg-background data-[ito-highlighted=true]:ring-2 data-[ito-highlighted=true]:ring-inset data-[ito-highlighted=true]:ring-violet-700",
|
|
171
|
+
)}
|
|
172
|
+
{...topology.regionProps("03")}
|
|
173
|
+
>
|
|
174
|
+
<TopologyMarker id="03" topology={topology} />
|
|
175
|
+
{showApplicationHeader ? (
|
|
176
|
+
<>
|
|
177
|
+
<WorkspaceApplicationHeader
|
|
178
|
+
applicationIcon={applicationIcon}
|
|
179
|
+
applicationLogoUrl={applicationLogoUrl}
|
|
180
|
+
applicationName={applicationName}
|
|
181
|
+
end={applicationHeaderEnd}
|
|
182
|
+
meta={applicationHeaderMeta}
|
|
183
|
+
status={applicationHeaderStatus}
|
|
184
|
+
showIdentity={showApplicationIdentity}
|
|
185
|
+
showWorkspaceTitle={showWorkspaceTitleInHeader}
|
|
186
|
+
start={applicationHeaderStart}
|
|
187
|
+
title={applicationHeaderTitle}
|
|
188
|
+
workspaceTitle={workspaceTitle}
|
|
189
|
+
/>
|
|
190
|
+
{applicationHeaderBelow}
|
|
191
|
+
</>
|
|
192
|
+
) : null}
|
|
193
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col">
|
|
194
|
+
<div className="min-h-0 flex-1">
|
|
195
|
+
{view === "settings" ? (
|
|
196
|
+
(settingsContent?.({
|
|
197
|
+
features,
|
|
198
|
+
onBack: () => setView("workspace"),
|
|
199
|
+
onFeatureChange: setFeature,
|
|
200
|
+
}) ?? (
|
|
201
|
+
<MdiFeatureSettings
|
|
202
|
+
showAgentWorkspaceOptions={Boolean(agentWorkspace)}
|
|
203
|
+
features={features}
|
|
204
|
+
onBack={() => setView("workspace")}
|
|
205
|
+
onFeatureChange={setFeature}
|
|
206
|
+
/>
|
|
207
|
+
))
|
|
208
|
+
) : agentWorkspace ? (
|
|
209
|
+
<AgentWorkspace
|
|
210
|
+
{...agentWorkspace}
|
|
211
|
+
showPrimaryRail={false}
|
|
212
|
+
showSecondaryRail={features.secondaryUtilityRail}
|
|
213
|
+
>
|
|
214
|
+
{children}
|
|
215
|
+
</AgentWorkspace>
|
|
216
|
+
) : (
|
|
217
|
+
<div className={cn("relative size-full min-h-0 min-w-0 overflow-hidden", contentClassName)}>{children}</div>
|
|
218
|
+
)}
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
</main>
|
|
222
|
+
{features.statusBar ? (
|
|
223
|
+
<MdiStatusBar statusEnd={statusEnd} statusLabel={statusLabel} workspaceTitle={workspaceTitle} />
|
|
224
|
+
) : null}
|
|
225
|
+
</SidebarInset>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
{showTopologyTools && features.ito ? (
|
|
229
|
+
<div className="pointer-events-none fixed inset-0 z-[60] bg-transparent">
|
|
230
|
+
<TopologyInspector topology={topology} />
|
|
231
|
+
<TopologyInspectionControl topology={topology} />
|
|
232
|
+
</div>
|
|
233
|
+
) : null}
|
|
234
|
+
</SidebarProvider>
|
|
235
|
+
</MdiTopologyProvider>
|
|
236
|
+
</Toaster>
|
|
237
|
+
</ThemeProvider>
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export type { MainWorkspaceProps };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { BellIcon, XIcon } from 'lucide-react'
|
|
2
|
+
import { motion, useReducedMotion } from 'framer-motion'
|
|
3
|
+
import { useEffect, useRef, useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { Button } from '@devxcrew/react-ui/components/button'
|
|
6
|
+
import { toast } from '@devxcrew/react-ui/components/toast'
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@devxcrew/react-ui/components/popover'
|
|
8
|
+
import { cn } from '@devxcrew/react-ui/lib/utils'
|
|
9
|
+
import { TopologyMarker } from '../../features/interface-topology'
|
|
10
|
+
|
|
11
|
+
import { useMdiTopology } from './mdi-topology'
|
|
12
|
+
import type { MdiNotification } from './mdi-types'
|
|
13
|
+
|
|
14
|
+
export function MdiNotificationsMenu({
|
|
15
|
+
count,
|
|
16
|
+
notifications,
|
|
17
|
+
}: {
|
|
18
|
+
count: number
|
|
19
|
+
notifications: readonly MdiNotification[]
|
|
20
|
+
}) {
|
|
21
|
+
const [open, setOpen] = useState(false)
|
|
22
|
+
const knownNotificationIds = useRef<Set<string> | null>(null)
|
|
23
|
+
const reduceMotion = useReducedMotion()
|
|
24
|
+
const topology = useMdiTopology()
|
|
25
|
+
const unreadCount =
|
|
26
|
+
notifications.length > 0
|
|
27
|
+
? notifications.filter((notification) => !notification.read).length
|
|
28
|
+
: count
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const unread = notifications.filter((notification) => !notification.read)
|
|
32
|
+
if (!knownNotificationIds.current) {
|
|
33
|
+
knownNotificationIds.current = new Set(notifications.map((notification) => notification.id))
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
const known = knownNotificationIds.current
|
|
37
|
+
for (const notification of newUnreadNotifications(known, unread)) {
|
|
38
|
+
toast.add({
|
|
39
|
+
description: notification.description,
|
|
40
|
+
id: `notification:${notification.id}`,
|
|
41
|
+
priority: notification.severity === 'error' ? 'high' : 'low',
|
|
42
|
+
title: notification.title,
|
|
43
|
+
type: notification.severity ?? 'info',
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
knownNotificationIds.current = new Set(notifications.map((notification) => notification.id))
|
|
47
|
+
}, [notifications])
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
51
|
+
<PopoverTrigger
|
|
52
|
+
render={
|
|
53
|
+
<Button
|
|
54
|
+
aria-label={unreadCount > 0 ? `Notifications, ${unreadCount} unread` : 'Notifications'}
|
|
55
|
+
className={cn(
|
|
56
|
+
'relative size-10 p-0 text-foreground',
|
|
57
|
+
topology.highlightClassName('01.4.1'),
|
|
58
|
+
)}
|
|
59
|
+
size="icon"
|
|
60
|
+
variant="ghost"
|
|
61
|
+
{...topology.regionProps('01.4.1')}
|
|
62
|
+
/>
|
|
63
|
+
}
|
|
64
|
+
>
|
|
65
|
+
<BellIcon className="size-4" />
|
|
66
|
+
{unreadCount > 0 ? <UnreadIndicator reduceMotion={Boolean(reduceMotion)} /> : null}
|
|
67
|
+
</PopoverTrigger>
|
|
68
|
+
<PopoverContent
|
|
69
|
+
align="end"
|
|
70
|
+
className={cn(
|
|
71
|
+
'w-88 gap-0 overflow-hidden rounded-3xl p-0',
|
|
72
|
+
topology.highlightClassName('01.4.2'),
|
|
73
|
+
)}
|
|
74
|
+
sideOffset={9}
|
|
75
|
+
{...topology.regionProps('01.4.2')}
|
|
76
|
+
>
|
|
77
|
+
<TopologyMarker id="01.4.2" topology={topology} />
|
|
78
|
+
<header className="flex items-center gap-3 border-b px-5 py-4">
|
|
79
|
+
<div className="min-w-0 flex-1">
|
|
80
|
+
<h2 className="text-base font-semibold">Notifications</h2>
|
|
81
|
+
<p className="text-sm text-muted-foreground">
|
|
82
|
+
{unreadCount > 0 ? `${unreadCount} unread` : 'You are all caught up'}
|
|
83
|
+
</p>
|
|
84
|
+
</div>
|
|
85
|
+
<Button
|
|
86
|
+
aria-label="Close notifications"
|
|
87
|
+
onClick={() => setOpen(false)}
|
|
88
|
+
size="icon-sm"
|
|
89
|
+
variant="ghost"
|
|
90
|
+
>
|
|
91
|
+
<XIcon />
|
|
92
|
+
</Button>
|
|
93
|
+
</header>
|
|
94
|
+
<div
|
|
95
|
+
className={cn('max-h-80 overflow-y-auto p-2', topology.highlightClassName('01.4.3'))}
|
|
96
|
+
{...topology.regionProps('01.4.3')}
|
|
97
|
+
>
|
|
98
|
+
{notifications.length > 0 ? (
|
|
99
|
+
notifications.map((notification) => (
|
|
100
|
+
<NotificationRow
|
|
101
|
+
key={notification.id}
|
|
102
|
+
notification={notification}
|
|
103
|
+
onClose={() => setOpen(false)}
|
|
104
|
+
/>
|
|
105
|
+
))
|
|
106
|
+
) : (
|
|
107
|
+
<div className="px-3 py-8 text-center">
|
|
108
|
+
<BellIcon className="mx-auto size-5 text-muted-foreground" />
|
|
109
|
+
<p className="pt-3 text-sm font-medium">
|
|
110
|
+
{unreadCount > 0 ? 'A workspace update is ready' : 'No new notifications'}
|
|
111
|
+
</p>
|
|
112
|
+
<p className="pt-1 text-sm text-muted-foreground">
|
|
113
|
+
{unreadCount > 0
|
|
114
|
+
? 'Open the active workspace to review it.'
|
|
115
|
+
: 'New activity will appear here.'}
|
|
116
|
+
</p>
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
</div>
|
|
120
|
+
</PopoverContent>
|
|
121
|
+
</Popover>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function newUnreadNotifications(
|
|
126
|
+
knownIds: ReadonlySet<string>,
|
|
127
|
+
notifications: readonly MdiNotification[],
|
|
128
|
+
): MdiNotification[] {
|
|
129
|
+
return notifications.filter((notification) => !knownIds.has(notification.id))
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function UnreadIndicator({ reduceMotion }: { reduceMotion: boolean }) {
|
|
133
|
+
return (
|
|
134
|
+
<span className="absolute top-1.5 right-1.5 grid size-2 place-items-center" aria-hidden="true">
|
|
135
|
+
{!reduceMotion ? (
|
|
136
|
+
<>
|
|
137
|
+
<motion.span
|
|
138
|
+
animate={{ opacity: [0, 0.45, 0.16, 0], scale: [0.75, 1, 1.9, 2.5] }}
|
|
139
|
+
className="absolute size-2 rounded-full border border-red-500"
|
|
140
|
+
transition={{
|
|
141
|
+
duration: 2.4,
|
|
142
|
+
ease: [0.16, 1, 0.3, 1],
|
|
143
|
+
repeat: Infinity,
|
|
144
|
+
repeatDelay: 0.15,
|
|
145
|
+
times: [0, 0.14, 0.72, 1],
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
<motion.span
|
|
149
|
+
animate={{ opacity: [1, 0.78, 1], scale: [1, 1.18, 1] }}
|
|
150
|
+
className="relative size-2 rounded-full border border-background bg-red-500"
|
|
151
|
+
transition={{ duration: 1.8, ease: 'easeInOut', repeat: Infinity }}
|
|
152
|
+
/>
|
|
153
|
+
</>
|
|
154
|
+
) : (
|
|
155
|
+
<span className="relative size-2 rounded-full border border-background bg-red-500" />
|
|
156
|
+
)}
|
|
157
|
+
</span>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function NotificationRow({
|
|
162
|
+
notification,
|
|
163
|
+
onClose,
|
|
164
|
+
}: {
|
|
165
|
+
notification: MdiNotification
|
|
166
|
+
onClose: () => void
|
|
167
|
+
}) {
|
|
168
|
+
return (
|
|
169
|
+
<button
|
|
170
|
+
className="flex w-full items-start gap-3 rounded-2xl px-3 py-3 text-left hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
171
|
+
onClick={() => {
|
|
172
|
+
notification.onSelect?.()
|
|
173
|
+
notification.onRead?.()
|
|
174
|
+
onClose()
|
|
175
|
+
}}
|
|
176
|
+
type="button"
|
|
177
|
+
>
|
|
178
|
+
<span
|
|
179
|
+
className={cn(
|
|
180
|
+
'mt-1.5 size-2 shrink-0 rounded-full',
|
|
181
|
+
notification.read ? 'bg-muted-foreground/30' : 'bg-red-500',
|
|
182
|
+
)}
|
|
183
|
+
/>
|
|
184
|
+
<span className="min-w-0 flex-1">
|
|
185
|
+
<span className="block truncate text-sm font-medium">{notification.title}</span>
|
|
186
|
+
{notification.description ? (
|
|
187
|
+
<span className="block pt-1 text-sm leading-5 text-muted-foreground">
|
|
188
|
+
{notification.description}
|
|
189
|
+
</span>
|
|
190
|
+
) : null}
|
|
191
|
+
</span>
|
|
192
|
+
{notification.time ? (
|
|
193
|
+
<span className="shrink-0 text-xs text-muted-foreground">{notification.time}</span>
|
|
194
|
+
) : null}
|
|
195
|
+
</button>
|
|
196
|
+
)
|
|
197
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { LogOutIcon, UserRoundIcon, XIcon } from "lucide-react";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@devxcrew/react-ui/components/avatar";
|
|
5
|
+
import { Button } from "@devxcrew/react-ui/components/button";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@devxcrew/react-ui/components/popover";
|
|
7
|
+
import { cn } from "@devxcrew/react-ui/lib/utils";
|
|
8
|
+
import { TopologyMarker } from "../../features/interface-topology";
|
|
9
|
+
|
|
10
|
+
import { mdiTopMenuButtonClassName } from "./mdi-top-menu-control";
|
|
11
|
+
import { useMdiTopology } from "./mdi-topology";
|
|
12
|
+
import type { MdiUser } from "./mdi-types";
|
|
13
|
+
|
|
14
|
+
export function MdiProfileMenu({ user }: { user: MdiUser }) {
|
|
15
|
+
const [open, setOpen] = useState(false);
|
|
16
|
+
const topology = useMdiTopology();
|
|
17
|
+
const fallback = user.name.trim().charAt(0).toUpperCase() || user.initials.charAt(0);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
21
|
+
<PopoverTrigger
|
|
22
|
+
render={
|
|
23
|
+
<Button
|
|
24
|
+
variant="outline"
|
|
25
|
+
size="icon"
|
|
26
|
+
className={cn(mdiTopMenuButtonClassName, "p-0.5", topology.highlightClassName("01.6.1"))}
|
|
27
|
+
aria-label="Open profile"
|
|
28
|
+
{...topology.regionProps("01.6.1")}
|
|
29
|
+
/>
|
|
30
|
+
}
|
|
31
|
+
>
|
|
32
|
+
<Avatar className="size-full">
|
|
33
|
+
{user.avatarUrl ? <AvatarImage alt={user.name} src={user.avatarUrl} /> : null}
|
|
34
|
+
<AvatarFallback className="bg-foreground/10 text-sm font-medium text-foreground">{fallback}</AvatarFallback>
|
|
35
|
+
</Avatar>
|
|
36
|
+
</PopoverTrigger>
|
|
37
|
+
<PopoverContent
|
|
38
|
+
align="end"
|
|
39
|
+
sideOffset={9}
|
|
40
|
+
className={cn("w-88 gap-4 rounded-3xl p-3", topology.highlightClassName("01.6.2"))}
|
|
41
|
+
{...topology.regionProps("01.6.2")}
|
|
42
|
+
>
|
|
43
|
+
<TopologyMarker id="01.6.2" topology={topology} />
|
|
44
|
+
<div className="flex items-center justify-end">
|
|
45
|
+
<span className="mr-auto truncate pl-3 text-sm text-muted-foreground">{user.email ?? "Local account"}</span>
|
|
46
|
+
<Button variant="ghost" size="icon-sm" onClick={() => setOpen(false)} aria-label="Close">
|
|
47
|
+
<XIcon />
|
|
48
|
+
</Button>
|
|
49
|
+
</div>
|
|
50
|
+
<div className="flex flex-col items-center gap-3 px-3">
|
|
51
|
+
<div className="grid w-full grid-cols-[1fr] items-center gap-3">
|
|
52
|
+
<Avatar
|
|
53
|
+
className={cn(
|
|
54
|
+
"size-20 justify-self-center border-4 border-background ring-2 ring-border",
|
|
55
|
+
topology.highlightClassName("01.6.3"),
|
|
56
|
+
)}
|
|
57
|
+
{...topology.regionProps("01.6.3")}
|
|
58
|
+
>
|
|
59
|
+
{user.avatarUrl ? <AvatarImage alt={user.name} src={user.avatarUrl} /> : null}
|
|
60
|
+
<AvatarFallback className="bg-foreground/10 text-2xl text-foreground">{fallback}</AvatarFallback>
|
|
61
|
+
</Avatar>
|
|
62
|
+
<span aria-hidden="true" />
|
|
63
|
+
</div>
|
|
64
|
+
<h2 className="text-xl font-semibold">Hi, {user.name}!</h2>
|
|
65
|
+
<Button variant="outline" className="rounded-full px-5" onClick={user.onManageProfile}>
|
|
66
|
+
<UserRoundIcon />
|
|
67
|
+
Manage your profile
|
|
68
|
+
</Button>
|
|
69
|
+
</div>
|
|
70
|
+
<div className={cn("grid gap-2", topology.highlightClassName("01.6.4"))} {...topology.regionProps("01.6.4")}>
|
|
71
|
+
<Button variant="outline" className="h-12 justify-start rounded-xl px-4" onClick={user.onSignOut}>
|
|
72
|
+
<LogOutIcon />
|
|
73
|
+
Log out
|
|
74
|
+
</Button>
|
|
75
|
+
</div>
|
|
76
|
+
</PopoverContent>
|
|
77
|
+
</Popover>
|
|
78
|
+
);
|
|
79
|
+
}
|