@salesforce/webapp-template-app-react-template-b2e-experimental 1.43.0 → 1.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/.a4drules/skills/install-feature/SKILL.md +0 -1
  2. package/dist/CHANGELOG.md +11 -0
  3. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/e2e/app.spec.ts +0 -7
  4. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/package-lock.json +3589 -3223
  5. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/package.json +2 -10
  6. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/app.tsx +19 -13
  7. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/appLayout.tsx +9 -1
  8. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/AgentforceConversationClient.tsx +127 -0
  9. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/index.ts +6 -0
  10. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/navigationMenu.tsx +73 -74
  11. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/router-utils.tsx +24 -23
  12. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/routes.tsx +0 -66
  13. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/styles/global.css +10 -129
  14. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/types/conversation.ts +21 -0
  15. package/dist/package.json +1 -1
  16. package/package.json +2 -2
  17. package/dist/force-app/main/default/classes/WebAppAuthUtils.cls +0 -68
  18. package/dist/force-app/main/default/classes/WebAppAuthUtils.cls-meta.xml +0 -5
  19. package/dist/force-app/main/default/classes/WebAppChangePassword.cls +0 -77
  20. package/dist/force-app/main/default/classes/WebAppChangePassword.cls-meta.xml +0 -5
  21. package/dist/force-app/main/default/classes/WebAppForgotPassword.cls +0 -71
  22. package/dist/force-app/main/default/classes/WebAppForgotPassword.cls-meta.xml +0 -5
  23. package/dist/force-app/main/default/classes/WebAppLogin.cls +0 -97
  24. package/dist/force-app/main/default/classes/WebAppLogin.cls-meta.xml +0 -5
  25. package/dist/force-app/main/default/classes/WebAppRegistration.cls +0 -162
  26. package/dist/force-app/main/default/classes/WebAppRegistration.cls-meta.xml +0 -5
  27. package/dist/force-app/main/default/digitalExperienceConfigs/appreacttemplateb2e1.digitalExperienceConfig +0 -8
  28. package/dist/force-app/main/default/digitalExperiences/site/appreacttemplateb2e1/appreacttemplateb2e1.digitalExperience-meta.xml +0 -11
  29. package/dist/force-app/main/default/digitalExperiences/site/appreacttemplateb2e1/sfdc_cms__site/appreacttemplateb2e1/_meta.json +0 -5
  30. package/dist/force-app/main/default/digitalExperiences/site/appreacttemplateb2e1/sfdc_cms__site/appreacttemplateb2e1/content.json +0 -10
  31. package/dist/force-app/main/default/networks/appreacttemplateb2e.network +0 -60
  32. package/dist/force-app/main/default/package.xml +0 -20
  33. package/dist/force-app/main/default/sites/appreacttemplateb2e.site +0 -31
  34. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/alerts/status-alert.tsx +0 -45
  35. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/auth/authentication-route.tsx +0 -21
  36. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/auth/private-route.tsx +0 -36
  37. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/footers/footer-link.tsx +0 -36
  38. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/forms/auth-form.tsx +0 -81
  39. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/forms/submit-button.tsx +0 -49
  40. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/layout/card-layout.tsx +0 -23
  41. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/layout/card-skeleton.tsx +0 -38
  42. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/layout/centered-page-layout.tsx +0 -73
  43. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/alert.tsx +0 -65
  44. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/button.tsx +0 -54
  45. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/card.tsx +0 -77
  46. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/field.tsx +0 -111
  47. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/index.ts +0 -71
  48. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/input.tsx +0 -19
  49. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/label.tsx +0 -19
  50. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/pagination.tsx +0 -99
  51. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/select.tsx +0 -151
  52. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/skeleton.tsx +0 -13
  53. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/spinner.tsx +0 -26
  54. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/table.tsx +0 -114
  55. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/tabs.tsx +0 -115
  56. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/context/AuthContext.tsx +0 -83
  57. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/hooks/form.tsx +0 -116
  58. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/lib/utils.ts +0 -6
  59. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/About.tsx +0 -12
  60. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/ChangePassword.tsx +0 -98
  61. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/ForgotPassword.tsx +0 -67
  62. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/Login.tsx +0 -89
  63. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/Profile.tsx +0 -177
  64. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/Register.tsx +0 -130
  65. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/ResetPassword.tsx +0 -101
  66. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/new.tsx +0 -10
  67. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/utils/authenticationConfig.ts +0 -52
  68. package/dist/force-app/main/default/webapplications/appreacttemplateb2e/src/utils/helpers.ts +0 -195
