@mdxui/cockpit 0.2.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +207 -8
- package/dist/auth/auth-layout.js +13 -53
- package/dist/auth/auth-layout.js.map +1 -1
- package/dist/auth/index.js +13 -54
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/login-page.js +13 -53
- package/dist/auth/login-page.js.map +1 -1
- package/dist/auth/otp-page.js +13 -53
- package/dist/auth/otp-page.js.map +1 -1
- package/dist/auth/password-reset-page.js +13 -53
- package/dist/auth/password-reset-page.js.map +1 -1
- package/dist/auth/signup-page.js +13 -53
- package/dist/auth/signup-page.js.map +1 -1
- package/dist/developer/index.d.ts +525 -11
- package/dist/developer/index.js +1053 -767
- package/dist/developer/index.js.map +1 -1
- package/dist/developer/themes/index.d.ts +1 -1
- package/dist/developer/themes/index.js +38 -1
- package/dist/developer/themes/index.js.map +1 -1
- package/dist/index.d.ts +35 -2
- package/dist/index.js +1111 -831
- package/dist/index.js.map +1 -1
- package/package.json +28 -17
package/README.md
CHANGED
|
@@ -13,21 +13,169 @@ pnpm add @mdxui/cockpit @mdxui/primitives @mdxui/themes mdxui
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
|
-
import {
|
|
16
|
+
import { DeveloperDashboard } from '@mdxui/cockpit'
|
|
17
17
|
|
|
18
18
|
export default function Dashboard() {
|
|
19
19
|
return (
|
|
20
|
-
<
|
|
21
|
-
branding={{
|
|
22
|
-
name: 'My App',
|
|
23
|
-
logo: <Logo />,
|
|
24
|
-
}}
|
|
20
|
+
<DeveloperDashboard
|
|
21
|
+
branding={{ name: 'My App', logo: <Logo /> }}
|
|
25
22
|
theme="default"
|
|
26
23
|
/>
|
|
27
24
|
)
|
|
28
25
|
}
|
|
29
26
|
```
|
|
30
27
|
|
|
28
|
+
## Composability
|
|
29
|
+
|
|
30
|
+
DeveloperDashboard is fully composable - you can add custom routes, hide built-in routes, and customize branding.
|
|
31
|
+
|
|
32
|
+
### Adding Custom Routes
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
<DeveloperDashboard
|
|
36
|
+
customRoutes={[
|
|
37
|
+
{
|
|
38
|
+
path: '/analytics',
|
|
39
|
+
label: 'Analytics',
|
|
40
|
+
icon: 'BarChart3', // Lucide icon name
|
|
41
|
+
element: <AnalyticsPage />,
|
|
42
|
+
group: 'main',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
path: '/integrations',
|
|
46
|
+
label: 'Integrations',
|
|
47
|
+
icon: 'Plug',
|
|
48
|
+
element: <IntegrationsPage />,
|
|
49
|
+
group: 'settings',
|
|
50
|
+
},
|
|
51
|
+
]}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Hiding Built-in Routes
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<DeveloperDashboard
|
|
59
|
+
routes={{
|
|
60
|
+
overview: true,
|
|
61
|
+
apiKeys: true,
|
|
62
|
+
webhooks: true,
|
|
63
|
+
usage: false, // Hide usage page
|
|
64
|
+
billing: false, // Hide billing page
|
|
65
|
+
team: true,
|
|
66
|
+
settings: true,
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Full Configuration
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
<DeveloperDashboard
|
|
75
|
+
// Branding
|
|
76
|
+
branding={{
|
|
77
|
+
name: 'Acme API',
|
|
78
|
+
logo: <AcmeLogo />,
|
|
79
|
+
}}
|
|
80
|
+
|
|
81
|
+
// Theme
|
|
82
|
+
theme="stripe"
|
|
83
|
+
|
|
84
|
+
// Route visibility
|
|
85
|
+
routes={{
|
|
86
|
+
overview: true,
|
|
87
|
+
apiKeys: true,
|
|
88
|
+
webhooks: true,
|
|
89
|
+
usage: true,
|
|
90
|
+
billing: true,
|
|
91
|
+
team: true,
|
|
92
|
+
settings: true,
|
|
93
|
+
}}
|
|
94
|
+
|
|
95
|
+
// Custom pages
|
|
96
|
+
customRoutes={[
|
|
97
|
+
{ path: '/logs', label: 'Logs', icon: 'ScrollText', element: <LogsPage /> },
|
|
98
|
+
]}
|
|
99
|
+
|
|
100
|
+
// Auth integration (WorkOS)
|
|
101
|
+
identity={{
|
|
102
|
+
provider: 'workos',
|
|
103
|
+
clientId: process.env.WORKOS_CLIENT_ID,
|
|
104
|
+
}}
|
|
105
|
+
/>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Standalone Components
|
|
109
|
+
|
|
110
|
+
Use standalone components to embed individual pages in your own app shell without the full dashboard.
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import {
|
|
114
|
+
StandaloneProvider,
|
|
115
|
+
StandaloneAPIKeys,
|
|
116
|
+
StandaloneWebhooks,
|
|
117
|
+
StandaloneBilling,
|
|
118
|
+
StandaloneTeam,
|
|
119
|
+
} from '@mdxui/cockpit'
|
|
120
|
+
|
|
121
|
+
function MySettings() {
|
|
122
|
+
return (
|
|
123
|
+
<StandaloneProvider config={{ theme: { preset: 'stripe' } }}>
|
|
124
|
+
<Tabs>
|
|
125
|
+
<TabsContent value="keys">
|
|
126
|
+
<StandaloneAPIKeys />
|
|
127
|
+
</TabsContent>
|
|
128
|
+
<TabsContent value="webhooks">
|
|
129
|
+
<StandaloneWebhooks />
|
|
130
|
+
</TabsContent>
|
|
131
|
+
</Tabs>
|
|
132
|
+
</StandaloneProvider>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### With Backend Integration
|
|
138
|
+
|
|
139
|
+
Standalone components accept data and callbacks for real backend integration:
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
import { StandaloneAPIKeys, type ApiKey } from '@mdxui/cockpit'
|
|
143
|
+
|
|
144
|
+
function APIKeysSettings() {
|
|
145
|
+
const [keys, setKeys] = useState<ApiKey[]>([])
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<StandaloneAPIKeys
|
|
149
|
+
keys={keys}
|
|
150
|
+
onCreateKey={async (name) => {
|
|
151
|
+
const result = await api.createKey(name)
|
|
152
|
+
setKeys([...keys, result])
|
|
153
|
+
return { id: result.id, key: result.key }
|
|
154
|
+
}}
|
|
155
|
+
onRevokeKey={async (id) => {
|
|
156
|
+
await api.revokeKey(id)
|
|
157
|
+
setKeys(keys.filter(k => k.id !== id))
|
|
158
|
+
}}
|
|
159
|
+
onRenameKey={async (id, name) => {
|
|
160
|
+
await api.renameKey(id, name)
|
|
161
|
+
setKeys(keys.map(k => k.id === id ? { ...k, name } : k))
|
|
162
|
+
}}
|
|
163
|
+
/>
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Available Standalone Components
|
|
169
|
+
|
|
170
|
+
| Component | Data Prop | Callbacks |
|
|
171
|
+
|-----------|-----------|-----------|
|
|
172
|
+
| `StandaloneAPIKeys` | `keys: ApiKey[]` | `onCreateKey`, `onRevokeKey`, `onRenameKey` |
|
|
173
|
+
| `StandaloneWebhooks` | `endpoints: WebhookEndpoint[]` | `onCreateEndpoint`, `onUpdateEndpoint`, `onDeleteEndpoint` |
|
|
174
|
+
| `StandaloneBilling` | `billingData: BillingData` | `onManagePlan`, `onUpdatePaymentMethod`, `onDownloadInvoice`, `onToggleAlerts` |
|
|
175
|
+
| `StandaloneTeam` | — | `useMockWidgets` (uses WorkOS widgets) |
|
|
176
|
+
|
|
177
|
+
All standalone components support `hideHeader` (default: true) and `className` props.
|
|
178
|
+
|
|
31
179
|
## Auth Pages
|
|
32
180
|
|
|
33
181
|
```tsx
|
|
@@ -50,7 +198,7 @@ import { LoginPage, SignupPage, OTPPage } from '@mdxui/cockpit/auth'
|
|
|
50
198
|
// OTP verification
|
|
51
199
|
<OTPPage
|
|
52
200
|
logo={<Logo />}
|
|
53
|
-
email="user@example.com"
|
|
201
|
+
email="user@example.com.ai"
|
|
54
202
|
onVerify={handleVerify}
|
|
55
203
|
/>
|
|
56
204
|
```
|
|
@@ -106,7 +254,19 @@ const { theme, setTheme } = useThemeStore()
|
|
|
106
254
|
|
|
107
255
|
```tsx
|
|
108
256
|
// Main export
|
|
109
|
-
import {
|
|
257
|
+
import { DeveloperDashboard } from '@mdxui/cockpit'
|
|
258
|
+
|
|
259
|
+
// Standalone components (embed in your own shell)
|
|
260
|
+
import {
|
|
261
|
+
StandaloneProvider,
|
|
262
|
+
StandaloneAPIKeys,
|
|
263
|
+
StandaloneWebhooks,
|
|
264
|
+
StandaloneBilling,
|
|
265
|
+
StandaloneTeam,
|
|
266
|
+
type ApiKey,
|
|
267
|
+
type WebhookEndpoint,
|
|
268
|
+
type BillingData,
|
|
269
|
+
} from '@mdxui/cockpit'
|
|
110
270
|
|
|
111
271
|
// Developer components
|
|
112
272
|
import { KPICard, DataTable } from '@mdxui/cockpit/developer'
|
|
@@ -131,6 +291,45 @@ import { useThemeStore, ThemeScript } from '@mdxui/cockpit/themes'
|
|
|
131
291
|
- [GitHub](https://github.com/dot-do/ui)
|
|
132
292
|
- [npm](https://www.npmjs.com/package/@mdxui/cockpit)
|
|
133
293
|
|
|
294
|
+
## Architecture
|
|
295
|
+
|
|
296
|
+
@mdxui/cockpit sits at the **template layer** - implementing the `AppComponents` interface from mdxui for developer dashboards and SaaS apps.
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
300
|
+
│ mdxui (interfaces) │
|
|
301
|
+
│ AppComponents interface defines: Dashboard, APIKeys, Billing │
|
|
302
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
303
|
+
↓ implements
|
|
304
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
305
|
+
│ @mdxui/primitives (raw UI) │
|
|
306
|
+
│ Button, Card, Dialog - base building blocks │
|
|
307
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
308
|
+
↓ uses
|
|
309
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
310
|
+
│ ★ @mdxui/cockpit (app templates) ← YOU ARE HERE │
|
|
311
|
+
│ DeveloperDashboard, APIKeys, Webhooks, Billing, Team... │
|
|
312
|
+
│ Implements AppComponents for end-user apps │
|
|
313
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Relationship to Other Packages
|
|
317
|
+
|
|
318
|
+
| Package | Relationship |
|
|
319
|
+
|---------|--------------|
|
|
320
|
+
| `mdxui` | Implements `AppComponents` interface |
|
|
321
|
+
| `@mdxui/primitives` | Uses for base UI components |
|
|
322
|
+
| `@mdxui/themes` | Uses for theming |
|
|
323
|
+
| `@mdxui/admin` | Admin-focused components (operators) |
|
|
324
|
+
| `saaskit` | Generates apps using cockpit components |
|
|
325
|
+
|
|
326
|
+
### Key Distinction: cockpit vs admin
|
|
327
|
+
|
|
328
|
+
| Package | For | Focus |
|
|
329
|
+
|---------|-----|-------|
|
|
330
|
+
| `@mdxui/cockpit` | End users, customers | Product experience, developer tools |
|
|
331
|
+
| `@mdxui/admin` | Operators, admins | CRUD, data management, internal tools |
|
|
332
|
+
|
|
134
333
|
## License
|
|
135
334
|
|
|
136
335
|
MIT
|
package/dist/auth/auth-layout.js
CHANGED
|
@@ -1,60 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
2
|
|
|
34
3
|
// src/auth/auth-layout.tsx
|
|
35
4
|
import { cn } from "@mdxui/primitives/lib/utils";
|
|
36
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
-
function AuthLayout(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"children",
|
|
50
|
-
"title",
|
|
51
|
-
"subtitle",
|
|
52
|
-
"logo",
|
|
53
|
-
"backgroundImage",
|
|
54
|
-
"showTestimonial",
|
|
55
|
-
"testimonial"
|
|
56
|
-
]);
|
|
57
|
-
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ className: cn("min-h-screen w-full lg:grid lg:grid-cols-2", className) }, props), { children: [
|
|
6
|
+
function AuthLayout({
|
|
7
|
+
className,
|
|
8
|
+
children,
|
|
9
|
+
title,
|
|
10
|
+
subtitle,
|
|
11
|
+
logo,
|
|
12
|
+
backgroundImage,
|
|
13
|
+
showTestimonial = false,
|
|
14
|
+
testimonial,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("min-h-screen w-full lg:grid lg:grid-cols-2", className), ...props, children: [
|
|
58
18
|
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto w-full max-w-[400px] space-y-8 px-4", children: [
|
|
59
19
|
logo && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: logo }),
|
|
60
20
|
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "space-y-2 text-center", children: [
|
|
@@ -95,7 +55,7 @@ function AuthLayout(_a) {
|
|
|
95
55
|
] }) }) })
|
|
96
56
|
}
|
|
97
57
|
)
|
|
98
|
-
] })
|
|
58
|
+
] });
|
|
99
59
|
}
|
|
100
60
|
export {
|
|
101
61
|
AuthLayout
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/auth-layout.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@mdxui/primitives/lib/utils\"\n\nexport interface AuthLayoutProps extends React.ComponentProps<\"div\"> {\n children: React.ReactNode\n title?: string\n subtitle?: string\n logo?: React.ReactNode\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction AuthLayout({\n className,\n children,\n title,\n subtitle,\n logo,\n backgroundImage,\n showTestimonial = false,\n testimonial,\n ...props\n}: AuthLayoutProps) {\n return (\n <div className={cn(\"min-h-screen w-full lg:grid lg:grid-cols-2\", className)} {...props}>\n {/* Left side - Form */}\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"mx-auto w-full max-w-[400px] space-y-8 px-4\">\n {logo && <div className=\"flex justify-center\">{logo}</div>}\n\n {(title || subtitle) && (\n <div className=\"space-y-2 text-center\">\n {title && (\n <h1 className=\"text-3xl font-bold tracking-tight\">{title}</h1>\n )}\n {subtitle && (\n <p className=\"text-muted-foreground text-sm\">{subtitle}</p>\n )}\n </div>\n )}\n\n <div>{children}</div>\n </div>\n </div>\n\n {/* Right side - Visual/Testimonial */}\n <div\n className=\"bg-muted hidden lg:block\"\n style={\n backgroundImage\n ? {\n backgroundImage: `url(${backgroundImage})`,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n }\n : undefined\n }\n >\n {showTestimonial && testimonial && !backgroundImage && (\n <div className=\"flex h-full items-center justify-center p-12\">\n <div className=\"max-w-md space-y-6\">\n <blockquote className=\"space-y-4\">\n <p className=\"text-lg font-medium leading-relaxed\">\n \"{testimonial.quote}\"\n </p>\n <footer className=\"flex items-center gap-3\">\n {testimonial.avatar && (\n <img\n src={testimonial.avatar}\n alt={testimonial.author}\n className=\"size-10 rounded-full\"\n />\n )}\n <div>\n <div className=\"font-semibold\">{testimonial.author}</div>\n <div className=\"text-muted-foreground text-sm\">\n {testimonial.role}\n </div>\n </div>\n </footer>\n </blockquote>\n </div>\n </div>\n )}\n </div>\n </div>\n )\n}\n\nexport { AuthLayout }\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/auth/auth-layout.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@mdxui/primitives/lib/utils\"\n\nexport interface AuthLayoutProps extends React.ComponentProps<\"div\"> {\n children: React.ReactNode\n title?: string\n subtitle?: string\n logo?: React.ReactNode\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction AuthLayout({\n className,\n children,\n title,\n subtitle,\n logo,\n backgroundImage,\n showTestimonial = false,\n testimonial,\n ...props\n}: AuthLayoutProps) {\n return (\n <div className={cn(\"min-h-screen w-full lg:grid lg:grid-cols-2\", className)} {...props}>\n {/* Left side - Form */}\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"mx-auto w-full max-w-[400px] space-y-8 px-4\">\n {logo && <div className=\"flex justify-center\">{logo}</div>}\n\n {(title || subtitle) && (\n <div className=\"space-y-2 text-center\">\n {title && (\n <h1 className=\"text-3xl font-bold tracking-tight\">{title}</h1>\n )}\n {subtitle && (\n <p className=\"text-muted-foreground text-sm\">{subtitle}</p>\n )}\n </div>\n )}\n\n <div>{children}</div>\n </div>\n </div>\n\n {/* Right side - Visual/Testimonial */}\n <div\n className=\"bg-muted hidden lg:block\"\n style={\n backgroundImage\n ? {\n backgroundImage: `url(${backgroundImage})`,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n }\n : undefined\n }\n >\n {showTestimonial && testimonial && !backgroundImage && (\n <div className=\"flex h-full items-center justify-center p-12\">\n <div className=\"max-w-md space-y-6\">\n <blockquote className=\"space-y-4\">\n <p className=\"text-lg font-medium leading-relaxed\">\n \"{testimonial.quote}\"\n </p>\n <footer className=\"flex items-center gap-3\">\n {testimonial.avatar && (\n <img\n src={testimonial.avatar}\n alt={testimonial.author}\n className=\"size-10 rounded-full\"\n />\n )}\n <div>\n <div className=\"font-semibold\">{testimonial.author}</div>\n <div className=\"text-muted-foreground text-sm\">\n {testimonial.role}\n </div>\n </div>\n </footer>\n </blockquote>\n </div>\n </div>\n )}\n </div>\n </div>\n )\n}\n\nexport { AuthLayout }\n"],"mappings":";;;AAGA,SAAS,UAAU;AAiCA,cAGP,YAHO;AAhBnB,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,SACE,qBAAC,SAAI,WAAW,GAAG,8CAA8C,SAAS,GAAI,GAAG,OAE/E;AAAA,wBAAC,SAAI,WAAU,0CACb,+BAAC,SAAI,WAAU,+CACZ;AAAA,cAAQ,oBAAC,SAAI,WAAU,uBAAuB,gBAAK;AAAA,OAElD,SAAS,aACT,qBAAC,SAAI,WAAU,yBACZ;AAAA,iBACC,oBAAC,QAAG,WAAU,qCAAqC,iBAAM;AAAA,QAE1D,YACC,oBAAC,OAAE,WAAU,iCAAiC,oBAAS;AAAA,SAE3D;AAAA,MAGF,oBAAC,SAAK,UAAS;AAAA,OACjB,GACF;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OACE,kBACI;AAAA,UACE,iBAAiB,OAAO,eAAe;AAAA,UACvC,gBAAgB;AAAA,UAChB,oBAAoB;AAAA,QACtB,IACA;AAAA,QAGL,6BAAmB,eAAe,CAAC,mBAClC,oBAAC,SAAI,WAAU,gDACb,8BAAC,SAAI,WAAU,sBACb,+BAAC,gBAAW,WAAU,aACpB;AAAA,+BAAC,OAAE,WAAU,uCAAsC;AAAA;AAAA,YAC/C,YAAY;AAAA,YAAM;AAAA,aACtB;AAAA,UACA,qBAAC,YAAO,WAAU,2BACf;AAAA,wBAAY,UACX;AAAA,cAAC;AAAA;AAAA,gBACC,KAAK,YAAY;AAAA,gBACjB,KAAK,YAAY;AAAA,gBACjB,WAAU;AAAA;AAAA,YACZ;AAAA,YAEF,qBAAC,SACC;AAAA,kCAAC,SAAI,WAAU,iBAAiB,sBAAY,QAAO;AAAA,cACnD,oBAAC,SAAI,WAAU,iCACZ,sBAAY,MACf;AAAA,eACF;AAAA,aACF;AAAA,WACF,GACF,GACF;AAAA;AAAA,IAEJ;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/auth/index.js
CHANGED
|
@@ -1,59 +1,18 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
1
|
// src/auth/auth-layout.tsx
|
|
34
2
|
import { cn } from "@mdxui/primitives/lib/utils";
|
|
35
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
-
function AuthLayout(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"children",
|
|
49
|
-
"title",
|
|
50
|
-
"subtitle",
|
|
51
|
-
"logo",
|
|
52
|
-
"backgroundImage",
|
|
53
|
-
"showTestimonial",
|
|
54
|
-
"testimonial"
|
|
55
|
-
]);
|
|
56
|
-
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ className: cn("min-h-screen w-full lg:grid lg:grid-cols-2", className) }, props), { children: [
|
|
4
|
+
function AuthLayout({
|
|
5
|
+
className,
|
|
6
|
+
children,
|
|
7
|
+
title,
|
|
8
|
+
subtitle,
|
|
9
|
+
logo,
|
|
10
|
+
backgroundImage,
|
|
11
|
+
showTestimonial = false,
|
|
12
|
+
testimonial,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("min-h-screen w-full lg:grid lg:grid-cols-2", className), ...props, children: [
|
|
57
16
|
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto w-full max-w-[400px] space-y-8 px-4", children: [
|
|
58
17
|
logo && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: logo }),
|
|
59
18
|
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "space-y-2 text-center", children: [
|
|
@@ -94,7 +53,7 @@ function AuthLayout(_a) {
|
|
|
94
53
|
] }) }) })
|
|
95
54
|
}
|
|
96
55
|
)
|
|
97
|
-
] })
|
|
56
|
+
] });
|
|
98
57
|
}
|
|
99
58
|
|
|
100
59
|
// src/auth/login-page.tsx
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/auth-layout.tsx","../../src/auth/login-page.tsx","../../src/auth/signup-page.tsx","../../src/auth/password-reset-page.tsx","../../src/auth/otp-page.tsx","../../src/auth/onboarding-page.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@mdxui/primitives/lib/utils\"\n\nexport interface AuthLayoutProps extends React.ComponentProps<\"div\"> {\n children: React.ReactNode\n title?: string\n subtitle?: string\n logo?: React.ReactNode\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction AuthLayout({\n className,\n children,\n title,\n subtitle,\n logo,\n backgroundImage,\n showTestimonial = false,\n testimonial,\n ...props\n}: AuthLayoutProps) {\n return (\n <div className={cn(\"min-h-screen w-full lg:grid lg:grid-cols-2\", className)} {...props}>\n {/* Left side - Form */}\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"mx-auto w-full max-w-[400px] space-y-8 px-4\">\n {logo && <div className=\"flex justify-center\">{logo}</div>}\n\n {(title || subtitle) && (\n <div className=\"space-y-2 text-center\">\n {title && (\n <h1 className=\"text-3xl font-bold tracking-tight\">{title}</h1>\n )}\n {subtitle && (\n <p className=\"text-muted-foreground text-sm\">{subtitle}</p>\n )}\n </div>\n )}\n\n <div>{children}</div>\n </div>\n </div>\n\n {/* Right side - Visual/Testimonial */}\n <div\n className=\"bg-muted hidden lg:block\"\n style={\n backgroundImage\n ? {\n backgroundImage: `url(${backgroundImage})`,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n }\n : undefined\n }\n >\n {showTestimonial && testimonial && !backgroundImage && (\n <div className=\"flex h-full items-center justify-center p-12\">\n <div className=\"max-w-md space-y-6\">\n <blockquote className=\"space-y-4\">\n <p className=\"text-lg font-medium leading-relaxed\">\n \"{testimonial.quote}\"\n </p>\n <footer className=\"flex items-center gap-3\">\n {testimonial.avatar && (\n <img\n src={testimonial.avatar}\n alt={testimonial.author}\n className=\"size-10 rounded-full\"\n />\n )}\n <div>\n <div className=\"font-semibold\">{testimonial.author}</div>\n <div className=\"text-muted-foreground text-sm\">\n {testimonial.role}\n </div>\n </div>\n </footer>\n </blockquote>\n </div>\n </div>\n )}\n </div>\n </div>\n )\n}\n\nexport { AuthLayout }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { LoginForm } from \"@mdxui/primitives/auth/login-form\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface LoginPageProps {\n onSubmit?: (data: { email: string; password: string; rememberMe?: boolean }) => void | Promise<void>\n onOAuthClick?: (provider: \"google\" | \"github\" | \"microsoft\") => void | Promise<void>\n onMagicLinkClick?: (email: string) => void | Promise<void>\n onForgotPasswordClick?: () => void\n onSignupClick?: () => void\n isLoading?: boolean\n showOAuth?: boolean\n showMagicLink?: boolean\n oauthProviders?: Array<\"google\" | \"github\" | \"microsoft\">\n error?: string\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction LoginPage({\n onSubmit,\n onOAuthClick,\n onMagicLinkClick,\n onForgotPasswordClick,\n onSignupClick,\n isLoading,\n showOAuth = true,\n showMagicLink = false,\n oauthProviders = [\"google\", \"github\"],\n error,\n logo,\n title = \"Welcome back\",\n subtitle = \"Sign in to your account to continue\",\n backgroundImage,\n showTestimonial = false,\n testimonial,\n}: LoginPageProps) {\n return (\n <AuthLayout\n logo={logo}\n title={title}\n subtitle={subtitle}\n backgroundImage={backgroundImage}\n showTestimonial={showTestimonial}\n testimonial={testimonial}\n >\n <LoginForm\n onSubmit={onSubmit}\n onOAuthClick={onOAuthClick}\n onMagicLinkClick={onMagicLinkClick}\n onForgotPasswordClick={onForgotPasswordClick}\n onSignupClick={onSignupClick}\n isLoading={isLoading}\n showOAuth={showOAuth}\n showMagicLink={showMagicLink}\n oauthProviders={oauthProviders}\n error={error}\n />\n </AuthLayout>\n )\n}\n\nexport { LoginPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { SignupForm } from \"@mdxui/primitives/auth/signup-form\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface SignupPageProps {\n onSubmit?: (data: {\n fullName: string\n email: string\n password: string\n confirmPassword: string\n agreeToTerms: boolean\n }) => void | Promise<void>\n onOAuthClick?: (provider: \"google\" | \"github\" | \"microsoft\") => void | Promise<void>\n onLoginClick?: () => void\n isLoading?: boolean\n showOAuth?: boolean\n oauthProviders?: Array<\"google\" | \"github\" | \"microsoft\">\n multiStep?: boolean\n error?: string\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction SignupPage({\n onSubmit,\n onOAuthClick,\n onLoginClick,\n isLoading,\n showOAuth = true,\n oauthProviders = [\"google\", \"github\"],\n multiStep = false,\n error,\n logo,\n title = \"Create an account\",\n subtitle = \"Get started with your free account\",\n backgroundImage,\n showTestimonial = false,\n testimonial,\n}: SignupPageProps) {\n return (\n <AuthLayout\n logo={logo}\n title={title}\n subtitle={subtitle}\n backgroundImage={backgroundImage}\n showTestimonial={showTestimonial}\n testimonial={testimonial}\n >\n <SignupForm\n onSubmit={onSubmit}\n onOAuthClick={onOAuthClick}\n onLoginClick={onLoginClick}\n isLoading={isLoading}\n showOAuth={showOAuth}\n oauthProviders={oauthProviders}\n multiStep={multiStep}\n error={error}\n />\n </AuthLayout>\n )\n}\n\nexport { SignupPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { PasswordResetForm } from \"@mdxui/primitives/auth/password-reset-form\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface PasswordResetPageProps {\n mode?: \"request\" | \"confirm\"\n onRequestSubmit?: (data: { email: string }) => void | Promise<void>\n onConfirmSubmit?: (data: { password: string; confirmPassword: string }) => void | Promise<void>\n onBackToLogin?: () => void\n isLoading?: boolean\n error?: string\n successMessage?: string\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n backgroundImage?: string\n}\n\nfunction PasswordResetPage({\n mode = \"request\",\n onRequestSubmit,\n onConfirmSubmit,\n onBackToLogin,\n isLoading,\n error,\n successMessage,\n logo,\n title,\n subtitle,\n backgroundImage,\n}: PasswordResetPageProps) {\n const defaultTitle =\n mode === \"request\" ? \"Reset your password\" : \"Create new password\"\n const defaultSubtitle =\n mode === \"request\"\n ? \"We'll send you a link to reset your password\"\n : \"Enter your new password below\"\n\n return (\n <AuthLayout\n logo={logo}\n title={title || defaultTitle}\n subtitle={subtitle || defaultSubtitle}\n backgroundImage={backgroundImage}\n >\n <PasswordResetForm\n mode={mode}\n onRequestSubmit={onRequestSubmit}\n onConfirmSubmit={onConfirmSubmit}\n onBackToLogin={onBackToLogin}\n isLoading={isLoading}\n error={error}\n successMessage={successMessage}\n />\n </AuthLayout>\n )\n}\n\nexport { PasswordResetPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { OTPInputForm } from \"@mdxui/primitives/auth/otp-input\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface OTPPageProps {\n onSubmit?: (data: { otp: string }) => void | Promise<void>\n onResend?: () => void | Promise<void>\n isLoading?: boolean\n error?: string\n canResend?: boolean\n resendTimeout?: number\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n description?: string\n backgroundImage?: string\n}\n\nfunction OTPPage({\n onSubmit,\n onResend,\n isLoading,\n error,\n canResend = false,\n resendTimeout = 60,\n logo,\n title = \"Two-Factor Authentication\",\n subtitle = \"Enter the code from your authenticator app\",\n description,\n backgroundImage,\n}: OTPPageProps) {\n return (\n <AuthLayout logo={logo} backgroundImage={backgroundImage}>\n <OTPInputForm\n onSubmit={onSubmit}\n onResend={onResend}\n isLoading={isLoading}\n error={error}\n title={title}\n description={description || subtitle}\n canResend={canResend}\n resendTimeout={resendTimeout}\n />\n </AuthLayout>\n )\n}\n\nexport { OTPPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { OnboardingWizard, type OnboardingStep } from \"@mdxui/primitives/auth/onboarding-wizard\"\nimport { cn } from \"@mdxui/primitives/lib/utils\"\n\nexport interface OnboardingPageProps {\n steps: OnboardingStep[]\n onComplete?: (data: Record<string, any>) => void | Promise<void>\n onSkip?: () => void\n allowSkip?: boolean\n isLoading?: boolean\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n showProgress?: boolean\n className?: string\n}\n\nfunction OnboardingPage({\n steps,\n onComplete,\n onSkip,\n allowSkip = false,\n isLoading,\n logo,\n title = \"Welcome! Let's get you set up\",\n subtitle = \"This will only take a few minutes\",\n showProgress = true,\n className,\n}: OnboardingPageProps) {\n return (\n <div className={cn(\"flex min-h-screen items-center justify-center p-4\", className)}>\n <div className=\"w-full space-y-8\">\n {logo && <div className=\"flex justify-center\">{logo}</div>}\n\n <OnboardingWizard\n steps={steps}\n onComplete={onComplete}\n onSkip={onSkip}\n allowSkip={allowSkip}\n isLoading={isLoading}\n title={title}\n subtitle={subtitle}\n showProgress={showProgress}\n />\n </div>\n </div>\n )\n}\n\nexport { OnboardingPage }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAS,UAAU;AAiCA,cAGP,YAHO;AAhBnB,SAAS,WAAW,IAUA;AAVA,eAClB;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,EA5BF,IAoBoB,IASf,kBATe,IASf;AAAA,IARH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,SACE,qBAAC,sCAAI,WAAW,GAAG,8CAA8C,SAAS,KAAO,QAAhF,EAEC;AAAA,wBAAC,SAAI,WAAU,0CACb,+BAAC,SAAI,WAAU,+CACZ;AAAA,cAAQ,oBAAC,SAAI,WAAU,uBAAuB,gBAAK;AAAA,OAElD,SAAS,aACT,qBAAC,SAAI,WAAU,yBACZ;AAAA,iBACC,oBAAC,QAAG,WAAU,qCAAqC,iBAAM;AAAA,QAE1D,YACC,oBAAC,OAAE,WAAU,iCAAiC,oBAAS;AAAA,SAE3D;AAAA,MAGF,oBAAC,SAAK,UAAS;AAAA,OACjB,GACF;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OACE,kBACI;AAAA,UACE,iBAAiB,OAAO,eAAe;AAAA,UACvC,gBAAgB;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;AAAA,EAChB;AAAA,EACA,QAAQ;AAAA,EACR,WAAW;AAAA,EACX;AAAA,EACA;AACF,GAAiB;AACf,SACE,gBAAAA,KAAC,cAAW,MAAY,iBACtB,0BAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,eAAe;AAAA,MAC5B;AAAA,MACA;AAAA;AAAA,EACF,GACF;AAEJ;;;AC5CA,SAAS,wBAA6C;AACtD,SAAS,MAAAC,WAAU;AA6Bb,SACW,OAAAC,MADX,QAAAC,aAAA;AAdN,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,eAAe;AAAA,EACf;AACF,GAAwB;AACtB,SACE,gBAAAD,KAAC,SAAI,WAAWD,IAAG,qDAAqD,SAAS,GAC/E,0BAAAE,MAAC,SAAI,WAAU,oBACZ;AAAA,YAAQ,gBAAAD,KAAC,SAAI,WAAU,uBAAuB,gBAAK;AAAA,IAEpD,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF,GACF;AAEJ;","names":["jsx","jsx","jsx","jsx","cn","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../../src/auth/auth-layout.tsx","../../src/auth/login-page.tsx","../../src/auth/signup-page.tsx","../../src/auth/password-reset-page.tsx","../../src/auth/otp-page.tsx","../../src/auth/onboarding-page.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@mdxui/primitives/lib/utils\"\n\nexport interface AuthLayoutProps extends React.ComponentProps<\"div\"> {\n children: React.ReactNode\n title?: string\n subtitle?: string\n logo?: React.ReactNode\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction AuthLayout({\n className,\n children,\n title,\n subtitle,\n logo,\n backgroundImage,\n showTestimonial = false,\n testimonial,\n ...props\n}: AuthLayoutProps) {\n return (\n <div className={cn(\"min-h-screen w-full lg:grid lg:grid-cols-2\", className)} {...props}>\n {/* Left side - Form */}\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"mx-auto w-full max-w-[400px] space-y-8 px-4\">\n {logo && <div className=\"flex justify-center\">{logo}</div>}\n\n {(title || subtitle) && (\n <div className=\"space-y-2 text-center\">\n {title && (\n <h1 className=\"text-3xl font-bold tracking-tight\">{title}</h1>\n )}\n {subtitle && (\n <p className=\"text-muted-foreground text-sm\">{subtitle}</p>\n )}\n </div>\n )}\n\n <div>{children}</div>\n </div>\n </div>\n\n {/* Right side - Visual/Testimonial */}\n <div\n className=\"bg-muted hidden lg:block\"\n style={\n backgroundImage\n ? {\n backgroundImage: `url(${backgroundImage})`,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n }\n : undefined\n }\n >\n {showTestimonial && testimonial && !backgroundImage && (\n <div className=\"flex h-full items-center justify-center p-12\">\n <div className=\"max-w-md space-y-6\">\n <blockquote className=\"space-y-4\">\n <p className=\"text-lg font-medium leading-relaxed\">\n \"{testimonial.quote}\"\n </p>\n <footer className=\"flex items-center gap-3\">\n {testimonial.avatar && (\n <img\n src={testimonial.avatar}\n alt={testimonial.author}\n className=\"size-10 rounded-full\"\n />\n )}\n <div>\n <div className=\"font-semibold\">{testimonial.author}</div>\n <div className=\"text-muted-foreground text-sm\">\n {testimonial.role}\n </div>\n </div>\n </footer>\n </blockquote>\n </div>\n </div>\n )}\n </div>\n </div>\n )\n}\n\nexport { AuthLayout }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { LoginForm } from \"@mdxui/primitives/auth/login-form\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface LoginPageProps {\n onSubmit?: (data: { email: string; password: string; rememberMe?: boolean }) => void | Promise<void>\n onOAuthClick?: (provider: \"google\" | \"github\" | \"microsoft\") => void | Promise<void>\n onMagicLinkClick?: (email: string) => void | Promise<void>\n onForgotPasswordClick?: () => void\n onSignupClick?: () => void\n isLoading?: boolean\n showOAuth?: boolean\n showMagicLink?: boolean\n oauthProviders?: Array<\"google\" | \"github\" | \"microsoft\">\n error?: string\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction LoginPage({\n onSubmit,\n onOAuthClick,\n onMagicLinkClick,\n onForgotPasswordClick,\n onSignupClick,\n isLoading,\n showOAuth = true,\n showMagicLink = false,\n oauthProviders = [\"google\", \"github\"],\n error,\n logo,\n title = \"Welcome back\",\n subtitle = \"Sign in to your account to continue\",\n backgroundImage,\n showTestimonial = false,\n testimonial,\n}: LoginPageProps) {\n return (\n <AuthLayout\n logo={logo}\n title={title}\n subtitle={subtitle}\n backgroundImage={backgroundImage}\n showTestimonial={showTestimonial}\n testimonial={testimonial}\n >\n <LoginForm\n onSubmit={onSubmit}\n onOAuthClick={onOAuthClick}\n onMagicLinkClick={onMagicLinkClick}\n onForgotPasswordClick={onForgotPasswordClick}\n onSignupClick={onSignupClick}\n isLoading={isLoading}\n showOAuth={showOAuth}\n showMagicLink={showMagicLink}\n oauthProviders={oauthProviders}\n error={error}\n />\n </AuthLayout>\n )\n}\n\nexport { LoginPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { SignupForm } from \"@mdxui/primitives/auth/signup-form\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface SignupPageProps {\n onSubmit?: (data: {\n fullName: string\n email: string\n password: string\n confirmPassword: string\n agreeToTerms: boolean\n }) => void | Promise<void>\n onOAuthClick?: (provider: \"google\" | \"github\" | \"microsoft\") => void | Promise<void>\n onLoginClick?: () => void\n isLoading?: boolean\n showOAuth?: boolean\n oauthProviders?: Array<\"google\" | \"github\" | \"microsoft\">\n multiStep?: boolean\n error?: string\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction SignupPage({\n onSubmit,\n onOAuthClick,\n onLoginClick,\n isLoading,\n showOAuth = true,\n oauthProviders = [\"google\", \"github\"],\n multiStep = false,\n error,\n logo,\n title = \"Create an account\",\n subtitle = \"Get started with your free account\",\n backgroundImage,\n showTestimonial = false,\n testimonial,\n}: SignupPageProps) {\n return (\n <AuthLayout\n logo={logo}\n title={title}\n subtitle={subtitle}\n backgroundImage={backgroundImage}\n showTestimonial={showTestimonial}\n testimonial={testimonial}\n >\n <SignupForm\n onSubmit={onSubmit}\n onOAuthClick={onOAuthClick}\n onLoginClick={onLoginClick}\n isLoading={isLoading}\n showOAuth={showOAuth}\n oauthProviders={oauthProviders}\n multiStep={multiStep}\n error={error}\n />\n </AuthLayout>\n )\n}\n\nexport { SignupPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { PasswordResetForm } from \"@mdxui/primitives/auth/password-reset-form\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface PasswordResetPageProps {\n mode?: \"request\" | \"confirm\"\n onRequestSubmit?: (data: { email: string }) => void | Promise<void>\n onConfirmSubmit?: (data: { password: string; confirmPassword: string }) => void | Promise<void>\n onBackToLogin?: () => void\n isLoading?: boolean\n error?: string\n successMessage?: string\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n backgroundImage?: string\n}\n\nfunction PasswordResetPage({\n mode = \"request\",\n onRequestSubmit,\n onConfirmSubmit,\n onBackToLogin,\n isLoading,\n error,\n successMessage,\n logo,\n title,\n subtitle,\n backgroundImage,\n}: PasswordResetPageProps) {\n const defaultTitle =\n mode === \"request\" ? \"Reset your password\" : \"Create new password\"\n const defaultSubtitle =\n mode === \"request\"\n ? \"We'll send you a link to reset your password\"\n : \"Enter your new password below\"\n\n return (\n <AuthLayout\n logo={logo}\n title={title || defaultTitle}\n subtitle={subtitle || defaultSubtitle}\n backgroundImage={backgroundImage}\n >\n <PasswordResetForm\n mode={mode}\n onRequestSubmit={onRequestSubmit}\n onConfirmSubmit={onConfirmSubmit}\n onBackToLogin={onBackToLogin}\n isLoading={isLoading}\n error={error}\n successMessage={successMessage}\n />\n </AuthLayout>\n )\n}\n\nexport { PasswordResetPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { OTPInputForm } from \"@mdxui/primitives/auth/otp-input\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface OTPPageProps {\n onSubmit?: (data: { otp: string }) => void | Promise<void>\n onResend?: () => void | Promise<void>\n isLoading?: boolean\n error?: string\n canResend?: boolean\n resendTimeout?: number\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n description?: string\n backgroundImage?: string\n}\n\nfunction OTPPage({\n onSubmit,\n onResend,\n isLoading,\n error,\n canResend = false,\n resendTimeout = 60,\n logo,\n title = \"Two-Factor Authentication\",\n subtitle = \"Enter the code from your authenticator app\",\n description,\n backgroundImage,\n}: OTPPageProps) {\n return (\n <AuthLayout logo={logo} backgroundImage={backgroundImage}>\n <OTPInputForm\n onSubmit={onSubmit}\n onResend={onResend}\n isLoading={isLoading}\n error={error}\n title={title}\n description={description || subtitle}\n canResend={canResend}\n resendTimeout={resendTimeout}\n />\n </AuthLayout>\n )\n}\n\nexport { OTPPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { OnboardingWizard, type OnboardingStep } from \"@mdxui/primitives/auth/onboarding-wizard\"\nimport { cn } from \"@mdxui/primitives/lib/utils\"\n\nexport interface OnboardingPageProps {\n steps: OnboardingStep[]\n onComplete?: (data: Record<string, any>) => void | Promise<void>\n onSkip?: () => void\n allowSkip?: boolean\n isLoading?: boolean\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n showProgress?: boolean\n className?: string\n}\n\nfunction OnboardingPage({\n steps,\n onComplete,\n onSkip,\n allowSkip = false,\n isLoading,\n logo,\n title = \"Welcome! Let's get you set up\",\n subtitle = \"This will only take a few minutes\",\n showProgress = true,\n className,\n}: OnboardingPageProps) {\n return (\n <div className={cn(\"flex min-h-screen items-center justify-center p-4\", className)}>\n <div className=\"w-full space-y-8\">\n {logo && <div className=\"flex justify-center\">{logo}</div>}\n\n <OnboardingWizard\n steps={steps}\n onComplete={onComplete}\n onSkip={onSkip}\n allowSkip={allowSkip}\n isLoading={isLoading}\n title={title}\n subtitle={subtitle}\n showProgress={showProgress}\n />\n </div>\n </div>\n )\n}\n\nexport { OnboardingPage }\n"],"mappings":";AAGA,SAAS,UAAU;AAiCA,cAGP,YAHO;AAhBnB,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,SACE,qBAAC,SAAI,WAAW,GAAG,8CAA8C,SAAS,GAAI,GAAG,OAE/E;AAAA,wBAAC,SAAI,WAAU,0CACb,+BAAC,SAAI,WAAU,+CACZ;AAAA,cAAQ,oBAAC,SAAI,WAAU,uBAAuB,gBAAK;AAAA,OAElD,SAAS,aACT,qBAAC,SAAI,WAAU,yBACZ;AAAA,iBACC,oBAAC,QAAG,WAAU,qCAAqC,iBAAM;AAAA,QAE1D,YACC,oBAAC,OAAE,WAAU,iCAAiC,oBAAS;AAAA,SAE3D;AAAA,MAGF,oBAAC,SAAK,UAAS;AAAA,OACjB,GACF;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OACE,kBACI;AAAA,UACE,iBAAiB,OAAO,eAAe;AAAA,UACvC,gBAAgB;AAAA,UAChB,oBAAoB;AAAA,QACtB,IACA;AAAA,QAGL,6BAAmB,eAAe,CAAC,mBAClC,oBAAC,SAAI,WAAU,gDACb,8BAAC,SAAI,WAAU,sBACb,+BAAC,gBAAW,WAAU,aACpB;AAAA,+BAAC,OAAE,WAA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A,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,eAAe;AAAA,MAC5B;AAAA,MACA;AAAA;AAAA,EACF,GACF;AAEJ;;;AC5CA,SAAS,wBAA6C;AACtD,SAAS,MAAAC,WAAU;AA6Bb,SACW,OAAAC,MADX,QAAAC,aAAA;AAdN,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,eAAe;AAAA,EACf;AACF,GAAwB;AACtB,SACE,gBAAAD,KAAC,SAAI,WAAWD,IAAG,qDAAqD,SAAS,GAC/E,0BAAAE,MAAC,SAAI,WAAU,oBACZ;AAAA,YAAQ,gBAAAD,KAAC,SAAI,WAAU,uBAAuB,gBAAK;AAAA,IAEpD,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF,GACF;AAEJ;","names":["jsx","jsx","jsx","jsx","cn","jsx","jsxs"]}
|
package/dist/auth/login-page.js
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
2
|
|
|
34
3
|
// src/auth/login-page.tsx
|
|
35
4
|
import { LoginForm } from "@mdxui/primitives/auth/login-form";
|
|
@@ -37,27 +6,18 @@ import { LoginForm } from "@mdxui/primitives/auth/login-form";
|
|
|
37
6
|
// src/auth/auth-layout.tsx
|
|
38
7
|
import { cn } from "@mdxui/primitives/lib/utils";
|
|
39
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
40
|
-
function AuthLayout(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"children",
|
|
53
|
-
"title",
|
|
54
|
-
"subtitle",
|
|
55
|
-
"logo",
|
|
56
|
-
"backgroundImage",
|
|
57
|
-
"showTestimonial",
|
|
58
|
-
"testimonial"
|
|
59
|
-
]);
|
|
60
|
-
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ className: cn("min-h-screen w-full lg:grid lg:grid-cols-2", className) }, props), { children: [
|
|
9
|
+
function AuthLayout({
|
|
10
|
+
className,
|
|
11
|
+
children,
|
|
12
|
+
title,
|
|
13
|
+
subtitle,
|
|
14
|
+
logo,
|
|
15
|
+
backgroundImage,
|
|
16
|
+
showTestimonial = false,
|
|
17
|
+
testimonial,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("min-h-screen w-full lg:grid lg:grid-cols-2", className), ...props, children: [
|
|
61
21
|
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto w-full max-w-[400px] space-y-8 px-4", children: [
|
|
62
22
|
logo && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: logo }),
|
|
63
23
|
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "space-y-2 text-center", children: [
|
|
@@ -98,7 +58,7 @@ function AuthLayout(_a) {
|
|
|
98
58
|
] }) }) })
|
|
99
59
|
}
|
|
100
60
|
)
|
|
101
|
-
] })
|
|
61
|
+
] });
|
|
102
62
|
}
|
|
103
63
|
|
|
104
64
|
// src/auth/login-page.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/login-page.tsx","../../src/auth/auth-layout.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { LoginForm } from \"@mdxui/primitives/auth/login-form\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface LoginPageProps {\n onSubmit?: (data: { email: string; password: string; rememberMe?: boolean }) => void | Promise<void>\n onOAuthClick?: (provider: \"google\" | \"github\" | \"microsoft\") => void | Promise<void>\n onMagicLinkClick?: (email: string) => void | Promise<void>\n onForgotPasswordClick?: () => void\n onSignupClick?: () => void\n isLoading?: boolean\n showOAuth?: boolean\n showMagicLink?: boolean\n oauthProviders?: Array<\"google\" | \"github\" | \"microsoft\">\n error?: string\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction LoginPage({\n onSubmit,\n onOAuthClick,\n onMagicLinkClick,\n onForgotPasswordClick,\n onSignupClick,\n isLoading,\n showOAuth = true,\n showMagicLink = false,\n oauthProviders = [\"google\", \"github\"],\n error,\n logo,\n title = \"Welcome back\",\n subtitle = \"Sign in to your account to continue\",\n backgroundImage,\n showTestimonial = false,\n testimonial,\n}: LoginPageProps) {\n return (\n <AuthLayout\n logo={logo}\n title={title}\n subtitle={subtitle}\n backgroundImage={backgroundImage}\n showTestimonial={showTestimonial}\n testimonial={testimonial}\n >\n <LoginForm\n onSubmit={onSubmit}\n onOAuthClick={onOAuthClick}\n onMagicLinkClick={onMagicLinkClick}\n onForgotPasswordClick={onForgotPasswordClick}\n onSignupClick={onSignupClick}\n isLoading={isLoading}\n showOAuth={showOAuth}\n showMagicLink={showMagicLink}\n oauthProviders={oauthProviders}\n error={error}\n />\n </AuthLayout>\n )\n}\n\nexport { LoginPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@mdxui/primitives/lib/utils\"\n\nexport interface AuthLayoutProps extends React.ComponentProps<\"div\"> {\n children: React.ReactNode\n title?: string\n subtitle?: string\n logo?: React.ReactNode\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction AuthLayout({\n className,\n children,\n title,\n subtitle,\n logo,\n backgroundImage,\n showTestimonial = false,\n testimonial,\n ...props\n}: AuthLayoutProps) {\n return (\n <div className={cn(\"min-h-screen w-full lg:grid lg:grid-cols-2\", className)} {...props}>\n {/* Left side - Form */}\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"mx-auto w-full max-w-[400px] space-y-8 px-4\">\n {logo && <div className=\"flex justify-center\">{logo}</div>}\n\n {(title || subtitle) && (\n <div className=\"space-y-2 text-center\">\n {title && (\n <h1 className=\"text-3xl font-bold tracking-tight\">{title}</h1>\n )}\n {subtitle && (\n <p className=\"text-muted-foreground text-sm\">{subtitle}</p>\n )}\n </div>\n )}\n\n <div>{children}</div>\n </div>\n </div>\n\n {/* Right side - Visual/Testimonial */}\n <div\n className=\"bg-muted hidden lg:block\"\n style={\n backgroundImage\n ? {\n backgroundImage: `url(${backgroundImage})`,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n }\n : undefined\n }\n >\n {showTestimonial && testimonial && !backgroundImage && (\n <div className=\"flex h-full items-center justify-center p-12\">\n <div className=\"max-w-md space-y-6\">\n <blockquote className=\"space-y-4\">\n <p className=\"text-lg font-medium leading-relaxed\">\n \"{testimonial.quote}\"\n </p>\n <footer className=\"flex items-center gap-3\">\n {testimonial.avatar && (\n <img\n src={testimonial.avatar}\n alt={testimonial.author}\n className=\"size-10 rounded-full\"\n />\n )}\n <div>\n <div className=\"font-semibold\">{testimonial.author}</div>\n <div className=\"text-muted-foreground text-sm\">\n {testimonial.role}\n </div>\n </div>\n </footer>\n </blockquote>\n </div>\n </div>\n )}\n </div>\n </div>\n )\n}\n\nexport { AuthLayout }\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/auth/login-page.tsx","../../src/auth/auth-layout.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { LoginForm } from \"@mdxui/primitives/auth/login-form\"\nimport { AuthLayout } from \"./auth-layout\"\n\nexport interface LoginPageProps {\n onSubmit?: (data: { email: string; password: string; rememberMe?: boolean }) => void | Promise<void>\n onOAuthClick?: (provider: \"google\" | \"github\" | \"microsoft\") => void | Promise<void>\n onMagicLinkClick?: (email: string) => void | Promise<void>\n onForgotPasswordClick?: () => void\n onSignupClick?: () => void\n isLoading?: boolean\n showOAuth?: boolean\n showMagicLink?: boolean\n oauthProviders?: Array<\"google\" | \"github\" | \"microsoft\">\n error?: string\n logo?: React.ReactNode\n title?: string\n subtitle?: string\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction LoginPage({\n onSubmit,\n onOAuthClick,\n onMagicLinkClick,\n onForgotPasswordClick,\n onSignupClick,\n isLoading,\n showOAuth = true,\n showMagicLink = false,\n oauthProviders = [\"google\", \"github\"],\n error,\n logo,\n title = \"Welcome back\",\n subtitle = \"Sign in to your account to continue\",\n backgroundImage,\n showTestimonial = false,\n testimonial,\n}: LoginPageProps) {\n return (\n <AuthLayout\n logo={logo}\n title={title}\n subtitle={subtitle}\n backgroundImage={backgroundImage}\n showTestimonial={showTestimonial}\n testimonial={testimonial}\n >\n <LoginForm\n onSubmit={onSubmit}\n onOAuthClick={onOAuthClick}\n onMagicLinkClick={onMagicLinkClick}\n onForgotPasswordClick={onForgotPasswordClick}\n onSignupClick={onSignupClick}\n isLoading={isLoading}\n showOAuth={showOAuth}\n showMagicLink={showMagicLink}\n oauthProviders={oauthProviders}\n error={error}\n />\n </AuthLayout>\n )\n}\n\nexport { LoginPage }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@mdxui/primitives/lib/utils\"\n\nexport interface AuthLayoutProps extends React.ComponentProps<\"div\"> {\n children: React.ReactNode\n title?: string\n subtitle?: string\n logo?: React.ReactNode\n backgroundImage?: string\n showTestimonial?: boolean\n testimonial?: {\n quote: string\n author: string\n role: string\n avatar?: string\n }\n}\n\nfunction AuthLayout({\n className,\n children,\n title,\n subtitle,\n logo,\n backgroundImage,\n showTestimonial = false,\n testimonial,\n ...props\n}: AuthLayoutProps) {\n return (\n <div className={cn(\"min-h-screen w-full lg:grid lg:grid-cols-2\", className)} {...props}>\n {/* Left side - Form */}\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"mx-auto w-full max-w-[400px] space-y-8 px-4\">\n {logo && <div className=\"flex justify-center\">{logo}</div>}\n\n {(title || subtitle) && (\n <div className=\"space-y-2 text-center\">\n {title && (\n <h1 className=\"text-3xl font-bold tracking-tight\">{title}</h1>\n )}\n {subtitle && (\n <p className=\"text-muted-foreground text-sm\">{subtitle}</p>\n )}\n </div>\n )}\n\n <div>{children}</div>\n </div>\n </div>\n\n {/* Right side - Visual/Testimonial */}\n <div\n className=\"bg-muted hidden lg:block\"\n style={\n backgroundImage\n ? {\n backgroundImage: `url(${backgroundImage})`,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n }\n : undefined\n }\n >\n {showTestimonial && testimonial && !backgroundImage && (\n <div className=\"flex h-full items-center justify-center p-12\">\n <div className=\"max-w-md space-y-6\">\n <blockquote className=\"space-y-4\">\n <p className=\"text-lg font-medium leading-relaxed\">\n \"{testimonial.quote}\"\n </p>\n <footer className=\"flex items-center gap-3\">\n {testimonial.avatar && (\n <img\n src={testimonial.avatar}\n alt={testimonial.author}\n className=\"size-10 rounded-full\"\n />\n )}\n <div>\n <div className=\"font-semibold\">{testimonial.author}</div>\n <div className=\"text-muted-foreground text-sm\">\n {testimonial.role}\n </div>\n </div>\n </footer>\n </blockquote>\n </div>\n </div>\n )}\n </div>\n </div>\n )\n}\n\nexport { AuthLayout }\n"],"mappings":";;;AAGA,SAAS,iBAAiB;;;ACA1B,SAAS,UAAU;AAiCA,cAGP,YAHO;AAhBnB,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,SACE,qBAAC,SAAI,WAAW,GAAG,8CAA8C,SAAS,GAAI,GAAG,OAE/E;AAAA,wBAAC,SAAI,WAAU,0CACb,+BAAC,SAAI,WAAU,+CACZ;AAAA,cAAQ,oBAAC,SAAI,WAAU,uBAAuB,gBAAK;AAAA,OAElD,SAAS,aACT,qBAAC,SAAI,WAAU,yBACZ;AAAA,iBACC,oBAAC,QAAG,WAAU,qCAAqC,iBAAM;AAAA,QAE1D,YACC,oBAAC,OAAE,WAAU,iCAAiC,oB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