@salesforce/ui-bundle-template-feature-react-authentication 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/CHANGELOG.md +9 -0
  2. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/components/alerts/status-alert.tsx +11 -8
  3. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/components/ui/input.tsx +1 -1
  4. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/api/userProfileApi.ts +2 -1
  5. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/authenticationConfig.ts +9 -9
  6. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/context/AuthContext.tsx +21 -4
  7. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/forms/auth-form.tsx +15 -1
  8. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/hooks/form.tsx +1 -1
  9. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/layouts/privateRouteLayout.tsx +2 -11
  10. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/pages/ChangePassword.tsx +20 -4
  11. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/pages/ForgotPassword.tsx +19 -4
  12. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/pages/Login.tsx +19 -4
  13. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/pages/Profile.tsx +80 -43
  14. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/pages/Register.tsx +15 -4
  15. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/pages/ResetPassword.tsx +19 -4
  16. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/utils/helpers.ts +15 -52
  17. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/hooks/useAsyncData.ts +67 -0
  18. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/routes.tsx +19 -25
  19. package/dist/package-lock.json +2 -2
  20. package/dist/package.json +1 -1
  21. package/dist/scripts/org-setup.config.json +0 -1
  22. package/dist/scripts/org-setup.mjs +528 -44
  23. package/package.json +2 -2
  24. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/layout/card-skeleton.tsx +0 -38
  25. package/dist/force-app/main/default/uiBundles/feature-react-authentication/src/features/authentication/layouts/authenticationRouteLayout.tsx +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-feature-react-authentication",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Authentication feature for UI Bundles",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -16,7 +16,7 @@
16
16
  "clean": "rm -rf dist"
17
17
  },
18
18
  "devDependencies": {
19
- "@salesforce/ui-bundle": "^3.0.0",
19
+ "@salesforce/ui-bundle": "^3.1.0",
20
20
  "@tanstack/react-form": "^1.27.7",
21
21
  "@types/react": "^19.2.7",
22
22
  "@types/react-dom": "^19.2.3",
@@ -1,38 +0,0 @@
1
- import { CenteredPageLayout } from "./centered-page-layout";
2
- import { Card, CardContent, CardHeader } from "../../../components/ui/card";
3
- import { Skeleton } from "../../../components/ui/skeleton";
4
-
5
- interface CardSkeletonProps {
6
- /**
7
- * Maximum width of the content container.
8
- * @default "sm"
9
- */
10
- contentMaxWidth?: "sm" | "md" | "lg";
11
- /**
12
- * Accessible label for screen readers.
13
- * @default "Loading…"
14
- */
15
- loadingText?: string;
16
- }
17
-
18
- /**
19
- * Full-page loading indicator with skeleton card placeholder.
20
- */
21
- export function CardSkeleton({ contentMaxWidth, loadingText = "Loading…" }: CardSkeletonProps) {
22
- return (
23
- <CenteredPageLayout contentMaxWidth={contentMaxWidth}>
24
- <div role="status" aria-live="polite">
25
- <Card className="w-full">
26
- <CardHeader>
27
- <Skeleton className="h-4 w-2/3" />
28
- <Skeleton className="h-4 w-1/2" />
29
- </CardHeader>
30
- <CardContent>
31
- <Skeleton className="aspect-video w-full" />
32
- </CardContent>
33
- </Card>
34
- <span className="sr-only">{loadingText}</span>
35
- </div>
36
- </CenteredPageLayout>
37
- );
38
- }
@@ -1,21 +0,0 @@
1
- import { Navigate, Outlet, useSearchParams } from "react-router";
2
- import { useAuth } from "../context/AuthContext";
3
- import { getStartUrl } from "../authHelpers";
4
- import { CardSkeleton } from "../layout/card-skeleton";
5
-
6
- /**
7
- * [Dev Note] "Public Only" Route Guard:
8
- * This component protects routes that should NOT be accessible if the user is already logged in
9
- * (e.g., Login, Register, Forgot Password).
10
- * If an authenticated user tries to access these pages, they are automatically redirected
11
- * to the default authenticated view (e.g., Home or Profile) to prevent confusion.
12
- */
13
- export default function AuthenticationRoute() {
14
- const { isAuthenticated, loading } = useAuth();
15
- const [searchParams] = useSearchParams();
16
-
17
- if (loading) return <CardSkeleton contentMaxWidth="md" />;
18
- if (isAuthenticated) return <Navigate to={getStartUrl(searchParams)} replace />;
19
-
20
- return <Outlet />;
21
- }