@@ -1,20 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Package xmlns="http://soap.sforce.com/2006/04/metadata">
3
- <types>
4
- <members>appreacttemplateb2e</members>
5
- <name>CustomSite</name>
6
- </types>
7
- <types>
8
- <members>site/appreacttemplateb2e1</members>
9
- <name>DigitalExperienceBundle</name>
10
- </types>
11
- <types>
12
- <members>appreacttemplateb2e1</members>
13
- <name>DigitalExperienceConfig</name>
14
- </types>
15
- <types>
16
- <members>appreacttemplateb2e</members>
17
- <name>Network</name>
18
- </types>
19
- <version>66.0</version>
20
- </Package>
@@ -1,31 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <CustomSite xmlns="http://soap.sforce.com/2006/04/metadata">
3
- <active>true</active>
4
- <allowGuestPaymentsApi>false</allowGuestPaymentsApi>
5
- <allowHomePage>false</allowHomePage>
6
- <allowStandardAnswersPages>false</allowStandardAnswersPages>
7
- <allowStandardIdeasPages>false</allowStandardIdeasPages>
8
- <allowStandardLookups>false</allowStandardLookups>
9
- <allowStandardPortalPages>true</allowStandardPortalPages>
10
- <allowStandardSearch>false</allowStandardSearch>
11
- <authorizationRequiredPage>CommunitiesLogin</authorizationRequiredPage>
12
- <bandwidthExceededPage>BandwidthExceeded</bandwidthExceededPage>
13
- <browserXssProtection>true</browserXssProtection>
14
- <cachePublicVisualforcePagesInProxyServers>true</cachePublicVisualforcePagesInProxyServers>
15
- <clickjackProtectionLevel>SameOriginOnly</clickjackProtectionLevel>
16
- <contentSniffingProtection>true</contentSniffingProtection>
17
- <enableAuraRequests>true</enableAuraRequests>
18
- <fileNotFoundPage>FileNotFound</fileNotFoundPage>
19
- <genericErrorPage>Exception</genericErrorPage>
20
- <inMaintenancePage>InMaintenance</inMaintenancePage>
21
- <indexPage>CommunitiesLanding</indexPage>
22
- <masterLabel>appreacttemplateb2e</masterLabel>
23
- <redirectToCustomDomain>false</redirectToCustomDomain>
24
- <referrerPolicyOriginWhenCrossOrigin>true</referrerPolicyOriginWhenCrossOrigin>
25
- <selfRegPage>CommunitiesSelfReg</selfRegPage>
26
- <!-- <serverIsDown>SNA_U2rxy_sf_default_cdn_byo1</serverIsDown> -->
27
- <!-- <siteAdmin>epic.out.d1d3a2d722c8@orgfarm.salesforce.com</siteAdmin> -->
28
- <!-- <siteGuestRecordDefaultOwner>epic.out.d1d3a2d722c8@orgfarm.salesforce.com</siteGuestRecordDefaultOwner> -->
29
- <siteType>ChatterNetwork</siteType>
30
- <urlPathPrefix>appreacttemplateb2evforcesite</urlPathPrefix>
31
- </CustomSite>
@@ -1,45 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import { AlertCircleIcon, CheckCircle2Icon } from "lucide-react";
3
- import { Alert, AlertDescription } from "../ui/alert";
4
- import { useId } from "react";
5
-
6
- const statusAlertVariants = cva("", {
7
- variants: {
8
- variant: {
9
- error: "",
10
- success: "",
11
- },
12
- },
13
- defaultVariants: {
14
- variant: "error",
15
- },
16
- });
17
-
18
- interface StatusAlertProps extends VariantProps<typeof statusAlertVariants> {
19
- children?: React.ReactNode;
20
- /** Alert variant type. @default "error" */
21
- variant?: "error" | "success";
22
- }
23
-
24
- /**
25
- * Status alert component for displaying error or success messages.
26
- * Returns null if no children are provided.
27
- */
28
- export function StatusAlert({ children, variant = "error" }: StatusAlertProps) {
29
- if (!children) return null;
30
-
31
- const isError = variant === "error";
32
- const descriptionId = useId();
33
-
34
- return (
35
- <Alert
36
- variant={isError ? "destructive" : "default"}
37
- className={statusAlertVariants({ variant })}
38
- aria-describedby={descriptionId}
39
- role={isError ? "alert" : "status"}
40
- >
41
- {isError ? <AlertCircleIcon aria-hidden="true" /> : <CheckCircle2Icon aria-hidden="true" />}
42
- <AlertDescription id={descriptionId}>{children}</AlertDescription>
43
- </Alert>
44
- );
45
- }
@@ -1,21 +0,0 @@
1
- import { Navigate, Outlet, useSearchParams } from "react-router";
2
- import { useAuth } from "../../context/AuthContext";
3
- import { getStartUrl } from "../../utils/helpers";
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
- }
@@ -1,36 +0,0 @@
1
- import { Navigate, Outlet, useLocation } from "react-router";
2
- import { useAuth } from "../../context/AuthContext";
3
- import { AUTH_REDIRECT_PARAM, ROUTES } from "../../utils/authenticationConfig";
4
- import { CardSkeleton } from "../layout/card-skeleton";
5
-
6
- /**
7
- * [Dev Note] Route Guard:
8
- * Renders the child route (Outlet) if the user is authenticated.
9
- * Otherwise, redirects to Login with a 'startUrl' parameter so the user can be
10
- * returned to this page after successful login.
11
- */
12
- export default function PrivateRoute() {
13
- const { isAuthenticated, loading } = useAuth();
14
- const location = useLocation();
15
-
16
- if (loading) return <CardSkeleton contentMaxWidth="md" />;
17
-
18
- if (!isAuthenticated) {
19
- const searchParams = new URLSearchParams();
20
-
21
- // [Dev Note] Capture current location to return after login
22
- const destination = location.pathname + location.search;
23
- searchParams.set(AUTH_REDIRECT_PARAM, destination);
24
- return (
25
- <Navigate // Navigate accepts an object to safely construct the URL
26
- to={{
27
- pathname: ROUTES.LOGIN.PATH,
28
- search: searchParams.toString(),
29
- }}
30
- replace
31
- />
32
- );
33
- }
34
-
35
- return <Outlet />;
36
- }
@@ -1,36 +0,0 @@
1
- import { Link } from "react-router";
2
- import { cn } from "../../lib/utils";
3
-
4
- interface FooterLinkProps extends Omit<React.ComponentProps<typeof Link>, "children"> {
5
- /** Link text prefix (e.g., "Don't have an account?") */
6
- text?: string;
7
- /** Link label (e.g., "Sign up") */
8
- linkText: string;
9
- }
10
-
11
- /**
12
- * Footer link component.
13
- */
14
- export function FooterLink({ text, to, linkText, className, ...props }: FooterLinkProps) {
15
- return (
16
- <p className={cn("w-full text-center text-sm text-muted-foreground", className)}>
17
- {text && (
18
- <>
19
- {text}
20
- {/* Robustness: Explicit space ensures formatting tools don't strip it */}
21
- {"\u00A0"}
22
- </>
23
- )}
24
- <Link
25
- to={to}
26
- className={cn(
27
- "font-medium underline hover:text-primary transition-colors",
28
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
29
- )}
30
- {...props}
31
- >
32
- {linkText}
33
- </Link>
34
- </p>
35
- );
36
- }
@@ -1,81 +0,0 @@
1
- import { FieldGroup } from "../ui/field";
2
- import { StatusAlert } from "../alerts/status-alert";
3
- import { FooterLink } from "../footers/footer-link";
4
- import { SubmitButton } from "./submit-button";
5
- import { CardLayout } from "../layout/card-layout";
6
- import { useFormContext } from "../../hooks/form";
7
- import { useId } from "react";
8
-
9
- /**
10
- * [Dev Note] A wrapper component that enforces consistent layout (Card) and error/success alert positioning
11
- * for all authentication forms.
12
- */
13
- interface AuthFormProps extends Omit<React.ComponentProps<"form">, "onSubmit"> {
14
- title: string;
15
- description: string;
16
- error?: React.ReactNode;
17
- success?: React.ReactNode;
18
- submit: {
19
- text: string;
20
- loadingText?: string;
21
- disabled?: boolean;
22
- };
23
- footer?: {
24
- text?: string;
25
- link: string;
26
- linkText: string;
27
- };
28
- }
29
-
30
- /**
31
- * [Dev Note] Standardized Authentication Layout:
32
- * Wraps the specific logic of Login/Register forms with a consistent visual frame (Card),
33
- * title, and error alert placement. Extends form element props for flexibility.
34
- * This ensures all auth-related pages look and behave similarly.
35
- */
36
- export function AuthForm({
37
- id: providedId,
38
- title,
39
- description,
40
- error,
41
- success,
42
- children,
43
- submit,
44
- footer,
45
- ...props
46
- }: AuthFormProps) {
47
- const form = useFormContext();
48
- const generatedId = useId();
49
- const id = providedId ?? generatedId;
50
-
51
- return (
52
- <CardLayout title={title} description={description}>
53
- <div className="space-y-6">
54
- {/* [Dev Note] Global form error alert (e.g. "Invalid Credentials") */}
55
- {error && <StatusAlert variant="error">{error}</StatusAlert>}
56
- {success && <StatusAlert variant="success">{success}</StatusAlert>}
57
-
58
- <form
59
- id={id}
60
- onSubmit={(e) => {
61
- e.preventDefault();
62
- e.stopPropagation();
63
- form.handleSubmit();
64
- }}
65
- {...props}
66
- >
67
- <FieldGroup>{children}</FieldGroup>
68
- <SubmitButton
69
- form={id}
70
- label={submit.text}
71
- loadingLabel={submit.loadingText}
72
- disabled={submit.disabled}
73
- className="mt-6"
74
- />
75
- </form>
76
- {/* [Dev Note] Navigation links (e.g. "Forgot Password?") */}
77
- {footer && <FooterLink text={footer.text} to={footer.link} linkText={footer.linkText} />}
78
- </div>
79
- </CardLayout>
80
- );
81
- }
@@ -1,49 +0,0 @@
1
- import { Button } from "../ui/button";
2
- import { Spinner } from "../ui/spinner";
3
- import { cn } from "../../lib/utils";
4
- import { useFormContext } from "../../hooks/form";
5
-
6
- interface SubmitButtonProps extends Omit<React.ComponentProps<typeof Button>, "type"> {
7
- /** Button text when not submitting */
8
- label: string;
9
- /** Button text while submitting */
10
- loadingLabel?: string;
11
- /** Form id to associate with (for buttons outside form element) */
12
- form?: string;
13
- }
14
-
15
- const isSubmittingSelector = (state: { isSubmitting: boolean }) => state.isSubmitting;
16
-
17
- /**
18
- * Submit button that subscribes to form submission state.
19
- * UX Best Practice:
20
- * 1. Disables interaction immediately upon click (via isLoading) to prevent
21
- * accidental double-submissions.
22
- * 2. Provides immediate visual feedback (Spinner).
23
- */
24
- export function SubmitButton({
25
- label,
26
- loadingLabel = "Submitting…",
27
- className,
28
- form: formId,
29
- disabled,
30
- ...props
31
- }: SubmitButtonProps) {
32
- const form = useFormContext();
33
- return (
34
- <form.Subscribe selector={isSubmittingSelector}>
35
- {(isSubmitting: boolean) => (
36
- <Button
37
- type="submit"
38
- form={formId}
39
- className={cn("w-full", className)}
40
- disabled={isSubmitting || disabled}
41
- {...props}
42
- >
43
- {isSubmitting && <Spinner className="mr-2" aria-hidden="true" />}
44
- {isSubmitting ? loadingLabel : label}
45
- </Button>
46
- )}
47
- </form.Subscribe>
48
- );
49
- }
@@ -1,23 +0,0 @@
1
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../ui/card";
2
-
3
- interface CardLayoutProps {
4
- title: string;
5
- description?: string;
6
- children: React.ReactNode;
7
- }
8
-
9
- /**
10
- * Card layout component for authentication pages.
11
- * Provides CardHeader with title and optional description, and CardContent.
12
- */
13
- export function CardLayout({ title, description, children }: CardLayoutProps) {
14
- return (
15
- <Card>
16
- <CardHeader>
17
- <CardTitle className="text-2xl">{title}</CardTitle>
18
- {description && <CardDescription>{description}</CardDescription>}
19
- </CardHeader>
20
- <CardContent>{children}</CardContent>
21
- </Card>
22
- );
23
- }
@@ -1,38 +0,0 @@
1
- import { CenteredPageLayout } from "./centered-page-layout";
2
- import { Card, CardContent, CardHeader } from "../ui/card";
3
- import { Skeleton } from "../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,73 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import { cn } from "../../lib/utils";
3
-
4
- /**
5
- * Variant styles for the content container's maximum width.
6
- * Controls the maximum width of the inner content area within the page layout.
7
- */
8
- const contentContainerVariants = cva("w-full", {
9
- variants: {
10
- contentMaxWidth: {
11
- sm: "max-w-sm",
12
- md: "max-w-md",
13
- lg: "max-w-lg",
14
- },
15
- },
16
- defaultVariants: {
17
- contentMaxWidth: "sm",
18
- },
19
- });
20
-
21
- /**
22
- * Props for the CenteredPageLayout component.
23
- */
24
- interface CenteredPageLayoutProps
25
- extends React.ComponentProps<"div">,
26
- VariantProps<typeof contentContainerVariants> {
27
- /** The content to be displayed within the page layout */
28
- children: React.ReactNode;
29
- /**
30
- * Maximum width of the content container.
31
- * @default "sm"
32
- */
33
- contentMaxWidth?: "sm" | "md" | "lg";
34
- /**
35
- * Optional page title. If provided, will render a <title> component that React will place in the document head.
36
- */
37
- title?: string;
38
- }
39
-
40
- /**
41
- * CenteredPageLayout component that provides consistent page structure and spacing.
42
- *
43
- * This component creates a full-viewport-height container that centers its content
44
- * both horizontally and vertically. The inner content area has a configurable maximum width
45
- * to prevent content from becoming too wide on large screens.
46
- *
47
- * @example
48
- * ```tsx
49
- * <CenteredPageLayout contentMaxWidth="md">
50
- * <YourPageContent />
51
- * </CenteredPageLayout>
52
- * ```
53
- */
54
- export function CenteredPageLayout({
55
- contentMaxWidth,
56
- className,
57
- children,
58
- title,
59
- ...props
60
- }: CenteredPageLayoutProps) {
61
- return (
62
- <>
63
- {title && <title>{title}</title>}
64
- <main
65
- className={cn("flex min-h-svh w-full items-center justify-center p-6 md:p-10", className)}
66
- data-slot="page-layout"
67
- {...props}
68
- >
69
- <div className={contentContainerVariants({ contentMaxWidth })}>{children}</div>
70
- </main>
71
- </>
72
- );
73
- }
@@ -1,65 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
-
3
- import { cn } from "../../lib/utils";
4
-
5
- const alertVariants = cva(
6
- "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
7
- {
8
- variants: {
9
- variant: {
10
- default: "bg-card text-card-foreground",
11
- destructive:
12
- "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
13
- },
14
- },
15
- defaultVariants: {
16
- variant: "default",
17
- },
18
- },
19
- );
20
-
21
- function Alert({
22
- className,
23
- variant,
24
- role,
25
- ...props
26
- }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
27
- return (
28
- <div
29
- data-slot="alert"
30
- role={role ?? (variant === "destructive" ? "alert" : "status")}
31
- className={cn(alertVariants({ variant }), className)}
32
- {...props}
33
- />
34
- );
35
- }
36
-
37
- // Maintenance/A11y: Added 'asChild' pattern or a simple 'as' prop
38
- // to allow rendering semantic headings (h1-h6).
39
- interface AlertTitleProps extends React.ComponentProps<"div"> {
40
- as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "p";
41
- }
42
- function AlertTitle({ className, as: Component = "div", ...props }: AlertTitleProps) {
43
- return (
44
- <div
45
- data-slot="alert-title"
46
- className={cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className)}
47
- {...props}
48
- />
49
- );
50
- }
51
-
52
- function AlertDescription({ className, ...props }: React.ComponentProps<"div">) {
53
- return (
54
- <div
55
- data-slot="alert-description"
56
- className={cn(
57
- "col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
58
- className,
59
- )}
60
- {...props}
61
- />
62
- );
63
- }
64
-
65
- export { Alert, AlertTitle, AlertDescription };
@@ -1,54 +0,0 @@
1
- import * as React from "react";
2
- import { Slot } from "@radix-ui/react-slot";
3
- import { cva, type VariantProps } from "class-variance-authority";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
13
- destructive:
14
- "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15
- outline:
16
- "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
17
- secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
18
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
19
- link: "text-primary underline-offset-4 hover:underline",
20
- },
21
- size: {
22
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
23
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
24
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
25
- icon: "size-9",
26
- },
27
- },
28
- defaultVariants: {
29
- variant: "default",
30
- size: "default",
31
- },
32
- },
33
- );
34
-
35
- const Button = React.forwardRef<
36
- HTMLButtonElement,
37
- React.ComponentProps<"button"> &
38
- VariantProps<typeof buttonVariants> & {
39
- asChild?: boolean;
40
- }
41
- >(function Button({ className, variant, size, asChild = false, ...props }, ref) {
42
- const Comp = asChild ? Slot : "button";
43
-
44
- return (
45
- <Comp
46
- ref={ref}
47
- data-slot="button"
48
- className={cn(buttonVariants({ variant, size, className }))}
49
- {...props}
50
- />
51
- );
52
- });
53
-
54
- export { Button, buttonVariants };
@@ -1,77 +0,0 @@
1
- import { cn } from "../../lib/utils";
2
-
3
- function Card({ className, ...props }: React.ComponentProps<"div">) {
4
- return (
5
- <div
6
- data-slot="card"
7
- className={cn(
8
- "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
9
- className,
10
- )}
11
- {...props}
12
- />
13
- );
14
- }
15
-
16
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
17
- return (
18
- <div
19
- data-slot="card-header"
20
- className={cn(
21
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
22
- className,
23
- )}
24
- {...props}
25
- />
26
- );
27
- }
28
-
29
- function CardTitle({
30
- className,
31
- as: Component = "h3",
32
- ...props
33
- }: React.ComponentProps<"div"> & { as?: any }) {
34
- return (
35
- <Component
36
- data-slot="card-title"
37
- className={cn("leading-none font-semibold tracking-tight", className)}
38
- {...props}
39
- />
40
- );
41
- }
42
-
43
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
44
- return (
45
- <div
46
- data-slot="card-description"
47
- className={cn("text-muted-foreground text-sm", className)}
48
- {...props}
49
- />
50
- );
51
- }
52
-
53
- function CardAction({ className, ...props }: React.ComponentProps<"div">) {
54
- return (
55
- <div
56
- data-slot="card-action"
57
- className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)}
58
- {...props}
59
- />
60
- );
61
- }
62
-
63
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
64
- return <div data-slot="card-content" className={cn("px-6", className)} {...props} />;
65
- }
66
-
67
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
68
- return (
69
- <div
70
- data-slot="card-footer"
71
- className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
72
- {...props}
73
- />
74
- );
75
- }
76
-
77
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };