Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement(ui): migrate shared components, auth entry pages and PAM loaders to V3 (#8612)

Andrew Huang3d78e7a683b3
diff --git a/frontend/src/components/approvals/PolicyApprovalSteps.tsx b/frontend/src/components/approvals/PolicyApprovalSteps.tsx
index 7847bc4d9d..e110f2c873 100644
--- a/frontend/src/components/approvals/PolicyApprovalSteps.tsx
+++ b/frontend/src/components/approvals/PolicyApprovalSteps.tsx
@@ -1,10 +1,19 @@
-import { useMemo } from "react";
+import { useId, useMemo } from "react";
import { Controller, useFieldArray, useFormContext } from "react-hook-form";
import { MultiValue } from "react-select";
-import { faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { PlusIcon, TrashIcon } from "lucide-react";
-import { Button, FilterableSelect, FormControl, IconButton, Input } from "@app/components/v2";
+import { FilterableSelect } from "@app/components/v2";
+import {
+ Button,
+ Field,
+ FieldContent,
+ FieldDescription,
+ FieldError,
+ FieldLabel,
+ IconButton,
+ Input
+} from "@app/components/v3";
import { useProject } from "@app/context";
import { getMemberLabel } from "@app/helpers/members";
import { useGetWorkspaceUsers, useListWorkspaceGroups } from "@app/hooks/api";
@@ -19,6 +28,7 @@ type Props = {
export const PolicyApprovalSteps = ({ applicationId }: Props = {}) => {
const { control } = useFormContext<TFormWithApprovalSteps>();
+ const fieldIdPrefix = useId();
const { currentProject } = useProject();
const projectId = currentProject?.id || "";
@@ -87,9 +97,8 @@ export const PolicyApprovalSteps = ({ applicationId }: Props = {}) => {
</div>
<Button
type="button"
- variant="outline_bg"
+ variant="outline"
size="xs"
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
onClick={() =>
appendStep({
name: "",
@@ -99,6 +108,7 @@ export const PolicyApprovalSteps = ({ applicationId }: Props = {}) => {
})
}
>
+ <PlusIcon />
Add Step
</Button>
</div>
@@ -115,12 +125,12 @@ export const PolicyApprovalSteps = ({ applicationId }: Props = {}) => {
</div>
{stepFields.length > 1 && (
<IconButton
- ariaLabel="Remove step"
- variant="plain"
+ aria-label="Remove step"
+ variant="ghost"
size="xs"
onClick={() => removeStep(index)}
>
- <FontAwesomeIcon icon={faTrash} className="text-danger" />
+ <TrashIcon className="text-danger" />
</IconButton>
)}
</div>
@@ -130,16 +140,20 @@ export const PolicyApprovalSteps = ({ applicationId }: Props = {}) => {
control={control}
name={`steps.${index}.name`}
render={({ field: nameField }) => (
- <FormControl
- label="Step Name (Optional)"
- helperText="A descriptive name for this approval step"
- >
- <Input
- {...nameField}
- value={nameField.value || ""}
- placeholder="e.g., Security Team Review"
- />
- </FormControl>
+ <Field>
+ <FieldLabel htmlFor={`${fieldIdPrefix}-${index}-name`}>
+ Step Name <span className="text-muted">(optional)</span>
+ </FieldLabel>
+ <FieldContent>
+ <Input
+ {...nameField}
+ id={`${fieldIdPrefix}-${index}-name`}
+ value={nameField.value || ""}
+ placeholder="e.g., Security Team Review"
+ />
+ <FieldDescription>A descriptive name for this approval step</FieldDescription>
+ </FieldContent>
+ </Field>
)}
/>
@@ -147,21 +161,26 @@ export const PolicyApprovalSteps = ({ applicationId }: Props = {}) => {
control={control}
name={`steps.${index}.requiredApprovals`}
render={({ field: approvalsField, fieldState: { error } }) => (
- <FormControl
- label="Required Approvals"
- isRequired
- isError={Boolean(error)}
- errorText={error?.message}
- helperText="Number of approvers that must approve (1-100)"
- >
- <Input
- {...approvalsField}
- type="number"
- min={1}
- max={100}
- onChange={(e) => approvalsField.onChange(parseInt(e.target.value, 10))}
- />
- </FormControl>
+ <Field>
+ <FieldLabel htmlFor={`${fieldIdPrefix}-${index}-required-approvals`}>
+ Required Approvals <span className="text-danger">*</span>
+ </FieldLabel>
+ <FieldContent>
+ <Input
+ {...approvalsField}
+ id={`${fieldIdPrefix}-${index}-required-approvals`}
+ type="number"
+ min={1}
+ max={100}
+ isError={Boolean(error)}
+ onChange={(e) => approvalsField.onChange(parseInt(e.target.value, 10))}
+ />
+ <FieldDescription isOpen={!error}>
+ Number of approvers that must approve (1-100)
+ </FieldDescription>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
)}
/>
@@ -173,70 +192,68 @@ export const PolicyApprovalSteps = ({ applicationId }: Props = {}) => {
render={({ field: { value, onChange }, fieldState: { error } }) => {
const userApprovers = value.filter((a) => a.type === ApproverType.User);
const groupApprovers = value.filter((a) => a.type === ApproverType.Group);
+ const approversError =
+ userApprovers.length === 0 && groupApprovers.length === 0
+ ? error?.message
+ : undefined;
return (
<>
- <FormControl
- label="User Approvers"
- isError={Boolean(error)}
- errorText={
- error?.message &&
- userApprovers.length === 0 &&
- groupApprovers.length === 0
- ? error?.message
- : undefined
- }
- >
- <FilterableSelect
- isMulti
- placeholder="Select users..."
- options={memberOptions}
- getOptionValue={(option) => option.id}
- getOptionLabel={(option) => userLabel(option.id)}
- value={userApprovers}
- onChange={(selected) => {
- const newApprovers = [
- ...((selected as MultiValue<{
- type: ApproverType;
- id: string;
- }>) || []),
- ...groupApprovers
- ];
- onChange(newApprovers);
- }}
- />
- </FormControl>
+ <Field>
+ <FieldLabel htmlFor={`${fieldIdPrefix}-${index}-user-approvers`}>
+ User Approvers
+ </FieldLabel>
+ <FieldContent>
+ <FilterableSelect
+ inputId={`${fieldIdPrefix}-${index}-user-approvers`}
+ isMulti
+ placeholder="Select users..."
+ options={memberOptions}
+ getOptionValue={(option) => option.id}
+ getOptionLabel={(option) => userLabel(option.id)}
+ value={userApprovers}
+ onChange={(selected) => {
+ const newApprovers = [
+ ...((selected as MultiValue<{
+ type: ApproverType;
+ id: string;
+ }>) || []),
+ ...groupApprovers
+ ];
+ onChange(newApprovers);
+ }}
+ />
+ <FieldError>{approversError}</FieldError>
+ </FieldContent>
+ </Field>
- <FormControl
- label="Group Approvers"
- isError={Boolean(error)}
- errorText={
- error?.message &&
- userApprovers.length === 0 &&
- groupApprovers.length === 0
- ? error?.message
- : undefined
- }
- >
- <FilterableSelect
- isMulti
- placeholder="Select groups..."
- options={groupOptions}
- getOptionValue={(option) => option.id}
- getOptionLabel={(option) => groupLabel(option.id)}
- value={groupApprovers}
- onChange={(selected) => {
- const newApprovers = [
- ...userApprovers,
- ...((selected as MultiValue<{
- type: ApproverType;
- id: string;
- }>) || [])
- ];
- onChange(newApprovers);
- }}
- />
- </FormControl>
+ <Field>
+ <FieldLabel htmlFor={`${fieldIdPrefix}-${index}-group-approvers`}>
+ Group Approvers
+ </FieldLabel>
+ <FieldContent>
+ <FilterableSelect
+ inputId={`${fieldIdPrefix}-${index}-group-approvers`}
+ isMulti
+ placeholder="Select groups..."
+ options={groupOptions}
+ getOptionValue={(option) => option.id}
+ getOptionLabel={(option) => groupLabel(option.id)}
+ value={groupApprovers}
+ onChange={(selected) => {
+ const newApprovers = [
+ ...userApprovers,
+ ...((selected as MultiValue<{
+ type: ApproverType;
+ id: string;
+ }>) || [])
+ ];
+ onChange(newApprovers);
+ }}
+ />
+ <FieldError>{approversError}</FieldError>
+ </FieldContent>
+ </Field>
</>
);
}}
diff --git a/frontend/src/components/features/TtlFormLabel.tsx b/frontend/src/components/features/TtlFormLabel.tsx
index a67dadcd59..50f5025e8b 100644
--- a/frontend/src/components/features/TtlFormLabel.tsx
+++ b/frontend/src/components/features/TtlFormLabel.tsx
@@ -1,31 +1,28 @@
import { CircleHelpIcon, ExternalLinkIcon } from "lucide-react";
-import { FormLabel } from "../v2";
-import { Tooltip, TooltipContent, TooltipTrigger } from "../v3";
+import { FieldLabel, Tooltip, TooltipContent, TooltipTrigger } from "../v3";
export const TtlFormLabel = ({ label }: { label: string }) => (
- <FormLabel
- label={label}
- icon={
- <Tooltip>
- <TooltipTrigger asChild>
- <CircleHelpIcon className="size-3.5 text-muted" />
- </TooltipTrigger>
- <TooltipContent className="max-w-lg">
- <span>
- Examples: 30m, 1h, 3d, etc.{" "}
- <a
- href="https://github.com/vercel/ms?tab=readme-ov-file#examples"
- target="_blank"
- rel="noopener noreferrer"
- className="font-medium"
- >
- <span className="underline underline-offset-2">See More Examples</span>{" "}
- <ExternalLinkIcon className="mb-0.5 inline size-3" />
- </a>
- </span>
- </TooltipContent>
- </Tooltip>
- }
- />
+ <FieldLabel>
+ {label}
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <CircleHelpIcon className="size-3.5 text-muted" />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-lg">
+ <span>
+ Examples: 30m, 1h, 3d, etc.{" "}
+ <a
+ href="https://github.com/vercel/ms?tab=readme-ov-file#examples"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="font-medium"
+ >
+ <span className="underline underline-offset-2">See More Examples</span>{" "}
+ <ExternalLinkIcon className="mb-0.5 inline size-3" />
+ </a>
+ </span>
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
);
diff --git a/frontend/src/components/secrets/diff/FieldDiffRenderers.tsx b/frontend/src/components/secrets/diff/FieldDiffRenderers.tsx
index 2b92f6581f..aa7af54ff8 100644
--- a/frontend/src/components/secrets/diff/FieldDiffRenderers.tsx
+++ b/frontend/src/components/secrets/diff/FieldDiffRenderers.tsx
@@ -1,10 +1,8 @@
-import { faLock } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { LockIcon } from "lucide-react";
import { twMerge } from "tailwind-merge";
import { computeWordDiff, isSingleLine } from "@app/components/utilities/diff";
-import { Tag, Tooltip } from "@app/components/v2";
-import { Badge } from "@app/components/v3";
+import { Badge, ButtonGroup, Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";
import { DiffContainer } from "./DiffContainer";
import { MultiLineDiff } from "./MultiLineDiff";
@@ -123,20 +121,15 @@ export const TagsDiffRenderer = ({
const isInOther = otherTagSlugs.has(slug);
const isRemoved = isOldVersion && !isInOther;
const isAdded = !isOldVersion && !isInOther;
+ let variant: "danger" | "success" | "outline" = "outline";
+ if (isRemoved) variant = "danger";
+ else if (isAdded) variant = "success";
return (
- <Tag
- className={twMerge(
- "mr-0 flex w-min items-center space-x-1.5 rounded border bg-surface-base/60 py-0.5 text-xs",
- isRemoved && "border-danger/35 bg-danger/20",
- isAdded && "border-success/35 bg-success/20",
- !isRemoved && !isAdded && "border-border"
- )}
- key={slug}
- >
- {color && <div className="h-3 w-3 rounded-full" style={{ backgroundColor: color }} />}
- <div className="text-xs text-foreground">{slug}</div>
- </Tag>
+ <Badge key={slug} variant={variant}>
+ {color && <span className="size-3 rounded-full" style={{ backgroundColor: color }} />}
+ {slug}
+ </Badge>
);
})}
</div>
@@ -184,66 +177,60 @@ export const MetadataDiffRenderer = ({
const encryptionTurnedOff = encryptionChanged && isOldVersion && el.isEncrypted === true;
const encryptionTurnedOn = encryptionChanged && !isOldVersion && el.isEncrypted === true;
- const keyHighlighted = isEntirelyNew || isEntirelyRemoved || isKeyRenamed;
- const valueHighlighted = isEntirelyNew || isEntirelyRemoved || isValueChanged;
+ const keyHighlighted =
+ isEntirelyNew || isEntirelyRemoved || isKeyRenamed || encryptionChanged;
+ const valueHighlighted =
+ isEntirelyNew || isEntirelyRemoved || isValueChanged || encryptionChanged;
- const hasAnyChange = keyHighlighted || valueHighlighted || encryptionChanged;
- const borderColorClass = isOldVersion ? "border-danger/35" : "border-success/35";
- const borderClass = twMerge(
- "border",
- hasAnyChange && borderColorClass,
- !hasAnyChange && "border-border"
- );
-
- const keyBgClass = twMerge(
- "bg-muted/40",
- keyHighlighted && (isOldVersion ? "bg-danger/30" : "bg-success/30")
- );
-
- const valueBgClass = twMerge(
- valueHighlighted && (isOldVersion ? "bg-danger/30" : "bg-success/30"),
- !valueHighlighted && "bg-surface-base/60"
- );
+ const diffVariant = isOldVersion ? "danger" : "success";
- const lockIconClass = twMerge(
- "mr-1",
- encryptionTurnedOff && "text-danger",
- encryptionTurnedOn && "text-success",
- !encryptionTurnedOff && !encryptionTurnedOn && "text-foreground"
- );
+ let lockIconClass: string | undefined;
+ if (encryptionTurnedOff) lockIconClass = "text-danger";
+ else if (encryptionTurnedOn) lockIconClass = "text-success";
return (
- <div key={el.key} className="flex items-center">
- <Tag
- size="xs"
- className={twMerge("mr-0 flex items-center rounded-r-none", borderClass, keyBgClass)}
+ <ButtonGroup key={el.key} className="max-w-full min-w-0">
+ <Badge
+ variant={keyHighlighted ? diffVariant : "default"}
+ isTruncatable
+ className="max-w-[125px]"
>
{el.isEncrypted && (
- <Tooltip content="This value is encrypted">
- <FontAwesomeIcon icon={faLock} size="xs" className={lockIconClass} />
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <span className="inline-flex">
+ <LockIcon className={lockIconClass} />
+ </span>
+ </TooltipTrigger>
+ <TooltipContent>This value is encrypted</TooltipContent>
</Tooltip>
)}
- <Tooltip className="max-w-lg break-words whitespace-normal" content={el.key}>
- <div className="max-w-[125px] overflow-hidden text-ellipsis whitespace-nowrap text-foreground">
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <span>{el.key}</span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-lg break-words whitespace-normal">
{el.key}
- </div>
+ </TooltipContent>
</Tooltip>
- </Tag>
- <Tag
- size="xs"
- className={twMerge(
- "mr-0 flex items-center !rounded-l-none border-l-0 pl-1",
- borderClass,
- valueBgClass
- )}
+ </Badge>
+ <Badge
+ variant={valueHighlighted ? diffVariant : "outline"}
+ isTruncatable
+ className="max-w-[125px]"
>
- <Tooltip className="max-w-lg break-words whitespace-normal" content={el.value}>
- <div className="max-w-[125px] overflow-hidden text-ellipsis whitespace-nowrap text-foreground">
- {el.value}
- </div>
- </Tooltip>
- </Tag>
- </div>
+ {el.value && (
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <span>{el.value}</span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-lg break-words whitespace-normal">
+ {el.value}
+ </TooltipContent>
+ </Tooltip>
+ )}
+ </Badge>
+ </ButtonGroup>
);
})}
</div>
diff --git a/frontend/src/components/utilities/certificateDisplayUtils.tsx b/frontend/src/components/utilities/certificateDisplayUtils.tsx
index 4a2b2de26c..9ed7f70c8d 100644
--- a/frontend/src/components/utilities/certificateDisplayUtils.tsx
+++ b/frontend/src/components/utilities/certificateDisplayUtils.tsx
@@ -1,6 +1,6 @@
import { ReactNode } from "react";
-import { Tooltip } from "@app/components/v2";
+import { Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";
interface CertificateNameData {
altNames?: string | null;
@@ -86,8 +86,11 @@ export const CertificateDisplayName = ({
if (isTruncated) {
return (
- <Tooltip content={originalDisplayName} className={tooltipClassName}>
- <div className={className}>{displayName}</div>
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <div className={className}>{displayName}</div>
+ </TooltipTrigger>
+ <TooltipContent className={tooltipClassName}>{originalDisplayName}</TooltipContent>
</Tooltip>
);
}
diff --git a/frontend/src/pages/auth/AccountRecoveryResetPage/components/ConfirmEmailStep.tsx b/frontend/src/pages/auth/AccountRecoveryResetPage/components/ConfirmEmailStep.tsx
index 598fce68a3..8187022c8f 100644
--- a/frontend/src/pages/auth/AccountRecoveryResetPage/components/ConfirmEmailStep.tsx
+++ b/frontend/src/pages/auth/AccountRecoveryResetPage/components/ConfirmEmailStep.tsx
@@ -1,6 +1,6 @@
import { useNavigate, useSearch } from "@tanstack/react-router";
-import { Button } from "@app/components/v2";
+import { Button } from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useVerifyAccountRecoveryEmail } from "@app/hooks/api";
import { UserEncryptionVersion } from "@app/hooks/api/auth/types";
@@ -34,11 +34,9 @@ export const ConfirmEmailStep = ({ onComplete }: Props) => {
<div className="w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6">
<Button
type="submit"
- size="sm"
+ size="lg"
isFullWidth
- className="h-10"
- colorSchema="primary"
- variant="solid"
+ variant="project"
onClick={async () => {
try {
const response = await verifyPasswordResetCodeMutateAsync({
@@ -56,7 +54,7 @@ export const ConfirmEmailStep = ({ onComplete }: Props) => {
navigate({ to: "/email-not-verified" });
}
}}
- isLoading={isVerifyPasswordResetLoading}
+ isPending={isVerifyPasswordResetLoading}
>
Confirm Email
</Button>
diff --git a/frontend/src/pages/auth/CliRedirectPage/CliRedirectPage.tsx b/frontend/src/pages/auth/CliRedirectPage/CliRedirectPage.tsx
index db2ac54f32..3b93f34053 100644
--- a/frontend/src/pages/auth/CliRedirectPage/CliRedirectPage.tsx
+++ b/frontend/src/pages/auth/CliRedirectPage/CliRedirectPage.tsx
@@ -1,11 +1,10 @@
import { Helmet } from "react-helmet";
-import { faCheck, faCopy } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, useSearch } from "@tanstack/react-router";
+import { CheckIcon, CopyIcon } from "lucide-react";
import { AuthPageLayout } from "@app/components/auth/AuthPageLayout";
import { AuthPagePanel } from "@app/components/auth/AuthPagePanel";
-import { IconButton, SecretInput } from "@app/components/v2";
+import { SecretInput } from "@app/components/v2";
import { Button } from "@app/components/v3";
import { SessionStorageKeys } from "@app/const";
import { useTimedReset } from "@app/hooks";
@@ -63,16 +62,10 @@ export const CliRedirectPage = () => {
<div className="dark relative flex max-h-36 max-w-xl flex-col items-center space-y-4 overflow-y-auto rounded-md border border-border-subtle bg-surface-base p-3">
<SecretInput value={cliToken as string} />
<div className="mx-1 flex">
- <IconButton
- variant="outline_bg"
- colorSchema="primary"
- ariaLabel="copy to clipboard"
- onClick={copyUrlToClipboard}
- className="flex items-center rounded-sm py-2"
- >
- <FontAwesomeIcon className="pr-2" icon={isUrlCopied ? faCheck : faCopy} /> Copy to
- clipboard
- </IconButton>
+ <Button variant="outline" onClick={copyUrlToClipboard}>
+ {isUrlCopied ? <CheckIcon /> : <CopyIcon />}
+ Copy to clipboard
+ </Button>
</div>
</div>
</>
diff --git a/frontend/src/pages/auth/SelectOrgPage/SelectOrgPage.tsx b/frontend/src/pages/auth/SelectOrgPage/SelectOrgPage.tsx
index ff8218c7b4..e6957e4e89 100644
--- a/frontend/src/pages/auth/SelectOrgPage/SelectOrgPage.tsx
+++ b/frontend/src/pages/auth/SelectOrgPage/SelectOrgPage.tsx
@@ -20,7 +20,6 @@ import { AuthPagePanel } from "@app/components/auth/AuthPagePanel";
import { Mfa } from "@app/components/auth/Mfa";
import { createNotification } from "@app/components/notifications";
import SecurityClient from "@app/components/utilities/SecurityClient";
-import { ContentLoader, Spinner } from "@app/components/v2";
import {
Breadcrumb,
BreadcrumbItem,
@@ -31,7 +30,9 @@ import {
InputGroup,
InputGroupAddon,
InputGroupInput,
+ PageLoader,
ScrollableContent,
+ Spinner,
VerificationCodeHeader
} from "@app/components/v3";
import { cn } from "@app/components/v3/utils";
@@ -443,7 +444,7 @@ export const SelectOrgPage = () => {
if (userLoading || !user) {
return (
<div className="h-screen w-screen bg-page">
- <ContentLoader />
+ <PageLoader />
</div>
);
}
diff --git a/frontend/src/pages/cert-manager/components/MetadataFilterSection.tsx b/frontend/src/pages/cert-manager/components/MetadataFilterSection.tsx
index c33474aa06..5045da4323 100644
--- a/frontend/src/pages/cert-manager/components/MetadataFilterSection.tsx
+++ b/frontend/src/pages/cert-manager/components/MetadataFilterSection.tsx
@@ -1,7 +1,6 @@
-import { faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { PlusIcon, TrashIcon } from "lucide-react";
-import { IconButton, Input } from "@app/components/v2";
+import { IconButton, Input } from "@app/components/v3";
export type MetadataFilterEntry = {
id: string;
@@ -58,23 +57,17 @@ export const MetadataFilterSection = ({ entries, onChange }: Props) => {
className="flex-1"
/>
<IconButton
- ariaLabel="Remove metadata filter"
- variant="plain"
+ aria-label="Remove metadata filter"
+ variant="ghost"
size="xs"
onClick={() => removeEntry(idx)}
>
- <FontAwesomeIcon icon={faTrash} size="xs" />
+ <TrashIcon />
</IconButton>
</div>
))}
- <IconButton
- ariaLabel="Add metadata filter"
- variant="outline_bg"
- size="xs"
- className="rounded-md"
- onClick={addEntry}
- >
- <FontAwesomeIcon icon={faPlus} />
+ <IconButton aria-label="Add metadata filter" variant="outline" size="xs" onClick={addEntry}>
+ <PlusIcon />
</IconButton>
</div>
);
diff --git a/frontend/src/pages/middlewares/restrict-login-signup.tsx b/frontend/src/pages/middlewares/restrict-login-signup.tsx
index 56321d2cde..d8c57ab994 100644
--- a/frontend/src/pages/middlewares/restrict-login-signup.tsx
+++ b/frontend/src/pages/middlewares/restrict-login-signup.tsx
@@ -7,7 +7,7 @@ import DOMPurify from "dompurify";
import rehypeRaw from "rehype-raw";
import { z } from "zod";
-import { Button } from "@app/components/v2";
+import { Button } from "@app/components/v3";
import { SessionStorageKeys } from "@app/const";
import { useServerConfig } from "@app/context";
import { setAuthToken } from "@app/hooks/api/reactQuery";
@@ -58,7 +58,7 @@ export const AuthConsentWrapper = () => {
{DOMPurify.sanitize(config.authConsentContent)}
</ReactMarkdown>
<div className="mt-6 flex justify-end">
- <Button onClick={handleConsent} colorSchema="secondary">
+ <Button onClick={handleConsent} variant="outline">
OK
</Button>
</div>
diff --git a/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/GitHubManifestCallbackPage.tsx b/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/GitHubManifestCallbackPage.tsx
index 6dabbac1f5..0d0555ae6d 100644
--- a/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/GitHubManifestCallbackPage.tsx
+++ b/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/GitHubManifestCallbackPage.tsx
@@ -2,7 +2,7 @@ import { useEffect, useRef } from "react";
import { useNavigate, useParams, useSearch } from "@tanstack/react-router";
import { createNotification } from "@app/components/notifications";
-import { ContentLoader } from "@app/components/v2";
+import { PageLoader } from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import {
consumeCsrfToken,
@@ -97,9 +97,5 @@ export const GitHubManifestCallbackPage = () => {
navigateBack(true);
}, []);
- return (
- <div className="flex h-full w-full items-center justify-center">
- <ContentLoader text="Creating your GitHub App, please wait..." />
- </div>
- );
+ return <PageLoader text="Creating your GitHub App, please wait..." />;
};
diff --git a/frontend/src/pages/organization/NoOrgPage/NoOrgPage.tsx b/frontend/src/pages/organization/NoOrgPage/NoOrgPage.tsx
index d266eb84da..c859b5e406 100644
--- a/frontend/src/pages/organization/NoOrgPage/NoOrgPage.tsx
+++ b/frontend/src/pages/organization/NoOrgPage/NoOrgPage.tsx
@@ -6,7 +6,7 @@ import { useNavigate } from "@tanstack/react-router";
import { createNotification } from "@app/components/notifications";
import { CreateOrgModal } from "@app/components/organization/CreateOrgModal";
-import { ContentLoader } from "@app/components/v2";
+import { PageLoader } from "@app/components/v3";
import {
fetchOrganizations,
organizationKeys,
@@ -108,7 +108,9 @@ export const NoOrgPage = () => {
{failed ? (
<CreateOrgModal isOpen logoutOnClose />
) : (
- <ContentLoader text="Setting up your organization..." />
+ <div className="h-screen">
+ <PageLoader text="Setting up your organization..." />
+ </div>
)}
</div>
</>
diff --git a/frontend/src/pages/organization/SettingsPage/OauthCallbackPage/OauthCallbackPage.tsx b/frontend/src/pages/organization/SettingsPage/OauthCallbackPage/OauthCallbackPage.tsx
index 054455e057..e0e8e4186e 100644
--- a/frontend/src/pages/organization/SettingsPage/OauthCallbackPage/OauthCallbackPage.tsx
+++ b/frontend/src/pages/organization/SettingsPage/OauthCallbackPage/OauthCallbackPage.tsx
@@ -3,7 +3,7 @@ import { useNavigate, useSearch } from "@tanstack/react-router";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
-import { ContentLoader } from "@app/components/v2";
+import { PageLoader } from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization } from "@app/context";
import { useCreateMicrosoftTeamsIntegration } from "@app/hooks/api";
@@ -82,9 +82,5 @@ export const OAuthCallbackPage = () => {
})();
}, [isReady]);
- return (
- <div className="flex h-full w-full items-center justify-center">
- <ContentLoader text="Please wait! Authentication in process." />
- </div>
- );
+ return <PageLoader text="Please wait! Authentication in process." />;
};
diff --git a/frontend/src/pages/organization/SignupOnboardingPage/SignupOnboardingPage.tsx b/frontend/src/pages/organization/SignupOnboardingPage/SignupOnboardingPage.tsx
index 0916699af3..f5c5bd3587 100644
--- a/frontend/src/pages/organization/SignupOnboardingPage/SignupOnboardingPage.tsx
+++ b/frontend/src/pages/organization/SignupOnboardingPage/SignupOnboardingPage.tsx
@@ -12,7 +12,7 @@ import ProductSelectionStep from "@app/components/auth/ProductSelectionStep";
import SignupCompleteStep from "@app/components/auth/SignupCompleteStep";
import { getSignupProduct, SignupProductType } from "@app/components/auth/signupProducts";
import TeamInviteStep from "@app/components/auth/TeamInviteStep";
-import { ContentLoader } from "@app/components/v2";
+import { PageLoader } from "@app/components/v3";
import { useSelectOrganization } from "@app/hooks/api/auth/queries";
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
import { Project, ProjectType } from "@app/hooks/api/projects/types";
@@ -159,7 +159,7 @@ export const SignupOnboardingPage = () => {
/>
);
default:
- return <ContentLoader text="Loading your account..." />;
+ return <PageLoader text="Loading your account..." />;
}
};
diff --git a/frontend/src/pages/pam/PamAccountAccessPage/RdpContent.tsx b/frontend/src/pages/pam/PamAccountAccessPage/RdpContent.tsx
index 5afefef673..d27a51964c 100644
--- a/frontend/src/pages/pam/PamAccountAccessPage/RdpContent.tsx
+++ b/frontend/src/pages/pam/PamAccountAccessPage/RdpContent.tsx
@@ -1,8 +1,7 @@
import { useState } from "react";
import { TriangleAlert } from "lucide-react";
-import { ContentLoader } from "@app/components/v2";
-import { Button } from "@app/components/v3";
+import { Button, PageLoader } from "@app/components/v3";
import { TPamAccount } from "@app/hooks/api/pam";
import { DisconnectedScreen } from "./DisconnectedScreen";
@@ -52,10 +51,9 @@ export const RdpContent = ({ account, reason, mfaSessionId, selectedHost }: RdpC
<div className="flex h-dvh w-screen flex-col bg-background">
<div ref={containerRef} className="relative min-h-0 flex-1 overflow-hidden">
{isConnecting && (
- <ContentLoader
- text="Connecting to remote desktop..."
- className="absolute inset-0 z-10 h-full"
- />
+ <div className="absolute inset-0 z-10">
+ <PageLoader text="Connecting to remote desktop..." />
+ </div>
)}
{error && (
<WebAccessStatusCard
diff --git a/frontend/src/pages/pam/PamAccountAccessPage/ReasonGate.tsx b/frontend/src/pages/pam/PamAccountAccessPage/ReasonGate.tsx
index 490fbd7846..6680e372e1 100644
--- a/frontend/src/pages/pam/PamAccountAccessPage/ReasonGate.tsx
+++ b/frontend/src/pages/pam/PamAccountAccessPage/ReasonGate.tsx
@@ -1,7 +1,6 @@
import { ReactNode, useCallback, useRef, useState } from "react";
import { ShieldCheck } from "lucide-react";
-import { Spinner } from "@app/components/v2";
import {
Button,
Card,
@@ -9,6 +8,7 @@ import {
CardDescription,
CardHeader,
CardTitle,
+ Spinner,
TextArea
} from "@app/components/v3";
import { apiRequest } from "@app/config/request";
@@ -187,7 +187,7 @@ export const SessionAccessGate = ({ account, children }: Props) => {
<CardContent>
{mfaVerifying ? (
<div className="flex items-center justify-center gap-2 py-2 text-xs text-muted">
- <Spinner className="h-4 w-4" />
+ <Spinner size="xs" />
Waiting for verification...
</div>
) : (
diff --git a/frontend/src/pages/pam/PamDataExplorerPage/components/DataExplorerGrid.tsx b/frontend/src/pages/pam/PamDataExplorerPage/components/DataExplorerGrid.tsx
index 456080776e..fc0104ba06 100644
--- a/frontend/src/pages/pam/PamDataExplorerPage/components/DataExplorerGrid.tsx
+++ b/frontend/src/pages/pam/PamDataExplorerPage/components/DataExplorerGrid.tsx
@@ -3,12 +3,12 @@ import type { CellContext, ColumnDef, HeaderContext } from "@tanstack/react-tabl
import { EyeIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
-import { ContentLoader } from "@app/components/v2";
import { Alert, AlertDescription } from "@app/components/v3/generic/Alert";
import { Checkbox } from "@app/components/v3/generic/Checkbox";
import type { CellOpts } from "@app/components/v3/generic/DataGrid";
import { DataGrid, useDataGrid } from "@app/components/v3/generic/DataGrid";
import { Skeleton } from "@app/components/v3/generic/Skeleton";
+import { PageLoader } from "@app/components/v3/platform/PageLoader";
import type { ColumnInfo, FieldInfo, ForeignKeyInfo, TableDetail } from "../data-explorer-types";
import { getColumnIndicator } from "../data-explorer-utils";
@@ -768,7 +768,7 @@ export const DataExplorerGrid = ({
{/* Dice UI DataGrid */}
<div className="data-explorer-grid relative flex min-h-0 flex-1 flex-col overflow-hidden font-mono text-foreground [--color-gray-200:var(--color-border)] [&_[data-slot=grid-footer]]:hidden [&_[data-slot=grid-header]]:bg-container [&_[data-slot=grid]]:thin-scrollbar [&_[data-slot=grid]]:rounded-none [&_[data-slot=grid]]:border-0 [&_[data-slot=grid]]:bg-background">
- {isDataLoading && !hasLoaded && <ContentLoader className="h-full" />}
+ {isDataLoading && !hasLoaded && <PageLoader />}
<DataGrid
{...gridProps}
className={`min-h-0 flex-1 ${isDataLoading && !hasLoaded ? "hidden" : ""}`}
@@ -776,7 +776,7 @@ export const DataExplorerGrid = ({
/>
{isDataLoading && hasLoaded && (
<div className="absolute inset-0 z-20 flex items-center justify-center bg-background/60">
- <ContentLoader className="h-auto" lottieClassName="h-24 w-24" />
+ <PageLoader />
</div>
)}
</div>
diff --git a/frontend/src/pages/pam/PamDataExplorerPage/components/QueryResultsTable.tsx b/frontend/src/pages/pam/PamDataExplorerPage/components/QueryResultsTable.tsx
index e77b0f6c63..ef4ceb1cd7 100644
--- a/frontend/src/pages/pam/PamDataExplorerPage/components/QueryResultsTable.tsx
+++ b/frontend/src/pages/pam/PamDataExplorerPage/components/QueryResultsTable.tsx
@@ -1,8 +1,8 @@
import { useCallback, useMemo } from "react";
import type { ColumnDef } from "@tanstack/react-table";
-import { Spinner } from "@app/components/v2";
import { DataGrid, useDataGrid } from "@app/components/v3/generic/DataGrid";
+import { Spinner } from "@app/components/v3/generic/Spinner";
import type { FieldInfo } from "../data-explorer-types";
@@ -72,7 +72,7 @@ export function QueryResultsTable({ result, error, isRunning }: Props) {
if (isRunning) {
return (
<div className="flex h-full items-center justify-center">
- <Spinner className="size-5" />
+ <Spinner size="xs" />
</div>
);
}
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/MetadataForm.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/MetadataForm.tsx
index 1a4f9e435b..ca53ba3514 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/MetadataForm.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/MetadataForm.tsx
@@ -1,9 +1,20 @@
+import { Fragment, useId } from "react";
import { Control, Controller, useFieldArray } from "react-hook-form";
-import { faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { PlusIcon, TrashIcon } from "lucide-react";
-import { Button, FormControl, FormLabel, IconButton, Input } from "@app/components/v2";
-import { Empty, EmptyContent, EmptyHeader, EmptyTitle } from "@app/components/v3";
+import {
+ Button,
+ Empty,
+ EmptyContent,
+ EmptyHeader,
+ EmptyTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ FieldTitle,
+ IconButton,
+ Input
+} from "@app/components/v3";
export const MetadataForm = ({
control,
@@ -20,91 +31,89 @@ export const MetadataForm = ({
control,
name
});
+ const fieldIdPrefix = useId();
return (
- <FormControl label={title} className="mt-4">
- <div className="flex flex-col space-y-2 pt-1">
- {metadataFormFields.fields.length === 0 ? (
- <Empty className="gap-2 p-6 md:p-6">
- <EmptyHeader>
- <EmptyTitle>No metadata entries</EmptyTitle>
- </EmptyHeader>
- <EmptyContent>
- <Button
- variant="outline_bg"
- size="xs"
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
- onClick={() => metadataFormFields.append({ key: "", value: "" })}
- >
- Add entry
- </Button>
- </EmptyContent>
- </Empty>
- ) : (
- <>
+ <Field className="mt-4">
+ {title && <FieldTitle>{title}</FieldTitle>}
+ {metadataFormFields.fields.length === 0 ? (
+ <Empty className="gap-2 p-6 md:p-6">
+ <EmptyHeader>
+ <EmptyTitle>No metadata entries</EmptyTitle>
+ </EmptyHeader>
+ <EmptyContent>
+ <Button
+ variant="outline"
+ size="xs"
+ onClick={() => metadataFormFields.append({ key: "", value: "" })}
+ >
+ <PlusIcon />
+ Add entry
+ </Button>
+ </EmptyContent>
+ </Empty>
+ ) : (
+ <div className="flex flex-col gap-2">
+ <div className="grid grid-cols-[1fr_1fr_auto] items-start gap-2">
+ <FieldLabel htmlFor={`${fieldIdPrefix}-key-0`}>Key</FieldLabel>
+ <FieldLabel htmlFor={`${fieldIdPrefix}-value-0`} className="col-span-2">
+ Value
+ {!isValueRequired && <span className="text-muted">(optional)</span>}
+ </FieldLabel>
{metadataFormFields.fields.map(({ id: metadataFieldId }, i) => (
- <div key={metadataFieldId} className="flex items-start space-x-2">
- <div className="grow">
- {i === 0 && <FormLabel label="Key" className="text-xs text-muted" />}
- <Controller
- control={control}
- name={`${name}.${i}.key`}
- render={({ field, fieldState: { error } }) => (
- <FormControl
+ <Fragment key={metadataFieldId}>
+ <Controller
+ control={control}
+ name={`${name}.${i}.key`}
+ render={({ field, fieldState: { error } }) => (
+ <div className="flex flex-col gap-1">
+ <Input
+ {...field}
+ id={`${fieldIdPrefix}-key-${i}`}
+ aria-label={i === 0 ? undefined : "Key"}
isError={Boolean(error?.message)}
- errorText={error?.message}
- className="mb-0"
- >
- <Input {...field} className="max-h-8" />
- </FormControl>
- )}
- />
- </div>
- <div className="grow">
- {i === 0 && (
- <FormLabel
- label="Value"
- className="text-xs text-muted"
- isOptional={!isValueRequired}
- />
+ />
+ <FieldError errors={[error]} />
+ </div>
)}
- <Controller
- control={control}
- name={`${name}.${i}.value`}
- render={({ field, fieldState: { error } }) => (
- <FormControl
+ />
+ <Controller
+ control={control}
+ name={`${name}.${i}.value`}
+ render={({ field, fieldState: { error } }) => (
+ <div className="flex flex-col gap-1">
+ <Input
+ {...field}
+ id={`${fieldIdPrefix}-value-${i}`}
+ aria-label={i === 0 ? undefined : "Value"}
isError={Boolean(error?.message)}
- errorText={error?.message}
- className="mb-0"
- >
- <Input {...field} className="max-h-8" />
- </FormControl>
- )}
- />
- </div>
+ />
+ <FieldError errors={[error]} />
+ </div>
+ )}
+ />
<IconButton
- ariaLabel="delete key"
- className={`${i === 0 ? "mt-[1.14rem]" : ""} max-h-8`}
- variant="outline_bg"
+ aria-label="Delete key"
+ variant="outline"
onClick={() => metadataFormFields.remove(i)}
>
- <FontAwesomeIcon icon={faTrash} />
+ <TrashIcon />
</IconButton>
- </div>
+ </Fragment>
))}
- <div className="pt-2">
- <Button
- variant="outline_bg"
- size="xs"
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
- onClick={() => metadataFormFields.append({ key: "", value: "" })}
- >
- Add entry
- </Button>
- </div>
- </>
- )}
- </div>
- </FormControl>
+ </div>
+ <div className="pt-2">
+ <Button
+ variant="outline"
+ size="xs"
+ onClick={() => metadataFormFields.append({ key: "", value: "" })}
+ >
+ <PlusIcon />
+ Add entry
+ </Button>
+ </div>
+ </div>
+ )}
+ </Field>
);
};