@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,159 @@
|
|
|
1
|
+
// Generated by @codexsun/app-cli. Do not edit manually.
|
|
2
|
+
|
|
3
|
+
export type MdiCatalogApplication = {
|
|
4
|
+
icon: string;
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
localUrlKey: string;
|
|
8
|
+
path: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const mdiCatalogApplications: readonly MdiCatalogApplication[] = [
|
|
12
|
+
{
|
|
13
|
+
"icon": "application",
|
|
14
|
+
"id": "accounts",
|
|
15
|
+
"label": "Accounts",
|
|
16
|
+
"localUrlKey": "VITE_ACCOUNTS_WEB_URL",
|
|
17
|
+
"path": "/"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"icon": "application",
|
|
21
|
+
"id": "auditor",
|
|
22
|
+
"label": "Auditor",
|
|
23
|
+
"localUrlKey": "VITE_AUDITOR_WEB_URL",
|
|
24
|
+
"path": "/"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"icon": "application",
|
|
28
|
+
"id": "billing",
|
|
29
|
+
"label": "Billing",
|
|
30
|
+
"localUrlKey": "VITE_BILLING_WEB_URL",
|
|
31
|
+
"path": "/"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"icon": "application",
|
|
35
|
+
"id": "codeitz",
|
|
36
|
+
"label": "Codeitz",
|
|
37
|
+
"localUrlKey": "VITE_CODEITZ_WEB_URL",
|
|
38
|
+
"path": "/"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"icon": "application",
|
|
42
|
+
"id": "codeloop",
|
|
43
|
+
"label": "CodeLoop",
|
|
44
|
+
"localUrlKey": "VITE_CODELOOP_WEB_URL",
|
|
45
|
+
"path": "/"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"icon": "application",
|
|
49
|
+
"id": "crm",
|
|
50
|
+
"label": "CRM",
|
|
51
|
+
"localUrlKey": "VITE_CRM_WEB_URL",
|
|
52
|
+
"path": "/"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"icon": "application",
|
|
56
|
+
"id": "cxforge",
|
|
57
|
+
"label": "CXForge",
|
|
58
|
+
"localUrlKey": "VITE_CXFORGE_WEB_URL",
|
|
59
|
+
"path": "/"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"icon": "application",
|
|
63
|
+
"id": "docx",
|
|
64
|
+
"label": "DOCX",
|
|
65
|
+
"localUrlKey": "VITE_DOCX_WEB_URL",
|
|
66
|
+
"path": "/"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"icon": "application",
|
|
70
|
+
"id": "ecommerce",
|
|
71
|
+
"label": "Ecommerce",
|
|
72
|
+
"localUrlKey": "VITE_ECOMMERCE_WEB_URL",
|
|
73
|
+
"path": "/"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"icon": "application",
|
|
77
|
+
"id": "garments",
|
|
78
|
+
"label": "Garments",
|
|
79
|
+
"localUrlKey": "VITE_GARMENTS_WEB_URL",
|
|
80
|
+
"path": "/"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"icon": "application",
|
|
84
|
+
"id": "himsx",
|
|
85
|
+
"label": "HIMSX",
|
|
86
|
+
"localUrlKey": "VITE_HIMSX_WEB_URL",
|
|
87
|
+
"path": "/"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"icon": "application",
|
|
91
|
+
"id": "hrms",
|
|
92
|
+
"label": "HRMS",
|
|
93
|
+
"localUrlKey": "VITE_HRMS_WEB_URL",
|
|
94
|
+
"path": "/"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"icon": "application",
|
|
98
|
+
"id": "lms",
|
|
99
|
+
"label": "LMS",
|
|
100
|
+
"localUrlKey": "VITE_LMS_WEB_URL",
|
|
101
|
+
"path": "/"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"icon": "application",
|
|
105
|
+
"id": "orship",
|
|
106
|
+
"label": "Orship",
|
|
107
|
+
"localUrlKey": "VITE_ORSHIP_WEB_URL",
|
|
108
|
+
"path": "/"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"icon": "platform",
|
|
112
|
+
"id": "platform",
|
|
113
|
+
"label": "Platform",
|
|
114
|
+
"localUrlKey": "VITE_PLATFORM_WEB_URL",
|
|
115
|
+
"path": "/system"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"icon": "application",
|
|
119
|
+
"id": "projex",
|
|
120
|
+
"label": "Projex",
|
|
121
|
+
"localUrlKey": "VITE_PROJEX_WEB_URL",
|
|
122
|
+
"path": "/"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"icon": "application",
|
|
126
|
+
"id": "qcafe",
|
|
127
|
+
"label": "Q Cafe",
|
|
128
|
+
"localUrlKey": "VITE_QCAFE_WEB_URL",
|
|
129
|
+
"path": "/"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"icon": "application",
|
|
133
|
+
"id": "sites",
|
|
134
|
+
"label": "Sites",
|
|
135
|
+
"localUrlKey": "VITE_SITES_WEB_URL",
|
|
136
|
+
"path": "/"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"icon": "uiux",
|
|
140
|
+
"id": "uiux",
|
|
141
|
+
"label": "UIUX",
|
|
142
|
+
"localUrlKey": "VITE_UIUX_WEB_URL",
|
|
143
|
+
"path": "/"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"icon": "zetro",
|
|
147
|
+
"id": "zetro",
|
|
148
|
+
"label": "Zetro",
|
|
149
|
+
"localUrlKey": "VITE_ZETRO_WEB_URL",
|
|
150
|
+
"path": "/zetro"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"icon": "application",
|
|
154
|
+
"id": "zuno",
|
|
155
|
+
"label": "Zuno",
|
|
156
|
+
"localUrlKey": "VITE_ZUNO_WEB_URL",
|
|
157
|
+
"path": "/"
|
|
158
|
+
}
|
|
159
|
+
] as const;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BookOpenIcon,
|
|
3
|
+
BotIcon,
|
|
4
|
+
BoxesIcon,
|
|
5
|
+
PanelsTopLeftIcon,
|
|
6
|
+
} from "lucide-react";
|
|
7
|
+
|
|
8
|
+
import type { MdiAppItem } from "./mdi-types";
|
|
9
|
+
import { mdiCatalogApplications } from "./mdi-app-catalog.generated";
|
|
10
|
+
|
|
11
|
+
type MdiCatalogEntry = MdiAppItem & {
|
|
12
|
+
id: string;
|
|
13
|
+
localUrlKey: string;
|
|
14
|
+
path: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const icons = {
|
|
18
|
+
docs: BookOpenIcon,
|
|
19
|
+
platform: BoxesIcon,
|
|
20
|
+
uiux: PanelsTopLeftIcon,
|
|
21
|
+
zetro: BotIcon,
|
|
22
|
+
};
|
|
23
|
+
const mdiApplicationCatalog: readonly MdiCatalogEntry[] =
|
|
24
|
+
mdiCatalogApplications.map((application) => ({
|
|
25
|
+
icon: icons[application.icon as keyof typeof icons] ?? BoxesIcon,
|
|
26
|
+
id: application.id,
|
|
27
|
+
localUrlKey: application.localUrlKey,
|
|
28
|
+
label: application.label,
|
|
29
|
+
path: application.path,
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
export function createDefaultMdiApps(applicationId: string): MdiAppItem[] {
|
|
33
|
+
const currentLocation =
|
|
34
|
+
typeof window === "undefined" ? undefined : window.location;
|
|
35
|
+
|
|
36
|
+
return mdiApplicationCatalog.map(({ id, localUrlKey, path, ...app }) => ({
|
|
37
|
+
...app,
|
|
38
|
+
active: isApplicationActive(id, applicationId),
|
|
39
|
+
href: createApplicationHref(
|
|
40
|
+
requiredEnvironmentPort(localUrlKey),
|
|
41
|
+
path,
|
|
42
|
+
currentLocation,
|
|
43
|
+
),
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function requiredEnvironmentPort(key: string): string {
|
|
48
|
+
const value = import.meta.env[key];
|
|
49
|
+
if (!/^\d{1,5}$/u.test(value ?? ""))
|
|
50
|
+
throw new Error(`${key} must be a local port in the root .env file.`);
|
|
51
|
+
return value!;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function isApplicationActive(id: string, applicationId: string): boolean {
|
|
55
|
+
return id === applicationId;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function createApplicationHref(
|
|
59
|
+
localPort: string,
|
|
60
|
+
path: string,
|
|
61
|
+
currentLocation?: Location,
|
|
62
|
+
): string {
|
|
63
|
+
if (!currentLocation || !isLocalHostname(currentLocation.hostname))
|
|
64
|
+
return path;
|
|
65
|
+
|
|
66
|
+
const target = new URL(currentLocation.origin);
|
|
67
|
+
target.port = localPort;
|
|
68
|
+
target.pathname = path;
|
|
69
|
+
target.search = "";
|
|
70
|
+
target.hash = "";
|
|
71
|
+
return target.toString();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function isLocalHostname(hostname: string): boolean {
|
|
75
|
+
return hostname === "127.0.0.1" || hostname === "localhost";
|
|
76
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { CheckIcon, XIcon } from 'lucide-react'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import { Button } from '@devxcrew/react-ui/components/button'
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@devxcrew/react-ui/components/popover'
|
|
6
|
+
import { cn } from '@devxcrew/react-ui/lib/utils'
|
|
7
|
+
import { TopologyMarker } from '../../features/interface-topology'
|
|
8
|
+
|
|
9
|
+
import { mdiTopMenuButtonClassName } from './mdi-top-menu-control'
|
|
10
|
+
import { useMdiTopology } from './mdi-topology'
|
|
11
|
+
import type { MdiAppItem } from './mdi-types'
|
|
12
|
+
|
|
13
|
+
export function MdiAppSwitcher({ apps }: { apps: MdiAppItem[] }) {
|
|
14
|
+
const [open, setOpen] = useState(false)
|
|
15
|
+
const topology = useMdiTopology()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
19
|
+
<PopoverTrigger
|
|
20
|
+
render={
|
|
21
|
+
<Button
|
|
22
|
+
variant="outline"
|
|
23
|
+
size="icon"
|
|
24
|
+
className={cn(mdiTopMenuButtonClassName, topology.highlightClassName('01.5.1'))}
|
|
25
|
+
aria-label="Open applications"
|
|
26
|
+
{...topology.regionProps('01.5.1')}
|
|
27
|
+
/>
|
|
28
|
+
}
|
|
29
|
+
>
|
|
30
|
+
<DotGrid />
|
|
31
|
+
</PopoverTrigger>
|
|
32
|
+
<PopoverContent
|
|
33
|
+
align="end"
|
|
34
|
+
sideOffset={9}
|
|
35
|
+
className={cn('w-88 gap-3 rounded-3xl p-4', topology.highlightClassName('01.5.2'))}
|
|
36
|
+
{...topology.regionProps('01.5.2')}
|
|
37
|
+
>
|
|
38
|
+
<TopologyMarker id="01.5.2" topology={topology} />
|
|
39
|
+
<div className="flex items-center justify-between px-2">
|
|
40
|
+
<h2 className="text-base font-semibold">Apps</h2>
|
|
41
|
+
<Button variant="ghost" size="icon-sm" onClick={() => setOpen(false)} aria-label="Close">
|
|
42
|
+
<XIcon />
|
|
43
|
+
</Button>
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
className={cn(
|
|
47
|
+
'grid grid-cols-3 gap-x-3 gap-y-5 rounded-2xl border p-5',
|
|
48
|
+
topology.highlightClassName('01.5.3'),
|
|
49
|
+
)}
|
|
50
|
+
{...topology.regionProps('01.5.3')}
|
|
51
|
+
>
|
|
52
|
+
{apps.map((app) => (
|
|
53
|
+
<AppItem key={app.label} app={app} onClose={() => setOpen(false)} />
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
</PopoverContent>
|
|
57
|
+
</Popover>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function DotGrid() {
|
|
62
|
+
return (
|
|
63
|
+
<span className="grid size-4 grid-cols-3 place-items-center gap-px" aria-hidden="true">
|
|
64
|
+
{Array.from({ length: 9 }, (_, index) => (
|
|
65
|
+
<span className="size-1 rounded-full bg-current" key={index} />
|
|
66
|
+
))}
|
|
67
|
+
</span>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function AppItem({ app, onClose }: { app: MdiAppItem; onClose: () => void }) {
|
|
72
|
+
const Icon = app.icon
|
|
73
|
+
const content = (
|
|
74
|
+
<>
|
|
75
|
+
<span
|
|
76
|
+
className={cn(
|
|
77
|
+
'relative grid size-11 place-items-center rounded-xl border bg-background shadow-sm',
|
|
78
|
+
app.active && 'border-foreground/50 bg-muted',
|
|
79
|
+
)}
|
|
80
|
+
>
|
|
81
|
+
<Icon className="size-5" />
|
|
82
|
+
{app.active ? (
|
|
83
|
+
<span className="absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-foreground text-background">
|
|
84
|
+
<CheckIcon className="size-2.5" />
|
|
85
|
+
</span>
|
|
86
|
+
) : null}
|
|
87
|
+
</span>
|
|
88
|
+
<span className="text-sm font-medium">{app.label}</span>
|
|
89
|
+
</>
|
|
90
|
+
)
|
|
91
|
+
const className =
|
|
92
|
+
'flex min-w-0 flex-col items-center gap-2 rounded-xl p-1 outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring'
|
|
93
|
+
const onClick = () => {
|
|
94
|
+
app.onSelect?.()
|
|
95
|
+
onClose()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return app.href ? (
|
|
99
|
+
<a className={className} href={app.href} onClick={onClick}>
|
|
100
|
+
{content}
|
|
101
|
+
</a>
|
|
102
|
+
) : (
|
|
103
|
+
<button className={className} type="button" onClick={onClick}>
|
|
104
|
+
{content}
|
|
105
|
+
</button>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { ArrowLeftIcon } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { Button } from '@devxcrew/react-ui/components/button';
|
|
4
|
+
import { Separator } from '@devxcrew/react-ui/components/separator';
|
|
5
|
+
import { Switch } from '@devxcrew/react-ui/components/switch';
|
|
6
|
+
import { TopologyMarker, TopologyRegion } from '../../features/interface-topology';
|
|
7
|
+
|
|
8
|
+
import type { MdiFeatureKey, MdiFeatures } from './mdi-types';
|
|
9
|
+
import { useMdiTopology } from './mdi-topology';
|
|
10
|
+
|
|
11
|
+
const featureOptions: Array<{
|
|
12
|
+
agentWorkspaceOnly?: boolean;
|
|
13
|
+
description: string;
|
|
14
|
+
key: MdiFeatureKey;
|
|
15
|
+
label: string;
|
|
16
|
+
topologyId: string;
|
|
17
|
+
}> = [
|
|
18
|
+
{
|
|
19
|
+
key: 'ito',
|
|
20
|
+
label: 'ITO inspection',
|
|
21
|
+
description: 'Show the Interface Topology inspection control above the status bar.',
|
|
22
|
+
topologyId: '06.2.0',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'topMenu',
|
|
26
|
+
label: 'Top menu',
|
|
27
|
+
description: 'Show the application context, search, and account actions.',
|
|
28
|
+
topologyId: '06.2.1',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'notifications',
|
|
32
|
+
label: 'Notifications',
|
|
33
|
+
description: 'Show the notification action in the top menu.',
|
|
34
|
+
topologyId: '06.2.2',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'appSwitcher',
|
|
38
|
+
label: 'Application switcher',
|
|
39
|
+
description: 'Show the grid used to move between available applications.',
|
|
40
|
+
topologyId: '06.2.3',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: 'profileMenu',
|
|
44
|
+
label: 'Profile menu',
|
|
45
|
+
description: 'Show the current user and account actions.',
|
|
46
|
+
topologyId: '06.2.4',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: 'statusBar',
|
|
50
|
+
label: 'Workspace status bar',
|
|
51
|
+
description: 'Show workspace state along the bottom edge.',
|
|
52
|
+
topologyId: '06.2.5',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
agentWorkspaceOnly: true,
|
|
56
|
+
key: 'primaryActivityRail',
|
|
57
|
+
label: 'Primary activity rail',
|
|
58
|
+
description: 'Show the fixed agent tools along the left edge of the workspace.',
|
|
59
|
+
topologyId: '06.2.6',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
agentWorkspaceOnly: true,
|
|
63
|
+
key: 'secondaryUtilityRail',
|
|
64
|
+
label: 'Secondary utility rail',
|
|
65
|
+
description: 'Show supporting agent tools along the right edge of the workspace.',
|
|
66
|
+
topologyId: '06.2.7',
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
type MdiFeatureSettingsProps = {
|
|
71
|
+
features: MdiFeatures;
|
|
72
|
+
onBack: () => void;
|
|
73
|
+
onFeatureChange: (feature: MdiFeatureKey, enabled: boolean) => void;
|
|
74
|
+
showAgentWorkspaceOptions?: boolean;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export function MdiFeatureSettings({
|
|
78
|
+
features,
|
|
79
|
+
onBack,
|
|
80
|
+
onFeatureChange,
|
|
81
|
+
showAgentWorkspaceOptions = false,
|
|
82
|
+
}: MdiFeatureSettingsProps) {
|
|
83
|
+
const topology = useMdiTopology();
|
|
84
|
+
const visibleOptions = featureOptions.filter((option) => !option.agentWorkspaceOnly || showAgentWorkspaceOptions);
|
|
85
|
+
return (
|
|
86
|
+
<section
|
|
87
|
+
className="relative h-full overflow-auto bg-background data-[ito-highlighted=true]:ring-2 data-[ito-highlighted=true]:ring-inset data-[ito-highlighted=true]:ring-violet-700"
|
|
88
|
+
aria-labelledby="mdi-features-title"
|
|
89
|
+
{...topology.regionProps('06')}
|
|
90
|
+
>
|
|
91
|
+
<TopologyMarker id="06" topology={topology} />
|
|
92
|
+
<div className="mx-auto flex w-full max-w-3xl flex-col gap-8 px-6 py-10 lg:px-10">
|
|
93
|
+
<div className="flex items-start gap-4">
|
|
94
|
+
<TopologyRegion as="div" id="06.1" topology={topology}>
|
|
95
|
+
<Button variant="outline" size="icon" onClick={onBack} aria-label="Back to workspace">
|
|
96
|
+
<ArrowLeftIcon />
|
|
97
|
+
</Button>
|
|
98
|
+
</TopologyRegion>
|
|
99
|
+
<div className="flex flex-col gap-1">
|
|
100
|
+
<p className="text-sm font-medium text-muted-foreground">Settings</p>
|
|
101
|
+
<h1 id="mdi-features-title" className="text-2xl font-semibold tracking-tight">
|
|
102
|
+
Workspace features
|
|
103
|
+
</h1>
|
|
104
|
+
<p className="text-sm leading-6 text-muted-foreground">
|
|
105
|
+
Choose which shared MDI controls appear in this application.
|
|
106
|
+
</p>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<TopologyRegion as="div" className="flex flex-col" id="06.2" topology={topology}>
|
|
110
|
+
{visibleOptions.map((option, index) => (
|
|
111
|
+
<TopologyRegion as="div" id={option.topologyId} key={option.key} topology={topology}>
|
|
112
|
+
{index > 0 ? <Separator /> : null}
|
|
113
|
+
<div className="flex items-center gap-6 py-5">
|
|
114
|
+
<span className="flex min-w-0 flex-1 flex-col gap-1">
|
|
115
|
+
<span id={`${option.key}-label`} className="text-sm font-semibold">
|
|
116
|
+
{option.label}
|
|
117
|
+
</span>
|
|
118
|
+
<span id={`${option.key}-description`} className="text-sm leading-5 text-muted-foreground">
|
|
119
|
+
{option.description}
|
|
120
|
+
</span>
|
|
121
|
+
</span>
|
|
122
|
+
<Switch
|
|
123
|
+
checked={features[option.key]}
|
|
124
|
+
onCheckedChange={(enabled) => onFeatureChange(option.key, enabled)}
|
|
125
|
+
aria-labelledby={`${option.key}-label`}
|
|
126
|
+
aria-describedby={`${option.key}-description`}
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
</TopologyRegion>
|
|
130
|
+
))}
|
|
131
|
+
</TopologyRegion>
|
|
132
|
+
</div>
|
|
133
|
+
</section>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { SearchIcon } from 'lucide-react'
|
|
2
|
+
import { useEffect, useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import { Button } from '@devxcrew/react-ui/components/button'
|
|
5
|
+
import {
|
|
6
|
+
Command,
|
|
7
|
+
CommandEmpty,
|
|
8
|
+
CommandGroup,
|
|
9
|
+
CommandInput,
|
|
10
|
+
CommandItem,
|
|
11
|
+
CommandList,
|
|
12
|
+
} from '@devxcrew/react-ui/components/command'
|
|
13
|
+
import {
|
|
14
|
+
Dialog,
|
|
15
|
+
DialogContent,
|
|
16
|
+
DialogDescription,
|
|
17
|
+
DialogHeader,
|
|
18
|
+
DialogTitle,
|
|
19
|
+
} from '@devxcrew/react-ui/components/dialog'
|
|
20
|
+
import { Kbd } from '@devxcrew/react-ui/components/kbd'
|
|
21
|
+
import { cn } from '@devxcrew/react-ui/lib/utils'
|
|
22
|
+
import { TopologyMarker } from '../../features/interface-topology'
|
|
23
|
+
|
|
24
|
+
import { mdiTopMenuSurfaceClassName } from './mdi-top-menu-control'
|
|
25
|
+
import { useMdiTopology } from './mdi-topology'
|
|
26
|
+
import type { MdiAppItem, MdiNavigationItem, MdiNavigationSection } from './mdi-types'
|
|
27
|
+
|
|
28
|
+
type MdiGlobalSearchProps = {
|
|
29
|
+
applicationName: string
|
|
30
|
+
apps: MdiAppItem[]
|
|
31
|
+
navigation: MdiNavigationSection[]
|
|
32
|
+
placeholder: string
|
|
33
|
+
value?: string
|
|
34
|
+
onSearchChange?: (value: string) => void
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function MdiGlobalSearch({
|
|
38
|
+
applicationName,
|
|
39
|
+
apps,
|
|
40
|
+
navigation,
|
|
41
|
+
placeholder,
|
|
42
|
+
value,
|
|
43
|
+
onSearchChange,
|
|
44
|
+
}: MdiGlobalSearchProps) {
|
|
45
|
+
const [open, setOpen] = useState(false)
|
|
46
|
+
const topology = useMdiTopology()
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
function handleShortcut(event: KeyboardEvent) {
|
|
50
|
+
if (!event.ctrlKey || event.key.toLowerCase() !== 'k') return
|
|
51
|
+
event.preventDefault()
|
|
52
|
+
setOpen((current) => !current)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
window.addEventListener('keydown', handleShortcut)
|
|
56
|
+
return () => window.removeEventListener('keydown', handleShortcut)
|
|
57
|
+
}, [])
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<Button
|
|
62
|
+
aria-keyshortcuts="Control+K"
|
|
63
|
+
aria-label="Open global search"
|
|
64
|
+
className={cn(
|
|
65
|
+
mdiTopMenuSurfaceClassName,
|
|
66
|
+
'h-9 gap-2 rounded-full px-2.5 text-sm font-medium sm:px-3',
|
|
67
|
+
topology.highlightClassName('01.3.1'),
|
|
68
|
+
)}
|
|
69
|
+
onClick={() => setOpen(true)}
|
|
70
|
+
variant="outline"
|
|
71
|
+
{...topology.regionProps('01.3.1')}
|
|
72
|
+
>
|
|
73
|
+
<SearchIcon className="size-4" />
|
|
74
|
+
<span className="hidden sm:inline">Search</span>
|
|
75
|
+
<Kbd className="hidden bg-muted-foreground/10 text-xs sm:inline-flex">Ctrl K</Kbd>
|
|
76
|
+
</Button>
|
|
77
|
+
|
|
78
|
+
<Dialog onOpenChange={setOpen} open={open}>
|
|
79
|
+
<DialogContent
|
|
80
|
+
className={cn(
|
|
81
|
+
'top-[14%] translate-y-0 overflow-hidden rounded-2xl! p-0 shadow-2xl sm:max-w-3xl',
|
|
82
|
+
topology.highlightClassName('01.3.2'),
|
|
83
|
+
)}
|
|
84
|
+
showCloseButton={false}
|
|
85
|
+
{...topology.regionProps('01.3.2')}
|
|
86
|
+
>
|
|
87
|
+
<DialogHeader className="sr-only">
|
|
88
|
+
<DialogTitle>Global search</DialogTitle>
|
|
89
|
+
<DialogDescription>
|
|
90
|
+
Search {applicationName} and open workspace destinations.
|
|
91
|
+
</DialogDescription>
|
|
92
|
+
</DialogHeader>
|
|
93
|
+
<TopologyMarker id="01.3.2" topology={topology} />
|
|
94
|
+
<Command>
|
|
95
|
+
<div
|
|
96
|
+
className={topology.highlightClassName('01.3.3')}
|
|
97
|
+
{...topology.regionProps('01.3.3')}
|
|
98
|
+
>
|
|
99
|
+
<CommandInput
|
|
100
|
+
autoFocus
|
|
101
|
+
onValueChange={onSearchChange}
|
|
102
|
+
placeholder={placeholder}
|
|
103
|
+
value={value}
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
<CommandList
|
|
107
|
+
className={topology.highlightClassName('01.3.4')}
|
|
108
|
+
{...topology.regionProps('01.3.4')}
|
|
109
|
+
>
|
|
110
|
+
<CommandEmpty>
|
|
111
|
+
{onSearchChange
|
|
112
|
+
? `Search results for ${applicationName} are updating in the workspace.`
|
|
113
|
+
: 'No matching destination.'}
|
|
114
|
+
</CommandEmpty>
|
|
115
|
+
<NavigationGroup navigation={navigation} onClose={() => setOpen(false)} />
|
|
116
|
+
<ApplicationGroup apps={apps} onClose={() => setOpen(false)} />
|
|
117
|
+
</CommandList>
|
|
118
|
+
<div className="flex items-center justify-end gap-2 border-t px-3 py-2 text-xs text-muted-foreground">
|
|
119
|
+
<span>Close</span>
|
|
120
|
+
<Kbd>Esc</Kbd>
|
|
121
|
+
</div>
|
|
122
|
+
</Command>
|
|
123
|
+
</DialogContent>
|
|
124
|
+
</Dialog>
|
|
125
|
+
</>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function NavigationGroup({
|
|
130
|
+
navigation,
|
|
131
|
+
onClose,
|
|
132
|
+
}: {
|
|
133
|
+
navigation: MdiNavigationSection[]
|
|
134
|
+
onClose: () => void
|
|
135
|
+
}) {
|
|
136
|
+
const items = navigation.flatMap((section) => getNavigationLeaves(section.items))
|
|
137
|
+
if (items.length === 0) return null
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<CommandGroup heading="Current workspace">
|
|
141
|
+
{items.map((item) => (
|
|
142
|
+
<DestinationItem item={item} key={`${item.label}-${item.href ?? ''}`} onClose={onClose} />
|
|
143
|
+
))}
|
|
144
|
+
</CommandGroup>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function getNavigationLeaves(items: MdiNavigationItem[]): MdiNavigationItem[] {
|
|
149
|
+
return items.flatMap((item) => {
|
|
150
|
+
const children = item.children ?? []
|
|
151
|
+
return children.length > 0 ? getNavigationLeaves(children) : [item]
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function ApplicationGroup({ apps, onClose }: { apps: MdiAppItem[]; onClose: () => void }) {
|
|
156
|
+
return (
|
|
157
|
+
<CommandGroup heading="Applications">
|
|
158
|
+
{apps.map((app) => {
|
|
159
|
+
const Icon = app.icon
|
|
160
|
+
return (
|
|
161
|
+
<CommandItem
|
|
162
|
+
key={app.label}
|
|
163
|
+
onSelect={() => activateDestination(app, onClose)}
|
|
164
|
+
value={app.label}
|
|
165
|
+
>
|
|
166
|
+
<Icon />
|
|
167
|
+
<span>{app.label}</span>
|
|
168
|
+
</CommandItem>
|
|
169
|
+
)
|
|
170
|
+
})}
|
|
171
|
+
</CommandGroup>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function DestinationItem({ item, onClose }: { item: MdiNavigationItem; onClose: () => void }) {
|
|
176
|
+
const Icon = item.icon
|
|
177
|
+
return (
|
|
178
|
+
<CommandItem onSelect={() => activateDestination(item, onClose)} value={item.label}>
|
|
179
|
+
{Icon ? <Icon /> : <span className="size-4" />}
|
|
180
|
+
<span>{item.label}</span>
|
|
181
|
+
</CommandItem>
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function activateDestination(
|
|
186
|
+
destination: Pick<MdiAppItem, 'href' | 'onSelect'>,
|
|
187
|
+
onClose: () => void,
|
|
188
|
+
) {
|
|
189
|
+
destination.onSelect?.()
|
|
190
|
+
if (destination.href) window.location.assign(destination.href)
|
|
191
|
+
onClose()
|
|
192
|
+
}
|