Skip to content

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

chore(ui): remove unused v2 ConfirmActionModal, DeleteActionModal, HoverCardv2, SecretInput and Switch (#8830)

Andrew Huang2d0a6caeb1bf
diff --git a/frontend/src/components/COMPONENT_LIFECYCLE.md b/frontend/src/components/COMPONENT_LIFECYCLE.md
index 1374315e55..70bee05ea6 100644
--- a/frontend/src/components/COMPONENT_LIFECYCLE.md
+++ b/frontend/src/components/COMPONENT_LIFECYCLE.md
@@ -9,12 +9,11 @@ The [V3 migration ledger](V3_MIGRATION.md) tracks source removal, coverage, and
| Components | Status | Direction |
| -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `FilterableSelect` | Deprecated | Use V3 `Combobox` where its contract fits. |
-| `Button`, `Card`, `Checkbox`, `EmptyState`, `IconButton`, `Input`, `Pagination`, `Select`, `Switch`, `TextArea`, `Tooltip` | Ready for focused deprecation | Supported V3 replacements exist. Check representative consumers before adding component-specific guidance. |
-| `Accordion`, `Alert`, `CopyButton`, `Dropdown`, `HoverCardv2`, `Skeleton`, `Spinner`, `Table`, `Tabs` | Blocked | Composition, interaction, or state parity still needs verification. |
-| `ConfirmActionModal`, `DeleteActionModal` | Deprecated | Use V3 `ConfirmationAlertDialog` and follow the overlay recipe in the [V3 migration ledger](V3_MIGRATION.md#overlay-migration-recipe). `ConfirmActionModal` has no remaining consumers. The last `DeleteActionModal` consumer is under Secret Scanning, so removal waits for that area. |
+| `Button`, `Card`, `Checkbox`, `EmptyState`, `IconButton`, `Input`, `Pagination`, `Select`, `TextArea`, `Tooltip` | Ready for focused deprecation | Supported V3 replacements exist. Check representative consumers before adding component-specific guidance. |
+| `Accordion`, `Alert`, `CopyButton`, `Dropdown`, `Skeleton`, `Spinner`, `Table`, `Tabs` | Blocked | Composition, interaction, or state parity still needs verification. |
+| `ConfirmActionModal`, `DeleteActionModal`, `HoverCardv2`, `SecretInput`, `Switch` | Removed | Deleted the unused implementations, family indexes, and root exports. No external or internal consumers remained at `becbf4813816bb3686111b2537009201b0a90c81`. Use V3 `ConfirmationAlertDialog`, `HoverCard`, `SecretInput`, and `Toggle` for new work. |
| `Modal` | Ready for focused deprecation | Follow the overlay recipe in the [V3 migration ledger](V3_MIGRATION.md#overlay-migration-recipe). |
| `ContentLoader`, `FormControl`, `GenericFieldLabel`, `Tag` | Blocked | The V3 replacements require consumer-specific composition or accessibility changes. |
-| `SecretInput` | Blocked | Security-sensitive or specialist behavior needs workflow-level parity validation. |
| `SecretPathInput` | Removed in candidate | Deleted the unused V2 implementation and family index. No incoming module or declaration references remained at `13f5e7fe562a803a9b6de1d512cb27f67868ea6d`. The independent V3 implementation and its consumers are unchanged; this does not certify workflow parity or removal on merged main. |
| `NoticeBannerV2` | Removed | Deleted the unused implementation, empty family index, and stale root export. No external or internal consumers remained at `e05f750eb36506dac9a599709055ffb33d5b58ab`. |
diff --git a/frontend/src/components/V3_MIGRATION.md b/frontend/src/components/V3_MIGRATION.md
index da9eb560bf..fb377d3e52 100644
--- a/frontend/src/components/V3_MIGRATION.md
+++ b/frontend/src/components/V3_MIGRATION.md
@@ -34,12 +34,12 @@ In the table, E is the number of external consumer files and I is the number of
| `Button/Button.tsx` | 141 / 4 | V3 Button; map intent, disabled/loading, type, refs, and permissions per flow. | `frontend/src/pages/middlewares/restrict-login-signup.tsx:61` |
| `Card/Card.tsx` | 66 / 2 | V3 Card slots; preserve layout and state-bearing children. | `frontend/src/pages/secret-manager/integrations/SelectIntegrationAuthPage/SelectIntegrationAuthPage.tsx:164` |
| `Checkbox/Checkbox.tsx` | 11 / 1 | V3 Checkbox + Field; verify controlled/indeterminate state and labels. | `frontend/src/pages/organization/AccessManagementPage/components/UpgradePrivilegeSystemModal/UpgradePrivilegeSystemModal.tsx:180` |
-| `ConfirmActionModal/ConfirmActionModal.tsx` | 2 / 0 | V3 `ConfirmationAlertDialog` with a non-danger `confirmVariant`; follow the overlay recipe. | `frontend/src/pages/auth/AccountRecoveryResetPage/AccountRecoveryResetPage.tsx:94` |
+| `ConfirmActionModal/ConfirmActionModal.tsx` | 2 / 0 | Deleted the unused implementation, family index, and root export; no consumer changes. | At `becbf4813816bb3686111b2537009201b0a90c81`, no incoming implementation edge or external symbol reference remained. |
| `ContentLoader/ContentLoader.tsx` | 12 / 0 | V3 Loader/PageLoader composition; preserve pending boundaries. Visible copy maps to PageLoader `text`; wrap PageLoader in an `h-screen` container where the page needs full viewport height. | `frontend/src/pages/auth/SelectOrgPage/SelectOrgPage.tsx:446` |
| `CopyButton/CopyButton.tsx` | 2 / 0 | V3 CopyButton; verify exact copy, failure feedback, and labels. | `frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateDetailsSection.tsx:275` |
| `CreatableSelect/CreatableSelect.tsx` | 0 / 0 | Deleted in first wave; no consumer. | No incoming non-export edge or external symbol reference. |
| `DatePicker/DatePicker.tsx` | 0 / 0 | Deleted in first wave; no active date contract replaced. | Only its own barrel exported it. |
-| `DeleteActionModal/DeleteActionModal.tsx` | 56 / 0 | V3 `ConfirmationAlertDialog`; follow the overlay recipe for confirmation gates, mutations, cleanup, and error recovery. | `frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsSection.tsx:121` |
+| `DeleteActionModal/DeleteActionModal.tsx` | 56 / 0 | Deleted the unused implementation, family index, and root export; no consumer changes. | At `becbf4813816bb3686111b2537009201b0a90c81`, no incoming implementation edge or external symbol reference remained. |
| `Divider/Divider.tsx` | 0 / 0 | Deleted in first wave; no consumer. | Only its own/root barrels exported it. |
| `Drawer/Drawer.tsx` | 0 / 0 | Deleted in first wave; no consumer. | Only its own/root barrels exported it. |
| `Dropdown/Dropdown.tsx` | 23 / 2 | V3 DropdownMenu; check checkbox/radio, submenu, disabled actions, and focus. | `frontend/src/pages/secret-scanning/SecretScanningFindingsPage/components/SecretScanningFindingRow.tsx:137` |
@@ -52,7 +52,7 @@ In the table, E is the number of external consumer files and I is the number of
| `HeaderResizer/HeaderResizer.tsx` | 0 / 0 | Deleted in first wave; no consumer. | No incoming module edge or external symbol reference. |
| `HighlightText/index.tsx` | 0 / 0 | Deleted unused V2 re-export; canonical shared utility stays. | No incoming module edge; utility has independent consumers. |
| `HoverCard/HoverCard.tsx` | 0 / 0 | Deleted in first wave; no consumer. | No incoming module edge or external symbol reference. |
-| `HoverCardv2/HoverCardv2.tsx` | 1 / 0 | V3 HoverCard; verify trigger, rich content, placement, and focus access. | `frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsx:154` |
+| `HoverCardv2/HoverCardv2.tsx` | 1 / 0 | Deleted the unused implementation, family index, and root export; no consumer changes. | At `becbf4813816bb3686111b2537009201b0a90c81`, no incoming implementation edge or external symbol reference remained. |
| `IconButton/IconButton.tsx` | 40 / 6 | V3 IconButton; preserve accessible names, disabled/pending state and triggers. | `frontend/src/pages/auth/CliRedirectPage/CliRedirectPage.tsx:66` |
| `Input/Input.tsx` | 100 / 4 | V3 Input/InputGroup; preserve refs, validation, type and adornment behavior. V3 Input applies the V2 `data-1p-ignore` default; an explicit `data-1p-ignore` is needed only where `autoComplete` names an email, password or username. | `frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/MetadataForm.tsx:58` |
| `Lottie/Lottie.tsx` | 1 / 0 | V3 Loader; remove entry/barrel chunk-order dependency with a production boot proof. | `frontend/src/main.tsx:83` |
@@ -66,14 +66,14 @@ In the table, E is the number of external consumer files and I is the number of
| `Popover/Popover.tsx` | 0 / 0 | Deleted in first wave; no consumer. | No incoming module edge or external symbol reference. |
| `Popoverv2/Popoverv2.tsx` | 0 / 1 | Deleted with unused DatePicker in first wave. | Only DatePicker referenced it outside its own family. |
| `RadioGroup/RadioGroup.tsx` | 0 / 0 | Deleted in first wave, including an obsolete commented import. | No actual incoming module edge or external symbol reference. |
-| `SecretInput/SecretInput.tsx` | 1 / 0 | V3 specialist input; preserve masking, permission boundaries, reveal, copy, and ref behavior. | `frontend/src/pages/auth/CliRedirectPage/CliRedirectPage.tsx:64` |
+| `SecretInput/SecretInput.tsx` | 1 / 0 | Deleted the unused implementation, family index, and root export; no consumer changes. | At `becbf4813816bb3686111b2537009201b0a90c81`, no incoming implementation edge or external symbol reference remained. |
| `SecretPathInput/SecretPathInput.tsx` | 12 / 0 | Deleted the unused V2 implementation and family index in this candidate, not yet on merged main. The independent V3 SecretPathInput and its consumers are unchanged; workflow parity remains a separate validation boundary. | No incoming module or declaration references at `13f5e7fe562a803a9b6de1d512cb27f67868ea6d`; no root export, computed/glob ingress, or top-level CSS import or executable initializer. |
| `Select/Select.tsx` and components | 58 / 0 | V3 Select/Combobox chosen by interaction; preserve option values and form semantics. | `frontend/src/pages/secret-scanning/SecretScanningFindingsPage/components/SecretScanningUpdateFindingModal.tsx:94` |
| `Skeleton/Skeleton.tsx` | 3 / 1 | V3 Skeleton; preserve meaningful loading shape and table ownership. | `frontend/src/views/PkiAlertsV2Page/components/ViewPkiAlertV2Modal.tsx:54` |
| `Slider/Slider.tsx` | 0 / 1 | Deleted with unused PasswordGenerator in first wave. | PasswordGenerator was its only external-family consumer. |
| `Spinner/Spinner.tsx` | 19 / 1 | V3 Spinner; preserve wait semantics, sizing, and caller disabling. | `frontend/src/pages/auth/SelectOrgPage/SelectOrgPage.tsx:346` |
| `Stepper/Stepper.tsx` | 0 / 0 | Deleted in first wave; no consumer. | Only its own/root barrels exported it. |
-| `Switch/Switch.tsx` | 20 / 0 | V3 Toggle; preserve checked/value contract, labels, disabled and mutation state. | `frontend/src/components/secret-rotations-v2/DeleteSecretRotationV2Modal.tsx:66` |
+| `Switch/Switch.tsx` | 20 / 0 | Deleted the unused implementation, family index, and root export; no consumer changes. | At `becbf4813816bb3686111b2537009201b0a90c81`, no incoming implementation edge or external symbol reference remained. |
| `Table/Table.tsx` | 30 / 0 | V3 Table/DataGrid chosen by workflow; preserve selection, sort, resize, virtualization and pagination state. `TableSkeleton` maps to `TableSkeletonRows` (`columns`, optional `rows`; drop `innerKey`). Long-text columns that wrapped in V2 set `isWrappable` on each `TableCell`; otherwise V3 keeps cells on one line. | `frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupProjectModal.tsx:109` |
| `Tabs/Tabs.tsx` | 10 / 0 | V3 Tabs; preserve controlled/default state, URL state, panel lifetime and keyboard navigation. | `frontend/src/pages/kms/SettingsPage/SettingsPage.tsx:33` |
| `Tag/Tag.tsx` | 3 / 0 | V3 Badge composition; preserve diff/status intent and accessible text. | `frontend/src/components/secrets/diff/FieldDiffRenderers.tsx:128` |
diff --git a/frontend/src/components/v2/ConfirmActionModal/ConfirmActionModal.tsx b/frontend/src/components/v2/ConfirmActionModal/ConfirmActionModal.tsx
deleted file mode 100644
index 8c9e74f5a3..0000000000
--- a/frontend/src/components/v2/ConfirmActionModal/ConfirmActionModal.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import { type JSX, ReactNode, useEffect, useState } from "react";
-
-import { useToggle } from "@app/hooks";
-
-import { Button } from "../Button";
-import { FormControl } from "../FormControl";
-import { Input } from "../Input";
-import { Modal, ModalClose, ModalContent } from "../Modal";
-
-type Props = {
- isOpen?: boolean;
- onClose?: () => void;
- onChange?: (isOpen: boolean) => void;
- confirmKey: string;
- title: string;
- subTitle?: string;
- onConfirmed: () => Promise<void>;
- buttonText?: string;
- formContent?: ReactNode;
- children?: ReactNode;
- confirmationMessage?: ReactNode;
-};
-
-/**
- * @deprecated Use the v3 `ConfirmationAlertDialog` from `@app/components/v3` with a non-danger
- * `confirmVariant`. See the overlay recipe in `components/V3_MIGRATION.md` for the prop mapping.
- */
-export const ConfirmActionModal = ({
- isOpen,
- onClose,
- onChange,
- confirmKey,
- onConfirmed,
- title,
- subTitle = "This action is irreversible.",
- buttonText = "Yes",
- formContent,
- confirmationMessage,
- children
-}: Props): JSX.Element => {
- const [inputData, setInputData] = useState("");
- const [isLoading, setIsLoading] = useToggle();
-
- useEffect(() => {
- setInputData("");
- }, [isOpen]);
-
- const onDelete = async () => {
- setIsLoading.on();
- try {
- await onConfirmed();
- } finally {
- setIsLoading.off();
- }
- };
-
- return (
- <Modal
- isOpen={isOpen}
- onOpenChange={(isOpenState) => {
- setInputData("");
- if (onChange) onChange(isOpenState);
- }}
- >
- <ModalContent
- title={title}
- subTitle={subTitle}
- footerContent={
- <div className="mx-2 flex items-center">
- <Button
- className="mr-4"
- isDisabled={!(confirmKey === inputData) || isLoading}
- onClick={onDelete}
- isLoading={isLoading}
- >
- {buttonText}
- </Button>
- <ModalClose asChild>
- <Button variant="plain" colorSchema="secondary" onClick={onClose}>
- Cancel
- </Button>
- </ModalClose>
- </div>
- }
- onClose={onClose}
- >
- {formContent}
- <form
- onSubmit={(evt) => {
- evt.preventDefault();
- if (confirmKey === inputData) onDelete();
- }}
- >
- <FormControl
- label={
- <div className="pb-2 text-sm break-words">
- {confirmationMessage || (
- <>
- Type <span className="font-bold">{confirmKey}</span> to perform this action
- </>
- )}
- </div>
- }
- className="mb-0"
- >
- <Input
- value={inputData}
- onChange={(e) => setInputData(e.target.value)}
- placeholder={`Type ${confirmKey} here`}
- />
- </FormControl>
- {children}
- </form>
- </ModalContent>
- </Modal>
- );
-};
diff --git a/frontend/src/components/v2/ConfirmActionModal/index.tsx b/frontend/src/components/v2/ConfirmActionModal/index.tsx
deleted file mode 100644
index 8c292343f4..0000000000
--- a/frontend/src/components/v2/ConfirmActionModal/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { ConfirmActionModal } from "./ConfirmActionModal";
diff --git a/frontend/src/components/v2/DeleteActionModal/DeleteActionModal.tsx b/frontend/src/components/v2/DeleteActionModal/DeleteActionModal.tsx
deleted file mode 100644
index 4d2afb2ff6..0000000000
--- a/frontend/src/components/v2/DeleteActionModal/DeleteActionModal.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-import { type JSX, ReactNode, useEffect, useState } from "react";
-
-import { useToggle } from "@app/hooks";
-
-import { Button } from "../Button";
-import { FormControl } from "../FormControl";
-import { Input } from "../Input";
-import { Modal, ModalClose, ModalContent } from "../Modal";
-
-type Props = {
- isOpen?: boolean;
- onClose?: () => void;
- onChange?: (isOpen: boolean) => void;
- deleteKey: string;
- title: string;
- subTitle?: string;
- onDeleteApproved: () => Promise<void>;
- buttonText?: string;
- formContent?: ReactNode;
- children?: ReactNode;
- deletionMessage?: ReactNode;
- buttonColorSchema?: "danger" | "primary" | "secondary" | "gray" | null;
- isDisabled?: boolean;
-};
-
-/**
- * @deprecated Use the v3 `ConfirmationAlertDialog` from `@app/components/v3`. See the overlay recipe in
- * `components/V3_MIGRATION.md` for the prop mapping.
- */
-export const DeleteActionModal = ({
- isOpen,
- onClose,
- onChange,
- deleteKey,
- onDeleteApproved,
- title,
- subTitle = "This action is irreversible.",
- buttonText = "Delete",
- formContent,
- deletionMessage,
- buttonColorSchema = "danger",
- isDisabled,
- children
-}: Props): JSX.Element => {
- const [inputData, setInputData] = useState("");
- const [isLoading, setIsLoading] = useToggle();
-
- useEffect(() => {
- setInputData("");
- }, [isOpen]);
-
- const onDelete = async () => {
- setIsLoading.on();
- try {
- await onDeleteApproved();
- } catch {
- setIsLoading.off();
- } finally {
- setIsLoading.off();
- }
- };
-
- return (
- <Modal
- isOpen={isOpen}
- onOpenChange={(isOpenState) => {
- setInputData("");
- if (onChange) onChange(isOpenState);
- }}
- >
- <ModalContent
- title={title}
- subTitle={subTitle}
- footerContent={
- <div className="mx-2 flex items-center">
- <Button
- className="mr-4"
- colorSchema={buttonColorSchema}
- isDisabled={!(deleteKey === inputData) || isLoading || isDisabled}
- onClick={onDelete}
- isLoading={isLoading}
- >
- {buttonText}
- </Button>
- <ModalClose asChild>
- <Button variant="plain" colorSchema="secondary" onClick={onClose}>
- Cancel
- </Button>
- </ModalClose>{" "}
- </div>
- }
- onClose={onClose}
- >
- {formContent}
- <form
- onSubmit={(evt) => {
- evt.preventDefault();
- if (deleteKey === inputData) onDelete();
- }}
- >
- <FormControl
- label={
- <div className="pb-2 text-sm break-words">
- {deletionMessage || (
- <>
- Type <span className="font-bold">{deleteKey}</span> to perform this action
- </>
- )}
- </div>
- }
- className="mb-0"
- >
- <Input
- value={inputData}
- onChange={(e) => setInputData(e.target.value)}
- placeholder={`Type ${deleteKey} here`}
- />
- </FormControl>
- {children}
- </form>
- </ModalContent>
- </Modal>
- );
-};
diff --git a/frontend/src/components/v2/DeleteActionModal/index.tsx b/frontend/src/components/v2/DeleteActionModal/index.tsx
deleted file mode 100644
index 92db0d89d3..0000000000
--- a/frontend/src/components/v2/DeleteActionModal/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { DeleteActionModal } from "./DeleteActionModal";
diff --git a/frontend/src/components/v2/HoverCardv2/HoverCardv2.tsx b/frontend/src/components/v2/HoverCardv2/HoverCardv2.tsx
deleted file mode 100644
index 656aa8ff29..0000000000
--- a/frontend/src/components/v2/HoverCardv2/HoverCardv2.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { ReactNode } from "react";
-import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
-import { twMerge } from "tailwind-merge";
-
-export const HoverCardTrigger = HoverCardPrimitive.Trigger;
-
-export const HoverCard = HoverCardPrimitive.Root;
-
-export type HoverCardContentProps = {
- children?: ReactNode;
-} & HoverCardPrimitive.HoverCardContentProps;
-
-export const HoverCardContent = ({ children, className, ...props }: HoverCardContentProps) => (
- <HoverCardPrimitive.Portal>
- <HoverCardPrimitive.Content
- {...props}
- className={twMerge(
- "relative w-64 rounded-md bg-surface-active fill-surface-active p-4 pt-6 font-sans text-foreground-cool shadow-md",
- className
- )}
- >
- {children}
- <HoverCardPrimitive.Arrow className="fill-inherit stroke-inherit" />
- </HoverCardPrimitive.Content>
- </HoverCardPrimitive.Portal>
-);
diff --git a/frontend/src/components/v2/HoverCardv2/index.tsx b/frontend/src/components/v2/HoverCardv2/index.tsx
deleted file mode 100644
index 30419fca6a..0000000000
--- a/frontend/src/components/v2/HoverCardv2/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { HoverCard, HoverCardContent, HoverCardTrigger } from "./HoverCardv2";
diff --git a/frontend/src/components/v2/SecretInput/SecretInput.tsx b/frontend/src/components/v2/SecretInput/SecretInput.tsx
deleted file mode 100644
index 9887916560..0000000000
--- a/frontend/src/components/v2/SecretInput/SecretInput.tsx
+++ /dev/null
@@ -1,244 +0,0 @@
-/* eslint-disable react/no-danger */
-import { forwardRef, TextareaHTMLAttributes, useEffect, useState } from "react";
-import { twMerge } from "tailwind-merge";
-
-import { HIDDEN_SECRET_VALUE } from "@app/const/secrets";
-import { useToggle } from "@app/hooks";
-
-const REGEX = /(\${([@a-zA-Z0-9-_. ]+)})/g;
-
-const syntaxHighlight = (
- content?: string | null,
- isVisible?: boolean,
- isImport?: boolean,
- isLoadingValue?: boolean,
- isErrorLoadingValue?: boolean,
- onHoverPart?: (part: string) => void,
- hoveredPart?: string,
- isCmdOrCtrlPressed?: boolean,
- onClickSegment?: (segment: string, allSegments: string[]) => void,
- placeholder?: string
-) => {
- if (isLoadingValue) return HIDDEN_SECRET_VALUE;
- if (isErrorLoadingValue)
- return <span className="ph-no-capture text-danger/75">Error loading secret value.</span>;
- if (isImport && !content) return "EMPTY";
- if (placeholder && (content === "" || !content)) return placeholder;
- if (content === "") return "EMPTY";
- if (!content) return "EMPTY";
- if (!isVisible) return HIDDEN_SECRET_VALUE;
-
- let skipNext = false;
- const formattedContent = content.split(REGEX).flatMap((el, i) => {
- const isInterpolationSyntax = el.startsWith("${") && el.endsWith("}");
- if (isInterpolationSyntax) {
- skipNext = true;
- const part = el;
- const innerContent = el.slice(2, -1); // Remove ${ and }
- const parts = innerContent.split(".");
- const isCrossProjectRef = parts[0]?.startsWith("@");
-
- return (
- <span className="ph-no-capture relative z-10 text-warning" key={`secret-value-${i + 1}`}>
- &#36;&#123;
- {parts.map((segment, segmentIndex) => {
- const segmentKey = `${part}-segment-${segmentIndex}`;
- const isHovered = hoveredPart === segmentKey;
- const isInteractive = isCmdOrCtrlPressed && !isCrossProjectRef;
- const shouldShowHoverStyle = isHovered && isInteractive;
-
- return (
- <span key={segmentKey}>
- <span
- role="button"
- tabIndex={isInteractive ? 0 : -1}
- className={`ph-no-capture text-warning/80 ${
- isInteractive ? "pointer-events-auto" : "pointer-events-none"
- } ${shouldShowHoverStyle ? "cursor-pointer underline decoration-warning" : ""}`}
- onMouseEnter={() => onHoverPart?.(segmentKey)}
- onMouseLeave={() => onHoverPart?.("")}
- onMouseDown={(e) => {
- if (isInteractive) {
- e.preventDefault();
- e.stopPropagation();
- }
- }}
- onClick={(e) => {
- e.stopPropagation();
- if (isInteractive) {
- e.preventDefault();
- onClickSegment?.(segment, parts);
- }
- }}
- onKeyDown={(e) => {
- if (isInteractive && (e.key === "Enter" || e.key === " ")) {
- e.preventDefault();
- e.stopPropagation();
- onClickSegment?.(segment, parts);
- }
- }}
- >
- {segment}
- </span>
- {segmentIndex < parts.length - 1 && (
- <span className="ph-no-capture pointer-events-none text-warning/80">.</span>
- )}
- </span>
- );
- })}
- &#125;
- </span>
- );
- }
- if (skipNext) {
- skipNext = false;
- return [];
- }
- return el;
- });
-
- // akhilmhdh: Dont remove this br. I am still clueless how this works but weirdly enough
- // when break is added a line break works properly
- return formattedContent.concat(
- <br key={`secret-value-linebreak-${formattedContent.length + 1}`} />
- );
-};
-
-type Props = TextareaHTMLAttributes<HTMLTextAreaElement> & {
- value?: string | null;
- isVisible?: boolean;
- valueAlwaysHidden?: boolean;
- isImport?: boolean;
- isReadOnly?: boolean;
- isDisabled?: boolean;
- containerClassName?: string;
- canEditButNotView?: boolean;
- isLoadingValue?: boolean;
- isErrorLoadingValue?: boolean;
- onClickSegment?: (segment: string, allSegments: string[]) => void;
-};
-
-const commonClassName =
- "font-mono text-sm caret-foreground border-none outline-hidden w-full break-all";
-
-export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
- (
- {
- value,
- isVisible,
- isImport,
- valueAlwaysHidden,
- containerClassName,
- onBlur,
- isDisabled,
- isReadOnly,
- onFocus,
- canEditButNotView,
- isLoadingValue,
- isErrorLoadingValue,
- onClickSegment,
- placeholder,
- ...props
- },
- ref
- ) => {
- const [isSecretFocused, setIsSecretFocused] = useToggle();
- const [hoveredPart, setHoveredPart] = useState<string | undefined>();
- const [isCmdOrCtrlPressed, setIsCmdOrCtrlPressed] = useState(false);
-
- useEffect(() => {
- const handleKeyDown = (e: KeyboardEvent) => {
- if (e.metaKey || e.ctrlKey) {
- setIsCmdOrCtrlPressed(true);
- }
- };
-
- const handleKeyUp = (e: KeyboardEvent) => {
- if (!e.metaKey && !e.ctrlKey) {
- setIsCmdOrCtrlPressed(false);
- }
- };
-
- const handleBlur = () => {
- setIsCmdOrCtrlPressed(false);
- };
-
- window.addEventListener("keydown", handleKeyDown);
- window.addEventListener("keyup", handleKeyUp);
- window.addEventListener("blur", handleBlur);
-
- return () => {
- window.removeEventListener("keydown", handleKeyDown);
- window.removeEventListener("keyup", handleKeyUp);
- window.removeEventListener("blur", handleBlur);
- };
- }, []);
-
- const shouldRevealValue = isVisible || (isSecretFocused && !valueAlwaysHidden);
- const shouldBindRealValue = isVisible || isSecretFocused;
-
- return (
- <div
- className={twMerge("no-scrollbar w-full overflow-auto rounded-md", containerClassName)}
- style={{ maxHeight: `${21 * 7}px` }}
- >
- <div className="relative overflow-hidden">
- <pre aria-hidden className="pointer-events-none relative z-10 m-0">
- <code className={`inline-block w-full ${commonClassName}`}>
- <span className={twMerge("whitespace-break-spaces", !value && "text-muted")}>
- {syntaxHighlight(
- value,
- shouldRevealValue,
- isImport,
- isLoadingValue,
- isErrorLoadingValue,
- (part) => {
- setHoveredPart(part);
- },
- hoveredPart,
- isCmdOrCtrlPressed,
- onClickSegment,
- placeholder
- )}
- </span>
- </code>
- </pre>
- <textarea
- placeholder={placeholder}
- style={{ whiteSpace: "break-spaces" }}
- aria-label="secret value"
- ref={ref}
- className={`no-scrollbar absolute inset-0 block h-full resize-none overflow-hidden bg-transparent text-transparent focus:border-0 ${commonClassName}`}
- onFocus={(evt) => {
- onFocus?.(evt);
- setIsSecretFocused.on();
- if (canEditButNotView && value === HIDDEN_SECRET_VALUE) {
- evt.currentTarget.select();
- }
- }}
- onMouseDown={(e) => {
- if (canEditButNotView && value === HIDDEN_SECRET_VALUE) {
- e.preventDefault();
- e.currentTarget.select();
- }
- }}
- disabled={isDisabled}
- spellCheck={false}
- onBlur={(evt) => {
- onBlur?.(evt);
- setIsSecretFocused.off();
- }}
- onMouseLeave={() => {
- setHoveredPart(undefined);
- }}
- value={value && !shouldBindRealValue ? HIDDEN_SECRET_VALUE : (value ?? "")}
- {...props}
- readOnly={isReadOnly || isLoadingValue || isErrorLoadingValue}
- />
- </div>
- </div>
- );
- }
-);
-
-SecretInput.displayName = "SecretInput";
diff --git a/frontend/src/components/v2/SecretInput/index.tsx b/frontend/src/components/v2/SecretInput/index.tsx
deleted file mode 100644
index 1c322fac4c..0000000000
--- a/frontend/src/components/v2/SecretInput/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { SecretInput } from "./SecretInput";
diff --git a/frontend/src/components/v2/Switch/Switch.tsx b/frontend/src/components/v2/Switch/Switch.tsx
deleted file mode 100644
index f49ecd5a3b..0000000000
--- a/frontend/src/components/v2/Switch/Switch.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import { type JSX, ReactNode } from "react";
-import * as SwitchPrimitive from "@radix-ui/react-switch";
-import { twMerge } from "tailwind-merge";
-
-export type SwitchProps = Omit<SwitchPrimitive.SwitchProps, "checked" | "disabled" | "required"> & {
- children?: ReactNode;
- id: string;
- isChecked?: boolean;
- isRequired?: boolean;
- isDisabled?: boolean;
- containerClassName?: string;
- thumbClassName?: string;
-};
-
-export const Switch = ({
- children,
- id,
- className,
- isChecked,
- isDisabled,
- isRequired,
- containerClassName,
- thumbClassName,
- ...props
-}: SwitchProps): JSX.Element => (
- <div className={twMerge("flex items-center font-sans text-label-secondary", containerClassName)}>
- {children && (
- <label className="text-sm" htmlFor={id}>
- {children}
- {isRequired && <span className="pl-1 text-danger">*</span>}
- </label>
- )}
- <SwitchPrimitive.Root
- {...props}
- required={isRequired}
- checked={isChecked}
- disabled={isDisabled}
- className={twMerge(
- "ml-3 h-5 w-9 rounded-full bg-label-secondary transition-all data-[state=checked]:bg-project",
- isDisabled && "bg-muted-secondary hover:bg-muted-secondary",
- className
- )}
- id={id}
- >
- <SwitchPrimitive.Thumb
- className={twMerge(
- "block h-4 w-4 translate-x-0.5 rounded-full border-none bg-black shadow-sm transition-all will-change-transform data-[state=checked]:translate-x-[18px]",
- thumbClassName
- )}
- />
- </SwitchPrimitive.Root>
- </div>
-);
diff --git a/frontend/src/components/v2/Switch/index.tsx b/frontend/src/components/v2/Switch/index.tsx
deleted file mode 100644
index 6ac4908d23..0000000000
--- a/frontend/src/components/v2/Switch/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { SwitchProps } from "./Switch";
-export { Switch } from "./Switch";
diff --git a/frontend/src/components/v2/index.tsx b/frontend/src/components/v2/index.tsx
index 9c86016ce5..03bf65f491 100644
--- a/frontend/src/components/v2/index.tsx
+++ b/frontend/src/components/v2/index.tsx
@@ -4,24 +4,19 @@ export * from "./Alert";
export * from "./Button";
export * from "./Card";
export * from "./Checkbox";
-export * from "./ConfirmActionModal";
export * from "./ContentLoader";
-export * from "./DeleteActionModal";
export * from "./Dropdown";
export * from "./EmptyState";
export * from "./FilterableSelect";
export * from "./FormControl";
export * from "./GenericFieldLabel";
-export * from "./HoverCardv2";
export * from "./IconButton";
export * from "./Input";
export * from "./Modal";
export * from "./Pagination";
-export * from "./SecretInput";
export * from "./Select";
export * from "./Skeleton";
export * from "./Spinner";
-export * from "./Switch";
export * from "./Table";
export * from "./Tabs";
export * from "./Tag";