Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

refractor(accounts):create-shared-component

Aswin Asok3a48512b86de
diff --git a/web/apps/auth/src/components/AuthShell.tsx b/web/apps/auth/src/components/AuthShell.tsx
index 5ee8e59204..d623dacd84 100644
--- a/web/apps/auth/src/components/AuthShell.tsx
+++ b/web/apps/auth/src/components/AuthShell.tsx
@@ -1,482 +1,48 @@
-import { Tick02Icon } from "@hugeicons/core-free-icons";
-import { HugeiconsIcon } from "@hugeicons/react";
-import { GlobalStyles, keyframes, styled } from "@mui/material";
-import { EnteLogo } from "ente-base/components/EnteLogo";
+import { AuthPageShell } from "ente-accounts/components/auth/AuthPageShell";
+import type { AuthPresentationConfig } from "ente-accounts/components/auth/styles";
import { t } from "i18next";
import type React from "react";
-import {
- authAboveMobileMediaQuery,
- authColorVariables,
- authDisplayFontFamily,
- authMobileMediaQuery,
-} from "./auth/styles";
interface AuthShellProps extends React.PropsWithChildren {
contentWidth?: 400 | 420;
}
-export const AuthShell: React.FC<AuthShellProps> = ({
- children,
- contentWidth = 400,
-}) => (
- <PageRoot>
- <GlobalStyles styles={authColorVariables} />
- <FrameCurves />
- <PageCard>
- <DesktopBrandSlot>
- <BrandPanel
- headline={t("authenticator_auth_headline")}
- size="desktop"
- />
- </DesktopBrandSlot>
- <TabletBrandSlot>
- <BrandPanel
- headline={t("authenticator_auth_headline")}
- size="tablet"
- />
- </TabletBrandSlot>
- <MobileBrandSlot>
- <BrandPanel
- headline={t("authenticator_auth_headline")}
- size="mobile"
- />
- </MobileBrandSlot>
- <ContentSheet>
- <SheetHandle />
- <ContentColumn contentWidth={contentWidth}>
- {children}
- </ContentColumn>
- </ContentSheet>
- </PageCard>
- </PageRoot>
-);
-
-const shellReveal = keyframes({
- from: { opacity: 0, transform: "translateY(18px)" },
- to: { opacity: 1, transform: "translateY(0)" },
-});
-
-const brandCopyReveal = keyframes({
- from: { opacity: 0, transform: "translateY(12px)" },
- to: { opacity: 1, transform: "translateY(0)" },
-});
-
-const illustrationReveal = keyframes({
- from: { opacity: 0, transform: "translateY(18px) scale(0.98)" },
- to: { opacity: 1, transform: "translateY(0) scale(1)" },
-});
-
-const cameraSparkle = keyframes({
- from: {
- opacity: 0,
- transform: "translate(-50%, -50%) scale(0) rotate(-20deg)",
- },
- "35%": {
- opacity: 1,
- transform: "translate(-50%, -50%) scale(1) rotate(0)",
- },
- "70%": {
- opacity: 0.85,
- transform: "translate(-50%, -50%) scale(0.72) rotate(24deg)",
- },
- to: {
- opacity: 0,
- transform: "translate(-50%, -50%) scale(1.3) rotate(45deg)",
- },
-});
-
-const brandCurvesDrift = keyframes({
- "0%, 100%": { backgroundPosition: "calc(50% - 6px) calc(50% + 4px)" },
- "50%": { backgroundPosition: "calc(50% + 6px) calc(50% - 4px)" },
-});
-
-const brandCopyAnimation = {
- animation: `${brandCopyReveal} 520ms cubic-bezier(0.22, 1, 0.36, 1) both`,
- "@media (prefers-reduced-motion: reduce)": { animation: "none" },
+const authenticatorAuthTheme: AuthPresentationConfig = {
+ primary: "#9610d6",
+ primaryHover: "#8e0fcb",
+ primaryActive: "#750ca8",
+ focus: "#9610d6",
+ focusDark: "#c76cff",
+ link: "#000",
+ linkDark: "#fff",
+ termsLink: "#000",
+ termsLinkDark: "#fff",
+ passwordMessage: "#666",
+ passwordMessageDark: "#999",
+ textDisabledDark: "#808080",
+ mobileBrandHeight: 196,
+ illustrationHeights: { desktop: 245, tablet: 185, mobile: 137, wide: 278 },
};
-interface BrandPanelProps {
- headline: string;
- size: "desktop" | "tablet" | "mobile";
+export function AuthShell({
+ children,
+ contentWidth,
+}: AuthShellProps): React.JSX.Element {
+ return (
+ <AuthPageShell
+ brand={{
+ headline: t("authenticator_auth_headline"),
+ subtitle: t("photos_auth_subtitle"),
+ bullets: [
+ t("authenticator_auth_free"),
+ t("photos_auth_no_ads_no_spying"),
+ t("auth_independently_audited"),
+ ],
+ }}
+ presentationConfig={authenticatorAuthTheme}
+ contentWidth={contentWidth}
+ >
+ {children}
+ </AuthPageShell>
+ );
}
-
-const BrandPanel: React.FC<BrandPanelProps> = ({ headline, size }) => (
- <BrandPanelRoot size={size}>
- <Wordmark size={size}>
- <EnteLogo />
- </Wordmark>
- <PanelCopy size={size}>
- <PanelHeadline size={size}>{headline}</PanelHeadline>
- {size !== "mobile" && (
- <PanelSubtitle size={size}>
- {t("photos_auth_subtitle")}
- </PanelSubtitle>
- )}
- {size === "desktop" && (
- <BulletList>
- {[
- t("authenticator_auth_free"),
- t("photos_auth_no_ads_no_spying"),
- t("auth_independently_audited"),
- ].map((bullet) => (
- <Bullet key={bullet}>
- <CheckCircle aria-hidden="true">
- <HugeiconsIcon
- icon={Tick02Icon}
- size={12}
- strokeWidth={3}
- />
- </CheckCircle>
- <span>{bullet}</span>
- </Bullet>
- ))}
- </BulletList>
- )}
- </PanelCopy>
- <IllustrationClip size={size}>
- <img src="/images/auth-ducky.svg" alt="" />
- </IllustrationClip>
- </BrandPanelRoot>
-);
-
-const PageRoot = styled("main")(({ theme }) => ({
- width: "100%",
- height: "100svh",
- minHeight: "100svh",
- display: "flex",
- position: "relative",
- overflow: "hidden",
- boxSizing: "border-box",
- backgroundColor: "#f4f4f4",
- ...theme.applyStyles("dark", { backgroundColor: "#0a0a0a" }),
- [authAboveMobileMediaQuery]: { padding: "40px" },
- "@media (min-width: 1024px)": {
- padding: 0,
- alignItems: "center",
- justifyContent: "center",
- },
-}));
-
-const FrameCurves = styled("div")(({ theme }) => ({
- display: "none",
- opacity: 0.3,
- ...theme.applyStyles("dark", { opacity: 0.02 }),
- [authAboveMobileMediaQuery]: {
- display: "block",
- position: "absolute",
- inset: 0,
- backgroundImage: 'url("/images/auth-frame-curves.svg")',
- backgroundRepeat: "no-repeat",
- backgroundSize: "cover",
- backgroundPosition: "center",
- pointerEvents: "none",
- },
-}));
-
-const PageCard = styled("div")(({ theme }) => ({
- width: "100%",
- height: "100%",
- minHeight: 0,
- display: "flex",
- flexDirection: "column",
- position: "relative",
- overflow: "hidden",
- backgroundColor: "#fff",
- animation: `${shellReveal} 620ms cubic-bezier(0.22, 1, 0.36, 1) both`,
- ...theme.applyStyles("dark", { backgroundColor: "#252525" }),
- "@media (prefers-reduced-motion: reduce)": { animation: "none" },
- [authAboveMobileMediaQuery]: { borderRadius: "24px" },
- "@media (min-width: 1024px)": {
- width: "1032px",
- height: "min(780px, 100%)",
- flexDirection: "row",
- },
- "@media (min-width: 1600px)": {
- width: "1240px",
- height: "min(900px, 100%)",
- },
-}));
-
-const DesktopBrandSlot = styled("div")({
- display: "none",
- "@media (min-width: 1024px)": {
- display: "block",
- flex: "0 0 440px",
- height: "100%",
- },
- "@media (min-width: 1600px)": { flexBasis: "496px" },
-});
-
-const TabletBrandSlot = styled("div")({
- display: "none",
- [`${authAboveMobileMediaQuery} and (max-width: 1023px)`]: {
- display: "block",
- // Grows with the copy when it wraps at narrow widths; the band's
- // 268px design height is enforced as a minimum by BrandPanelRoot.
- flex: "0 0 auto",
- position: "relative",
- overflow: "hidden",
- },
-});
-
-const MobileBrandSlot = styled("div")({
- display: "block",
- flex: "0 0 196px",
- minHeight: 0,
- position: "relative",
- overflow: "hidden",
- [authAboveMobileMediaQuery]: { display: "none" },
-});
-
-const ContentSheet = styled("section")(({ theme }) => ({
- flex: 1,
- minHeight: 0,
- marginTop: "-28px",
- padding: "40px 24px 24px",
- display: "flex",
- flexDirection: "column",
- gap: "24px",
- position: "relative",
- zIndex: 1,
- overflowY: "auto",
- boxSizing: "border-box",
- borderRadius: "24px 24px 0 0",
- backgroundColor: "#fff",
- ...theme.applyStyles("dark", { backgroundColor: "#252525" }),
- [authAboveMobileMediaQuery]: {
- marginTop: "-32px",
- padding: "16px 48px 48px",
- },
- "@media (min-width: 1024px)": {
- width: "592px",
- marginTop: 0,
- padding: "48px 96px",
- alignItems: "center",
- justifyContent: "center",
- borderRadius: 0,
- },
- "@media (min-width: 1600px)": { width: "744px", padding: "56px 172px" },
-}));
-
-const SheetHandle = styled("div")({
- width: "36px",
- height: "4px",
- flexShrink: 0,
- alignSelf: "center",
- borderRadius: "999px",
- backgroundColor: "var(--auth-app-fill-active)",
- [authMobileMediaQuery]: { display: "none" },
- "@media (min-width: 1024px)": { display: "none" },
-});
-
-const ContentColumn = styled("div", {
- shouldForwardProp: (prop) => prop !== "contentWidth",
-})<{ contentWidth: 400 | 420 }>(({ contentWidth }) => ({
- width: "100%",
- minHeight: "min-content",
- display: "flex",
- flexDirection: "column",
- gap: "24px",
- [authMobileMediaQuery]: { flexGrow: 1 },
- [authAboveMobileMediaQuery]: {
- width: "440px",
- maxWidth: "100%",
- marginBlock: "auto",
- alignSelf: "center",
- },
- "@media (min-width: 1024px)": { width: `${contentWidth}px` },
- "@media (min-width: 1600px)": { gap: "28px" },
-}));
-
-const BrandPanelRoot = styled("div", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- width: "100%",
- height: size === "tablet" ? "auto" : "100%",
- ...(size === "tablet" && { minHeight: "268px", rowGap: "24px" }),
- padding:
- size === "desktop"
- ? "44px"
- : size === "tablet"
- ? "40px 40px 60px"
- : "18px 16px 40px",
- display: "flex",
- flexDirection: "column",
- justifyContent: size === "desktop" ? "flex-start" : "space-between",
- position: "relative",
- overflow: "hidden",
- boxSizing: "border-box",
- color: "#fff",
- backgroundColor: "var(--auth-app-primary)",
- backgroundImage: 'url("/images/auth-surface-noise.svg")',
- backgroundRepeat: "repeat",
- backgroundPosition: "0 0",
- backgroundSize: "auto",
- "&::before": {
- content: '""',
- position: "absolute",
- inset: 0,
- pointerEvents: "none",
- backgroundImage: 'url("/images/auth-frame-curves.svg")',
- backgroundRepeat: "no-repeat",
- backgroundPosition: "center",
- backgroundSize: "cover",
- maskImage:
- "linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55) 42%, #000 100%)",
- WebkitMaskImage:
- "linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55) 42%, #000 100%)",
- animation: `${brandCurvesDrift} 20s ease-in-out infinite`,
- },
- "@media (prefers-reduced-motion: reduce)": {
- "&::before": { animation: "none" },
- },
-}));
-
-const Wordmark = styled("div", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- width: size === "desktop" ? "83px" : size === "tablet" ? "77px" : "64px",
- height: size === "desktop" ? "26px" : size === "tablet" ? "24px" : "20px",
- flexShrink: 0,
- margin: size === "mobile" ? "8px 0 0 8px" : 0,
- lineHeight: 0,
- position: "relative",
- zIndex: 1,
- "& > svg": { width: "100%", height: "100%" },
-}));
-
-const PanelCopy = styled("div", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- marginTop: size === "desktop" ? "36px" : 0,
- marginLeft: size === "mobile" ? "8px" : 0,
- // On the tablet band the ducky is anchored to the right edge, so keep
- // the copy from running underneath it at narrow widths.
- ...(size === "tablet" && { maxWidth: "calc(100% - 245px)" }),
- position: "relative",
- zIndex: 1,
-}));
-
-const PanelHeadline = styled("h1", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- maxWidth:
- size === "desktop" ? "300px" : size === "tablet" ? "380px" : "188px",
- margin: 0,
- fontFamily: authDisplayFontFamily,
- fontSize: size === "desktop" ? "42px" : size === "tablet" ? "34px" : "26px",
- fontWeight: 600,
- lineHeight:
- size === "desktop" ? "50px" : size === "tablet" ? "42px" : "34px",
- letterSpacing: "-0.02em",
- textWrap: "pretty",
- ...brandCopyAnimation,
- animationDelay: "80ms",
-}));
-
-const PanelSubtitle = styled("p", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- margin: 0,
- marginTop: size === "desktop" ? "14px" : "10px",
- fontSize: size === "desktop" ? "20px" : "17px",
- fontWeight: 500,
- lineHeight: size === "desktop" ? "28px" : "24px",
- color: "rgba(255, 255, 255, 0.88)",
- ...brandCopyAnimation,
- animationDelay: "170ms",
-}));
-
-const BulletList = styled("ul")({
- margin: "34px 0 0",
- padding: 0,
- display: "flex",
- flexDirection: "column",
- gap: "14px",
- listStyle: "none",
-});
-
-const Bullet = styled("li")({
- display: "flex",
- alignItems: "center",
- gap: "12px",
- fontSize: "17px",
- fontWeight: 500,
- lineHeight: "24px",
- ...brandCopyAnimation,
- "&:nth-of-type(1)": { animationDelay: "280ms" },
- "&:nth-of-type(2)": { animationDelay: "350ms" },
- "&:nth-of-type(3)": { animationDelay: "420ms" },
-});
-
-const CheckCircle = styled("span")({
- width: "24px",
- height: "24px",
- flex: "0 0 24px",
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- borderRadius: "50%",
- backgroundColor: "rgba(255, 255, 255, 0.14)",
-});
-
-const IllustrationClip = styled("div", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- width: size === "desktop" ? "313px" : size === "tablet" ? "237px" : "175px",
- height:
- size === "desktop" ? "245px" : size === "tablet" ? "185px" : "137px",
- flexShrink: 0,
- position: "relative",
- overflow: "hidden",
- zIndex: 0,
- ...(size !== "tablet" && {
- animation: `${illustrationReveal} 500ms cubic-bezier(0.22, 1, 0.36, 1) ${size === "desktop" ? "840ms" : "130ms"} both`,
- "@media (prefers-reduced-motion: reduce)": { animation: "none" },
- }),
- ...(size === "desktop"
- ? {
- marginTop: "auto",
- alignSelf: "center",
- "@media (min-width: 1600px)": { width: "355px", height: "278px" },
- }
- : {
- position: "absolute",
- right: size === "tablet" ? "28px" : "-4px",
- // Sit clear of the content sheet, which overlaps the band's
- // bottom edge by 32px (tablet) / 28px (mobile).
- bottom: size === "tablet" ? "44px" : "38px",
- }),
- "&::after": {
- content: '""',
- width:
- size === "desktop" ? "34px" : size === "tablet" ? "26px" : "20px",
- aspectRatio: "1",
- position: "absolute",
- left: "67%",
- top: size === "desktop" ? "59%" : "57%",
- zIndex: 1,
- pointerEvents: "none",
- backgroundColor: "#fff",
- clipPath:
- "polygon(50% 0%, 59% 39%, 100% 50%, 59% 61%, 50% 100%, 41% 61%, 0% 50%, 41% 39%)",
- filter: "drop-shadow(0 0 7px rgba(255, 245, 168, 0.95))",
- animation: `${cameraSparkle} 520ms ease-out ${size === "desktop" ? "1400ms" : size === "tablet" ? "740ms" : "690ms"} both`,
- "@media (prefers-reduced-motion: reduce)": { display: "none" },
- },
- "& > img": {
- display: "block",
- width: "473.694px",
- height: "370px",
- transformOrigin: "top left",
- transform:
- size === "desktop"
- ? "scale(0.66)"
- : size === "tablet"
- ? "scale(0.5)"
- : "scale(0.37)",
- ...(size === "desktop" && {
- "@media (min-width: 1600px)": { transform: "scale(0.75)" },
- }),
- },
-}));
diff --git a/web/apps/auth/src/components/auth/DevSettingsDialog.tsx b/web/apps/auth/src/components/auth/DevSettingsDialog.tsx
index 17ff0a551f..59decc814e 100644
--- a/web/apps/auth/src/components/auth/DevSettingsDialog.tsx
+++ b/web/apps/auth/src/components/auth/DevSettingsDialog.tsx
@@ -1,22 +1,22 @@
import { InformationCircleIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { CircularProgress, styled } from "@mui/material";
-import type { DevSettingsPresentationProps } from "ente-new/photos/components/DevSettings";
-import { t } from "i18next";
-import type React from "react";
import {
AuthDialog,
AuthDialogHeader,
AuthDialogText,
AuthDialogTitle,
-} from "./AuthDialog";
-import { Button } from "./Button";
+} from "ente-accounts/components/auth/AuthDialog";
+import { Button } from "ente-accounts/components/auth/Button";
import {
authBodyTypography,
authDialogContentLayout,
authFocusRing,
-} from "./styles";
-import { TextField } from "./TextField";
+} from "ente-accounts/components/auth/styles";
+import { TextField } from "ente-accounts/components/auth/TextField";
+import type { DevSettingsPresentationProps } from "ente-new/photos/components/DevSettings";
+import { t } from "i18next";
+import type React from "react";
export function DevSettingsDialog({
open,
@@ -82,7 +82,7 @@ export function DevSettingsDialog({
<StatusPill role="status">
<CircularProgress
size={18}
- sx={{ color: "var(--auth-app-primary)" }}
+ sx={{ color: "var(--auth-ui-primary)" }}
/>
<span>{t("auth_endpoint_checking")}</span>
</StatusPill>
@@ -115,8 +115,8 @@ const InfoLink = styled("a")({
alignItems: "center",
justifyContent: "center",
borderRadius: "4px",
- color: "var(--auth-app-text-faint)",
- "&:hover": { color: "var(--auth-app-text-muted)" },
+ color: "var(--auth-ui-text-faint)",
+ "&:hover": { color: "var(--auth-ui-text-muted)" },
"&:focus-visible": authFocusRing,
});
@@ -127,9 +127,9 @@ const StatusPill = styled("div")({
gap: "10px",
padding: "12px 14px",
borderRadius: "20px",
- backgroundColor: "var(--auth-app-button-secondary)",
- boxShadow: "inset 0 0 0 1px var(--auth-app-stroke)",
- color: "var(--auth-app-text-muted)",
+ backgroundColor: "var(--auth-ui-button-secondary)",
+ boxShadow: "inset 0 0 0 1px var(--auth-ui-stroke)",
+ color: "var(--auth-ui-text-muted)",
"& > svg, & > .MuiCircularProgress-root": { flexShrink: 0 },
});
diff --git a/web/apps/auth/src/components/auth/styles.ts b/web/apps/auth/src/components/auth/styles.ts
deleted file mode 100644
index 00a7304c0c..0000000000
--- a/web/apps/auth/src/components/auth/styles.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-export const authColorVariables = {
- ":where(:root)": {
- "--auth-app-primary": "#9610d6",
- "--auth-app-accent": "#9610d6",
- "--auth-app-primary-hover": "#8e0fcb",
- "--auth-app-primary-active": "#750ca8",
- "--auth-app-success": "#069d1e",
- "--auth-app-warning": "#f63a3a",
- "--auth-app-caution": "#f08a1e",
- "--auth-app-text": "#000",
- "--auth-app-text-muted": "#666",
- "--auth-app-text-faint": "#969696",
- "--auth-app-text-disabled": "#d6d6d6",
- "--auth-app-field": "#fff",
- "--auth-app-fill": "#eaeaea",
- "--auth-app-fill-hover": "#dedede",
- "--auth-app-fill-active": "#d2d2d2",
- "--auth-app-stroke": "#e0e0e0",
- "--auth-app-button-secondary": "#eaeaea",
- "--auth-app-button-secondary-hover": "#dedede",
- "--auth-app-button-secondary-active": "#d2d2d2",
- "--auth-app-button-secondary-stroke": "transparent",
- "--auth-app-button-secondary-stroke-hover": "transparent",
- "--auth-app-button-secondary-stroke-active": "transparent",
- "--auth-app-button-primary-stroke": "rgba(255, 255, 255, 0.14)",
- "--auth-app-button-primary-stroke-hover": "rgba(255, 255, 255, 0.32)",
- "--auth-app-button-primary-stroke-active": "rgba(255, 255, 255, 0.2)",
- },
- "*:where(.dark)": {
- "--auth-app-accent": "#c76cff",
- "--auth-app-success": "#08c225",
- "--auth-app-text": "#fff",
- "--auth-app-text-muted": "#999",
- "--auth-app-text-disabled": "#808080",
- "--auth-app-field": "#1a1a1a",
- "--auth-app-fill": "#0a0a0a",
- "--auth-app-fill-hover": "#1a1a1a",
- "--auth-app-fill-active": "#292929",
- "--auth-app-stroke": "#3e3e3e",
- "--auth-app-button-secondary": "#1e1e1e",
- "--auth-app-button-secondary-hover": "#1a1a1a",
- "--auth-app-button-secondary-active": "#161616",
- "--auth-app-button-secondary-stroke": "rgba(255, 255, 255, 0.07)",
- "--auth-app-button-secondary-stroke-hover": "rgba(255, 255, 255, 0.18)",
- "--auth-app-button-secondary-stroke-active":
- "rgba(255, 255, 255, 0.12)",
- },
-};
-
-const authMobileCutoffPx = 640;
-export const authMobileMediaQuery = `@media (max-width: ${authMobileCutoffPx - 0.05}px)`;
-export const authAboveMobileMediaQuery = `@media (min-width: ${authMobileCutoffPx}px)`;
-
-export const authTransientProps = {
- shouldForwardProp: (prop: string) => !prop.startsWith("$"),
-};
-
-export const authDisplayFontFamily = '"Outfit Variable", sans-serif';
-
-export const authFocusRing = {
- outline: "1px solid var(--auth-app-accent)",
- outlineOffset: "2px",
-};
-
-export const authBodyTypography = {
- fontSize: "14px",
- fontWeight: 500,
- lineHeight: "20px",
-};
-
-export const authMiniTypography = {
- fontSize: "12px",
- fontWeight: 500,
- lineHeight: "16px",
-};
-
-export const authDialogContentLayout = {
- display: "flex",
- flexDirection: "column",
- gap: "24px",
- [authMobileMediaQuery]: { gap: "20px" },
-} as const;
diff --git a/web/apps/auth/src/pages/change-password.tsx b/web/apps/auth/src/pages/change-password.tsx
index 1b8c9695f5..52a53c1960 100644
--- a/web/apps/auth/src/pages/change-password.tsx
+++ b/web/apps/auth/src/pages/change-password.tsx
@@ -1,6 +1,6 @@
-import { SetPasswordForm } from "@/components/auth/SetPasswordForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
+import { SetPasswordForm } from "ente-accounts/components/auth/SetPasswordForm";
import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";
import AccountsChangePasswordPage from "ente-accounts/pages/change-password";
import type React from "react";
diff --git a/web/apps/auth/src/pages/credentials.tsx b/web/apps/auth/src/pages/credentials.tsx
index 12f6d19716..e4a4ab9558 100644
--- a/web/apps/auth/src/pages/credentials.tsx
+++ b/web/apps/auth/src/pages/credentials.tsx
@@ -1,10 +1,10 @@
+import { AuthShell } from "@/components/AuthShell";
+import { featureFlags } from "@/feature-flags";
import {
CredentialsForm,
PasswordForm,
-} from "@/components/auth/CredentialsForm";
-import { SecondFactorChoiceDialog } from "@/components/auth/SecondFactorChoiceDialog";
-import { AuthShell } from "@/components/AuthShell";
-import { featureFlags } from "@/feature-flags";
+} from "ente-accounts/components/auth/CredentialsForm";
+import { SecondFactorChoiceDialog } from "ente-accounts/components/auth/SecondFactorChoiceDialog";
import AccountsCredentialsPage, {
type CredentialsPresentationProps,
} from "ente-accounts/pages/credentials";
diff --git a/web/apps/auth/src/pages/generate.tsx b/web/apps/auth/src/pages/generate.tsx
index 404b48940b..ab8fd18abb 100644
--- a/web/apps/auth/src/pages/generate.tsx
+++ b/web/apps/auth/src/pages/generate.tsx
@@ -1,7 +1,7 @@
-import { RecoveryKeyForm } from "@/components/auth/RecoveryKeyForm";
-import { SetPasswordForm } from "@/components/auth/SetPasswordForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
+import { RecoveryKeyForm } from "ente-accounts/components/auth/RecoveryKeyForm";
+import { SetPasswordForm } from "ente-accounts/components/auth/SetPasswordForm";
import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";
import type { RecoveryKeyPresentationProps } from "ente-accounts/components/RecoveryKey";
import AccountsGeneratePage from "ente-accounts/pages/generate";
diff --git a/web/apps/auth/src/pages/login.tsx b/web/apps/auth/src/pages/login.tsx
index 5205de4d9c..53bb132703 100644
--- a/web/apps/auth/src/pages/login.tsx
+++ b/web/apps/auth/src/pages/login.tsx
@@ -1,8 +1,8 @@
import { DevSettingsDialog } from "@/components/auth/DevSettingsDialog";
-import { LoginForm } from "@/components/auth/LoginForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
import { Paper, Stack, styled } from "@mui/material";
+import { LoginForm } from "ente-accounts/components/auth/LoginForm";
import {
LoginContents,
type LoginPresentationProps,
diff --git a/web/apps/auth/src/pages/passkeys/recover.tsx b/web/apps/auth/src/pages/passkeys/recover.tsx
index f4104331a2..134e3a2ef2 100644
--- a/web/apps/auth/src/pages/passkeys/recover.tsx
+++ b/web/apps/auth/src/pages/passkeys/recover.tsx
@@ -1,6 +1,6 @@
-import { RecoverTwoFactorForm } from "@/components/auth/RecoveryForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
+import { RecoverTwoFactorForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsTwoFactorRecoverPage, {
type TwoFactorRecoverPresentationProps,
} from "ente-accounts/pages/two-factor/recover";
diff --git a/web/apps/auth/src/pages/recover.tsx b/web/apps/auth/src/pages/recover.tsx
index b3335d35bb..4d7bdc1af6 100644
--- a/web/apps/auth/src/pages/recover.tsx
+++ b/web/apps/auth/src/pages/recover.tsx
@@ -1,6 +1,6 @@
-import { RecoverAccountForm } from "@/components/auth/RecoveryForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
+import { RecoverAccountForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsRecoverPage, {
type RecoverAccountPresentationProps,
} from "ente-accounts/pages/recover";
diff --git a/web/apps/auth/src/pages/signup.tsx b/web/apps/auth/src/pages/signup.tsx
index 4e02bc952c..6df7e29403 100644
--- a/web/apps/auth/src/pages/signup.tsx
+++ b/web/apps/auth/src/pages/signup.tsx
@@ -1,6 +1,6 @@
-import { SignUpForm } from "@/components/auth/SignUpForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
+import { SignUpForm } from "ente-accounts/components/auth/SignUpForm";
import type { SignUpPresentationProps } from "ente-accounts/components/SignUpContents";
import AccountsSignUpPage from "ente-accounts/pages/signup";
import type React from "react";
diff --git a/web/apps/auth/src/pages/two-factor/recover.tsx b/web/apps/auth/src/pages/two-factor/recover.tsx
index b8984592a5..2a2251c26b 100644
--- a/web/apps/auth/src/pages/two-factor/recover.tsx
+++ b/web/apps/auth/src/pages/two-factor/recover.tsx
@@ -1,6 +1,6 @@
-import { RecoverTwoFactorForm } from "@/components/auth/RecoveryForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
+import { RecoverTwoFactorForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsTwoFactorRecoverPage, {
type TwoFactorRecoverPresentationProps,
} from "ente-accounts/pages/two-factor/recover";
diff --git a/web/apps/auth/src/pages/two-factor/verify.tsx b/web/apps/auth/src/pages/two-factor/verify.tsx
index c3ef1bbaaf..f93e497e4e 100644
--- a/web/apps/auth/src/pages/two-factor/verify.tsx
+++ b/web/apps/auth/src/pages/two-factor/verify.tsx
@@ -1,6 +1,6 @@
-import { TwoFactorForm } from "@/components/auth/TwoFactorForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
+import { TwoFactorForm } from "ente-accounts/components/auth/TwoFactorForm";
import AccountsTwoFactorVerifyPage, {
type TwoFactorVerifyPresentationProps,
} from "ente-accounts/pages/two-factor/verify";
diff --git a/web/apps/auth/src/pages/verify.tsx b/web/apps/auth/src/pages/verify.tsx
index f11c0bdc94..5d8b5b360d 100644
--- a/web/apps/auth/src/pages/verify.tsx
+++ b/web/apps/auth/src/pages/verify.tsx
@@ -1,7 +1,7 @@
-import { SecondFactorChoiceDialog } from "@/components/auth/SecondFactorChoiceDialog";
-import { VerifyEmailForm } from "@/components/auth/VerifyEmailForm";
import { AuthShell } from "@/components/AuthShell";
import { featureFlags } from "@/feature-flags";
+import { SecondFactorChoiceDialog } from "ente-accounts/components/auth/SecondFactorChoiceDialog";
+import { VerifyEmailForm } from "ente-accounts/components/auth/VerifyEmailForm";
import AccountsVerifyPage, {
type VerifyEmailPresentationProps,
} from "ente-accounts/pages/verify";
diff --git a/web/apps/locker/src/components/LockerAuthShell.tsx b/web/apps/locker/src/components/LockerAuthShell.tsx
index 8ecc6c7e07..f0c7d20b45 100644
--- a/web/apps/locker/src/components/LockerAuthShell.tsx
+++ b/web/apps/locker/src/components/LockerAuthShell.tsx
@@ -1,485 +1,49 @@
-import { Tick02Icon } from "@hugeicons/core-free-icons";
-import { HugeiconsIcon } from "@hugeicons/react";
-import { GlobalStyles, keyframes, styled } from "@mui/material";
-import { EnteLogo } from "ente-base/components/EnteLogo";
+import { AuthPageShell } from "ente-accounts/components/auth/AuthPageShell";
+import type { AuthPresentationConfig } from "ente-accounts/components/auth/styles";
import { t } from "i18next";
import type React from "react";
-import {
- authAboveMobileMediaQuery,
- authColorVariables,
- authDisplayFontFamily,
- authMobileMediaQuery,
-} from "./auth/styles";
interface LockerAuthShellProps extends React.PropsWithChildren {
contentWidth?: 400 | 420;
}
-export const LockerAuthShell: React.FC<LockerAuthShellProps> = ({
- children,
- contentWidth = 400,
-}) => (
- <PageRoot>
- <GlobalStyles styles={authColorVariables} />
- <FrameCurves />
- <PageCard>
- <DesktopBrandSlot>
- <BrandPanel
- headline={t("locker_auth_headline")}
- size="desktop"
- />
- </DesktopBrandSlot>
- <TabletBrandSlot>
- <BrandPanel
- headline={t("locker_auth_headline")}
- size="tablet"
- />
- </TabletBrandSlot>
- <MobileBrandSlot>
- <BrandPanel
- headline={t("locker_auth_headline")}
- size="mobile"
- />
- </MobileBrandSlot>
- <ContentSheet>
- <SheetHandle />
- <ContentColumn contentWidth={contentWidth}>
- {children}
- </ContentColumn>
- </ContentSheet>
- </PageCard>
- </PageRoot>
-);
-
-const shellReveal = keyframes({
- from: { opacity: 0, transform: "translateY(18px)" },
- to: { opacity: 1, transform: "translateY(0)" },
-});
-
-const brandCopyReveal = keyframes({
- from: { opacity: 0, transform: "translateY(12px)" },
- to: { opacity: 1, transform: "translateY(0)" },
-});
-
-const illustrationReveal = keyframes({
- from: { opacity: 0, transform: "translateY(18px) scale(0.98)" },
- to: { opacity: 1, transform: "translateY(0) scale(1)" },
-});
-
-const cameraSparkle = keyframes({
- from: {
- opacity: 0,
- transform: "translate(-50%, -50%) scale(0) rotate(-20deg)",
- },
- "35%": {
- opacity: 1,
- transform: "translate(-50%, -50%) scale(1) rotate(0)",
- },
- "70%": {
- opacity: 0.85,
- transform: "translate(-50%, -50%) scale(0.72) rotate(24deg)",
- },
- to: {
- opacity: 0,
- transform: "translate(-50%, -50%) scale(1.3) rotate(45deg)",
- },
-});
-
-const brandCurvesDrift = keyframes({
- "0%, 100%": { backgroundPosition: "calc(50% - 6px) calc(50% + 4px)" },
- "50%": { backgroundPosition: "calc(50% + 6px) calc(50% - 4px)" },
-});
-
-const brandCopyAnimation = {
- animation: `${brandCopyReveal} 520ms cubic-bezier(0.22, 1, 0.36, 1) both`,
- "@media (prefers-reduced-motion: reduce)": { animation: "none" },
+const lockerAuthTheme: AuthPresentationConfig = {
+ primary: "#1071ff",
+ primaryHover: "#0056cc",
+ primaryActive: "#004db8",
+ focus: "#1071ff",
+ focusDark: "#1071ff",
+ link: "#1071ff",
+ linkDark: "#1071ff",
+ termsLink: "#1071ff",
+ termsLinkDark: "#1071ff",
+ passwordMessage: "#000",
+ passwordMessageDark: "#fff",
+ textDisabledDark: "#4d4d4d",
+ wideGamutPrimary: "color(display-p3 0.0627 0.4431 1)",
+ mobileBrandHeight: 232,
+ illustrationHeights: { desktop: 219, tablet: 172, mobile: 127, wide: 249 },
};
-interface BrandPanelProps {
- headline: string;
- size: "desktop" | "tablet" | "mobile";
+export function LockerAuthShell({
+ children,
+ contentWidth,
+}: LockerAuthShellProps): React.JSX.Element {
+ return (
+ <AuthPageShell
+ brand={{
+ headline: t("locker_auth_headline"),
+ subtitle: t("photos_auth_subtitle"),
+ bullets: [
+ t("locker_auth_free_files"),
+ t("photos_auth_no_ads_no_spying"),
+ t("auth_independently_audited"),
+ ],
+ }}
+ presentationConfig={lockerAuthTheme}
+ contentWidth={contentWidth}
+ >
+ {children}
+ </AuthPageShell>
+ );
}
-
-const BrandPanel: React.FC<BrandPanelProps> = ({ headline, size }) => (
- <BrandPanelRoot size={size}>
- <Wordmark size={size}>
- <EnteLogo />
- </Wordmark>
- <PanelCopy size={size}>
- <PanelHeadline size={size}>{headline}</PanelHeadline>
- {size !== "mobile" && (
- <PanelSubtitle size={size}>
- {t("photos_auth_subtitle")}
- </PanelSubtitle>
- )}
- {size === "desktop" && (
- <BulletList>
- {[
- t("locker_auth_free_files"),
- t("photos_auth_no_ads_no_spying"),
- t("auth_independently_audited"),
- ].map((bullet) => (
- <Bullet key={bullet}>
- <CheckCircle aria-hidden="true">
- <HugeiconsIcon
- icon={Tick02Icon}
- size={12}
- strokeWidth={3}
- />
- </CheckCircle>
- <span>{bullet}</span>
- </Bullet>
- ))}
- </BulletList>
- )}
- </PanelCopy>
- <IllustrationClip size={size}>
- <img src="/images/auth-ducky.svg" alt="" />
- </IllustrationClip>
- </BrandPanelRoot>
-);
-
-const PageRoot = styled("main")(({ theme }) => ({
- width: "100%",
- height: "100svh",
- minHeight: "100svh",
- display: "flex",
- position: "relative",
- overflow: "hidden",
- boxSizing: "border-box",
- backgroundColor: "#f4f4f4",
- ...theme.applyStyles("dark", { backgroundColor: "#0a0a0a" }),
- [authAboveMobileMediaQuery]: { padding: "40px" },
- "@media (min-width: 1024px)": {
- padding: 0,
- alignItems: "center",
- justifyContent: "center",
- },
-}));
-
-const FrameCurves = styled("div")(({ theme }) => ({
- display: "none",
- opacity: 0.3,
- ...theme.applyStyles("dark", { opacity: 0.02 }),
- [authAboveMobileMediaQuery]: {
- display: "block",
- position: "absolute",
- inset: 0,
- backgroundImage: 'url("/images/auth-frame-curves.svg")',
- backgroundRepeat: "no-repeat",
- backgroundSize: "cover",
- backgroundPosition: "center",
- pointerEvents: "none",
- },
-}));
-
-const PageCard = styled("div")(({ theme }) => ({
- width: "100%",
- height: "100%",
- minHeight: 0,
- display: "flex",
- flexDirection: "column",
- position: "relative",
- overflow: "hidden",
- backgroundColor: "#fff",
- animation: `${shellReveal} 620ms cubic-bezier(0.22, 1, 0.36, 1) both`,
- ...theme.applyStyles("dark", { backgroundColor: "#252525" }),
- "@media (prefers-reduced-motion: reduce)": { animation: "none" },
- [authAboveMobileMediaQuery]: { borderRadius: "24px" },
- "@media (min-width: 1024px)": {
- width: "1032px",
- height: "min(780px, 100%)",
- flexDirection: "row",
- },
- "@media (min-width: 1600px)": {
- width: "1240px",
- height: "min(900px, 100%)",
- },
-}));
-
-const DesktopBrandSlot = styled("div")({
- display: "none",
- "@media (min-width: 1024px)": {
- display: "block",
- flex: "0 0 440px",
- height: "100%",
- },
- "@media (min-width: 1600px)": { flexBasis: "496px" },
-});
-
-const TabletBrandSlot = styled("div")({
- display: "none",
- [`${authAboveMobileMediaQuery} and (max-width: 1023px)`]: {
- display: "block",
- // Grows with the copy when it wraps at narrow widths; the band's
- // 268px design height is enforced as a minimum by BrandPanelRoot.
- flex: "0 0 auto",
- position: "relative",
- overflow: "hidden",
- },
-});
-
-const MobileBrandSlot = styled("div")({
- display: "block",
- flex: "0 0 232px",
- minHeight: 0,
- position: "relative",
- overflow: "hidden",
- [authAboveMobileMediaQuery]: { display: "none" },
-});
-
-const ContentSheet = styled("section")(({ theme }) => ({
- flex: 1,
- minHeight: 0,
- marginTop: "-28px",
- padding: "40px 24px 24px",
- display: "flex",
- flexDirection: "column",
- gap: "24px",
- position: "relative",
- zIndex: 1,
- overflowY: "auto",
- boxSizing: "border-box",
- borderRadius: "24px 24px 0 0",
- backgroundColor: "#fff",
- ...theme.applyStyles("dark", { backgroundColor: "#252525" }),
- [authAboveMobileMediaQuery]: {
- marginTop: "-32px",
- padding: "16px 48px 48px",
- },
- "@media (min-width: 1024px)": {
- width: "592px",
- marginTop: 0,
- padding: "48px 96px",
- alignItems: "center",
- justifyContent: "center",
- borderRadius: 0,
- },
- "@media (min-width: 1600px)": { width: "744px", padding: "56px 172px" },
-}));
-
-const SheetHandle = styled("div")({
- width: "36px",
- height: "4px",
- flexShrink: 0,
- alignSelf: "center",
- borderRadius: "999px",
- backgroundColor: "var(--locker-auth-fill-active)",
- [authMobileMediaQuery]: { display: "none" },
- "@media (min-width: 1024px)": { display: "none" },
-});
-
-const ContentColumn = styled("div", {
- shouldForwardProp: (prop) => prop !== "contentWidth",
-})<{ contentWidth: 400 | 420 }>(({ contentWidth }) => ({
- width: "100%",
- minHeight: "min-content",
- display: "flex",
- flexDirection: "column",
- gap: "24px",
- [authMobileMediaQuery]: { flexGrow: 1 },
- [authAboveMobileMediaQuery]: {
- width: "440px",
- maxWidth: "100%",
- marginBlock: "auto",
- alignSelf: "center",
- },
- "@media (min-width: 1024px)": { width: `${contentWidth}px` },
- "@media (min-width: 1600px)": { gap: "28px" },
-}));
-
-const BrandPanelRoot = styled("div", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- width: "100%",
- height: size === "tablet" ? "auto" : "100%",
- ...(size === "tablet" && { minHeight: "268px", rowGap: "24px" }),
- padding:
- size === "desktop"
- ? "44px"
- : size === "tablet"
- ? "40px 40px 60px"
- : "18px 16px 40px",
- display: "flex",
- flexDirection: "column",
- justifyContent: size === "desktop" ? "flex-start" : "space-between",
- position: "relative",
- overflow: "hidden",
- boxSizing: "border-box",
- color: "#fff",
- backgroundColor: "var(--locker-auth-primary)",
- backgroundImage: 'url("/images/auth-surface-noise.svg")',
- backgroundRepeat: "repeat",
- backgroundPosition: "0 0",
- backgroundSize: "auto",
- "&::before": {
- content: '""',
- position: "absolute",
- inset: 0,
- pointerEvents: "none",
- backgroundImage: 'url("/images/auth-frame-curves.svg")',
- backgroundRepeat: "no-repeat",
- backgroundPosition: "center",
- backgroundSize: "cover",
- maskImage:
- "linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55) 42%, #000 100%)",
- WebkitMaskImage:
- "linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55) 42%, #000 100%)",
- animation: `${brandCurvesDrift} 20s ease-in-out infinite`,
- },
- "@supports (color: color(display-p3 1 1 1))": {
- backgroundColor: "color(display-p3 0.0627 0.4431 1)",
- },
- "@media (prefers-reduced-motion: reduce)": {
- "&::before": { animation: "none" },
- },
-}));
-
-const Wordmark = styled("div", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- width: size === "desktop" ? "83px" : size === "tablet" ? "77px" : "64px",
- height: size === "desktop" ? "26px" : size === "tablet" ? "24px" : "20px",
- flexShrink: 0,
- margin: size === "mobile" ? "8px 0 0 8px" : 0,
- lineHeight: 0,
- position: "relative",
- zIndex: 1,
- "& > svg": { width: "100%", height: "100%" },
-}));
-
-const PanelCopy = styled("div", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- marginTop: size === "desktop" ? "36px" : 0,
- marginLeft: size === "mobile" ? "8px" : 0,
- // On the tablet band the ducky is anchored to the right edge, so keep
- // the copy from running underneath it at narrow widths.
- ...(size === "tablet" && { maxWidth: "calc(100% - 245px)" }),
- position: "relative",
- zIndex: 1,
-}));
-
-const PanelHeadline = styled("h1", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- maxWidth:
- size === "desktop" ? "300px" : size === "tablet" ? "380px" : "188px",
- margin: 0,
- fontFamily: authDisplayFontFamily,
- fontSize: size === "desktop" ? "42px" : size === "tablet" ? "34px" : "26px",
- fontWeight: 600,
- lineHeight:
- size === "desktop" ? "50px" : size === "tablet" ? "42px" : "34px",
- letterSpacing: "-0.02em",
- textWrap: "pretty",
- ...brandCopyAnimation,
- animationDelay: "80ms",
-}));
-
-const PanelSubtitle = styled("p", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- margin: 0,
- marginTop: size === "desktop" ? "14px" : "10px",
- fontSize: size === "desktop" ? "20px" : "17px",
- fontWeight: 500,
- lineHeight: size === "desktop" ? "28px" : "24px",
- color: "rgba(255, 255, 255, 0.88)",
- ...brandCopyAnimation,
- animationDelay: "170ms",
-}));
-
-const BulletList = styled("ul")({
- margin: "34px 0 0",
- padding: 0,
- display: "flex",
- flexDirection: "column",
- gap: "14px",
- listStyle: "none",
-});
-
-const Bullet = styled("li")({
- display: "flex",
- alignItems: "center",
- gap: "12px",
- fontSize: "17px",
- fontWeight: 500,
- lineHeight: "24px",
- ...brandCopyAnimation,
- "&:nth-of-type(1)": { animationDelay: "280ms" },
- "&:nth-of-type(2)": { animationDelay: "350ms" },
- "&:nth-of-type(3)": { animationDelay: "420ms" },
-});
-
-const CheckCircle = styled("span")({
- width: "24px",
- height: "24px",
- flex: "0 0 24px",
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- borderRadius: "50%",
- backgroundColor: "rgba(255, 255, 255, 0.14)",
-});
-
-const IllustrationClip = styled("div", {
- shouldForwardProp: (prop) => prop !== "size",
-})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
- width: size === "desktop" ? "313px" : size === "tablet" ? "237px" : "175px",
- height:
- size === "desktop" ? "219px" : size === "tablet" ? "172px" : "127px",
- flexShrink: 0,
- position: "relative",
- overflow: "hidden",
- zIndex: 0,
- ...(size !== "tablet" && {
- animation: `${illustrationReveal} 500ms cubic-bezier(0.22, 1, 0.36, 1) ${size === "desktop" ? "840ms" : "130ms"} both`,
- "@media (prefers-reduced-motion: reduce)": { animation: "none" },
- }),
- ...(size === "desktop"
- ? {
- marginTop: "auto",
- alignSelf: "center",
- "@media (min-width: 1600px)": { width: "355px", height: "249px" },
- }
- : {
- position: "absolute",
- right: size === "tablet" ? "28px" : "-4px",
- // Sit clear of the content sheet, which overlaps the band's
- // bottom edge by 32px (tablet) / 28px (mobile).
- bottom: size === "tablet" ? "44px" : "38px",
- }),
- "&::after": {
- content: '""',
- width:
- size === "desktop" ? "34px" : size === "tablet" ? "26px" : "20px",
- aspectRatio: "1",
- position: "absolute",
- left: "67%",
- top: size === "desktop" ? "59%" : "57%",
- zIndex: 1,
- pointerEvents: "none",
- backgroundColor: "#fff",
- clipPath:
- "polygon(50% 0%, 59% 39%, 100% 50%, 59% 61%, 50% 100%, 41% 61%, 0% 50%, 41% 39%)",
- filter: "drop-shadow(0 0 7px rgba(255, 245, 168, 0.95))",
- animation: `${cameraSparkle} 520ms ease-out ${size === "desktop" ? "1400ms" : size === "tablet" ? "740ms" : "690ms"} both`,
- "@media (prefers-reduced-motion: reduce)": { display: "none" },
- },
- "& > img": {
- display: "block",
- width: "473.694px",
- height: "370px",
- transformOrigin: "top left",
- transform:
- size === "desktop"
- ? "scale(0.66)"
- : size === "tablet"
- ? "scale(0.5)"
- : "scale(0.37)",
- ...(size === "desktop" && {
- "@media (min-width: 1600px)": { transform: "scale(0.75)" },
- }),
- },
-}));
diff --git a/web/apps/locker/src/components/auth/AuthDialog.tsx b/web/apps/locker/src/components/auth/AuthDialog.tsx
deleted file mode 100644
index 8b3c1ebbaa..0000000000
--- a/web/apps/locker/src/components/auth/AuthDialog.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-import {
- Dialog,
- GlobalStyles,
- Slide,
- styled,
- type ModalProps,
-} from "@mui/material";
-import type { TransitionProps } from "@mui/material/transitions";
-import React, { forwardRef } from "react";
-import {
- authBodyTypography,
- authColorVariables,
- authDisplayFontFamily,
- authMobileMediaQuery,
-} from "./styles";
-
-interface AuthDialogProps extends React.PropsWithChildren {
- open: boolean;
- onClose: ModalProps["onClose"];
- ariaLabelledby?: string;
-}
-
-const SlideUpTransition = forwardRef(function SlideUpTransition(
- props: TransitionProps & { children: React.ReactElement },
- ref: React.Ref<unknown>,
-) {
- return <Slide direction="up" ref={ref} {...props} />;
-});
-
-export const AuthDialog: React.FC<AuthDialogProps> = ({
- open,
- onClose,
- ariaLabelledby,
- children,
-}) => (
- <DialogRoot
- open={open}
- onClose={onClose}
- slots={{ transition: SlideUpTransition }}
- slotProps={{
- backdrop: { sx: { backgroundColor: "rgba(0, 0, 0, 0.4)" } },
- }}
- maxWidth={false}
- aria-labelledby={ariaLabelledby}
- >
- <GlobalStyles styles={authColorVariables} />
- <SheetHandle />
- {children}
- </DialogRoot>
-);
-
-export const AuthDialogHeader = styled("div")({
- display: "flex",
- flexDirection: "column",
- gap: "6px",
-});
-
-export const AuthDialogTitle = styled("h2")({
- margin: 0,
- fontFamily: authDisplayFontFamily,
- fontSize: "22px",
- fontWeight: 600,
- lineHeight: "30px",
- color: "var(--locker-auth-text)",
- [authMobileMediaQuery]: { fontSize: "20px", lineHeight: "28px" },
-});
-
-export const AuthDialogText = styled("p")({
- ...authBodyTypography,
- margin: 0,
- color: "var(--locker-auth-text-muted)",
- textWrap: "pretty",
-});
-
-const DialogRoot = styled(Dialog)(({ theme }) => ({
- "& .MuiDialog-paper": {
- width: "456px",
- maxWidth: "calc(100% - 32px)",
- margin: "16px",
- padding: "32px",
- boxSizing: "border-box",
- borderRadius: "24px",
- backgroundColor: "#fff",
- backgroundImage: "none",
- boxShadow: "0 4px 16px rgba(0, 0, 0, 0.14)",
- ...theme.applyStyles("dark", { backgroundColor: "#252525" }),
- },
- [authMobileMediaQuery]: {
- "& .MuiDialog-container": { alignItems: "flex-end" },
- "& .MuiDialog-paper": {
- width: "100%",
- maxWidth: "100%",
- margin: 0,
- padding: "12px 24px 28px",
- borderRadius: "24px 24px 0 0",
- },
- },
-}));
-
-const SheetHandle = styled("div")({
- display: "none",
- [authMobileMediaQuery]: {
- display: "block",
- width: "36px",
- height: "4px",
- flexShrink: 0,
- margin: "0 auto 20px",
- borderRadius: "999px",
- backgroundColor: "var(--locker-auth-fill-active)",
- },
-});
diff --git a/web/apps/locker/src/components/auth/Button.tsx b/web/apps/locker/src/components/auth/Button.tsx
deleted file mode 100644
index 0c92a896a9..0000000000
--- a/web/apps/locker/src/components/auth/Button.tsx
+++ /dev/null
@@ -1,144 +0,0 @@
-import { CircularProgress, styled } from "@mui/material";
-import type React from "react";
-import {
- authBodyTypography,
- authFocusRing,
- authTransientProps,
-} from "./styles";
-
-export type ButtonVariant = "primary" | "secondary";
-
-export interface ButtonProps extends Omit<
- React.ButtonHTMLAttributes<HTMLButtonElement>,
- "color" | "children"
-> {
- variant?: ButtonVariant;
- fullWidth?: boolean;
- loading?: boolean;
- loadingMessage?: React.ReactNode;
- children: React.ReactNode;
-}
-
-export function Button({
- variant = "primary",
- fullWidth = false,
- loading = false,
- loadingMessage,
- disabled,
- type = "button",
- children,
- ...buttonProps
-}: ButtonProps): React.JSX.Element {
- return (
- <ButtonRoot
- type={type}
- disabled={disabled || loading}
- aria-busy={loading || undefined}
- $variant={variant}
- $fullWidth={fullWidth}
- $loading={loading}
- {...buttonProps}
- >
- {loading && loadingMessage ? (
- <LoadingContent>
- <CircularProgress size={20} color="inherit" />
- <span>{loadingMessage}</span>
- </LoadingContent>
- ) : (
- <>
- <ButtonLabel $loading={loading}>{children}</ButtonLabel>
- {loading && <CircularProgress size={20} color="inherit" />}
- </>
- )}
- </ButtonRoot>
- );
-}
-
-interface ButtonRootProps {
- $variant: ButtonVariant;
- $fullWidth: boolean;
- $loading: boolean;
-}
-
-const ButtonRoot = styled(
- "button",
- authTransientProps,
-)<ButtonRootProps>(({ $variant, $fullWidth, $loading }) => ({
- ...authBodyTypography,
- width: $fullWidth ? "100%" : "auto",
- height: "52px",
- padding: "14px 24px",
- border: 0,
- borderRadius: "20px",
- display: "inline-flex",
- alignItems: "center",
- justifyContent: "center",
- position: "relative",
- boxSizing: "border-box",
- fontFamily: "inherit",
- color: $variant === "primary" ? "#fff" : "var(--locker-auth-text)",
- backgroundColor:
- $variant === "primary"
- ? "var(--locker-auth-primary)"
- : "var(--locker-auth-button-secondary)",
- boxShadow:
- $variant === "primary"
- ? "inset 0 0 0 1px var(--locker-auth-button-primary-stroke)"
- : "inset 0 0 0 1px var(--locker-auth-button-secondary-stroke)",
- cursor: $loading ? "default" : "pointer",
- transition:
- "background-color 160ms ease, box-shadow 160ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1)",
- "&:hover:not(:disabled)": {
- backgroundColor:
- $variant === "primary"
- ? "var(--locker-auth-primary-hover)"
- : "var(--locker-auth-button-secondary-hover)",
- boxShadow:
- $variant === "primary"
- ? "inset 0 0 0 1px var(--locker-auth-button-primary-stroke-hover)"
- : "inset 0 0 0 1px var(--locker-auth-button-secondary-stroke-hover)",
- transform: "translateY(-2px)",
- },
- "&:active:not(:disabled)": {
- backgroundColor:
- $variant === "primary"
- ? "var(--locker-auth-primary-active)"
- : "var(--locker-auth-button-secondary-active)",
- boxShadow:
- $variant === "primary"
- ? "inset 0 0 0 1px var(--locker-auth-button-primary-stroke-active)"
- : "inset 0 0 0 1px var(--locker-auth-button-secondary-stroke-active)",
- transform: "translateY(0) scale(0.985)",
- },
- "&:focus-visible": authFocusRing,
- "&:disabled": $loading
- ? { cursor: "default" }
- : {
- color: "var(--locker-auth-text-disabled)",
- backgroundColor: "var(--locker-auth-fill-hover)",
- boxShadow: "none",
- cursor: "not-allowed",
- },
- "& > .MuiCircularProgress-root": { position: "absolute" },
- "@media (prefers-reduced-motion: reduce)": {
- transition: "background-color 120ms ease",
- "&:hover:not(:disabled), &:active:not(:disabled)": {
- transform: "none",
- },
- },
-}));
-
-const ButtonLabel = styled(
- "span",
- authTransientProps,
-)<{ $loading: boolean }>(({ $loading }) => ({ opacity: $loading ? 0 : 1 }));
-
-const LoadingContent = styled("span")({
- minWidth: 0,
- display: "inline-flex",
- alignItems: "center",
- justifyContent: "center",
- gap: "8px",
- whiteSpace: "nowrap",
- "& > .MuiCircularProgress-root": { flexShrink: 0 },
-});
diff --git a/web/apps/locker/src/components/auth/Checkbox.tsx b/web/apps/locker/src/components/auth/Checkbox.tsx
deleted file mode 100644
index 9eb340bb40..0000000000
--- a/web/apps/locker/src/components/auth/Checkbox.tsx
+++ /dev/null
@@ -1,105 +0,0 @@
-import { Tick02Icon } from "@hugeicons/core-free-icons";
-import { HugeiconsIcon } from "@hugeicons/react";
-import { styled } from "@mui/material";
-import type React from "react";
-import {
- authBodyTypography,
- authFocusRing,
- authTransientProps,
-} from "./styles";
-
-export interface CheckboxProps extends Omit<
- React.InputHTMLAttributes<HTMLInputElement>,
- "checked" | "children" | "onChange" | "type"
-> {
- checked: boolean;
- onChange: (checked: boolean) => void;
- label?: React.ReactNode;
-}
-
-export function Checkbox({
- checked,
- onChange,
- disabled,
- label,
- ...inputProps
-}: CheckboxProps): React.JSX.Element {
- function handleChange(event: React.ChangeEvent<HTMLInputElement>) {
- onChange(event.target.checked);
- }
-
- return (
- <CheckboxRoot $disabled={Boolean(disabled)}>
- <CheckboxInput
- type="checkbox"
- checked={checked}
- onChange={handleChange}
- disabled={disabled}
- {...inputProps}
- />
- <CheckboxMark aria-hidden="true">
- {checked && (
- <HugeiconsIcon
- icon={Tick02Icon}
- size={11}
- strokeWidth={3}
- />
- )}
- </CheckboxMark>
- {label && <CheckboxLabelText>{label}</CheckboxLabelText>}
- </CheckboxRoot>
- );
-}
-
-const CheckboxRoot = styled(
- "label",
- authTransientProps,
-)<{ $disabled: boolean }>(({ $disabled }) => ({
- display: "inline-flex",
- alignItems: "flex-start",
- gap: "8px",
- position: "relative",
- cursor: $disabled ? "not-allowed" : "pointer",
-}));
-
-const CheckboxInput = styled("input")({
- width: "1px",
- height: "1px",
- margin: 0,
- padding: 0,
- position: "absolute",
- overflow: "hidden",
- clip: "rect(0 0 0 0)",
- clipPath: "inset(50%)",
- whiteSpace: "nowrap",
-});
-
-const CheckboxMark = styled("span")({
- width: "16px",
- height: "16px",
- flex: "0 0 16px",
- marginTop: "2px",
- borderRadius: "4px",
- display: "inline-flex",
- alignItems: "center",
- justifyContent: "center",
- boxSizing: "border-box",
- color: "#fff",
- backgroundColor: "var(--locker-auth-primary)",
- "input:disabled + &": {
- backgroundColor: "var(--locker-auth-text-disabled)",
- },
- "input:not(:checked) + &": {
- backgroundColor: "transparent",
- boxShadow: "inset 0 0 0 1px var(--locker-auth-text-faint)",
- },
- "input:not(:checked):disabled + &": {
- boxShadow: "inset 0 0 0 1px var(--locker-auth-text-disabled)",
- },
- "input:focus-visible + &": authFocusRing,
-});
-
-const CheckboxLabelText = styled("span")({
- ...authBodyTypography,
- color: "var(--locker-auth-text)",
-});
diff --git a/web/apps/locker/src/components/auth/CredentialsForm.tsx b/web/apps/locker/src/components/auth/CredentialsForm.tsx
deleted file mode 100644
index b241e0307b..0000000000
--- a/web/apps/locker/src/components/auth/CredentialsForm.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-import { styled } from "@mui/material";
-import type { VerifyMasterPasswordPresentationProps } from "ente-accounts/components/VerifyMasterPasswordForm";
-import type { CredentialsPresentationProps } from "ente-accounts/pages/credentials";
-import { t } from "i18next";
-import type React from "react";
-import { Trans } from "react-i18next";
-import { Button } from "./Button";
-import { Form } from "./Form";
-import { FormFields } from "./FormFields";
-import { FormFooter } from "./FormFooter";
-import { ScreenHeader } from "./ScreenHeader";
-import { TextField } from "./TextField";
-import { TextLink } from "./TextLink";
-
-export function CredentialsForm({
- userEmail,
- host,
- passwordForm,
- onRecover,
- onChangeEmail,
-}: CredentialsPresentationProps): React.JSX.Element {
- return (
- <>
- <ScreenHeader
- title={t("enter_password")}
- subtitle={
- <Trans
- i18nKey="auth_signing_in_as"
- components={{ a: <Email /> }}
- values={{ email: userEmail }}
- />
- }
- />
- {passwordForm}
- <FormFooter>
- <FooterLinks>
- <TextLink onClick={onRecover}>
- {t("forgot_password")}
- </TextLink>
- <TextLink onClick={onChangeEmail}>
- {t("change_email")}
- </TextLink>
- </FooterLinks>
- <Host>{host ?? ""}</Host>
- </FormFooter>
- </>
- );
-}
-
-export function PasswordForm({
- userEmail,
- password,
- passwordError,
- isSubmitting,
- submitButtonTitle,
- onPasswordChange,
- onSubmit,
-}: VerifyMasterPasswordPresentationProps): React.JSX.Element {
- return (
- <Form onSubmit={onSubmit}>
- <HiddenEmail
- name="email"
- type="email"
- autoComplete="username"
- value={userEmail}
- readOnly
- tabIndex={-1}
- />
- <FormFields>
- <TextField
- name="password"
- value={password}
- onChange={onPasswordChange}
- type="password"
- autoComplete="current-password"
- label={t("password")}
- showPasswordToggle
- autoFocus
- disabled={isSubmitting}
- error={Boolean(passwordError)}
- helperText={passwordError}
- />
- </FormFields>
- <FormFooter>
- <Button fullWidth type="submit" loading={isSubmitting}>
- {submitButtonTitle}
- </Button>
- </FormFooter>
- </Form>
- );
-}
-
-const HiddenEmail = styled("input")({ display: "none" });
-
-const Email = styled("strong")({
- color: "var(--locker-auth-text)",
- wordBreak: "break-word",
-});
-
-const FooterLinks = styled("div")({
- display: "flex",
- justifyContent: "space-between",
- gap: "16px",
-});
-
-const Host = styled("div")({
- minHeight: "16px",
- textAlign: "center",
- fontSize: "12px",
- fontWeight: 500,
- lineHeight: "16px",
- color: "var(--locker-auth-text-faint)",
-});
diff --git a/web/apps/locker/src/components/auth/Form.tsx b/web/apps/locker/src/components/auth/Form.tsx
deleted file mode 100644
index bf9395fefb..0000000000
--- a/web/apps/locker/src/components/auth/Form.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { styled } from "@mui/material";
-import type React from "react";
-import { authMobileMediaQuery } from "./styles";
-
-export interface FormProps extends React.FormHTMLAttributes<HTMLFormElement> {
- children: React.ReactNode;
-}
-
-export function Form({ children, ...formProps }: FormProps): React.JSX.Element {
- return <FormRoot {...formProps}>{children}</FormRoot>;
-}
-
-const FormRoot = styled("form")({
- width: "100%",
- minHeight: "min-content",
- display: "flex",
- flexDirection: "column",
- gap: "24px",
- [authMobileMediaQuery]: { flex: 1 },
-});
diff --git a/web/apps/locker/src/components/auth/FormFields.tsx b/web/apps/locker/src/components/auth/FormFields.tsx
deleted file mode 100644
index 46651d2b1a..0000000000
--- a/web/apps/locker/src/components/auth/FormFields.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { styled } from "@mui/material";
-import type React from "react";
-
-export function FormFields({
- children,
-}: React.PropsWithChildren): React.JSX.Element {
- return <FormFieldsRoot>{children}</FormFieldsRoot>;
-}
-
-const FormFieldsRoot = styled("div")({
- "--locker-auth-message-gap": "16px",
- width: "100%",
- display: "flex",
- flexDirection: "column",
- gap: "16px",
-});
diff --git a/web/apps/locker/src/components/auth/FormFooter.tsx b/web/apps/locker/src/components/auth/FormFooter.tsx
deleted file mode 100644
index f59919ed4d..0000000000
--- a/web/apps/locker/src/components/auth/FormFooter.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { styled } from "@mui/material";
-import type React from "react";
-import { authMobileMediaQuery } from "./styles";
-
-export function FormFooter({
- children,
-}: React.PropsWithChildren): React.JSX.Element {
- return <FormFooterRoot>{children}</FormFooterRoot>;
-}
-
-const FormFooterRoot = styled("div")({
- width: "100%",
- display: "flex",
- flexDirection: "column",
- gap: "16px",
- [authMobileMediaQuery]: { marginTop: "auto" },
-});
diff --git a/web/apps/locker/src/components/auth/LoginForm.tsx b/web/apps/locker/src/components/auth/LoginForm.tsx
deleted file mode 100644
index 618d21a67c..0000000000
--- a/web/apps/locker/src/components/auth/LoginForm.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { Input, styled } from "@mui/material";
-import type { LoginPresentationProps } from "ente-accounts/components/LoginContents";
-import { t } from "i18next";
-import type React from "react";
-import { Button } from "./Button";
-import { Form } from "./Form";
-import { FormFields } from "./FormFields";
-import { FormFooter } from "./FormFooter";
-import { ScreenHeader } from "./ScreenHeader";
-import { TextField } from "./TextField";
-import { TextLink } from "./TextLink";
-
-export function LoginForm({
- email,
- emailError,
- host,
- isSubmitting,
- isJoinAlbumContext,
- isEnsu,
- onEmailChange,
- onSubmit,
- onSignUp,
- onCancel,
-}: LoginPresentationProps): React.JSX.Element {
- return (
- <>
- <ScreenHeader
- title={
- isJoinAlbumContext
- ? t("login_to_join_album")
- : t("auth_welcome_back")
- }
- subtitle={t("auth_login_subtitle")}
- />
- <Form onSubmit={onSubmit}>
- <FormFields>
- <TextField
- name="email"
- value={email}
- onChange={onEmailChange}
- type="email"
- autoComplete="username"
- label={t("auth_email_label")}
- placeholder={t("auth_email_placeholder")}
- autoFocus
- disabled={isSubmitting}
- error={Boolean(emailError)}
- helperText={emailError}
- />
- <Input
- sx={{ display: "none" }}
- type="password"
- value=""
- readOnly
- />
- </FormFields>
- <FormFooter>
- <Button fullWidth type="submit" loading={isSubmitting}>
- {t("login")}
- </Button>
- <AccountActions>
- {isEnsu ? (
- <TextLink onClick={onCancel}>
- {t("cancel")}
- </TextLink>
- ) : (
- <AccountPrompt>
- <span>{t("auth_new_account_prompt")}</span>
- <TextLink regular onClick={onSignUp}>
- {t("sign_up")}
- </TextLink>
- </AccountPrompt>
- )}
- <Host>{host ?? ""}</Host>
- </AccountActions>
- </FormFooter>
- </Form>
- </>
- );
-}
-
-const AccountActions = styled("div")({
- display: "flex",
- flexDirection: "column",
- alignItems: "center",
- gap: "10px",
- textAlign: "center",
-});
-
-const AccountPrompt = styled("div")({
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- gap: "6px",
- fontSize: "14px",
- fontWeight: 500,
- lineHeight: "20px",
- color: "var(--locker-auth-text-muted)",
-});
-
-const Host = styled("div")({
- minHeight: "16px",
- fontSize: "12px",
- fontWeight: 500,
- lineHeight: "16px",
- color: "var(--locker-auth-text-faint)",
-});
diff --git a/web/apps/locker/src/components/auth/Message.tsx b/web/apps/locker/src/components/auth/Message.tsx
deleted file mode 100644
index 1f3f192d9a..0000000000
--- a/web/apps/locker/src/components/auth/Message.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-import {
- Alert02Icon,
- AlertCircleIcon,
- InformationCircleIcon,
- Tick02Icon,
-} from "@hugeicons/core-free-icons";
-import { HugeiconsIcon } from "@hugeicons/react";
-import { styled } from "@mui/material";
-import type React from "react";
-import { useEffect, useRef } from "react";
-import { authMiniTypography, authTransientProps } from "./styles";
-
-export type MessageKind = "error" | "warning" | "success" | "info";
-
-export interface MessageProps {
- children: React.ReactNode;
- kind?: MessageKind;
- note?: boolean;
- visible?: boolean;
- id?: string;
-}
-
-export function Message({
- children,
- kind = "info",
- note = false,
- visible,
- id,
-}: MessageProps): React.JSX.Element {
- const isVisible = visible ?? true;
- const lastVisibleContent = useRef({ children, kind });
- const displayedContent = isVisible
- ? { children, kind }
- : lastVisibleContent.current;
-
- useEffect(() => {
- if (isVisible) lastVisibleContent.current = { children, kind };
- }, [children, isVisible, kind]);
-
- return (
- <MessageRoot
- id={id}
- role={displayedContent.kind === "error" ? "alert" : "status"}
- aria-hidden={!isVisible || undefined}
- $kind={displayedContent.kind}
- $animated={visible !== undefined}
- $visible={isVisible}
- >
- <MessageContent $note={note}>
- <HugeiconsIcon
- icon={messageIcons[displayedContent.kind]}
- size={14}
- strokeWidth={2}
- aria-hidden="true"
- />
- <span>{displayedContent.children}</span>
- </MessageContent>
- </MessageRoot>
- );
-}
-
-const messageIcons = {
- error: AlertCircleIcon,
- warning: Alert02Icon,
- success: Tick02Icon,
- info: InformationCircleIcon,
-} as const;
-
-const MessageRoot = styled(
- "span",
- authTransientProps,
-)<{ $kind: MessageKind; $animated: boolean; $visible: boolean }>(({
- $kind,
- $animated,
- $visible,
-}) => {
- const delay = $visible ? "40ms" : "0ms";
-
- return {
- ...authMiniTypography,
- display: "inline-grid",
- gridTemplateRows: $visible ? "1fr" : "0fr",
- marginTop:
- $animated && !$visible
- ? "calc(-1 * var(--locker-auth-message-gap, 8px))"
- : 0,
- opacity: $visible ? 1 : 0,
- transform: $visible ? "translateY(0)" : "translateY(-4px)",
- visibility: $visible ? "visible" : "hidden",
- color:
- $kind === "error"
- ? "var(--locker-auth-warning)"
- : $kind === "warning"
- ? "var(--locker-auth-caution)"
- : $kind === "success"
- ? "var(--locker-auth-success)"
- : "var(--locker-auth-text-muted)",
- ...($animated && {
- overflow: "hidden",
- transition: [
- `grid-template-rows 360ms cubic-bezier(0.22, 1, 0.36, 1) ${delay}`,
- `margin-top 360ms cubic-bezier(0.22, 1, 0.36, 1) ${delay}`,
- `opacity 360ms cubic-bezier(0.22, 1, 0.36, 1) ${delay}`,
- `transform 360ms cubic-bezier(0.22, 1, 0.36, 1) ${delay}`,
- `visibility 0s linear ${$visible ? "0ms" : "360ms"}`,
- ].join(", "),
- "@media (prefers-reduced-motion: reduce)": { transition: "none" },
- }),
- };
-});
-
-const MessageContent = styled(
- "span",
- authTransientProps,
-)<{ $note: boolean }>(({ $note }) => ({
- minHeight: 0,
- display: "inline-flex",
- alignItems: $note ? "flex-start" : "center",
- gap: $note ? "8px" : "4px",
- "& > svg": { flexShrink: 0 },
-}));
diff --git a/web/apps/locker/src/components/auth/OTPField.tsx b/web/apps/locker/src/components/auth/OTPField.tsx
deleted file mode 100644
index 20befc826b..0000000000
--- a/web/apps/locker/src/components/auth/OTPField.tsx
+++ /dev/null
@@ -1,265 +0,0 @@
-import { styled } from "@mui/material";
-import { t } from "i18next";
-import type React from "react";
-import { useEffect, useRef } from "react";
-import {
- authDisplayFontFamily,
- authMiniTypography,
- authTransientProps,
-} from "./styles";
-
-export interface OTPFieldProps {
- id?: string;
- name?: string;
- label?: React.ReactNode;
- value: string;
- onChange: (value: string) => void;
- length?: number;
- error?: boolean;
- disabled?: boolean;
- autoFocus?: boolean;
- ariaLabel?: string;
- ariaDescribedBy?: string;
-}
-
-export function OTPField({
- id,
- name,
- label,
- value,
- onChange,
- length = 6,
- error = false,
- disabled = false,
- autoFocus,
- ariaLabel,
- ariaDescribedBy,
-}: OTPFieldProps): React.JSX.Element {
- const inputRefs = useRef<(HTMLInputElement | null)[]>([]);
- const wasDisabled = useRef(disabled);
- const hadError = useRef(error);
-
- useEffect(() => {
- if (autoFocus && value.length === 0) inputRefs.current[0]?.focus();
- }, [autoFocus, value]);
-
- function isInputValueValid(input: string) {
- return !isNaN(Number(input)) && input.trim().length === 1;
- }
-
- function focusInput(index: number) {
- const nextIndex = Math.max(Math.min(length - 1, index), 0);
- const input = inputRefs.current[nextIndex];
- if (input) {
- input.focus();
- input.select();
- }
- }
-
- useEffect(() => {
- const shouldRestoreFocus =
- error && !disabled && (wasDisabled.current || !hadError.current);
-
- wasDisabled.current = disabled;
- hadError.current = error;
-
- if (shouldRestoreFocus) {
- const index = Math.max(
- Math.min(value.trimEnd().length - 1, length - 1),
- 0,
- );
- const input = inputRefs.current[index];
- input?.focus();
- input?.select();
- }
- }, [disabled, error, length, value]);
-
- function updateDigit(index: number, digit: string) {
- const otp = value.padEnd(length, " ").slice(0, length).split("");
- otp[index] = digit || " ";
- onChange(otp.join(""));
- }
-
- function handleChange(
- index: number,
- event: React.ChangeEvent<HTMLInputElement>,
- ) {
- const input = event.currentTarget.value;
- if (isInputValueValid(input)) {
- updateDigit(index, input);
- focusInput(index + 1);
- }
- }
-
- function handleInput(
- index: number,
- event: React.SyntheticEvent<HTMLInputElement, InputEvent>,
- ) {
- const nativeEvent = event.nativeEvent;
- const input = event.currentTarget.value;
- if (!isInputValueValid(input)) {
- if (
- input.length === length &&
- !input.split("").some((digit) => !isInputValueValid(digit))
- ) {
- onChange(input);
- focusInput(length - 1);
- }
-
- if (
- nativeEvent.data === null &&
- nativeEvent.inputType === "deleteContentBackward"
- ) {
- event.preventDefault();
- updateDigit(index, "");
- focusInput(index - 1);
- }
-
- event.currentTarget.value = "";
- }
- }
-
- function handleKeyDown(
- index: number,
- event: React.KeyboardEvent<HTMLInputElement>,
- ) {
- const otp = value.padEnd(length, " ").slice(0, length).split("");
- if ([event.code, event.key].includes("Backspace")) {
- event.preventDefault();
- updateDigit(index, "");
- focusInput(index - 1);
- } else if (event.code === "Delete") {
- event.preventDefault();
- updateDigit(index, "");
- } else if (event.code === "ArrowLeft") {
- event.preventDefault();
- focusInput(index - 1);
- } else if (event.code === "ArrowRight") {
- event.preventDefault();
- focusInput(index + 1);
- } else if (event.code === "Spacebar" || event.code === "Space") {
- event.preventDefault();
- } else if (event.key === otp[index]) {
- event.preventDefault();
- focusInput(index + 1);
- } else if (event.code === "ArrowUp" || event.code === "ArrowDown") {
- event.preventDefault();
- }
- }
-
- function handlePaste(
- index: number,
- event: React.ClipboardEvent<HTMLInputElement>,
- ) {
- event.preventDefault();
- const otp = value.padEnd(length, " ").slice(0, length).split("");
- const pastedData = event.clipboardData
- .getData("text/plain")
- .slice(0, length - index)
- .split("");
-
- if (pastedData.some((digit) => !isInputValueValid(digit))) return;
-
- pastedData.forEach((digit, offset) => {
- otp[index + offset] = digit;
- });
-
- focusInput(index + pastedData.length);
- onChange(otp.join(""));
- }
-
- const inputAriaLabel = ariaLabel ?? t("verification_code");
-
- return (
- <OTPFieldRoot>
- {label && <OTPLabel>{label}</OTPLabel>}
- <OTPRoot $disabled={disabled}>
- {Array.from({ length }, (_, index) => (
- <OTPInput
- key={index}
- ref={(element) => {
- inputRefs.current[index] = element;
- }}
- id={index === 0 ? id : undefined}
- name={index === 0 ? name : undefined}
- type="tel"
- value={value[index]?.trim() ?? ""}
- onChange={(event) => handleChange(index, event)}
- onFocus={(event) => event.currentTarget.select()}
- onInput={(event) => handleInput(index, event)}
- onKeyDown={(event) => handleKeyDown(index, event)}
- onPaste={(event) => handlePaste(index, event)}
- disabled={disabled}
- autoFocus={autoFocus && index === 0}
- inputMode="numeric"
- pattern="[0-9]*"
- autoComplete={index === 0 ? "one-time-code" : "off"}
- aria-label={`${inputAriaLabel} ${index + 1}`}
- aria-describedby={ariaDescribedBy}
- aria-invalid={error || undefined}
- $error={error}
- />
- ))}
- </OTPRoot>
- </OTPFieldRoot>
- );
-}
-
-const OTPFieldRoot = styled("div")({
- width: "100%",
- display: "flex",
- flexDirection: "column",
- gap: "16px",
- "&:focus-within > span": { color: "var(--locker-auth-text)" },
-});
-
-const OTPLabel = styled("span")({
- ...authMiniTypography,
- color: "var(--locker-auth-text-muted)",
- transition: "color 100ms ease-in",
- "@media (prefers-reduced-motion: reduce)": { transition: "none" },
-});
-
-const OTPRoot = styled(
- "div",
- authTransientProps,
-)<{ $disabled: boolean }>(({ $disabled }) => ({
- width: "100%",
- display: "flex",
- gap: "8px",
- position: "relative",
- containerType: "inline-size",
- cursor: $disabled ? "not-allowed" : "text",
-}));
-
-const OTPInput = styled(
- "input",
- authTransientProps,
-)<{ $error: boolean }>(({ $error }) => ({
- aspectRatio: "44 / 52",
- minWidth: 0,
- flex: "1 1 0",
- padding: 0,
- border: 0,
- borderRadius: "16px",
- boxSizing: "border-box",
- fontFamily: authDisplayFontFamily,
- fontSize: "clamp(20px, 6.6cqi, 30px)",
- fontWeight: 600,
- lineHeight: 1,
- textAlign: "center",
- color: "var(--locker-auth-text)",
- backgroundColor: "var(--locker-auth-field)",
- boxShadow: `inset 0 0 0 1px ${
- $error ? "var(--locker-auth-warning)" : "var(--locker-auth-stroke)"
- }`,
- outline: 0,
- cursor: "text",
- transition: "box-shadow 0.2s ease",
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${
- $error ? "var(--locker-auth-warning)" : "var(--locker-auth-primary)"
- }`,
- },
- "&:disabled": { cursor: "not-allowed" },
-}));
diff --git a/web/apps/locker/src/components/auth/PasswordStrengthMessage.tsx b/web/apps/locker/src/components/auth/PasswordStrengthMessage.tsx
deleted file mode 100644
index c4eb537f5e..0000000000
--- a/web/apps/locker/src/components/auth/PasswordStrengthMessage.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { PasswordStrength } from "ente-accounts/utils/password";
-import { t } from "i18next";
-import type React from "react";
-import { Message, type MessageKind } from "./Message";
-
-interface PasswordStrengthMessageProps {
- strength?: PasswordStrength;
- visible: boolean;
-}
-
-export function PasswordStrengthMessage({
- strength,
- visible,
-}: PasswordStrengthMessageProps): React.JSX.Element {
- const displayedStrength = strength ?? "weak";
-
- const kind: MessageKind =
- displayedStrength === "weak"
- ? "error"
- : displayedStrength === "moderate"
- ? "warning"
- : "success";
-
- return (
- <Message kind={kind} visible={visible}>
- {t("password_strength", { context: displayedStrength })}
- </Message>
- );
-}
diff --git a/web/apps/locker/src/components/auth/RecoveryForm.tsx b/web/apps/locker/src/components/auth/RecoveryForm.tsx
deleted file mode 100644
index a28b6526ae..0000000000
--- a/web/apps/locker/src/components/auth/RecoveryForm.tsx
+++ /dev/null
@@ -1,177 +0,0 @@
-import { styled } from "@mui/material";
-import type { RecoverAccountPresentationProps } from "ente-accounts/pages/recover";
-import type { TwoFactorRecoverPresentationProps } from "ente-accounts/pages/two-factor/recover";
-import log from "ente-base/log";
-import { useFormik } from "formik";
-import { t } from "i18next";
-import React, { useState } from "react";
-import {
- AuthDialog,
- AuthDialogHeader,
- AuthDialogText,
- AuthDialogTitle,
-} from "./AuthDialog";
-import { Button } from "./Button";
-import { Form } from "./Form";
-import { FormFields } from "./FormFields";
-import { FormFooter } from "./FormFooter";
-import { ScreenHeader } from "./ScreenHeader";
-import { authDialogContentLayout } from "./styles";
-import { TextField } from "./TextField";
-import { TextLink } from "./TextLink";
-
-export function RecoverAccountForm(
- props: RecoverAccountPresentationProps,
-): React.JSX.Element {
- const [showNoRecoveryKey, setShowNoRecoveryKey] = useState(false);
-
- return (
- <>
- <RecoveryForm
- {...props}
- onNoRecoveryKey={() => setShowNoRecoveryKey(true)}
- title={t("recover_account")}
- subtitle={t("auth_recover_account_subtitle")}
- />
- <AuthDialog
- open={showNoRecoveryKey}
- onClose={() => setShowNoRecoveryKey(false)}
- ariaLabelledby="no-recovery-key-title"
- >
- <DialogContent>
- <AuthDialogHeader>
- <AuthDialogTitle id="no-recovery-key-title">
- {t("sorry")}
- </AuthDialogTitle>
- <AuthDialogText>
- {t("no_recovery_key_message")}
- </AuthDialogText>
- </AuthDialogHeader>
- <Button
- variant="secondary"
- fullWidth
- autoFocus
- onClick={() => setShowNoRecoveryKey(false)}
- >
- {t("ok")}
- </Button>
- </DialogContent>
- </AuthDialog>
- </>
- );
-}
-
-const DialogContent = styled("div")(authDialogContentLayout);
-
-export function RecoverTwoFactorForm(
- props: TwoFactorRecoverPresentationProps,
-): React.JSX.Element {
- return (
- <RecoveryForm
- {...props}
- title={t("recover_two_factor")}
- subtitle={t("auth_recover_two_factor_subtitle")}
- />
- );
-}
-
-interface RecoveryFormProps extends RecoverAccountPresentationProps {
- title: React.ReactNode;
- subtitle: React.ReactNode;
-}
-
-function RecoveryForm({
- title,
- subtitle,
- onSubmit,
- onNoRecoveryKey,
- onBack,
-}: RecoveryFormProps): React.JSX.Element {
- const formik = useFormik({
- initialValues: { recoveryKey: "" },
- onSubmit: async ({ recoveryKey }, { setFieldError }) => {
- function setRecoveryKeyError(message: string) {
- setFieldError("recoveryKey", message);
- }
-
- if (!recoveryKey) {
- setRecoveryKeyError(t("required"));
- return;
- }
-
- try {
- await onSubmit(recoveryKey, setRecoveryKeyError);
- } catch (error) {
- log.error("Failed to submit recovery key", error);
- setRecoveryKeyError(t("generic_error"));
- }
- },
- });
-
- function handleRecoveryKeyDown(
- event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>,
- ) {
- if (
- event.key === "Enter" &&
- !event.shiftKey &&
- !event.nativeEvent.isComposing
- ) {
- event.preventDefault();
- void formik.submitForm();
- }
- }
-
- return (
- <>
- <ScreenHeader title={title} subtitle={subtitle} />
- <Form onSubmit={formik.handleSubmit}>
- <FormFields>
- <TextField
- name="recoveryKey"
- label={t("recovery_key")}
- placeholder={t("auth_recovery_key_placeholder")}
- value={formik.values.recoveryKey}
- onChange={formik.handleChange}
- onKeyDown={handleRecoveryKeyDown}
- autoComplete="off"
- multiline
- rows={5}
- autoFocus
- disabled={formik.isSubmitting}
- error={Boolean(formik.errors.recoveryKey)}
- helperText={formik.errors.recoveryKey}
- />
- </FormFields>
- <FormFooter>
- <Button
- fullWidth
- type="submit"
- loading={formik.isSubmitting}
- >
- {t("recover")}
- </Button>
- <FooterLinks>
- <TextLink
- onClick={onNoRecoveryKey}
- disabled={formik.isSubmitting}
- >
- {t("no_recovery_key_title")}
- </TextLink>
- <TextLink
- onClick={onBack}
- disabled={formik.isSubmitting}
- >
- {t("go_back")}
- </TextLink>
- </FooterLinks>
- </FormFooter>
- </Form>
- </>
- );
-}
-
-const FooterLinks = styled("div")({
- display: "flex",
- justifyContent: "space-between",
- gap: "16px",
-});
diff --git a/web/apps/locker/src/components/auth/RecoveryKeyForm.tsx b/web/apps/locker/src/components/auth/RecoveryKeyForm.tsx
deleted file mode 100644
index 2ac1337f82..0000000000
--- a/web/apps/locker/src/components/auth/RecoveryKeyForm.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import ContentCopyIcon from "@mui/icons-material/ContentCopy";
-import DoneIcon from "@mui/icons-material/Done";
-import { CircularProgress, styled } from "@mui/material";
-import type { RecoveryKeyPresentationProps } from "ente-accounts/components/RecoveryKey";
-import { useClipboardCopy } from "ente-base/components/utils/hooks";
-import { t } from "i18next";
-import type React from "react";
-import { Button } from "./Button";
-import { FormFooter } from "./FormFooter";
-import { Message } from "./Message";
-import { ScreenHeader } from "./ScreenHeader";
-import { authFocusRing } from "./styles";
-
-export function RecoveryKeyForm({
- recoveryKey,
- onClose,
- onSave,
-}: RecoveryKeyPresentationProps): React.JSX.Element {
- const [copied, handleCopy] = useClipboardCopy(recoveryKey ?? "");
- const CopyIcon = copied ? DoneIcon : ContentCopyIcon;
-
- return (
- <>
- <ScreenHeader
- title={t("auth_recovery_key_title")}
- subtitle={t("recovery_key_description")}
- />
- <RecoveryKeyBox>
- {recoveryKey ? (
- <>
- <RecoveryKeyText>{recoveryKey}</RecoveryKeyText>
- <CopyButton
- type="button"
- onClick={handleCopy}
- aria-label={
- copied
- ? t("copied")
- : t("auth_copy_recovery_key")
- }
- >
- <CopyIcon fontSize="small" />
- </CopyButton>
- </>
- ) : (
- <CircularProgress
- size={24}
- sx={{ color: "var(--locker-auth-primary)" }}
- />
- )}
- </RecoveryKeyBox>
- <Message note>{t("key_not_stored_note")}</Message>
- <FormFooter>
- <Actions>
- <Button fullWidth variant="secondary" onClick={onClose}>
- {t("do_this_later")}
- </Button>
- <Button fullWidth onClick={onSave} disabled={!recoveryKey}>
- {t("save_key")}
- </Button>
- </Actions>
- </FormFooter>
- </>
- );
-}
-
-const RecoveryKeyBox = styled("div")({
- minHeight: "128px",
- padding: "20px",
- borderRadius: "16px",
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- position: "relative",
- boxSizing: "border-box",
- backgroundColor: "var(--locker-auth-field)",
- boxShadow: "inset 0 0 0 1px var(--locker-auth-stroke)",
-});
-
-const RecoveryKeyText = styled("p")({
- margin: 0,
- paddingRight: "28px",
- fontSize: "15px",
- fontWeight: 500,
- lineHeight: "24px",
- wordBreak: "break-word",
- color: "var(--locker-auth-text)",
-});
-
-const CopyButton = styled("button")({
- width: "32px",
- height: "32px",
- padding: 0,
- border: 0,
- borderRadius: "8px",
- display: "inline-flex",
- alignItems: "center",
- justifyContent: "center",
- position: "absolute",
- top: "12px",
- right: "12px",
- backgroundColor: "transparent",
- color: "var(--locker-auth-text-muted)",
- cursor: "pointer",
- "&:focus-visible": authFocusRing,
-});
-
-const Actions = styled("div")({ display: "flex", gap: "12px" });
diff --git a/web/apps/locker/src/components/auth/ScreenHeader.tsx b/web/apps/locker/src/components/auth/ScreenHeader.tsx
deleted file mode 100644
index a827b86203..0000000000
--- a/web/apps/locker/src/components/auth/ScreenHeader.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { styled } from "@mui/material";
-import type React from "react";
-import { authDisplayFontFamily, authMobileMediaQuery } from "./styles";
-
-export interface ScreenHeaderProps {
- title: React.ReactNode;
- subtitle?: React.ReactNode;
-}
-
-export function ScreenHeader({
- title,
- subtitle,
-}: ScreenHeaderProps): React.JSX.Element {
- return (
- <ScreenHeaderRoot>
- <ScreenTitle>{title}</ScreenTitle>
- {subtitle && <ScreenSubtitle>{subtitle}</ScreenSubtitle>}
- </ScreenHeaderRoot>
- );
-}
-
-const ScreenHeaderRoot = styled("div")({
- display: "flex",
- flexDirection: "column",
- gap: "8px",
-});
-
-const ScreenTitle = styled("h1")({
- margin: 0,
- fontFamily: authDisplayFontFamily,
- fontSize: "30px",
- fontWeight: 600,
- lineHeight: "38px",
- textWrap: "pretty",
- color: "var(--locker-auth-text)",
- [authMobileMediaQuery]: { fontSize: "26px", lineHeight: "34px" },
- "@media (min-width: 1600px)": { fontSize: "32px", lineHeight: "40px" },
-});
-
-const ScreenSubtitle = styled("p")({
- margin: 0,
- fontSize: "16px",
- fontWeight: 500,
- lineHeight: "24px",
- textWrap: "pretty",
- color: "var(--locker-auth-text-muted)",
- [authMobileMediaQuery]: { fontSize: "13px", lineHeight: "20px" },
-});
diff --git a/web/apps/locker/src/components/auth/SecondFactorChoiceDialog.tsx b/web/apps/locker/src/components/auth/SecondFactorChoiceDialog.tsx
deleted file mode 100644
index 475264a817..0000000000
--- a/web/apps/locker/src/components/auth/SecondFactorChoiceDialog.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { styled } from "@mui/material";
-import type { SecondFactorChoicePresentationProps } from "ente-accounts/components/SecondFactorChoice";
-import { t } from "i18next";
-import type React from "react";
-import {
- AuthDialog,
- AuthDialogHeader,
- AuthDialogText,
- AuthDialogTitle,
-} from "./AuthDialog";
-import { Button } from "./Button";
-import { authDialogContentLayout } from "./styles";
-
-export function SecondFactorChoiceDialog({
- open,
- onDialogClose,
- onSelect,
-}: SecondFactorChoicePresentationProps): React.JSX.Element {
- return (
- <AuthDialog
- open={open}
- onClose={onDialogClose}
- ariaLabelledby="second-factor-choice-title"
- >
- <ContentRoot>
- <AuthDialogHeader>
- <AuthDialogTitle id="second-factor-choice-title">
- {t("two_factor")}
- </AuthDialogTitle>
- <AuthDialogText>
- {t("auth_second_factor_choice_subtitle")}
- </AuthDialogText>
- </AuthDialogHeader>
- <ButtonStack>
- <Button
- variant="primary"
- fullWidth
- onClick={() => onSelect("totp")}
- >
- {t("totp_login")}
- </Button>
- <Button
- variant="secondary"
- fullWidth
- onClick={() => onSelect("passkey")}
- >
- {t("passkey_login")}
- </Button>
- </ButtonStack>
- </ContentRoot>
- </AuthDialog>
- );
-}
-
-const ContentRoot = styled("div")(authDialogContentLayout);
-
-const ButtonStack = styled("div")({
- display: "flex",
- flexDirection: "column",
- gap: "12px",
-});
diff --git a/web/apps/locker/src/components/auth/SetPasswordForm.tsx b/web/apps/locker/src/components/auth/SetPasswordForm.tsx
deleted file mode 100644
index 4c95b7968f..0000000000
--- a/web/apps/locker/src/components/auth/SetPasswordForm.tsx
+++ /dev/null
@@ -1,119 +0,0 @@
-import { styled } from "@mui/material";
-import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";
-import { t } from "i18next";
-import type React from "react";
-import { Button } from "./Button";
-import { Form } from "./Form";
-import { FormFields } from "./FormFields";
-import { FormFooter } from "./FormFooter";
-import { Message } from "./Message";
-import { PasswordStrengthMessage } from "./PasswordStrengthMessage";
-import { ScreenHeader } from "./ScreenHeader";
-import { TextField } from "./TextField";
-import { TextLink } from "./TextLink";
-
-export function SetPasswordForm({
- userEmail,
- password,
- confirmPassword,
- passwordError,
- confirmPasswordError,
- passwordStrength,
- isSubmitting,
- isSubmitDisabled,
- submitButtonTitle,
- onBack,
- onPasswordChange,
- onConfirmPasswordChange,
- onSubmit,
-}: NewPasswordPresentationProps): React.JSX.Element {
- return (
- <>
- <ScreenHeader
- title={submitButtonTitle}
- subtitle={t("auth_password_recovery_warning")}
- />
- <Form onSubmit={onSubmit}>
- <HiddenEmail
- name="email"
- type="email"
- autoComplete="username"
- value={userEmail}
- readOnly
- tabIndex={-1}
- />
- <FormFields>
- <PasswordField>
- <TextField
- name="password"
- label={t("password")}
- placeholder={t("auth_strong_password_placeholder")}
- autoComplete="new-password"
- showPasswordToggle
- value={password}
- onChange={onPasswordChange}
- error={Boolean(passwordError)}
- helperText={passwordError}
- disabled={isSubmitting}
- autoFocus
- />
- <PasswordStrengthMessage
- strength={passwordStrength}
- visible={Boolean(password)}
- />
- </PasswordField>
- <TextField
- name="confirmPassword"
- label={t("confirm_password")}
- placeholder={t("auth_repeat_password_placeholder")}
- autoComplete="new-password"
- showPasswordToggle
- value={confirmPassword}
- onChange={onConfirmPasswordChange}
- error={Boolean(confirmPasswordError)}
- helperText={confirmPasswordError}
- disabled={isSubmitting}
- />
- </FormFields>
- <FormFooter>
- <Button
- fullWidth
- type="submit"
- loading={isSubmitting}
- disabled={isSubmitDisabled}
- >
- {submitButtonTitle}
- </Button>
- {isSubmitting ? (
- <SubmittingMessage>
- <Message>{t("key_generation_in_progress")}</Message>
- </SubmittingMessage>
- ) : null}
- {onBack ? (
- <BackAction>
- <TextLink onClick={onBack} disabled={isSubmitting}>
- {t("go_back")}
- </TextLink>
- </BackAction>
- ) : null}
- </FormFooter>
- </Form>
- </>
- );
-}
-
-const HiddenEmail = styled("input")({ display: "none" });
-
-const PasswordField = styled("div")({
- "--locker-auth-message-gap": "8px",
- display: "flex",
- flexDirection: "column",
- gap: "8px",
-});
-
-const SubmittingMessage = styled("div")({
- display: "flex",
- justifyContent: "center",
-});
-
-const BackAction = styled("div")({ display: "flex", justifyContent: "center" });
diff --git a/web/apps/locker/src/components/auth/SignUpForm.tsx b/web/apps/locker/src/components/auth/SignUpForm.tsx
deleted file mode 100644
index 30b281412d..0000000000
--- a/web/apps/locker/src/components/auth/SignUpForm.tsx
+++ /dev/null
@@ -1,215 +0,0 @@
-import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
-import { styled, Tooltip } from "@mui/material";
-import type { SignUpPresentationProps } from "ente-accounts/components/SignUpContents";
-import { t } from "i18next";
-import type React from "react";
-import { Trans } from "react-i18next";
-import { Button } from "./Button";
-import { Checkbox } from "./Checkbox";
-import { Form } from "./Form";
-import { FormFields } from "./FormFields";
-import { FormFooter } from "./FormFooter";
-import { PasswordStrengthMessage } from "./PasswordStrengthMessage";
-import { ScreenHeader } from "./ScreenHeader";
-import { TextField } from "./TextField";
-import { TextLink } from "./TextLink";
-
-export function SignUpForm({
- email,
- password,
- confirmPassword,
- referral,
- acceptedTerms,
- emailError,
- passwordError,
- confirmPasswordError,
- passwordStrength,
- isSubmitting,
- isSubmitDisabled,
- isJoinAlbumContext,
- host,
- onEmailChange,
- onPasswordChange,
- onConfirmPasswordChange,
- onReferralChange,
- onAcceptedTermsChange,
- onSubmit,
- onLogin,
-}: SignUpPresentationProps): React.JSX.Element {
- return (
- <>
- <ScreenHeader
- title={
- isJoinAlbumContext
- ? t("signup_to_join_album")
- : t("auth_create_account")
- }
- subtitle={t("auth_signup_subtitle")}
- />
- <Form onSubmit={onSubmit}>
- <FormFields>
- <TextField
- name="email"
- label={t("auth_email_label")}
- placeholder={t("auth_email_placeholder")}
- type="email"
- autoComplete="username"
- value={email}
- onChange={onEmailChange}
- autoFocus
- error={Boolean(emailError)}
- helperText={emailError}
- disabled={isSubmitting}
- />
- <PasswordField>
- <TextField
- name="password"
- label={t("password")}
- placeholder={t("auth_password_placeholder")}
- autoComplete="new-password"
- showPasswordToggle
- value={password}
- onChange={onPasswordChange}
- error={Boolean(passwordError)}
- helperText={passwordError}
- disabled={isSubmitting}
- />
- <PasswordStrengthMessage
- strength={passwordStrength}
- visible={Boolean(passwordStrength)}
- />
- </PasswordField>
- <TextField
- name="confirmPassword"
- label={t("confirm_password")}
- placeholder={t("auth_confirm_password_placeholder")}
- autoComplete="new-password"
- showPasswordToggle
- value={confirmPassword}
- onChange={onConfirmPasswordChange}
- error={Boolean(confirmPasswordError)}
- helperText={confirmPasswordError}
- disabled={isSubmitting}
- />
- <TextField
- name="referral"
- label={
- <ReferralLabel>
- {t("referral_source_hint")}
- <Tooltip title={t("referral_source_info")}>
- <InfoOutlinedIcon
- fontSize="inherit"
- tabIndex={0}
- aria-label={t("referral_source_info")}
- />
- </Tooltip>
- </ReferralLabel>
- }
- placeholder={t("auth_optional")}
- value={referral}
- onChange={onReferralChange}
- disabled={isSubmitting}
- />
- </FormFields>
- <Checkbox
- name="acceptedTerms"
- checked={acceptedTerms}
- onChange={onAcceptedTermsChange}
- disabled={isSubmitting}
- label={
- <TermsText>
- <Trans
- i18nKey="terms_and_conditions"
- components={{
- a: (
- <TermsLink
- href="https://ente.com/terms"
- target="_blank"
- />
- ),
- b: (
- <TermsLink
- href="https://ente.com/privacy"
- target="_blank"
- />
- ),
- }}
- />
- </TermsText>
- }
- />
- <FormFooter>
- <Button
- fullWidth
- type="submit"
- loading={isSubmitting}
- loadingMessage={t("key_generation_in_progress")}
- disabled={isSubmitDisabled}
- >
- {t("create_account")}
- </Button>
- <AccountPrompt>
- <span>{t("auth_existing_account_prompt")}</span>
- <TextLink regular onClick={onLogin}>
- {t("login")}
- </TextLink>
- </AccountPrompt>
- {host ? <Host>{host}</Host> : null}
- </FormFooter>
- </Form>
- </>
- );
-}
-
-const PasswordField = styled("div")({
- "--locker-auth-message-gap": "8px",
- display: "flex",
- flexDirection: "column",
- gap: "8px",
-});
-
-const ReferralLabel = styled("span")({
- display: "inline-flex",
- alignItems: "center",
- gap: "4px",
- "& > svg": { fontSize: "14px" },
-});
-
-const TermsText = styled("span")({
- fontSize: "14px",
- fontWeight: 500,
- lineHeight: "20px",
- color: "var(--locker-auth-text)",
-});
-
-const TermsLink = styled("a")({
- color: "var(--locker-auth-primary)",
- textDecoration: "none",
- "&:hover": { textDecoration: "underline" },
- "&:focus-visible": {
- borderRadius: "4px",
- outline: "2px solid var(--locker-auth-primary)",
- outlineOffset: "2px",
- },
-});
-
-const AccountPrompt = styled("div")({
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- gap: "6px",
- fontSize: "14px",
- fontWeight: 500,
- lineHeight: "20px",
- textAlign: "center",
- color: "var(--locker-auth-text-muted)",
-});
-
-const Host = styled("div")({
- minHeight: "16px",
- fontSize: "12px",
- fontWeight: 500,
- lineHeight: "16px",
- textAlign: "center",
- color: "var(--locker-auth-text-faint)",
-});
diff --git a/web/apps/locker/src/components/auth/TextField.tsx b/web/apps/locker/src/components/auth/TextField.tsx
deleted file mode 100644
index ee19f9d548..0000000000
--- a/web/apps/locker/src/components/auth/TextField.tsx
+++ /dev/null
@@ -1,282 +0,0 @@
-import { ViewIcon, ViewOffSlashIcon } from "@hugeicons/core-free-icons";
-import { HugeiconsIcon } from "@hugeicons/react";
-import { styled } from "@mui/material";
-import { t } from "i18next";
-import type React from "react";
-import { useId, useState } from "react";
-import { Message } from "./Message";
-import {
- authBodyTypography,
- authFocusRing,
- authMiniTypography,
- authTransientProps,
-} from "./styles";
-
-export interface TextFieldProps {
- id?: string;
- label?: React.ReactNode;
- value: string;
- onChange: (
- event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
- ) => void;
- onKeyDown?: (
- event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>,
- ) => void;
- onBlur?: (
- event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>,
- ) => void;
- type?: React.HTMLInputTypeAttribute;
- placeholder?: string;
- required?: boolean;
- disabled?: boolean;
- error?: boolean;
- helperText?: React.ReactNode;
- autoFocus?: boolean;
- autoComplete?: string;
- name?: string;
- showPasswordToggle?: boolean;
- multiline?: boolean;
- rows?: number;
- inputMode?: React.HTMLAttributes<HTMLInputElement>["inputMode"];
- ariaLabel?: string;
- trailing?: React.ReactNode;
-}
-
-export function TextField({
- id,
- label,
- value,
- onChange,
- onKeyDown,
- onBlur,
- type = "text",
- placeholder,
- required,
- disabled,
- error,
- helperText,
- autoFocus,
- autoComplete,
- name,
- showPasswordToggle,
- multiline,
- rows = 5,
- inputMode,
- ariaLabel,
- trailing,
-}: TextFieldProps): React.JSX.Element {
- const generatedID = useId();
- const inputID = id ?? generatedID;
- const helperID = `${inputID}-helper`;
- const hasHelper = Boolean(helperText);
- const [isPasswordVisible, setIsPasswordVisible] = useState(false);
- const inputType = showPasswordToggle
- ? isPasswordVisible
- ? "text"
- : "password"
- : type;
-
- function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {
- onChange(event);
- }
-
- function handleTextAreaChange(
- event: React.ChangeEvent<HTMLTextAreaElement>,
- ) {
- onChange(event);
- }
-
- function handlePasswordToggle() {
- setIsPasswordVisible((isVisible) => !isVisible);
- }
-
- function handlePasswordToggleMouseDown(
- event: React.MouseEvent<HTMLButtonElement>,
- ) {
- event.preventDefault();
- }
-
- const sharedControlProps = {
- id: inputID,
- value,
- placeholder,
- required,
- disabled,
- autoFocus,
- autoComplete,
- name,
- onBlur,
- "aria-label": ariaLabel,
- "aria-invalid": error || undefined,
- "aria-describedby": hasHelper ? helperID : undefined,
- };
-
- return (
- <FieldRoot>
- {label && (
- <FieldLabel htmlFor={inputID}>
- {label}
- {required && (
- <RequiredMark aria-hidden="true"> *</RequiredMark>
- )}
- </FieldLabel>
- )}
- <FieldBox
- $error={Boolean(error)}
- $disabled={Boolean(disabled)}
- $multiline={Boolean(multiline)}
- >
- {multiline ? (
- <TextAreaControl
- {...sharedControlProps}
- rows={rows}
- onChange={handleTextAreaChange}
- onKeyDown={onKeyDown}
- />
- ) : (
- <TextInputControl
- {...sharedControlProps}
- type={inputType}
- inputMode={inputMode}
- onChange={handleInputChange}
- onKeyDown={onKeyDown}
- />
- )}
- {showPasswordToggle && !multiline && (
- <PasswordToggle
- type="button"
- tabIndex={-1}
- aria-label={t("show_or_hide_password")}
- aria-controls={inputID}
- aria-pressed={isPasswordVisible}
- disabled={disabled}
- onClick={handlePasswordToggle}
- onMouseDown={handlePasswordToggleMouseDown}
- >
- <HugeiconsIcon
- icon={
- isPasswordVisible ? ViewOffSlashIcon : ViewIcon
- }
- size={20}
- strokeWidth={2}
- aria-hidden="true"
- />
- </PasswordToggle>
- )}
- {trailing}
- </FieldBox>
- <Message
- id={helperID}
- kind={error ? "error" : "info"}
- visible={hasHelper}
- >
- {helperText}
- </Message>
- </FieldRoot>
- );
-}
-
-const FieldRoot = styled("div")({
- "--locker-auth-message-gap": "9px",
- width: "100%",
- display: "flex",
- flexDirection: "column",
- gap: "9px",
- "&:focus-within > label": { color: "var(--locker-auth-text)" },
-});
-
-const FieldLabel = styled("label")({
- ...authMiniTypography,
- color: "var(--locker-auth-text-muted)",
- transition: "color 100ms ease-in",
- "@media (prefers-reduced-motion: reduce)": { transition: "none" },
-});
-
-const RequiredMark = styled("span")({ color: "var(--locker-auth-warning)" });
-
-interface FieldBoxProps {
- $error: boolean;
- $disabled: boolean;
- $multiline: boolean;
-}
-
-const FieldBox = styled(
- "div",
- authTransientProps,
-)<FieldBoxProps>(({ $error, $disabled, $multiline }) => ({
- width: "100%",
- height: $multiline ? "auto" : "52px",
- minHeight: $multiline ? "112px" : undefined,
- padding: $multiline ? "16px" : "0 16px",
- borderRadius: "16px",
- display: "flex",
- alignItems: $multiline ? "flex-start" : "center",
- gap: "8px",
- boxSizing: "border-box",
- backgroundColor: $disabled
- ? "var(--locker-auth-fill-hover)"
- : "var(--locker-auth-field)",
- boxShadow: $disabled
- ? "none"
- : `inset 0 0 0 1px ${
- $error
- ? "var(--locker-auth-warning)"
- : "var(--locker-auth-stroke)"
- }`,
- "&:focus-within": $disabled
- ? undefined
- : {
- boxShadow: `inset 0 0 0 1px ${
- $error
- ? "var(--locker-auth-warning)"
- : "var(--locker-auth-primary)"
- }`,
- },
-}));
-
-const controlStyles = {
- ...authBodyTypography,
- width: "100%",
- minWidth: 0,
- flex: 1,
- padding: 0,
- border: 0,
- outline: 0,
- background: "transparent",
- fontFamily: "inherit",
- color: "var(--locker-auth-text)",
- "&::placeholder": { color: "var(--locker-auth-text-faint)", opacity: 1 },
- "&:disabled": {
- color: "var(--locker-auth-text-disabled)",
- WebkitTextFillColor: "var(--locker-auth-text-disabled)",
- cursor: "not-allowed",
- },
-};
-
-const TextInputControl = styled("input")({ ...controlStyles });
-
-const TextAreaControl = styled("textarea")({
- ...controlStyles,
- minHeight: "80px",
- resize: "none",
-});
-
-const PasswordToggle = styled("button")({
- width: "20px",
- height: "20px",
- flex: "0 0 20px",
- padding: 0,
- border: 0,
- borderRadius: "4px",
- display: "inline-flex",
- alignItems: "center",
- justifyContent: "center",
- background: "transparent",
- color: "var(--locker-auth-text-faint)",
- cursor: "pointer",
- "&:focus-visible": authFocusRing,
- "&:disabled": {
- color: "var(--locker-auth-text-disabled)",
- cursor: "not-allowed",
- },
-});
diff --git a/web/apps/locker/src/components/auth/TextLink.tsx b/web/apps/locker/src/components/auth/TextLink.tsx
deleted file mode 100644
index ba7580f1e8..0000000000
--- a/web/apps/locker/src/components/auth/TextLink.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { styled } from "@mui/material";
-import type React from "react";
-import {
- authBodyTypography,
- authFocusRing,
- authTransientProps,
-} from "./styles";
-
-export interface TextLinkProps extends Omit<
- React.ButtonHTMLAttributes<HTMLButtonElement>,
- "color" | "children"
-> {
- regular?: boolean;
- children: React.ReactNode;
-}
-
-export function TextLink({
- regular = false,
- type = "button",
- children,
- ...buttonProps
-}: TextLinkProps): React.JSX.Element {
- return (
- <TextLinkRoot type={type} $regular={regular} {...buttonProps}>
- {children}
- </TextLinkRoot>
- );
-}
-
-const TextLinkRoot = styled(
- "button",
- authTransientProps,
-)<{ $regular: boolean }>(({ $regular }) => ({
- ...authBodyTypography,
- display: "inline-flex",
- alignItems: "center",
- gap: "4px",
- padding: 0,
- border: 0,
- background: "transparent",
- fontFamily: "inherit",
- fontWeight: $regular ? 500 : 600,
- color: "var(--locker-auth-primary)",
- textDecoration: "none",
- cursor: "pointer",
- "&:hover:not(:disabled)": {
- textDecoration: "underline",
- textUnderlineOffset: "3px",
- },
- "&:focus-visible": { ...authFocusRing, borderRadius: "4px" },
- "&:disabled": {
- color: "var(--locker-auth-text-disabled)",
- cursor: "not-allowed",
- },
-}));
diff --git a/web/apps/locker/src/components/auth/TwoFactorForm.tsx b/web/apps/locker/src/components/auth/TwoFactorForm.tsx
deleted file mode 100644
index caec794e12..0000000000
--- a/web/apps/locker/src/components/auth/TwoFactorForm.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import { styled } from "@mui/material";
-import type { TwoFactorVerifyPresentationProps } from "ente-accounts/pages/two-factor/verify";
-import { isHTTP401Error } from "ente-base/http";
-import log from "ente-base/log";
-import { useFormik } from "formik";
-import { t } from "i18next";
-import type React from "react";
-import { Button } from "./Button";
-import { Form } from "./Form";
-import { FormFields } from "./FormFields";
-import { FormFooter } from "./FormFooter";
-import { Message } from "./Message";
-import { OTPField } from "./OTPField";
-import { ScreenHeader } from "./ScreenHeader";
-import { TextLink } from "./TextLink";
-
-const completeCodePattern = /^\d{6}$/;
-
-export function TwoFactorForm({
- onSubmit,
- onRecover,
- onChangeEmail,
-}: TwoFactorVerifyPresentationProps): React.JSX.Element {
- const formik = useFormik({
- initialValues: { otp: "" },
- validateOnBlur: false,
- validateOnChange: false,
- onSubmit: async ({ otp }, { setFieldError, resetForm }) => {
- if (!completeCodePattern.test(otp)) {
- setFieldError("otp", t("required"));
- return;
- }
-
- try {
- await onSubmit(otp);
- resetForm();
- } catch (error) {
- log.error("Failed to submit 2FA code", error);
- resetForm();
- setFieldError(
- "otp",
- isHTTP401Error(error)
- ? t("incorrect_code")
- : t("generic_error"),
- );
- }
- },
- });
-
- function handleCodeChange(otp: string) {
- const shouldAutoSubmit =
- !completeCodePattern.test(formik.values.otp) &&
- completeCodePattern.test(otp);
-
- void formik.setFieldValue("otp", otp).then(() => {
- if (shouldAutoSubmit && !formik.isSubmitting) {
- void formik.submitForm();
- }
- });
- }
-
- return (
- <>
- <ScreenHeader
- title={t("two_factor")}
- subtitle={t("enter_two_factor_otp")}
- />
- <Form onSubmit={formik.handleSubmit}>
- <FormFields>
- <OTPField
- name="otp"
- value={formik.values.otp}
- onChange={handleCodeChange}
- error={Boolean(formik.errors.otp)}
- disabled={formik.isSubmitting}
- autoFocus
- />
- <Message kind="error" visible={Boolean(formik.errors.otp)}>
- {formik.errors.otp}
- </Message>
- </FormFields>
- <FormFooter>
- <Button
- fullWidth
- type="submit"
- loading={formik.isSubmitting}
- disabled={!completeCodePattern.test(formik.values.otp)}
- >
- {t("verify")}
- </Button>
- <FooterLinks>
- <TextLink
- onClick={onRecover}
- disabled={formik.isSubmitting}
- >
- {t("lost_2fa_device")}
- </TextLink>
- <TextLink
- onClick={onChangeEmail}
- disabled={formik.isSubmitting}
- >
- {t("change_email")}
- </TextLink>
- </FooterLinks>
- </FormFooter>
- </Form>
- </>
- );
-}
-
-const FooterLinks = styled("div")({
- display: "flex",
- justifyContent: "space-between",
- gap: "16px",
-});
diff --git a/web/apps/locker/src/components/auth/VerifyEmailForm.tsx b/web/apps/locker/src/components/auth/VerifyEmailForm.tsx
deleted file mode 100644
index 5fb12046fa..0000000000
--- a/web/apps/locker/src/components/auth/VerifyEmailForm.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-import { styled } from "@mui/material";
-import type { VerifyEmailPresentationProps } from "ente-accounts/pages/verify";
-import log from "ente-base/log";
-import { useFormik } from "formik";
-import { t } from "i18next";
-import type React from "react";
-import { Trans } from "react-i18next";
-import { Button } from "./Button";
-import { Form } from "./Form";
-import { FormFields } from "./FormFields";
-import { FormFooter } from "./FormFooter";
-import { Message } from "./Message";
-import { OTPField } from "./OTPField";
-import { ScreenHeader } from "./ScreenHeader";
-import { TextLink } from "./TextLink";
-
-const completeCodePattern = /^\d{6}$/;
-
-export function VerifyEmailForm({
- email,
- resend,
- onSubmit,
- onResend,
- onChangeEmail,
-}: VerifyEmailPresentationProps): React.JSX.Element {
- const formik = useFormik({
- initialValues: { code: "" },
- onSubmit: async ({ code }, { setFieldError }) => {
- function setCodeError(message: string) {
- setFieldError("code", message);
- }
-
- if (!completeCodePattern.test(code)) {
- setCodeError(t("required"));
- return;
- }
-
- try {
- await onSubmit(code, setCodeError);
- } catch (error) {
- log.error("Failed to submit email verification code", error);
- setCodeError(t("generic_error"));
- }
- },
- });
-
- function handleCodeChange(code: string) {
- const shouldAutoSubmit =
- !completeCodePattern.test(formik.values.code) &&
- completeCodePattern.test(code);
-
- void formik.setFieldValue("code", code).then(() => {
- if (shouldAutoSubmit && !formik.isSubmitting) {
- void formik.submitForm();
- }
- });
- }
-
- const resendLabel =
- resend === "sending"
- ? t("status_sending")
- : resend === "sent"
- ? t("status_sent")
- : t("resend_code");
-
- return (
- <>
- <ScreenHeader
- title={t("auth_check_inbox")}
- subtitle={
- <Trans
- i18nKey="auth_verification_code_sent_to"
- components={{ a: <Email /> }}
- values={{ email }}
- />
- }
- />
- <Form onSubmit={formik.handleSubmit}>
- <FormFields>
- <OTPField
- name="code"
- label={t("verification_code")}
- value={formik.values.code}
- onChange={handleCodeChange}
- error={Boolean(formik.errors.code)}
- disabled={formik.isSubmitting}
- autoFocus
- />
- <Message kind="error" visible={Boolean(formik.errors.code)}>
- {formik.errors.code}
- </Message>
- </FormFields>
- <FormFooter>
- <Button
- fullWidth
- type="submit"
- loading={formik.isSubmitting}
- >
- {t("verify")}
- </Button>
- <FooterLinks>
- <TextLink
- onClick={onResend}
- disabled={resend !== "enable"}
- >
- {resendLabel}
- </TextLink>
- <TextLink onClick={onChangeEmail}>
- {t("change_email")}
- </TextLink>
- </FooterLinks>
- </FormFooter>
- </Form>
- </>
- );
-}
-
-const Email = styled("strong")({
- color: "var(--locker-auth-text)",
- wordBreak: "break-word",
-});
-
-const FooterLinks = styled("div")({
- display: "flex",
- justifyContent: "space-between",
- gap: "16px",
-});
diff --git a/web/apps/locker/src/components/auth/styles.ts b/web/apps/locker/src/components/auth/styles.ts
deleted file mode 100644
index 374f179296..0000000000
--- a/web/apps/locker/src/components/auth/styles.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-export const authColorVariables = {
- ":where(:root)": {
- "--locker-auth-primary": "#1071ff",
- "--locker-auth-primary-hover": "#0056cc",
- "--locker-auth-primary-active": "#004db8",
- "--locker-auth-success": "#069d1e",
- "--locker-auth-warning": "#f63a3a",
- "--locker-auth-caution": "#f08a1e",
- "--locker-auth-text": "#000",
- "--locker-auth-text-muted": "#666",
- "--locker-auth-text-faint": "#969696",
- "--locker-auth-text-disabled": "#d6d6d6",
- "--locker-auth-field": "#fff",
- "--locker-auth-fill": "#eaeaea",
- "--locker-auth-fill-hover": "#dedede",
- "--locker-auth-fill-active": "#d2d2d2",
- "--locker-auth-stroke": "#e0e0e0",
- "--locker-auth-button-secondary": "#eaeaea",
- "--locker-auth-button-secondary-hover": "#dedede",
- "--locker-auth-button-secondary-active": "#d2d2d2",
- "--locker-auth-button-secondary-stroke": "transparent",
- "--locker-auth-button-secondary-stroke-hover": "transparent",
- "--locker-auth-button-secondary-stroke-active": "transparent",
- "--locker-auth-button-primary-stroke": "rgba(255, 255, 255, 0.14)",
- "--locker-auth-button-primary-stroke-hover":
- "rgba(255, 255, 255, 0.32)",
- "--locker-auth-button-primary-stroke-active":
- "rgba(255, 255, 255, 0.2)",
- },
- "*:where(.dark)": {
- "--locker-auth-success": "#08c225",
- "--locker-auth-text": "#fff",
- "--locker-auth-text-muted": "#999",
- "--locker-auth-text-disabled": "#4d4d4d",
- "--locker-auth-field": "#1a1a1a",
- "--locker-auth-fill": "#0a0a0a",
- "--locker-auth-fill-hover": "#1a1a1a",
- "--locker-auth-fill-active": "#292929",
- "--locker-auth-stroke": "#3e3e3e",
- "--locker-auth-button-secondary": "#1e1e1e",
- "--locker-auth-button-secondary-hover": "#1a1a1a",
- "--locker-auth-button-secondary-active": "#161616",
- "--locker-auth-button-secondary-stroke": "rgba(255, 255, 255, 0.07)",
- "--locker-auth-button-secondary-stroke-hover":
- "rgba(255, 255, 255, 0.18)",
- "--locker-auth-button-secondary-stroke-active":
- "rgba(255, 255, 255, 0.12)",
- },
-};
-
-const authMobileCutoffPx = 640;
-export const authMobileMediaQuery = `@media (max-width: ${authMobileCutoffPx - 0.05}px)`;
-export const authAboveMobileMediaQuery = `@media (min-width: ${authMobileCutoffPx}px)`;
-
-export const authTransientProps = {
- shouldForwardProp: (prop: string) => !prop.startsWith("$"),
-};
-
-export const authDisplayFontFamily = '"Outfit Variable", sans-serif';
-
-export const authFocusRing = {
- outline: "1px solid var(--locker-auth-primary)",
- outlineOffset: "2px",
-};
-
-export const authBodyTypography = {
- fontSize: "14px",
- fontWeight: 500,
- lineHeight: "20px",
-};
-
-export const authMiniTypography = {
- fontSize: "12px",
- fontWeight: 500,
- lineHeight: "16px",
-};
-
-export const authDialogContentLayout = {
- display: "flex",
- flexDirection: "column",
- gap: "24px",
- [authMobileMediaQuery]: { gap: "20px" },
-} as const;
diff --git a/web/apps/locker/src/pages/change-password.tsx b/web/apps/locker/src/pages/change-password.tsx
index 6ed4c7ac69..085d421870 100644
--- a/web/apps/locker/src/pages/change-password.tsx
+++ b/web/apps/locker/src/pages/change-password.tsx
@@ -1,6 +1,6 @@
-import { SetPasswordForm } from "@/components/auth/SetPasswordForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { SetPasswordForm } from "ente-accounts/components/auth/SetPasswordForm";
import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";
import AccountsChangePasswordPage from "ente-accounts/pages/change-password";
import type React from "react";
diff --git a/web/apps/locker/src/pages/credentials.tsx b/web/apps/locker/src/pages/credentials.tsx
index aa2f8a5a54..c106efae17 100644
--- a/web/apps/locker/src/pages/credentials.tsx
+++ b/web/apps/locker/src/pages/credentials.tsx
@@ -1,10 +1,10 @@
+import { LockerAuthShell } from "@/components/LockerAuthShell";
+import { featureFlags } from "@/feature-flags";
import {
CredentialsForm,
PasswordForm,
-} from "@/components/auth/CredentialsForm";
-import { SecondFactorChoiceDialog } from "@/components/auth/SecondFactorChoiceDialog";
-import { LockerAuthShell } from "@/components/LockerAuthShell";
-import { featureFlags } from "@/feature-flags";
+} from "ente-accounts/components/auth/CredentialsForm";
+import { SecondFactorChoiceDialog } from "ente-accounts/components/auth/SecondFactorChoiceDialog";
import AccountsCredentialsPage, {
type CredentialsPresentationProps,
} from "ente-accounts/pages/credentials";
diff --git a/web/apps/locker/src/pages/generate.tsx b/web/apps/locker/src/pages/generate.tsx
index e1394f0d00..464c3e5c4a 100644
--- a/web/apps/locker/src/pages/generate.tsx
+++ b/web/apps/locker/src/pages/generate.tsx
@@ -1,7 +1,7 @@
-import { RecoveryKeyForm } from "@/components/auth/RecoveryKeyForm";
-import { SetPasswordForm } from "@/components/auth/SetPasswordForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { RecoveryKeyForm } from "ente-accounts/components/auth/RecoveryKeyForm";
+import { SetPasswordForm } from "ente-accounts/components/auth/SetPasswordForm";
import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";
import type { RecoveryKeyPresentationProps } from "ente-accounts/components/RecoveryKey";
import AccountsGeneratePage from "ente-accounts/pages/generate";
diff --git a/web/apps/locker/src/pages/login.tsx b/web/apps/locker/src/pages/login.tsx
index 0691b4acfa..939c28cbd1 100644
--- a/web/apps/locker/src/pages/login.tsx
+++ b/web/apps/locker/src/pages/login.tsx
@@ -1,6 +1,6 @@
-import { LoginForm } from "@/components/auth/LoginForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { LoginForm } from "ente-accounts/components/auth/LoginForm";
import {
LoginContents,
type LoginPresentationProps,
diff --git a/web/apps/locker/src/pages/passkeys/recover.tsx b/web/apps/locker/src/pages/passkeys/recover.tsx
index 4eee2c3b0d..e530219673 100644
--- a/web/apps/locker/src/pages/passkeys/recover.tsx
+++ b/web/apps/locker/src/pages/passkeys/recover.tsx
@@ -1,6 +1,6 @@
-import { RecoverTwoFactorForm } from "@/components/auth/RecoveryForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { RecoverTwoFactorForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsTwoFactorRecoverPage, {
type TwoFactorRecoverPresentationProps,
} from "ente-accounts/pages/two-factor/recover";
diff --git a/web/apps/locker/src/pages/recover.tsx b/web/apps/locker/src/pages/recover.tsx
index 831f873d3d..0976da9dc7 100644
--- a/web/apps/locker/src/pages/recover.tsx
+++ b/web/apps/locker/src/pages/recover.tsx
@@ -1,6 +1,6 @@
-import { RecoverAccountForm } from "@/components/auth/RecoveryForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { RecoverAccountForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsRecoverPage, {
type RecoverAccountPresentationProps,
} from "ente-accounts/pages/recover";
diff --git a/web/apps/locker/src/pages/signup.tsx b/web/apps/locker/src/pages/signup.tsx
index b02ea68b6b..72a2df7cc8 100644
--- a/web/apps/locker/src/pages/signup.tsx
+++ b/web/apps/locker/src/pages/signup.tsx
@@ -1,6 +1,6 @@
-import { SignUpForm } from "@/components/auth/SignUpForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { SignUpForm } from "ente-accounts/components/auth/SignUpForm";
import type { SignUpPresentationProps } from "ente-accounts/components/SignUpContents";
import AccountsSignUpPage from "ente-accounts/pages/signup";
import type React from "react";
diff --git a/web/apps/locker/src/pages/two-factor/recover.tsx b/web/apps/locker/src/pages/two-factor/recover.tsx
index b5a44cdcf1..35e58eb815 100644
--- a/web/apps/locker/src/pages/two-factor/recover.tsx
+++ b/web/apps/locker/src/pages/two-factor/recover.tsx
@@ -1,6 +1,6 @@
-import { RecoverTwoFactorForm } from "@/components/auth/RecoveryForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { RecoverTwoFactorForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsTwoFactorRecoverPage, {
type TwoFactorRecoverPresentationProps,
} from "ente-accounts/pages/two-factor/recover";
diff --git a/web/apps/locker/src/pages/two-factor/verify.tsx b/web/apps/locker/src/pages/two-factor/verify.tsx
index d18dcfe2c9..7b7730ae38 100644
--- a/web/apps/locker/src/pages/two-factor/verify.tsx
+++ b/web/apps/locker/src/pages/two-factor/verify.tsx
@@ -1,6 +1,6 @@
-import { TwoFactorForm } from "@/components/auth/TwoFactorForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { TwoFactorForm } from "ente-accounts/components/auth/TwoFactorForm";
import AccountsTwoFactorVerifyPage, {
type TwoFactorVerifyPresentationProps,
} from "ente-accounts/pages/two-factor/verify";
diff --git a/web/apps/locker/src/pages/verify.tsx b/web/apps/locker/src/pages/verify.tsx
index 2a82ffb3c9..2cc5dd71ca 100644
--- a/web/apps/locker/src/pages/verify.tsx
+++ b/web/apps/locker/src/pages/verify.tsx
@@ -1,7 +1,7 @@
-import { SecondFactorChoiceDialog } from "@/components/auth/SecondFactorChoiceDialog";
-import { VerifyEmailForm } from "@/components/auth/VerifyEmailForm";
import { LockerAuthShell } from "@/components/LockerAuthShell";
import { featureFlags } from "@/feature-flags";
+import { SecondFactorChoiceDialog } from "ente-accounts/components/auth/SecondFactorChoiceDialog";
+import { VerifyEmailForm } from "ente-accounts/components/auth/VerifyEmailForm";
import AccountsVerifyPage, {
type VerifyEmailPresentationProps,
} from "ente-accounts/pages/verify";
diff --git a/web/package-lock.json b/web/package-lock.json
index 97404e3fb6..1c69cc3f9b 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -11169,6 +11169,8 @@
"name": "ente-accounts",
"version": "0.0.0",
"dependencies": {
+ "@hugeicons/core-free-icons": "1.2.1",
+ "@hugeicons/react": "1.1.6",
"comlink": "4.4.2",
"ente-base": "*",
"ente-core-wasm": "*",
diff --git a/web/apps/auth/src/components/auth/AuthDialog.tsx b/web/packages/accounts/components/auth/AuthDialog.tsx
similarity index 88%
rename from web/apps/auth/src/components/auth/AuthDialog.tsx
rename to web/packages/accounts/components/auth/AuthDialog.tsx
index 444512f212..5744aac344 100644
--- a/web/apps/auth/src/components/auth/AuthDialog.tsx
+++ b/web/packages/accounts/components/auth/AuthDialog.tsx
@@ -1,15 +1,8 @@
-import {
- Dialog,
- GlobalStyles,
- Slide,
- styled,
- type ModalProps,
-} from "@mui/material";
+import { Dialog, Slide, styled, type ModalProps } from "@mui/material";
import type { TransitionProps } from "@mui/material/transitions";
import React, { forwardRef } from "react";
import {
authBodyTypography,
- authColorVariables,
authDisplayFontFamily,
authMobileMediaQuery,
} from "./styles";
@@ -43,7 +36,6 @@ export const AuthDialog: React.FC<AuthDialogProps> = ({
maxWidth={false}
aria-labelledby={ariaLabelledby}
>
- <GlobalStyles styles={authColorVariables} />
<SheetHandle />
{children}
</DialogRoot>
@@ -61,14 +53,14 @@ export const AuthDialogTitle = styled("h2")({
fontSize: "22px",
fontWeight: 600,
lineHeight: "30px",
- color: "var(--auth-app-text)",
+ color: "var(--auth-ui-text)",
[authMobileMediaQuery]: { fontSize: "20px", lineHeight: "28px" },
});
export const AuthDialogText = styled("p")({
...authBodyTypography,
margin: 0,
- color: "var(--auth-app-text-muted)",
+ color: "var(--auth-ui-text-muted)",
textWrap: "pretty",
});
@@ -106,6 +98,6 @@ const SheetHandle = styled("div")({
flexShrink: 0,
margin: "0 auto 20px",
borderRadius: "999px",
- backgroundColor: "var(--auth-app-fill-active)",
+ backgroundColor: "var(--auth-ui-fill-active)",
},
});
diff --git a/web/packages/accounts/components/auth/AuthPageShell.tsx b/web/packages/accounts/components/auth/AuthPageShell.tsx
new file mode 100644
index 0000000000..2736efdafa
--- /dev/null
+++ b/web/packages/accounts/components/auth/AuthPageShell.tsx
@@ -0,0 +1,526 @@
+import { Tick02Icon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+import { GlobalStyles, keyframes, styled } from "@mui/material";
+import { EnteLogo } from "ente-base/components/EnteLogo";
+import type React from "react";
+import {
+ authAboveMobileMediaQuery,
+ authDisplayFontFamily,
+ authMobileMediaQuery,
+ createAuthColorVariables,
+ type AuthPresentationConfig,
+} from "./styles";
+
+export interface AuthBrandCopy {
+ headline: string;
+ subtitle: string;
+ bullets: readonly [string, string, string];
+}
+
+export interface AuthPageShellProps extends React.PropsWithChildren {
+ brand: AuthBrandCopy;
+ presentationConfig: AuthPresentationConfig;
+ contentWidth?: 400 | 420;
+}
+
+export function AuthPageShell({
+ brand,
+ presentationConfig,
+ children,
+ contentWidth = 400,
+}: AuthPageShellProps): React.JSX.Element {
+ return (
+ <PageRoot>
+ <GlobalStyles
+ styles={createAuthColorVariables(presentationConfig)}
+ />
+ <FrameCurves />
+ <PageCard>
+ <DesktopBrandSlot>
+ <BrandPanel
+ brand={brand}
+ presentationConfig={presentationConfig}
+ size="desktop"
+ />
+ </DesktopBrandSlot>
+ <TabletBrandSlot>
+ <BrandPanel
+ brand={brand}
+ presentationConfig={presentationConfig}
+ size="tablet"
+ />
+ </TabletBrandSlot>
+ <MobileBrandSlot $height={presentationConfig.mobileBrandHeight}>
+ <BrandPanel
+ brand={brand}
+ presentationConfig={presentationConfig}
+ size="mobile"
+ />
+ </MobileBrandSlot>
+ <ContentSheet>
+ <SheetHandle />
+ <ContentColumn contentWidth={contentWidth}>
+ {children}
+ </ContentColumn>
+ </ContentSheet>
+ </PageCard>
+ </PageRoot>
+ );
+}
+
+const shellReveal = keyframes({
+ from: { opacity: 0, transform: "translateY(18px)" },
+ to: { opacity: 1, transform: "translateY(0)" },
+});
+
+const brandCopyReveal = keyframes({
+ from: { opacity: 0, transform: "translateY(12px)" },
+ to: { opacity: 1, transform: "translateY(0)" },
+});
+
+const illustrationReveal = keyframes({
+ from: { opacity: 0, transform: "translateY(18px) scale(0.98)" },
+ to: { opacity: 1, transform: "translateY(0) scale(1)" },
+});
+
+const cameraSparkle = keyframes({
+ from: {
+ opacity: 0,
+ transform: "translate(-50%, -50%) scale(0) rotate(-20deg)",
+ },
+ "35%": {
+ opacity: 1,
+ transform: "translate(-50%, -50%) scale(1) rotate(0)",
+ },
+ "70%": {
+ opacity: 0.85,
+ transform: "translate(-50%, -50%) scale(0.72) rotate(24deg)",
+ },
+ to: {
+ opacity: 0,
+ transform: "translate(-50%, -50%) scale(1.3) rotate(45deg)",
+ },
+});
+
+const brandCurvesDrift = keyframes({
+ "0%, 100%": { backgroundPosition: "calc(50% - 6px) calc(50% + 4px)" },
+ "50%": { backgroundPosition: "calc(50% + 6px) calc(50% - 4px)" },
+});
+
+const brandCopyAnimation = {
+ animation: `${brandCopyReveal} 520ms cubic-bezier(0.22, 1, 0.36, 1) both`,
+ "@media (prefers-reduced-motion: reduce)": { animation: "none" },
+};
+
+interface BrandPanelProps {
+ brand: AuthBrandCopy;
+ presentationConfig: AuthPresentationConfig;
+ size: "desktop" | "tablet" | "mobile";
+}
+
+function BrandPanel({
+ brand,
+ presentationConfig,
+ size,
+}: BrandPanelProps): React.JSX.Element {
+ return (
+ <BrandPanelRoot
+ size={size}
+ $wideGamutPrimary={presentationConfig.wideGamutPrimary}
+ >
+ <Wordmark size={size}>
+ <EnteLogo />
+ </Wordmark>
+ <PanelCopy size={size}>
+ <PanelHeadline size={size}>{brand.headline}</PanelHeadline>
+ {size !== "mobile" && (
+ <PanelSubtitle size={size}>{brand.subtitle}</PanelSubtitle>
+ )}
+ {size === "desktop" && (
+ <BulletList>
+ {brand.bullets.map((bullet) => (
+ <Bullet key={bullet}>
+ <CheckCircle aria-hidden="true">
+ <HugeiconsIcon
+ icon={Tick02Icon}
+ size={12}
+ strokeWidth={3}
+ />
+ </CheckCircle>
+ <span>{bullet}</span>
+ </Bullet>
+ ))}
+ </BulletList>
+ )}
+ </PanelCopy>
+ <IllustrationClip
+ size={size}
+ $heights={presentationConfig.illustrationHeights}
+ >
+ <img src="/images/auth-ducky.svg" alt="" />
+ </IllustrationClip>
+ </BrandPanelRoot>
+ );
+}
+
+const PageRoot = styled("main")(({ theme }) => ({
+ width: "100%",
+ height: "100svh",
+ minHeight: "100svh",
+ display: "flex",
+ position: "relative",
+ overflow: "hidden",
+ boxSizing: "border-box",
+ backgroundColor: "#f4f4f4",
+ ...theme.applyStyles("dark", { backgroundColor: "#0a0a0a" }),
+ [authAboveMobileMediaQuery]: { padding: "40px" },
+ "@media (min-width: 1024px)": {
+ padding: 0,
+ alignItems: "center",
+ justifyContent: "center",
+ },
+}));
+
+const FrameCurves = styled("div")(({ theme }) => ({
+ display: "none",
+ opacity: 0.3,
+ ...theme.applyStyles("dark", { opacity: 0.02 }),
+ [authAboveMobileMediaQuery]: {
+ display: "block",
+ position: "absolute",
+ inset: 0,
+ backgroundImage: 'url("/images/auth-frame-curves.svg")',
+ backgroundRepeat: "no-repeat",
+ backgroundSize: "cover",
+ backgroundPosition: "center",
+ pointerEvents: "none",
+ },
+}));
+
+const PageCard = styled("div")(({ theme }) => ({
+ width: "100%",
+ height: "100%",
+ minHeight: 0,
+ display: "flex",
+ flexDirection: "column",
+ position: "relative",
+ overflow: "hidden",
+ backgroundColor: "#fff",
+ animation: `${shellReveal} 620ms cubic-bezier(0.22, 1, 0.36, 1) both`,
+ ...theme.applyStyles("dark", { backgroundColor: "#252525" }),
+ "@media (prefers-reduced-motion: reduce)": { animation: "none" },
+ [authAboveMobileMediaQuery]: { borderRadius: "24px" },
+ "@media (min-width: 1024px)": {
+ width: "1032px",
+ height: "min(780px, 100%)",
+ flexDirection: "row",
+ },
+ "@media (min-width: 1600px)": {
+ width: "1240px",
+ height: "min(900px, 100%)",
+ },
+}));
+
+const DesktopBrandSlot = styled("div")({
+ display: "none",
+ "@media (min-width: 1024px)": {
+ display: "block",
+ flex: "0 0 440px",
+ height: "100%",
+ },
+ "@media (min-width: 1600px)": { flexBasis: "496px" },
+});
+
+const TabletBrandSlot = styled("div")({
+ display: "none",
+ [`${authAboveMobileMediaQuery} and (max-width: 1023px)`]: {
+ display: "block",
+ // Grows with the copy when it wraps at narrow widths; the band's
+ // 268px design height is enforced as a minimum by BrandPanelRoot.
+ flex: "0 0 auto",
+ position: "relative",
+ overflow: "hidden",
+ },
+});
+
+const MobileBrandSlot = styled("div", {
+ shouldForwardProp: (prop) => prop !== "$height",
+})<{ $height: number }>(({ $height }) => ({
+ display: "block",
+ flex: `0 0 ${$height}px`,
+ minHeight: 0,
+ position: "relative",
+ overflow: "hidden",
+ [authAboveMobileMediaQuery]: { display: "none" },
+}));
+
+const ContentSheet = styled("section")(({ theme }) => ({
+ flex: 1,
+ minHeight: 0,
+ marginTop: "-28px",
+ padding: "40px 24px 24px",
+ display: "flex",
+ flexDirection: "column",
+ gap: "24px",
+ position: "relative",
+ zIndex: 1,
+ overflowY: "auto",
+ boxSizing: "border-box",
+ borderRadius: "24px 24px 0 0",
+ backgroundColor: "#fff",
+ ...theme.applyStyles("dark", { backgroundColor: "#252525" }),
+ [authAboveMobileMediaQuery]: {
+ marginTop: "-32px",
+ padding: "16px 48px 48px",
+ },
+ "@media (min-width: 1024px)": {
+ width: "592px",
+ marginTop: 0,
+ padding: "48px 96px",
+ alignItems: "center",
+ justifyContent: "center",
+ borderRadius: 0,
+ },
+ "@media (min-width: 1600px)": { width: "744px", padding: "56px 172px" },
+}));
+
+const SheetHandle = styled("div")({
+ width: "36px",
+ height: "4px",
+ flexShrink: 0,
+ alignSelf: "center",
+ borderRadius: "999px",
+ backgroundColor: "var(--auth-ui-fill-active)",
+ [authMobileMediaQuery]: { display: "none" },
+ "@media (min-width: 1024px)": { display: "none" },
+});
+
+const ContentColumn = styled("div", {
+ shouldForwardProp: (prop) => prop !== "contentWidth",
+})<{ contentWidth: 400 | 420 }>(({ contentWidth }) => ({
+ width: "100%",
+ minHeight: "min-content",
+ display: "flex",
+ flexDirection: "column",
+ gap: "24px",
+ [authMobileMediaQuery]: { flexGrow: 1 },
+ [authAboveMobileMediaQuery]: {
+ width: "440px",
+ maxWidth: "100%",
+ marginBlock: "auto",
+ alignSelf: "center",
+ },
+ "@media (min-width: 1024px)": { width: `${contentWidth}px` },
+ "@media (min-width: 1600px)": { gap: "28px" },
+}));
+
+const BrandPanelRoot = styled("div", {
+ shouldForwardProp: (prop) =>
+ prop !== "size" && prop !== "$wideGamutPrimary",
+})<{ size: BrandPanelProps["size"]; $wideGamutPrimary?: string }>(
+ ({ size, $wideGamutPrimary }) => ({
+ width: "100%",
+ height: size === "tablet" ? "auto" : "100%",
+ ...(size === "tablet" && { minHeight: "268px", rowGap: "24px" }),
+ padding:
+ size === "desktop"
+ ? "44px"
+ : size === "tablet"
+ ? "40px 40px 60px"
+ : "18px 16px 40px",
+ display: "flex",
+ flexDirection: "column",
+ justifyContent: size === "desktop" ? "flex-start" : "space-between",
+ position: "relative",
+ overflow: "hidden",
+ boxSizing: "border-box",
+ color: "#fff",
+ backgroundColor: "var(--auth-ui-primary)",
+ backgroundImage: 'url("/images/auth-surface-noise.svg")',
+ backgroundRepeat: "repeat",
+ backgroundPosition: "0 0",
+ backgroundSize: "auto",
+ "&::before": {
+ content: '""',
+ position: "absolute",
+ inset: 0,
+ pointerEvents: "none",
+ backgroundImage: 'url("/images/auth-frame-curves.svg")',
+ backgroundRepeat: "no-repeat",
+ backgroundPosition: "center",
+ backgroundSize: "cover",
+ maskImage:
+ "linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55) 42%, #000 100%)",
+ WebkitMaskImage:
+ "linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55) 42%, #000 100%)",
+ animation: `${brandCurvesDrift} 20s ease-in-out infinite`,
+ },
+ "@media (prefers-reduced-motion: reduce)": {
+ "&::before": { animation: "none" },
+ },
+ ...($wideGamutPrimary && {
+ "@supports (color: color(display-p3 1 1 1))": {
+ backgroundColor: $wideGamutPrimary,
+ },
+ }),
+ }),
+);
+
+const Wordmark = styled("div", {
+ shouldForwardProp: (prop) => prop !== "size",
+})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
+ width: size === "desktop" ? "83px" : size === "tablet" ? "77px" : "64px",
+ height: size === "desktop" ? "26px" : size === "tablet" ? "24px" : "20px",
+ flexShrink: 0,
+ margin: size === "mobile" ? "8px 0 0 8px" : 0,
+ lineHeight: 0,
+ position: "relative",
+ zIndex: 1,
+ "& > svg": { width: "100%", height: "100%" },
+}));
+
+const PanelCopy = styled("div", {
+ shouldForwardProp: (prop) => prop !== "size",
+})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
+ marginTop: size === "desktop" ? "36px" : 0,
+ marginLeft: size === "mobile" ? "8px" : 0,
+ // On the tablet band the ducky is anchored to the right edge, so keep
+ // the copy from running underneath it at narrow widths.
+ ...(size === "tablet" && { maxWidth: "calc(100% - 245px)" }),
+ position: "relative",
+ zIndex: 1,
+}));
+
+const PanelHeadline = styled("h1", {
+ shouldForwardProp: (prop) => prop !== "size",
+})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
+ maxWidth:
+ size === "desktop" ? "300px" : size === "tablet" ? "380px" : "188px",
+ margin: 0,
+ fontFamily: authDisplayFontFamily,
+ fontSize: size === "desktop" ? "42px" : size === "tablet" ? "34px" : "26px",
+ fontWeight: 600,
+ lineHeight:
+ size === "desktop" ? "50px" : size === "tablet" ? "42px" : "34px",
+ letterSpacing: "-0.02em",
+ textWrap: "pretty",
+ ...brandCopyAnimation,
+ animationDelay: "80ms",
+}));
+
+const PanelSubtitle = styled("p", {
+ shouldForwardProp: (prop) => prop !== "size",
+})<{ size: BrandPanelProps["size"] }>(({ size }) => ({
+ margin: 0,
+ marginTop: size === "desktop" ? "14px" : "10px",
+ fontSize: size === "desktop" ? "20px" : "17px",
+ fontWeight: 500,
+ lineHeight: size === "desktop" ? "28px" : "24px",
+ color: "rgba(255, 255, 255, 0.88)",
+ ...brandCopyAnimation,
+ animationDelay: "170ms",
+}));
+
+const BulletList = styled("ul")({
+ margin: "34px 0 0",
+ padding: 0,
+ display: "flex",
+ flexDirection: "column",
+ gap: "14px",
+ listStyle: "none",
+});
+
+const Bullet = styled("li")({
+ display: "flex",
+ alignItems: "center",
+ gap: "12px",
+ fontSize: "17px",
+ fontWeight: 500,
+ lineHeight: "24px",
+ ...brandCopyAnimation,
+ "&:nth-of-type(1)": { animationDelay: "280ms" },
+ "&:nth-of-type(2)": { animationDelay: "350ms" },
+ "&:nth-of-type(3)": { animationDelay: "420ms" },
+});
+
+const CheckCircle = styled("span")({
+ width: "24px",
+ height: "24px",
+ flex: "0 0 24px",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ borderRadius: "50%",
+ backgroundColor: "rgba(255, 255, 255, 0.14)",
+});
+
+const IllustrationClip = styled("div", {
+ shouldForwardProp: (prop) => prop !== "size" && prop !== "$heights",
+})<{
+ size: BrandPanelProps["size"];
+ $heights: AuthPresentationConfig["illustrationHeights"];
+}>(({ size, $heights }) => ({
+ width: size === "desktop" ? "313px" : size === "tablet" ? "237px" : "175px",
+ height:
+ size === "desktop"
+ ? `${$heights.desktop}px`
+ : size === "tablet"
+ ? `${$heights.tablet}px`
+ : `${$heights.mobile}px`,
+ flexShrink: 0,
+ position: "relative",
+ overflow: "hidden",
+ zIndex: 0,
+ ...(size !== "tablet" && {
+ animation: `${illustrationReveal} 500ms cubic-bezier(0.22, 1, 0.36, 1) ${size === "desktop" ? "840ms" : "130ms"} both`,
+ "@media (prefers-reduced-motion: reduce)": { animation: "none" },
+ }),
+ ...(size === "desktop"
+ ? {
+ marginTop: "auto",
+ alignSelf: "center",
+ "@media (min-width: 1600px)": {
+ width: "355px",
+ height: `${$heights.wide}px`,
+ },
+ }
+ : {
+ position: "absolute",
+ right: size === "tablet" ? "28px" : "-4px",
+ // Sit clear of the content sheet, which overlaps the band's
+ // bottom edge by 32px (tablet) / 28px (mobile).
+ bottom: size === "tablet" ? "44px" : "38px",
+ }),
+ "&::after": {
+ content: '""',
+ width:
+ size === "desktop" ? "34px" : size === "tablet" ? "26px" : "20px",
+ aspectRatio: "1",
+ position: "absolute",
+ left: "67%",
+ top: size === "desktop" ? "59%" : "57%",
+ zIndex: 1,
+ pointerEvents: "none",
+ backgroundColor: "#fff",
+ clipPath:
+ "polygon(50% 0%, 59% 39%, 100% 50%, 59% 61%, 50% 100%, 41% 61%, 0% 50%, 41% 39%)",
+ filter: "drop-shadow(0 0 7px rgba(255, 245, 168, 0.95))",
+ animation: `${cameraSparkle} 520ms ease-out ${size === "desktop" ? "1400ms" : size === "tablet" ? "740ms" : "690ms"} both`,
+ "@media (prefers-reduced-motion: reduce)": { display: "none" },
+ },
+ "& > img": {
+ display: "block",
+ width: "473.694px",
+ height: "370px",
+ transformOrigin: "top left",
+ transform:
+ size === "desktop"
+ ? "scale(0.66)"
+ : size === "tablet"
+ ? "scale(0.5)"
+ : "scale(0.37)",
+ ...(size === "desktop" && {
+ "@media (min-width: 1600px)": { transform: "scale(0.75)" },
+ }),
+ },
+}));
diff --git a/web/apps/auth/src/components/auth/Button.tsx b/web/packages/accounts/components/auth/Button.tsx
similarity index 78%
rename from web/apps/auth/src/components/auth/Button.tsx
rename to web/packages/accounts/components/auth/Button.tsx
index dbec644ed8..15cd13085f 100644
--- a/web/apps/auth/src/components/auth/Button.tsx
+++ b/web/packages/accounts/components/auth/Button.tsx
@@ -76,46 +76,46 @@ const ButtonRoot = styled(
position: "relative",
boxSizing: "border-box",
fontFamily: "inherit",
- color: $variant === "primary" ? "#fff" : "var(--auth-app-text)",
+ color: $variant === "primary" ? "#fff" : "var(--auth-ui-text)",
backgroundColor:
$variant === "primary"
- ? "var(--auth-app-primary)"
- : "var(--auth-app-button-secondary)",
+ ? "var(--auth-ui-primary)"
+ : "var(--auth-ui-button-secondary)",
boxShadow:
$variant === "primary"
- ? "inset 0 0 0 1px var(--auth-app-button-primary-stroke)"
- : "inset 0 0 0 1px var(--auth-app-button-secondary-stroke)",
+ ? "inset 0 0 0 1px var(--auth-ui-button-primary-stroke)"
+ : "inset 0 0 0 1px var(--auth-ui-button-secondary-stroke)",
cursor: $loading ? "default" : "pointer",
transition:
"background-color 160ms ease, box-shadow 160ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1)",
"&:hover:not(:disabled)": {
backgroundColor:
$variant === "primary"
- ? "var(--auth-app-primary-hover)"
- : "var(--auth-app-button-secondary-hover)",
+ ? "var(--auth-ui-primary-hover)"
+ : "var(--auth-ui-button-secondary-hover)",
boxShadow:
$variant === "primary"
- ? "inset 0 0 0 1px var(--auth-app-button-primary-stroke-hover)"
- : "inset 0 0 0 1px var(--auth-app-button-secondary-stroke-hover)",
+ ? "inset 0 0 0 1px var(--auth-ui-button-primary-stroke-hover)"
+ : "inset 0 0 0 1px var(--auth-ui-button-secondary-stroke-hover)",
transform: "translateY(-2px)",
},
"&:active:not(:disabled)": {
backgroundColor:
$variant === "primary"
- ? "var(--auth-app-primary-active)"
- : "var(--auth-app-button-secondary-active)",
+ ? "var(--auth-ui-primary-active)"
+ : "var(--auth-ui-button-secondary-active)",
boxShadow:
$variant === "primary"
- ? "inset 0 0 0 1px var(--auth-app-button-primary-stroke-active)"
- : "inset 0 0 0 1px var(--auth-app-button-secondary-stroke-active)",
+ ? "inset 0 0 0 1px var(--auth-ui-button-primary-stroke-active)"
+ : "inset 0 0 0 1px var(--auth-ui-button-secondary-stroke-active)",
transform: "translateY(0) scale(0.985)",
},
"&:focus-visible": authFocusRing,
"&:disabled": $loading
? { cursor: "default" }
: {
- color: "var(--auth-app-text-disabled)",
- backgroundColor: "var(--auth-app-fill-hover)",
+ color: "var(--auth-ui-text-disabled)",
+ backgroundColor: "var(--auth-ui-fill-hover)",
boxShadow: "none",
cursor: "not-allowed",
},
diff --git a/web/apps/auth/src/components/auth/Checkbox.tsx b/web/packages/accounts/components/auth/Checkbox.tsx
similarity index 89%
rename from web/apps/auth/src/components/auth/Checkbox.tsx
rename to web/packages/accounts/components/auth/Checkbox.tsx
index 37a887b4b8..0859a69ba4 100644
--- a/web/apps/auth/src/components/auth/Checkbox.tsx
+++ b/web/packages/accounts/components/auth/Checkbox.tsx
@@ -85,19 +85,19 @@ const CheckboxMark = styled("span")({
justifyContent: "center",
boxSizing: "border-box",
color: "#fff",
- backgroundColor: "var(--auth-app-primary)",
- "input:disabled + &": { backgroundColor: "var(--auth-app-text-disabled)" },
+ backgroundColor: "var(--auth-ui-primary)",
+ "input:disabled + &": { backgroundColor: "var(--auth-ui-text-disabled)" },
"input:not(:checked) + &": {
backgroundColor: "transparent",
- boxShadow: "inset 0 0 0 1px var(--auth-app-text-faint)",
+ boxShadow: "inset 0 0 0 1px var(--auth-ui-text-faint)",
},
"input:not(:checked):disabled + &": {
- boxShadow: "inset 0 0 0 1px var(--auth-app-text-disabled)",
+ boxShadow: "inset 0 0 0 1px var(--auth-ui-text-disabled)",
},
"input:focus-visible + &": authFocusRing,
});
const CheckboxLabelText = styled("span")({
...authBodyTypography,
- color: "var(--auth-app-text)",
+ color: "var(--auth-ui-text)",
});
diff --git a/web/apps/auth/src/components/auth/CredentialsForm.tsx b/web/packages/accounts/components/auth/CredentialsForm.tsx
similarity index 97%
rename from web/apps/auth/src/components/auth/CredentialsForm.tsx
rename to web/packages/accounts/components/auth/CredentialsForm.tsx
index 0a41367a7a..672d72e696 100644
--- a/web/apps/auth/src/components/auth/CredentialsForm.tsx
+++ b/web/packages/accounts/components/auth/CredentialsForm.tsx
@@ -93,7 +93,7 @@ export function PasswordForm({
const HiddenEmail = styled("input")({ display: "none" });
const Email = styled("strong")({
- color: "var(--auth-app-text)",
+ color: "var(--auth-ui-text)",
wordBreak: "break-word",
});
@@ -109,5 +109,5 @@ const Host = styled("div")({
fontSize: "12px",
fontWeight: 500,
lineHeight: "16px",
- color: "var(--auth-app-text-faint)",
+ color: "var(--auth-ui-text-faint)",
});
diff --git a/web/apps/auth/src/components/auth/Form.tsx b/web/packages/accounts/components/auth/Form.tsx
similarity index 100%
rename from web/apps/auth/src/components/auth/Form.tsx
rename to web/packages/accounts/components/auth/Form.tsx
diff --git a/web/apps/auth/src/components/auth/FormFields.tsx b/web/packages/accounts/components/auth/FormFields.tsx
similarity index 90%
rename from web/apps/auth/src/components/auth/FormFields.tsx
rename to web/packages/accounts/components/auth/FormFields.tsx
index 5b6098e1c5..0971cf4f55 100644
--- a/web/apps/auth/src/components/auth/FormFields.tsx
+++ b/web/packages/accounts/components/auth/FormFields.tsx
@@ -8,7 +8,7 @@ export function FormFields({
}
const FormFieldsRoot = styled("div")({
- "--auth-app-message-gap": "16px",
+ "--auth-ui-message-gap": "16px",
width: "100%",
display: "flex",
flexDirection: "column",
diff --git a/web/apps/auth/src/components/auth/FormFooter.tsx b/web/packages/accounts/components/auth/FormFooter.tsx
similarity index 100%
rename from web/apps/auth/src/components/auth/FormFooter.tsx
rename to web/packages/accounts/components/auth/FormFooter.tsx
diff --git a/web/apps/auth/src/components/auth/LoginForm.tsx b/web/packages/accounts/components/auth/LoginForm.tsx
similarity index 97%
rename from web/apps/auth/src/components/auth/LoginForm.tsx
rename to web/packages/accounts/components/auth/LoginForm.tsx
index df505e62f9..d921d563e6 100644
--- a/web/apps/auth/src/components/auth/LoginForm.tsx
+++ b/web/packages/accounts/components/auth/LoginForm.tsx
@@ -95,7 +95,7 @@ const AccountPrompt = styled("div")({
fontSize: "14px",
fontWeight: 500,
lineHeight: "20px",
- color: "var(--auth-app-text-muted)",
+ color: "var(--auth-ui-text-muted)",
});
const Host = styled("div")({
@@ -103,5 +103,5 @@ const Host = styled("div")({
fontSize: "12px",
fontWeight: 500,
lineHeight: "16px",
- color: "var(--auth-app-text-faint)",
+ color: "var(--auth-ui-text-faint)",
});
diff --git a/web/apps/auth/src/components/auth/Message.tsx b/web/packages/accounts/components/auth/Message.tsx
similarity index 93%
rename from web/apps/auth/src/components/auth/Message.tsx
rename to web/packages/accounts/components/auth/Message.tsx
index 857159b7df..b13e4b726d 100644
--- a/web/apps/auth/src/components/auth/Message.tsx
+++ b/web/packages/accounts/components/auth/Message.tsx
@@ -82,19 +82,19 @@ const MessageRoot = styled(
gridTemplateRows: $visible ? "1fr" : "0fr",
marginTop:
$animated && !$visible
- ? "calc(-1 * var(--auth-app-message-gap, 8px))"
+ ? "calc(-1 * var(--auth-ui-message-gap, 8px))"
: 0,
opacity: $visible ? 1 : 0,
transform: $visible ? "translateY(0)" : "translateY(-4px)",
visibility: $visible ? "visible" : "hidden",
color:
$kind === "error"
- ? "var(--auth-app-warning)"
+ ? "var(--auth-ui-warning)"
: $kind === "warning"
- ? "var(--auth-app-caution)"
+ ? "var(--auth-ui-caution)"
: $kind === "success"
- ? "var(--auth-app-success)"
- : "var(--auth-app-text-muted)",
+ ? "var(--auth-ui-success)"
+ : "var(--auth-ui-text-muted)",
...($animated && {
overflow: "hidden",
transition: [
diff --git a/web/apps/auth/src/components/auth/OTPField.tsx b/web/packages/accounts/components/auth/OTPField.tsx
similarity index 95%
rename from web/apps/auth/src/components/auth/OTPField.tsx
rename to web/packages/accounts/components/auth/OTPField.tsx
index 7e2724e8af..cfd7af2b1c 100644
--- a/web/apps/auth/src/components/auth/OTPField.tsx
+++ b/web/packages/accounts/components/auth/OTPField.tsx
@@ -210,12 +210,12 @@ const OTPFieldRoot = styled("div")({
display: "flex",
flexDirection: "column",
gap: "16px",
- "&:focus-within > span": { color: "var(--auth-app-text)" },
+ "&:focus-within > span": { color: "var(--auth-ui-text)" },
});
const OTPLabel = styled("span")({
...authMiniTypography,
- color: "var(--auth-app-text-muted)",
+ color: "var(--auth-ui-text-muted)",
transition: "color 100ms ease-in",
"@media (prefers-reduced-motion: reduce)": { transition: "none" },
});
@@ -248,17 +248,17 @@ const OTPInput = styled(
fontWeight: 600,
lineHeight: 1,
textAlign: "center",
- color: "var(--auth-app-text)",
- backgroundColor: "var(--auth-app-field)",
+ color: "var(--auth-ui-text)",
+ backgroundColor: "var(--auth-ui-field)",
boxShadow: `inset 0 0 0 1px ${
- $error ? "var(--auth-app-warning)" : "var(--auth-app-stroke)"
+ $error ? "var(--auth-ui-warning)" : "var(--auth-ui-stroke)"
}`,
outline: 0,
cursor: "text",
transition: "box-shadow 0.2s ease",
"&:focus": {
boxShadow: `inset 0 0 0 1px ${
- $error ? "var(--auth-app-warning)" : "var(--auth-app-primary)"
+ $error ? "var(--auth-ui-warning)" : "var(--auth-ui-primary)"
}`,
},
"&:disabled": { cursor: "not-allowed" },
diff --git a/web/apps/auth/src/components/auth/PasswordStrengthMessage.tsx b/web/packages/accounts/components/auth/PasswordStrengthMessage.tsx
similarity index 100%
rename from web/apps/auth/src/components/auth/PasswordStrengthMessage.tsx
rename to web/packages/accounts/components/auth/PasswordStrengthMessage.tsx
diff --git a/web/apps/auth/src/components/auth/RecoveryForm.tsx b/web/packages/accounts/components/auth/RecoveryForm.tsx
similarity index 100%
rename from web/apps/auth/src/components/auth/RecoveryForm.tsx
rename to web/packages/accounts/components/auth/RecoveryForm.tsx
diff --git a/web/apps/auth/src/components/auth/RecoveryKeyForm.tsx b/web/packages/accounts/components/auth/RecoveryKeyForm.tsx
similarity index 92%
rename from web/apps/auth/src/components/auth/RecoveryKeyForm.tsx
rename to web/packages/accounts/components/auth/RecoveryKeyForm.tsx
index c8fb835db8..7c24028812 100644
--- a/web/apps/auth/src/components/auth/RecoveryKeyForm.tsx
+++ b/web/packages/accounts/components/auth/RecoveryKeyForm.tsx
@@ -44,7 +44,7 @@ export function RecoveryKeyForm({
) : (
<CircularProgress
size={24}
- sx={{ color: "var(--auth-app-primary)" }}
+ sx={{ color: "var(--auth-ui-primary)" }}
/>
)}
</RecoveryKeyBox>
@@ -72,8 +72,8 @@ const RecoveryKeyBox = styled("div")({
justifyContent: "center",
position: "relative",
boxSizing: "border-box",
- backgroundColor: "var(--auth-app-field)",
- boxShadow: "inset 0 0 0 1px var(--auth-app-stroke)",
+ backgroundColor: "var(--auth-ui-field)",
+ boxShadow: "inset 0 0 0 1px var(--auth-ui-stroke)",
});
const RecoveryKeyText = styled("p")({
@@ -83,7 +83,7 @@ const RecoveryKeyText = styled("p")({
fontWeight: 500,
lineHeight: "24px",
wordBreak: "break-word",
- color: "var(--auth-app-text)",
+ color: "var(--auth-ui-text)",
});
const CopyButton = styled("button")({
@@ -99,7 +99,7 @@ const CopyButton = styled("button")({
top: "12px",
right: "12px",
backgroundColor: "transparent",
- color: "var(--auth-app-text-muted)",
+ color: "var(--auth-ui-text-muted)",
cursor: "pointer",
"&:focus-visible": authFocusRing,
});
diff --git a/web/apps/auth/src/components/auth/ScreenHeader.tsx b/web/packages/accounts/components/auth/ScreenHeader.tsx
similarity index 94%
rename from web/apps/auth/src/components/auth/ScreenHeader.tsx
rename to web/packages/accounts/components/auth/ScreenHeader.tsx
index 906d448809..5c9f036346 100644
--- a/web/apps/auth/src/components/auth/ScreenHeader.tsx
+++ b/web/packages/accounts/components/auth/ScreenHeader.tsx
@@ -32,7 +32,7 @@ const ScreenTitle = styled("h1")({
fontWeight: 600,
lineHeight: "38px",
textWrap: "pretty",
- color: "var(--auth-app-text)",
+ color: "var(--auth-ui-text)",
[authMobileMediaQuery]: { fontSize: "26px", lineHeight: "34px" },
"@media (min-width: 1600px)": { fontSize: "32px", lineHeight: "40px" },
});
@@ -43,6 +43,6 @@ const ScreenSubtitle = styled("p")({
fontWeight: 500,
lineHeight: "24px",
textWrap: "pretty",
- color: "var(--auth-app-text-muted)",
+ color: "var(--auth-ui-text-muted)",
[authMobileMediaQuery]: { fontSize: "13px", lineHeight: "20px" },
});
diff --git a/web/apps/auth/src/components/auth/SecondFactorChoiceDialog.tsx b/web/packages/accounts/components/auth/SecondFactorChoiceDialog.tsx
similarity index 100%
rename from web/apps/auth/src/components/auth/SecondFactorChoiceDialog.tsx
rename to web/packages/accounts/components/auth/SecondFactorChoiceDialog.tsx
diff --git a/web/apps/auth/src/components/auth/SetPasswordForm.tsx b/web/packages/accounts/components/auth/SetPasswordForm.tsx
similarity index 99%
rename from web/apps/auth/src/components/auth/SetPasswordForm.tsx
rename to web/packages/accounts/components/auth/SetPasswordForm.tsx
index 52ec9c8547..037bd863d6 100644
--- a/web/apps/auth/src/components/auth/SetPasswordForm.tsx
+++ b/web/packages/accounts/components/auth/SetPasswordForm.tsx
@@ -105,7 +105,7 @@ export function SetPasswordForm({
const HiddenEmail = styled("input")({ display: "none" });
const PasswordField = styled("div")({
- "--auth-app-message-gap": "8px",
+ "--auth-ui-message-gap": "8px",
display: "flex",
flexDirection: "column",
gap: "8px",
diff --git a/web/apps/auth/src/components/auth/SignUpForm.tsx b/web/packages/accounts/components/auth/SignUpForm.tsx
similarity index 96%
rename from web/apps/auth/src/components/auth/SignUpForm.tsx
rename to web/packages/accounts/components/auth/SignUpForm.tsx
index 0245840e8b..87200cad0d 100644
--- a/web/apps/auth/src/components/auth/SignUpForm.tsx
+++ b/web/packages/accounts/components/auth/SignUpForm.tsx
@@ -162,7 +162,7 @@ export function SignUpForm({
}
const PasswordField = styled("div")({
- "--auth-app-message-gap": "8px",
+ "--auth-ui-message-gap": "8px",
display: "flex",
flexDirection: "column",
gap: "8px",
@@ -179,16 +179,16 @@ const TermsText = styled("span")({
fontSize: "14px",
fontWeight: 500,
lineHeight: "20px",
- color: "var(--auth-app-text-muted)",
+ color: "var(--auth-ui-password-message)",
});
const TermsLink = styled("a")({
- color: "var(--auth-app-text)",
+ color: "var(--auth-ui-terms-link)",
textDecoration: "none",
"&:hover": { textDecoration: "underline" },
"&:focus-visible": {
borderRadius: "4px",
- outline: "2px solid var(--auth-app-accent)",
+ outline: "2px solid var(--auth-ui-focus)",
outlineOffset: "2px",
},
});
@@ -202,7 +202,7 @@ const AccountPrompt = styled("div")({
fontWeight: 500,
lineHeight: "20px",
textAlign: "center",
- color: "var(--auth-app-text-muted)",
+ color: "var(--auth-ui-text-muted)",
});
const Host = styled("div")({
@@ -211,5 +211,5 @@ const Host = styled("div")({
fontWeight: 500,
lineHeight: "16px",
textAlign: "center",
- color: "var(--auth-app-text-faint)",
+ color: "var(--auth-ui-text-faint)",
});
diff --git a/web/apps/auth/src/components/auth/TextField.tsx b/web/packages/accounts/components/auth/TextField.tsx
similarity index 90%
rename from web/apps/auth/src/components/auth/TextField.tsx
rename to web/packages/accounts/components/auth/TextField.tsx
index 69a823ecd7..55e0475ff3 100644
--- a/web/apps/auth/src/components/auth/TextField.tsx
+++ b/web/packages/accounts/components/auth/TextField.tsx
@@ -176,22 +176,22 @@ export function TextField({
}
const FieldRoot = styled("div")({
- "--auth-app-message-gap": "9px",
+ "--auth-ui-message-gap": "9px",
width: "100%",
display: "flex",
flexDirection: "column",
gap: "9px",
- "&:focus-within > label": { color: "var(--auth-app-text)" },
+ "&:focus-within > label": { color: "var(--auth-ui-text)" },
});
const FieldLabel = styled("label")({
...authMiniTypography,
- color: "var(--auth-app-text-muted)",
+ color: "var(--auth-ui-text-muted)",
transition: "color 100ms ease-in",
"@media (prefers-reduced-motion: reduce)": { transition: "none" },
});
-const RequiredMark = styled("span")({ color: "var(--auth-app-warning)" });
+const RequiredMark = styled("span")({ color: "var(--auth-ui-warning)" });
interface FieldBoxProps {
$error: boolean;
@@ -213,18 +213,18 @@ const FieldBox = styled(
gap: "8px",
boxSizing: "border-box",
backgroundColor: $disabled
- ? "var(--auth-app-fill-hover)"
- : "var(--auth-app-field)",
+ ? "var(--auth-ui-fill-hover)"
+ : "var(--auth-ui-field)",
boxShadow: $disabled
? "none"
: `inset 0 0 0 1px ${
- $error ? "var(--auth-app-warning)" : "var(--auth-app-stroke)"
+ $error ? "var(--auth-ui-warning)" : "var(--auth-ui-stroke)"
}`,
"&:focus-within": $disabled
? undefined
: {
boxShadow: `inset 0 0 0 1px ${
- $error ? "var(--auth-app-warning)" : "var(--auth-app-primary)"
+ $error ? "var(--auth-ui-warning)" : "var(--auth-ui-primary)"
}`,
},
}));
@@ -239,11 +239,11 @@ const controlStyles = {
outline: 0,
background: "transparent",
fontFamily: "inherit",
- color: "var(--auth-app-text)",
- "&::placeholder": { color: "var(--auth-app-text-faint)", opacity: 1 },
+ color: "var(--auth-ui-text)",
+ "&::placeholder": { color: "var(--auth-ui-text-faint)", opacity: 1 },
"&:disabled": {
- color: "var(--auth-app-text-disabled)",
- WebkitTextFillColor: "var(--auth-app-text-disabled)",
+ color: "var(--auth-ui-text-disabled)",
+ WebkitTextFillColor: "var(--auth-ui-text-disabled)",
cursor: "not-allowed",
},
};
@@ -267,11 +267,11 @@ const PasswordToggle = styled("button")({
alignItems: "center",
justifyContent: "center",
background: "transparent",
- color: "var(--auth-app-text-faint)",
+ color: "var(--auth-ui-text-faint)",
cursor: "pointer",
"&:focus-visible": authFocusRing,
"&:disabled": {
- color: "var(--auth-app-text-disabled)",
+ color: "var(--auth-ui-text-disabled)",
cursor: "not-allowed",
},
});
diff --git a/web/apps/auth/src/components/auth/TextLink.tsx b/web/packages/accounts/components/auth/TextLink.tsx
similarity index 93%
rename from web/apps/auth/src/components/auth/TextLink.tsx
rename to web/packages/accounts/components/auth/TextLink.tsx
index 1d9c4996d0..cdb9879738 100644
--- a/web/apps/auth/src/components/auth/TextLink.tsx
+++ b/web/packages/accounts/components/auth/TextLink.tsx
@@ -40,7 +40,7 @@ const TextLinkRoot = styled(
background: "transparent",
fontFamily: "inherit",
fontWeight: $regular ? 500 : 600,
- color: "var(--auth-app-text)",
+ color: "var(--auth-ui-link)",
textDecoration: "none",
cursor: "pointer",
"&:hover:not(:disabled)": {
@@ -49,7 +49,7 @@ const TextLinkRoot = styled(
},
"&:focus-visible": { ...authFocusRing, borderRadius: "4px" },
"&:disabled": {
- color: "var(--auth-app-text-disabled)",
+ color: "var(--auth-ui-text-disabled)",
cursor: "not-allowed",
},
}));
diff --git a/web/apps/auth/src/components/auth/TwoFactorForm.tsx b/web/packages/accounts/components/auth/TwoFactorForm.tsx
similarity index 100%
rename from web/apps/auth/src/components/auth/TwoFactorForm.tsx
rename to web/packages/accounts/components/auth/TwoFactorForm.tsx
diff --git a/web/apps/auth/src/components/auth/VerifyEmailForm.tsx b/web/packages/accounts/components/auth/VerifyEmailForm.tsx
similarity index 99%
rename from web/apps/auth/src/components/auth/VerifyEmailForm.tsx
rename to web/packages/accounts/components/auth/VerifyEmailForm.tsx
index d6aa3b2a98..3e46adb014 100644
--- a/web/apps/auth/src/components/auth/VerifyEmailForm.tsx
+++ b/web/packages/accounts/components/auth/VerifyEmailForm.tsx
@@ -116,7 +116,7 @@ export function VerifyEmailForm({
}
const Email = styled("strong")({
- color: "var(--auth-app-text)",
+ color: "var(--auth-ui-text)",
wordBreak: "break-word",
});
diff --git a/web/packages/accounts/components/auth/styles.ts b/web/packages/accounts/components/auth/styles.ts
new file mode 100644
index 0000000000..d58a838542
--- /dev/null
+++ b/web/packages/accounts/components/auth/styles.ts
@@ -0,0 +1,110 @@
+export interface AuthPresentationConfig {
+ primary: string;
+ primaryHover: string;
+ primaryActive: string;
+ focus: string;
+ focusDark: string;
+ link: string;
+ linkDark: string;
+ termsLink: string;
+ termsLinkDark: string;
+ passwordMessage: string;
+ passwordMessageDark: string;
+ textDisabledDark: string;
+ wideGamutPrimary?: string;
+ mobileBrandHeight: number;
+ illustrationHeights: {
+ desktop: number;
+ tablet: number;
+ mobile: number;
+ wide: number;
+ };
+}
+
+export const createAuthColorVariables = (theme: AuthPresentationConfig) => ({
+ ":where(:root)": {
+ "--auth-ui-primary": theme.primary,
+ "--auth-ui-primary-hover": theme.primaryHover,
+ "--auth-ui-primary-active": theme.primaryActive,
+ "--auth-ui-focus": theme.focus,
+ "--auth-ui-link": theme.link,
+ "--auth-ui-terms-link": theme.termsLink,
+ "--auth-ui-password-message": theme.passwordMessage,
+ "--auth-ui-success": "#069d1e",
+ "--auth-ui-warning": "#f63a3a",
+ "--auth-ui-caution": "#f08a1e",
+ "--auth-ui-text": "#000",
+ "--auth-ui-text-muted": "#666",
+ "--auth-ui-text-faint": "#969696",
+ "--auth-ui-text-disabled": "#d6d6d6",
+ "--auth-ui-field": "#fff",
+ "--auth-ui-fill": "#eaeaea",
+ "--auth-ui-fill-hover": "#dedede",
+ "--auth-ui-fill-active": "#d2d2d2",
+ "--auth-ui-stroke": "#e0e0e0",
+ "--auth-ui-button-secondary": "#eaeaea",
+ "--auth-ui-button-secondary-hover": "#dedede",
+ "--auth-ui-button-secondary-active": "#d2d2d2",
+ "--auth-ui-button-secondary-stroke": "transparent",
+ "--auth-ui-button-secondary-stroke-hover": "transparent",
+ "--auth-ui-button-secondary-stroke-active": "transparent",
+ "--auth-ui-button-primary-stroke": "rgba(255, 255, 255, 0.14)",
+ "--auth-ui-button-primary-stroke-hover": "rgba(255, 255, 255, 0.32)",
+ "--auth-ui-button-primary-stroke-active": "rgba(255, 255, 255, 0.2)",
+ },
+ "*:where(.dark)": {
+ "--auth-ui-focus": theme.focusDark,
+ "--auth-ui-link": theme.linkDark,
+ "--auth-ui-terms-link": theme.termsLinkDark,
+ "--auth-ui-password-message": theme.passwordMessageDark,
+ "--auth-ui-success": "#08c225",
+ "--auth-ui-text": "#fff",
+ "--auth-ui-text-muted": "#999",
+ "--auth-ui-text-disabled": theme.textDisabledDark,
+ "--auth-ui-field": "#1a1a1a",
+ "--auth-ui-fill": "#0a0a0a",
+ "--auth-ui-fill-hover": "#1a1a1a",
+ "--auth-ui-fill-active": "#292929",
+ "--auth-ui-stroke": "#3e3e3e",
+ "--auth-ui-button-secondary": "#1e1e1e",
+ "--auth-ui-button-secondary-hover": "#1a1a1a",
+ "--auth-ui-button-secondary-active": "#161616",
+ "--auth-ui-button-secondary-stroke": "rgba(255, 255, 255, 0.07)",
+ "--auth-ui-button-secondary-stroke-hover": "rgba(255, 255, 255, 0.18)",
+ "--auth-ui-button-secondary-stroke-active": "rgba(255, 255, 255, 0.12)",
+ },
+});
+
+const authMobileCutoffPx = 640;
+export const authMobileMediaQuery = `@media (max-width: ${authMobileCutoffPx - 0.05}px)`;
+export const authAboveMobileMediaQuery = `@media (min-width: ${authMobileCutoffPx}px)`;
+
+export const authTransientProps = {
+ shouldForwardProp: (prop: string) => !prop.startsWith("$"),
+};
+
+export const authDisplayFontFamily = '"Outfit Variable", sans-serif';
+
+export const authFocusRing = {
+ outline: "1px solid var(--auth-ui-focus)",
+ outlineOffset: "2px",
+};
+
+export const authBodyTypography = {
+ fontSize: "14px",
+ fontWeight: 500,
+ lineHeight: "20px",
+};
+
+export const authMiniTypography = {
+ fontSize: "12px",
+ fontWeight: 500,
+ lineHeight: "16px",
+};
+
+export const authDialogContentLayout = {
+ display: "flex",
+ flexDirection: "column",
+ gap: "24px",
+ [authMobileMediaQuery]: { gap: "20px" },
+} as const;
diff --git a/web/packages/accounts/package.json b/web/packages/accounts/package.json
index 4a03c83a97..4dcaef7975 100644
--- a/web/packages/accounts/package.json
+++ b/web/packages/accounts/package.json
@@ -3,6 +3,8 @@
"version": "0.0.0",
"private": true,
"dependencies": {
+ "@hugeicons/core-free-icons": "1.2.1",
+ "@hugeicons/react": "1.1.6",
"comlink": "4.4.2",
"ente-base": "*",
"ente-core-wasm": "*",