@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,206 @@
|
|
|
1
|
+
import { AppleIcon, Globe2Icon, LogInIcon, OrbitIcon } from "lucide-react";
|
|
2
|
+
import { useState, type FormEvent } from "react";
|
|
3
|
+
import { Button } from "../../components/button";
|
|
4
|
+
import {
|
|
5
|
+
Field,
|
|
6
|
+
FieldDescription,
|
|
7
|
+
FieldGroup,
|
|
8
|
+
FieldLabel,
|
|
9
|
+
FieldSeparator,
|
|
10
|
+
} from "../../components/field";
|
|
11
|
+
import { Input } from "../../components/input";
|
|
12
|
+
import {
|
|
13
|
+
AuthPageLayout,
|
|
14
|
+
AuthVisualPanel,
|
|
15
|
+
type AuthPageVariant,
|
|
16
|
+
} from "./auth-page-layout";
|
|
17
|
+
|
|
18
|
+
export type LoginPageProps = {
|
|
19
|
+
brandName?: string;
|
|
20
|
+
busy?: boolean;
|
|
21
|
+
description?: string;
|
|
22
|
+
devLoginEnabled?: boolean;
|
|
23
|
+
embedded?: boolean;
|
|
24
|
+
error?: string;
|
|
25
|
+
forgotHref?: string | null;
|
|
26
|
+
onSubmit(identifier: string, password: string): void;
|
|
27
|
+
onDevLogin?: () => void;
|
|
28
|
+
registerHref?: string | null;
|
|
29
|
+
title?: string;
|
|
30
|
+
variant?: AuthPageVariant;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function LoginPage({
|
|
34
|
+
brandName,
|
|
35
|
+
busy = false,
|
|
36
|
+
description,
|
|
37
|
+
devLoginEnabled = false,
|
|
38
|
+
embedded = false,
|
|
39
|
+
error,
|
|
40
|
+
forgotHref = "/password/forgot",
|
|
41
|
+
onSubmit,
|
|
42
|
+
onDevLogin,
|
|
43
|
+
registerHref = "/register",
|
|
44
|
+
title,
|
|
45
|
+
variant = "v1",
|
|
46
|
+
}: LoginPageProps) {
|
|
47
|
+
const [identifier, setIdentifier] = useState("");
|
|
48
|
+
const [password, setPassword] = useState("");
|
|
49
|
+
|
|
50
|
+
function submit(event: FormEvent) {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
onSubmit(identifier, password);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<AuthPageLayout
|
|
57
|
+
aside={
|
|
58
|
+
<AuthVisualPanel
|
|
59
|
+
description="Keep projects, people, and trusted application access in one connected workspace."
|
|
60
|
+
title="One workspace. Every application."
|
|
61
|
+
/>
|
|
62
|
+
}
|
|
63
|
+
brandName={brandName}
|
|
64
|
+
embedded={embedded}
|
|
65
|
+
variant={variant}
|
|
66
|
+
>
|
|
67
|
+
<form className="grid gap-6" onSubmit={submit}>
|
|
68
|
+
<header
|
|
69
|
+
className={
|
|
70
|
+
variant === "v2" ? "grid gap-1.5 text-center" : "grid gap-2"
|
|
71
|
+
}
|
|
72
|
+
>
|
|
73
|
+
<h1 className="text-2xl font-semibold tracking-tight">
|
|
74
|
+
{title ?? (variant === "v2" ? "Welcome back" : "Welcome")}
|
|
75
|
+
</h1>
|
|
76
|
+
<p className="text-sm leading-6 text-muted-foreground">
|
|
77
|
+
{description ??
|
|
78
|
+
(variant === "v2"
|
|
79
|
+
? "Sign in to continue to your CODEXSUN workspace."
|
|
80
|
+
: "Use your admin username or email and password for this desk.")}
|
|
81
|
+
</p>
|
|
82
|
+
</header>
|
|
83
|
+
{variant === "v1" ? <div className="border-t" /> : null}
|
|
84
|
+
<FieldGroup>
|
|
85
|
+
<Field>
|
|
86
|
+
<FieldLabel htmlFor={`login-${variant}-identifier`}>
|
|
87
|
+
Username or email
|
|
88
|
+
</FieldLabel>
|
|
89
|
+
<Input
|
|
90
|
+
autoComplete="username"
|
|
91
|
+
className="h-11"
|
|
92
|
+
id={`login-${variant}-identifier`}
|
|
93
|
+
onChange={(event) => setIdentifier(event.target.value)}
|
|
94
|
+
placeholder={variant === "v2" ? "Username or email" : undefined}
|
|
95
|
+
required
|
|
96
|
+
type="text"
|
|
97
|
+
value={identifier}
|
|
98
|
+
/>
|
|
99
|
+
</Field>
|
|
100
|
+
{devLoginEnabled && onDevLogin ? (
|
|
101
|
+
<Button
|
|
102
|
+
className="w-full"
|
|
103
|
+
disabled={busy}
|
|
104
|
+
onClick={onDevLogin}
|
|
105
|
+
type="button"
|
|
106
|
+
variant="outline"
|
|
107
|
+
>
|
|
108
|
+
Development sign in
|
|
109
|
+
</Button>
|
|
110
|
+
) : null}
|
|
111
|
+
<Field>
|
|
112
|
+
<div className={variant === "v2" ? "flex items-center gap-4" : ""}>
|
|
113
|
+
<FieldLabel htmlFor={`login-${variant}-password`}>
|
|
114
|
+
Password
|
|
115
|
+
</FieldLabel>
|
|
116
|
+
{variant === "v2" && forgotHref ? (
|
|
117
|
+
<a
|
|
118
|
+
className="ml-auto text-sm underline-offset-4 hover:underline"
|
|
119
|
+
href={forgotHref}
|
|
120
|
+
>
|
|
121
|
+
Forgot your password?
|
|
122
|
+
</a>
|
|
123
|
+
) : null}
|
|
124
|
+
</div>
|
|
125
|
+
<Input
|
|
126
|
+
autoComplete="current-password"
|
|
127
|
+
className="h-11"
|
|
128
|
+
id={`login-${variant}-password`}
|
|
129
|
+
minLength={8}
|
|
130
|
+
onChange={(event) => setPassword(event.target.value)}
|
|
131
|
+
required
|
|
132
|
+
type="password"
|
|
133
|
+
value={password}
|
|
134
|
+
/>
|
|
135
|
+
</Field>
|
|
136
|
+
{error ? (
|
|
137
|
+
<p className="text-sm text-destructive" role="alert">
|
|
138
|
+
{error}
|
|
139
|
+
</p>
|
|
140
|
+
) : null}
|
|
141
|
+
{variant === "v1" && forgotHref ? (
|
|
142
|
+
<a
|
|
143
|
+
className="text-center text-sm font-medium hover:underline"
|
|
144
|
+
href={forgotHref}
|
|
145
|
+
>
|
|
146
|
+
Forgot password?
|
|
147
|
+
</a>
|
|
148
|
+
) : null}
|
|
149
|
+
<Field>
|
|
150
|
+
<Button
|
|
151
|
+
className="w-full"
|
|
152
|
+
disabled={busy}
|
|
153
|
+
type="submit"
|
|
154
|
+
variant={variant === "v1" ? "success" : "default"}
|
|
155
|
+
>
|
|
156
|
+
{variant === "v1" ? <LogInIcon /> : null}
|
|
157
|
+
{busy ? "Signing in…" : variant === "v2" ? "Login" : "Sign in"}
|
|
158
|
+
</Button>
|
|
159
|
+
</Field>
|
|
160
|
+
{variant === "v2" ? <ProviderActions /> : null}
|
|
161
|
+
{registerHref ? (
|
|
162
|
+
<FieldDescription className="text-center">
|
|
163
|
+
Don't have an account? <a href={registerHref}>Sign up</a>
|
|
164
|
+
</FieldDescription>
|
|
165
|
+
) : null}
|
|
166
|
+
</FieldGroup>
|
|
167
|
+
</form>
|
|
168
|
+
</AuthPageLayout>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function ProviderActions() {
|
|
173
|
+
return (
|
|
174
|
+
<>
|
|
175
|
+
<FieldSeparator className="*:data-[slot=field-separator-content]:bg-card">
|
|
176
|
+
Or continue with
|
|
177
|
+
</FieldSeparator>
|
|
178
|
+
<Field className="grid grid-cols-3 gap-3">
|
|
179
|
+
<Button
|
|
180
|
+
aria-label="Login with Apple"
|
|
181
|
+
size="icon"
|
|
182
|
+
type="button"
|
|
183
|
+
variant="outline"
|
|
184
|
+
>
|
|
185
|
+
<AppleIcon />
|
|
186
|
+
</Button>
|
|
187
|
+
<Button
|
|
188
|
+
aria-label="Login with Google"
|
|
189
|
+
size="icon"
|
|
190
|
+
type="button"
|
|
191
|
+
variant="outline"
|
|
192
|
+
>
|
|
193
|
+
<Globe2Icon />
|
|
194
|
+
</Button>
|
|
195
|
+
<Button
|
|
196
|
+
aria-label="Login with another provider"
|
|
197
|
+
size="icon"
|
|
198
|
+
type="button"
|
|
199
|
+
variant="outline"
|
|
200
|
+
>
|
|
201
|
+
<OrbitIcon />
|
|
202
|
+
</Button>
|
|
203
|
+
</Field>
|
|
204
|
+
</>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useState, type FormEvent } from 'react'
|
|
2
|
+
import { Button } from '../../components/button'
|
|
3
|
+
import { Input } from '../../components/input'
|
|
4
|
+
import { Field, FieldGroup, FieldLabel } from '../../components/field'
|
|
5
|
+
import { AuthPageLayout } from './auth-page-layout'
|
|
6
|
+
|
|
7
|
+
export interface PasswordForgotPageProps {
|
|
8
|
+
backHref: string
|
|
9
|
+
embedded?: boolean
|
|
10
|
+
onSubmit(identifier: string): void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function PasswordForgotPage({
|
|
14
|
+
backHref,
|
|
15
|
+
embedded = false,
|
|
16
|
+
onSubmit,
|
|
17
|
+
}: PasswordForgotPageProps) {
|
|
18
|
+
const [identifier, setIdentifier] = useState('')
|
|
19
|
+
return (
|
|
20
|
+
<AuthPageLayout embedded={embedded} variant="v1">
|
|
21
|
+
<form
|
|
22
|
+
className="grid gap-6"
|
|
23
|
+
onSubmit={(event: FormEvent) => {
|
|
24
|
+
event.preventDefault()
|
|
25
|
+
onSubmit(identifier)
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<header className="grid gap-2">
|
|
29
|
+
<h1 className="text-2xl font-semibold tracking-tight">Reset your password</h1>
|
|
30
|
+
<p className="text-sm leading-6 text-muted-foreground">
|
|
31
|
+
Enter your username or email. The response does not reveal whether an account exists.
|
|
32
|
+
</p>
|
|
33
|
+
</header>
|
|
34
|
+
<div className="border-t" />
|
|
35
|
+
<FieldGroup>
|
|
36
|
+
<Field>
|
|
37
|
+
<FieldLabel htmlFor="recovery-identifier">Username or email</FieldLabel>
|
|
38
|
+
<Input
|
|
39
|
+
className="h-11"
|
|
40
|
+
id="recovery-identifier"
|
|
41
|
+
type="text"
|
|
42
|
+
value={identifier}
|
|
43
|
+
onChange={(event) => setIdentifier(event.target.value)}
|
|
44
|
+
required
|
|
45
|
+
/>
|
|
46
|
+
</Field>
|
|
47
|
+
<Button className="w-full" type="submit">
|
|
48
|
+
Request reset
|
|
49
|
+
</Button>
|
|
50
|
+
<a
|
|
51
|
+
className="text-center text-sm text-muted-foreground hover:text-foreground"
|
|
52
|
+
href={backHref}
|
|
53
|
+
>
|
|
54
|
+
Back to sign in
|
|
55
|
+
</a>
|
|
56
|
+
</FieldGroup>
|
|
57
|
+
</form>
|
|
58
|
+
</AuthPageLayout>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
function PortalPage({
|
|
4
|
+
children,
|
|
5
|
+
label,
|
|
6
|
+
title,
|
|
7
|
+
}: {
|
|
8
|
+
children?: ReactNode
|
|
9
|
+
label: string
|
|
10
|
+
title: string
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<div className="min-h-full bg-background p-8">
|
|
14
|
+
<div className="mx-auto max-w-6xl space-y-3">
|
|
15
|
+
<p className="text-sm font-medium text-muted-foreground">{label}</p>
|
|
16
|
+
<h1 className="text-3xl font-semibold tracking-tight">{title}</h1>
|
|
17
|
+
<p className="text-muted-foreground">Your authenticated workspace is ready.</p>
|
|
18
|
+
{children}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function ClientPortalPage() {
|
|
25
|
+
return <PortalPage label="Client portal" title="Workspace" />
|
|
26
|
+
}
|
|
27
|
+
export function AdminPortalPage() {
|
|
28
|
+
return <PortalPage label="Administration" title="Administrator desk" />
|
|
29
|
+
}
|
|
30
|
+
export function SuperAdminPortalPage() {
|
|
31
|
+
return <PortalPage label="System control" title="Super administrator desk" />
|
|
32
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { LayoutDashboardIcon, ShieldCheckIcon, WrenchIcon } from 'lucide-react'
|
|
2
|
+
import { MainWorkspace } from '../../layouts/mdi-main/mdi-main'
|
|
3
|
+
import type { MdiNavigationSection } from '../../layouts/mdi-main/mdi-types'
|
|
4
|
+
|
|
5
|
+
export function PrivilegedDesk({
|
|
6
|
+
applicationId,
|
|
7
|
+
applicationName,
|
|
8
|
+
logout,
|
|
9
|
+
portal,
|
|
10
|
+
}: {
|
|
11
|
+
applicationId: string
|
|
12
|
+
applicationName: string
|
|
13
|
+
logout(): void
|
|
14
|
+
portal: 'admin' | 'super-admin'
|
|
15
|
+
}) {
|
|
16
|
+
const superAdmin = portal === 'super-admin'
|
|
17
|
+
const title = `${applicationName} ${superAdmin ? 'Super Admin' : 'Admin'} Desk`
|
|
18
|
+
return (
|
|
19
|
+
<MainWorkspace
|
|
20
|
+
applicationId={applicationId}
|
|
21
|
+
applicationName={applicationName}
|
|
22
|
+
navigation={superAdmin ? superAdminNavigation() : adminNavigation()}
|
|
23
|
+
primaryAction={null}
|
|
24
|
+
user={{
|
|
25
|
+
initials: superAdmin ? 'SA' : 'A',
|
|
26
|
+
name: superAdmin ? 'Super administrator' : 'Administrator',
|
|
27
|
+
onSignOut: logout,
|
|
28
|
+
}}
|
|
29
|
+
workspaceTitle={title}
|
|
30
|
+
>
|
|
31
|
+
<main className="p-6">
|
|
32
|
+
<h1 className="text-lg font-semibold">{title}</h1>
|
|
33
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
34
|
+
{superAdmin
|
|
35
|
+
? 'Maintenance, access controls, and higher-end reports.'
|
|
36
|
+
: 'Manager approvals, administration controls, and reports.'}
|
|
37
|
+
</p>
|
|
38
|
+
</main>
|
|
39
|
+
</MainWorkspace>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function adminNavigation(): MdiNavigationSection[] {
|
|
44
|
+
return [
|
|
45
|
+
{ items: [{ active: true, icon: LayoutDashboardIcon, label: 'Overview' }], label: 'Desk' },
|
|
46
|
+
{ items: [{ icon: ShieldCheckIcon, label: 'Approvals' }, { icon: LayoutDashboardIcon, label: 'Reports' }], label: 'Administration' },
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function superAdminNavigation(): MdiNavigationSection[] {
|
|
51
|
+
return [
|
|
52
|
+
{ items: [{ active: true, icon: LayoutDashboardIcon, label: 'Overview' }], label: 'Maintenance' },
|
|
53
|
+
{ items: [{ icon: WrenchIcon, label: 'System maintenance' }, { icon: ShieldCheckIcon, label: 'Access audit' }, { icon: LayoutDashboardIcon, label: 'Higher-end reports' }], label: 'Platform' },
|
|
54
|
+
]
|
|
55
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { useState, type FormEvent } from 'react'
|
|
2
|
+
import { Button } from '../../components/button'
|
|
3
|
+
import { Field, FieldGroup, FieldLabel } from '../../components/field'
|
|
4
|
+
import { Input } from '../../components/input'
|
|
5
|
+
import { AuthPageLayout, AuthVisualPanel, type AuthPageVariant } from './auth-page-layout'
|
|
6
|
+
|
|
7
|
+
export function RegisterPage({
|
|
8
|
+
embedded = false,
|
|
9
|
+
onSubmit,
|
|
10
|
+
variant = 'v1',
|
|
11
|
+
}: {
|
|
12
|
+
embedded?: boolean
|
|
13
|
+
onSubmit(name: string, email: string, password: string, username?: string, mobile?: string): void
|
|
14
|
+
variant?: AuthPageVariant
|
|
15
|
+
}) {
|
|
16
|
+
const [name, setName] = useState('')
|
|
17
|
+
const [email, setEmail] = useState('')
|
|
18
|
+
const [password, setPassword] = useState('')
|
|
19
|
+
const [username, setUsername] = useState('')
|
|
20
|
+
const [mobile, setMobile] = useState('')
|
|
21
|
+
return (
|
|
22
|
+
<AuthPageLayout
|
|
23
|
+
aside={
|
|
24
|
+
<AuthVisualPanel
|
|
25
|
+
description="Create one trusted identity for projects, agents, and connected application desks."
|
|
26
|
+
title="Start with a secure workspace."
|
|
27
|
+
/>
|
|
28
|
+
}
|
|
29
|
+
embedded={embedded}
|
|
30
|
+
variant={variant}
|
|
31
|
+
>
|
|
32
|
+
<form
|
|
33
|
+
className="grid gap-6"
|
|
34
|
+
onSubmit={(event: FormEvent) => {
|
|
35
|
+
event.preventDefault()
|
|
36
|
+
onSubmit(name, email, password, username || undefined, mobile || undefined)
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<header className={variant === 'v2' ? 'grid gap-1.5 text-center' : 'grid gap-2'}>
|
|
40
|
+
<h1 className="text-2xl font-semibold tracking-tight">Create an account</h1>
|
|
41
|
+
<p className="text-sm leading-6 text-muted-foreground">
|
|
42
|
+
Register your CODEXSUN workspace identity.
|
|
43
|
+
</p>
|
|
44
|
+
</header>
|
|
45
|
+
{variant === 'v1' ? <div className="border-t" /> : null}
|
|
46
|
+
<FieldGroup>
|
|
47
|
+
<Field>
|
|
48
|
+
<FieldLabel htmlFor={`register-${variant}-name`}>Name</FieldLabel>
|
|
49
|
+
<Input
|
|
50
|
+
className="h-11"
|
|
51
|
+
id={`register-${variant}-name`}
|
|
52
|
+
value={name}
|
|
53
|
+
onChange={(event) => setName(event.target.value)}
|
|
54
|
+
required
|
|
55
|
+
/>
|
|
56
|
+
</Field>
|
|
57
|
+
<Field>
|
|
58
|
+
<FieldLabel htmlFor={`register-${variant}-email`}>Email</FieldLabel>
|
|
59
|
+
<Input
|
|
60
|
+
className="h-11"
|
|
61
|
+
id={`register-${variant}-email`}
|
|
62
|
+
type="email"
|
|
63
|
+
value={email}
|
|
64
|
+
onChange={(event) => setEmail(event.target.value)}
|
|
65
|
+
required
|
|
66
|
+
/>
|
|
67
|
+
</Field>
|
|
68
|
+
<Field>
|
|
69
|
+
<FieldLabel htmlFor={`register-${variant}-password`}>Password</FieldLabel>
|
|
70
|
+
<Input
|
|
71
|
+
className="h-11"
|
|
72
|
+
id={`register-${variant}-password`}
|
|
73
|
+
type="password"
|
|
74
|
+
minLength={8}
|
|
75
|
+
value={password}
|
|
76
|
+
onChange={(event) => setPassword(event.target.value)}
|
|
77
|
+
required
|
|
78
|
+
/>
|
|
79
|
+
</Field>
|
|
80
|
+
{variant === 'v2' ? (
|
|
81
|
+
<div className="grid gap-4 sm:grid-cols-2">
|
|
82
|
+
<Field>
|
|
83
|
+
<FieldLabel htmlFor="register-v2-username">Username (optional)</FieldLabel>
|
|
84
|
+
<Input
|
|
85
|
+
className="h-11"
|
|
86
|
+
id="register-v2-username"
|
|
87
|
+
minLength={3}
|
|
88
|
+
value={username}
|
|
89
|
+
onChange={(event) => setUsername(event.target.value)}
|
|
90
|
+
/>
|
|
91
|
+
</Field>
|
|
92
|
+
<Field>
|
|
93
|
+
<FieldLabel htmlFor="register-v2-mobile">Mobile number (optional)</FieldLabel>
|
|
94
|
+
<Input
|
|
95
|
+
className="h-11"
|
|
96
|
+
id="register-v2-mobile"
|
|
97
|
+
type="tel"
|
|
98
|
+
value={mobile}
|
|
99
|
+
onChange={(event) => setMobile(event.target.value)}
|
|
100
|
+
/>
|
|
101
|
+
</Field>
|
|
102
|
+
</div>
|
|
103
|
+
) : null}
|
|
104
|
+
<Button className="w-full" type="submit">
|
|
105
|
+
Create account
|
|
106
|
+
</Button>
|
|
107
|
+
<a
|
|
108
|
+
className="text-center text-sm text-muted-foreground hover:text-foreground"
|
|
109
|
+
href="/login"
|
|
110
|
+
>
|
|
111
|
+
Back to sign in
|
|
112
|
+
</a>
|
|
113
|
+
</FieldGroup>
|
|
114
|
+
</form>
|
|
115
|
+
</AuthPageLayout>
|
|
116
|
+
)
|
|
117
|
+
}
|