@main12/auth-login 1.0.2 → 1.0.3
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.
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import type { DeepPartial, UiTranslations } from './ui/translations';
|
|
3
3
|
export interface AuthLayoutConfig {
|
|
4
4
|
backgroundClass?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Vertical placement of the content within the viewport.
|
|
7
|
+
* Defaults to `'center'`; pass `'top'` to align content to the top instead.
|
|
8
|
+
*/
|
|
9
|
+
verticalAlign?: 'center' | 'top';
|
|
5
10
|
/**
|
|
6
11
|
* Locale for this page's copy. Built-in support for 'en' and 'es'.
|
|
7
12
|
* Auto-detected by `<AuthPages />` when omitted; pass explicitly when using
|
|
@@ -36,5 +41,8 @@ export interface AuthLayoutProps extends AuthLayoutConfig {
|
|
|
36
41
|
* </div>
|
|
37
42
|
* </AuthLayout>
|
|
38
43
|
* ```
|
|
44
|
+
*
|
|
45
|
+
* Content is vertically centered in the viewport by default; pass
|
|
46
|
+
* `verticalAlign="top"` to align it to the top instead.
|
|
39
47
|
*/
|
|
40
48
|
export declare const AuthLayout: React.FC<AuthLayoutProps>;
|
|
@@ -23,9 +23,15 @@ import React from 'react';
|
|
|
23
23
|
* </div>
|
|
24
24
|
* </AuthLayout>
|
|
25
25
|
* ```
|
|
26
|
-
|
|
26
|
+
*
|
|
27
|
+
* Content is vertically centered in the viewport by default; pass
|
|
28
|
+
* `verticalAlign="top"` to align it to the top instead.
|
|
29
|
+
*/ export const AuthLayout = ({ children, backgroundClass = 'bg-accent', verticalAlign = 'center' })=>{
|
|
27
30
|
return /*#__PURE__*/ _jsx("main", {
|
|
28
31
|
className: `flex flex-col min-h-screen ${backgroundClass}`,
|
|
29
|
-
children:
|
|
32
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
33
|
+
className: `flex-1 flex flex-col ${verticalAlign === 'top' ? 'justify-start' : 'justify-center'}`,
|
|
34
|
+
children: children
|
|
35
|
+
})
|
|
30
36
|
});
|
|
31
37
|
};
|
|
@@ -20,4 +20,4 @@ export interface AuthPagesProps extends AuthCardConfig, AuthLayoutConfig {
|
|
|
20
20
|
locale?: string;
|
|
21
21
|
messages?: Record<string, DeepPartial<UiTranslations>>;
|
|
22
22
|
}
|
|
23
|
-
export default function AuthPages({ backgroundClass, slug, redirectTo, logo, onPasswordLogin, onSignup, basePath, showGoogleOAuth, allowSignup, passwordLogin, otpLogin, locale, messages, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant, }: AuthPagesProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default function AuthPages({ backgroundClass, verticalAlign, slug, redirectTo, logo, onPasswordLogin, onSignup, basePath, showGoogleOAuth, allowSignup, passwordLogin, otpLogin, locale, messages, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant, }: AuthPagesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { AuthLayout } from './AuthLayout.js';
|
|
4
4
|
import { AuthCard } from './AuthCard.js';
|
|
5
|
-
export default function AuthPages({ backgroundClass, slug, redirectTo = '/admin', logo, onPasswordLogin, onSignup, basePath = '/auth', showGoogleOAuth, allowSignup = true, passwordLogin = true, otpLogin = true, locale, messages, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant }) {
|
|
5
|
+
export default function AuthPages({ backgroundClass, verticalAlign, slug, redirectTo = '/admin', logo, onPasswordLogin, onSignup, basePath = '/auth', showGoogleOAuth, allowSignup = true, passwordLogin = true, otpLogin = true, locale, messages, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant }) {
|
|
6
6
|
return /*#__PURE__*/ _jsx(AuthLayout, {
|
|
7
7
|
backgroundClass: backgroundClass,
|
|
8
|
+
verticalAlign: verticalAlign,
|
|
8
9
|
children: /*#__PURE__*/ _jsx(AuthCard, {
|
|
9
10
|
slug: slug?.[0] ?? 'login',
|
|
10
11
|
redirectTo: redirectTo,
|
|
@@ -96,7 +96,7 @@ export function AuthCardShell({ children, logo, title, subtitle, footer, powered
|
|
|
96
96
|
]
|
|
97
97
|
}),
|
|
98
98
|
/*#__PURE__*/ _jsx("div", {
|
|
99
|
-
className: "hidden md:flex
|
|
99
|
+
className: "hidden md:flex justify-center px-4 py-12 w-full",
|
|
100
100
|
children: cardBody
|
|
101
101
|
})
|
|
102
102
|
]
|
package/package.json
CHANGED