@entropy-softworks/ui 2026.9.8 → 2026.9.10
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/lib/screens/auth/AuthPage.d.ts +33 -0
- package/lib/screens/auth/AuthPage.d.ts.map +1 -0
- package/lib/screens/auth/AuthPage.jsx +55 -0
- package/lib/screens/auth/AuthPage.jsx.map +1 -0
- package/lib/screens/auth/MfaEnrollScreen.d.ts +4 -1
- package/lib/screens/auth/MfaEnrollScreen.d.ts.map +1 -1
- package/lib/screens/auth/MfaEnrollScreen.jsx +85 -124
- package/lib/screens/auth/MfaEnrollScreen.jsx.map +1 -1
- package/lib/screens/auth/VerifyEmailScreen.d.ts +6 -1
- package/lib/screens/auth/VerifyEmailScreen.d.ts.map +1 -1
- package/lib/screens/auth/VerifyEmailScreen.jsx +22 -44
- package/lib/screens/auth/VerifyEmailScreen.jsx.map +1 -1
- package/lib/screens/auth/index.d.ts +5 -4
- package/lib/screens/auth/index.d.ts.map +1 -1
- package/lib/screens/auth/index.js +4 -3
- package/lib/screens/auth/index.js.map +1 -1
- package/package.json +1 -1
- package/src/screens/auth/AuthPage.tsx +128 -0
- package/src/screens/auth/MfaEnrollScreen.tsx +191 -232
- package/src/screens/auth/VerifyEmailScreen.tsx +84 -101
- package/src/screens/auth/index.ts +5 -14
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
export { AuthPage, type AuthPageProps, type AuthPageLayout } from "./AuthPage";
|
|
1
2
|
export { WelcomeScreen, type WelcomeScreenProps } from "./WelcomeScreen";
|
|
2
3
|
export { ForgotPasswordScreen } from "./ForgotPasswordScreen";
|
|
3
4
|
export { MfaChallengeScreen } from "./MfaChallengeScreen";
|
|
4
5
|
export { TermsOfServiceScreen, type TermsOfServiceScreenProps, type LegalSection, } from "./TermsOfServiceScreen";
|
|
5
|
-
export { VerifyEmailScreen } from "./VerifyEmailScreen";
|
|
6
|
+
export { VerifyEmailScreen, type VerifyEmailScreenProps } from "./VerifyEmailScreen";
|
|
6
7
|
export { PrivacyPolicyScreen, type PrivacyPolicyScreenProps } from "./PrivacyPolicyScreen";
|
|
7
8
|
export { ResetPasswordScreen, type ResetPasswordScreenProps } from "./ResetPasswordScreen";
|
|
8
9
|
export { LoginScreen, type LoginScreenProps } from "./LoginScreen";
|
|
@@ -11,9 +12,9 @@ export { MfaEnrollScreen, type MfaEnrollScreenProps } from "./MfaEnrollScreen";
|
|
|
11
12
|
export { RegisterScreen, type RegisterScreenProps } from "./RegisterScreen";
|
|
12
13
|
export { ServerConfigScreen, type ServerConfigScreenProps } from "./ServerConfigScreen";
|
|
13
14
|
export { ImportDataScreen, type ImportDataScreenProps } from "./ImportDataScreen";
|
|
14
|
-
export { ConsentScreen, type ConsentScreenProps, type ConsentScope
|
|
15
|
+
export { ConsentScreen, type ConsentScreenProps, type ConsentScope } from "./ConsentScreen";
|
|
15
16
|
export { AccountPickerScreen, type AccountPickerScreenProps, type PickableAccount, } from "./AccountPickerScreen";
|
|
16
|
-
export { PasskeyEnrollScreen, type PasskeyEnrollScreenProps
|
|
17
|
+
export { PasskeyEnrollScreen, type PasskeyEnrollScreenProps } from "./PasskeyEnrollScreen";
|
|
17
18
|
export { ErrorScreen, type ErrorScreenProps } from "./ErrorScreen";
|
|
18
|
-
export { ExpiredLinkScreen, type ExpiredLinkScreenProps
|
|
19
|
+
export { ExpiredLinkScreen, type ExpiredLinkScreenProps } from "./ExpiredLinkScreen";
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO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AoB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { AuthPage } from "./AuthPage";
|
|
1
2
|
export { WelcomeScreen } from "./WelcomeScreen";
|
|
2
3
|
export { ForgotPasswordScreen } from "./ForgotPasswordScreen";
|
|
3
4
|
export { MfaChallengeScreen } from "./MfaChallengeScreen";
|
|
@@ -11,9 +12,9 @@ export { MfaEnrollScreen } from "./MfaEnrollScreen";
|
|
|
11
12
|
export { RegisterScreen } from "./RegisterScreen";
|
|
12
13
|
export { ServerConfigScreen } from "./ServerConfigScreen";
|
|
13
14
|
export { ImportDataScreen } from "./ImportDataScreen";
|
|
14
|
-
export { ConsentScreen
|
|
15
|
+
export { ConsentScreen } from "./ConsentScreen";
|
|
15
16
|
export { AccountPickerScreen, } from "./AccountPickerScreen";
|
|
16
|
-
export { PasskeyEnrollScreen
|
|
17
|
+
export { PasskeyEnrollScreen } from "./PasskeyEnrollScreen";
|
|
17
18
|
export { ErrorScreen } from "./ErrorScreen";
|
|
18
|
-
export { ExpiredLinkScreen
|
|
19
|
+
export { ExpiredLinkScreen } from "./ExpiredLinkScreen";
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screens/auth/index.ts"],"names":[],"mappings":"AAAA,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AE,WAAW,EAAyB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAA+B,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ScrollView, View } from "react-native";
|
|
3
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
|
+
import { StatusBar } from "expo-status-bar";
|
|
5
|
+
import { useColorScheme } from "nativewind";
|
|
6
|
+
import {
|
|
7
|
+
Card,
|
|
8
|
+
CardContent,
|
|
9
|
+
CardDescription,
|
|
10
|
+
CardFooter,
|
|
11
|
+
CardHeader,
|
|
12
|
+
CardTitle,
|
|
13
|
+
} from "../../components/card";
|
|
14
|
+
import { Heading, MutedText } from "../../components/text";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Which shape an auth screen takes.
|
|
18
|
+
*
|
|
19
|
+
* `card` is a dialog floated in the middle of the viewport: a title, a
|
|
20
|
+
* description, the content and the actions, all inside a bordered panel. It is
|
|
21
|
+
* right on a desktop portal and it is what every consumer of these screens has
|
|
22
|
+
* always had.
|
|
23
|
+
*
|
|
24
|
+
* `screen` is the phone shape — heading at the top, content filling the space
|
|
25
|
+
* below it, actions at the bottom, no panel. A card on a phone is a panel
|
|
26
|
+
* floated over nothing, with its own padding inside the screen's padding, and
|
|
27
|
+
* next to a flow built the other way it reads as something from another app.
|
|
28
|
+
*
|
|
29
|
+
* The default stays `card` so nothing changes for anyone who does not ask.
|
|
30
|
+
*/
|
|
31
|
+
export type AuthPageLayout = "card" | "screen";
|
|
32
|
+
|
|
33
|
+
export interface AuthPageProps {
|
|
34
|
+
layout?: AuthPageLayout;
|
|
35
|
+
title: string;
|
|
36
|
+
subtitle?: string | null;
|
|
37
|
+
/** Drawn above the title in the card layout, and nowhere in the screen one. */
|
|
38
|
+
icon?: React.ReactNode;
|
|
39
|
+
/** Top-left of the page, outside the content — a sign-out control, usually. */
|
|
40
|
+
corner?: React.ReactNode;
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
footer?: React.ReactNode;
|
|
43
|
+
/** Card width. Ignored by the screen layout, which has the whole width. */
|
|
44
|
+
maxWidth?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function AuthPage({
|
|
48
|
+
layout = "card",
|
|
49
|
+
title,
|
|
50
|
+
subtitle,
|
|
51
|
+
icon,
|
|
52
|
+
corner,
|
|
53
|
+
children,
|
|
54
|
+
footer,
|
|
55
|
+
maxWidth = 440,
|
|
56
|
+
}: AuthPageProps) {
|
|
57
|
+
const { colorScheme } = useColorScheme();
|
|
58
|
+
const isDark = colorScheme === "dark";
|
|
59
|
+
|
|
60
|
+
if (layout === "screen") {
|
|
61
|
+
return (
|
|
62
|
+
<SafeAreaView className="flex-1 bg-background dark:bg-black">
|
|
63
|
+
<StatusBar style={isDark ? "light" : "dark"} />
|
|
64
|
+
<ScrollView
|
|
65
|
+
className="flex-1"
|
|
66
|
+
contentContainerStyle={{ flexGrow: 1 }}
|
|
67
|
+
keyboardShouldPersistTaps="handled"
|
|
68
|
+
>
|
|
69
|
+
<View className="flex-1 px-6 pb-10 pt-4">
|
|
70
|
+
{/* The corner control sits in the 40px above the heading rather
|
|
71
|
+
than absolutely over the content, which is where the card
|
|
72
|
+
layout puts it. Same row every screen in the flow leaves for a
|
|
73
|
+
back control, so the headings all land in the same place. */}
|
|
74
|
+
<View className="mb-4 h-10 flex-row items-center">{corner}</View>
|
|
75
|
+
|
|
76
|
+
<Heading
|
|
77
|
+
className="text-3xl"
|
|
78
|
+
numberOfLines={1}
|
|
79
|
+
adjustsFontSizeToFit
|
|
80
|
+
minimumFontScale={0.7}
|
|
81
|
+
>
|
|
82
|
+
{title}
|
|
83
|
+
</Heading>
|
|
84
|
+
{subtitle ? (
|
|
85
|
+
<MutedText className="mt-2 text-base leading-6">{subtitle}</MutedText>
|
|
86
|
+
) : null}
|
|
87
|
+
|
|
88
|
+
<View className="flex-1 pt-6">{children}</View>
|
|
89
|
+
{footer ? <View className="gap-2 pt-6">{footer}</View> : null}
|
|
90
|
+
</View>
|
|
91
|
+
</ScrollView>
|
|
92
|
+
</SafeAreaView>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<SafeAreaView className="flex-1 bg-background dark:bg-black">
|
|
98
|
+
<StatusBar style={isDark ? "light" : "dark"} />
|
|
99
|
+
<ScrollView
|
|
100
|
+
className="flex-1"
|
|
101
|
+
contentContainerClassName="flex-1 items-center justify-center p-6"
|
|
102
|
+
keyboardShouldPersistTaps="handled"
|
|
103
|
+
>
|
|
104
|
+
{corner ? <View className="absolute left-6 top-4 mt-4 self-start">{corner}</View> : null}
|
|
105
|
+
|
|
106
|
+
<Card className="w-full" style={{ maxWidth }}>
|
|
107
|
+
<CardHeader className="items-center">
|
|
108
|
+
{icon}
|
|
109
|
+
<CardTitle className="text-center text-2xl">{title}</CardTitle>
|
|
110
|
+
{subtitle ? (
|
|
111
|
+
<CardDescription className="text-center text-base">{subtitle}</CardDescription>
|
|
112
|
+
) : null}
|
|
113
|
+
</CardHeader>
|
|
114
|
+
|
|
115
|
+
<CardContent className="gap-4 pb-3">{children}</CardContent>
|
|
116
|
+
|
|
117
|
+
{footer ? (
|
|
118
|
+
<CardFooter className="flex-col items-stretch gap-1 border-t-0 pt-0">
|
|
119
|
+
{footer}
|
|
120
|
+
</CardFooter>
|
|
121
|
+
) : null}
|
|
122
|
+
</Card>
|
|
123
|
+
</ScrollView>
|
|
124
|
+
</SafeAreaView>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export default AuthPage;
|