Skip to content

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

chore(ui): remove the V2 component library (#8865)

Andrew Huangeee5f955c281
diff --git a/DESIGN.md b/DESIGN.md
index 642fcaea0f..4d42a460ef 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -160,11 +160,10 @@ labels, and dropdown menu items. See §8 for voice rules on copy itself.
## 4. Component Stylings
-Prefer v3 components from [`frontend/src/components/v3/`](frontend/src/components/v3)
-for new UI. The v2 library is legacy; use it for new work only when v3 does not
-cover the required behavior. Existing v2 consumers marked blocked in the
-[lifecycle ledger](frontend/src/components/COMPONENT_LIFECYCLE.md) need
-consumer-specific parity checks before replacement, even on mixed pages.
+Use v3 components from [`frontend/src/components/v3/`](frontend/src/components/v3)
+for all UI. The v2 library has been removed; see the
+[lifecycle ledger](frontend/src/components/COMPONENT_LIFECYCLE.md) for
+deprecated v3 components and their replacements.
For exact tokens, classes, and supported variants, read component source and
the story when present; stories may not enumerate every implemented variant.
@@ -336,7 +335,6 @@ remain legible across the control edge.
- **DO** pair destructive confirmations with the resource name and the
consequence (see §9).
- **DO** cite tokens (`bg-card`) over hex (`#xxxxxx`) in new code.
-- **DON'T** replace existing blocked v2 consumers based on matching component names alone; check the lifecycle ledger and interaction parity first.
- **DON'T** add ad hoc box-shadows as a depth cue — borders and surface tones do
that work. The shared `Card` already has `shadow-xs`; floating elements
(Popover, DropdownMenu, Sheet, SelectedActionBar) include stronger shadows.
@@ -472,7 +470,7 @@ Pasteable prompt fragments for AI coding agents producing new UI.
4. **Adding a variant** — extend the `cva()` block in the component and add
a story when appropriate. Match the existing variant family rather than
imposing a tint recipe on neutral, outline, or product variants.
-5. **Prefer v3 for new code** — use v2 only where needed for behavior not covered
- by v3. Existing blocked v2 consumers migrate after lifecycle parity review.
+5. **Use v3.** The v2 library has been removed. Check the lifecycle ledger
+ before reaching for a deprecated v3 component.
6. **Before merging** — `make reviewable-ui` (lint + type-check).
7. **When in doubt** — mirror `OverviewPage`.
diff --git a/frontend/AGENTS.md b/frontend/AGENTS.md
index 06e68396ac..b1db5dfe2d 100644
--- a/frontend/AGENTS.md
+++ b/frontend/AGENTS.md
@@ -36,8 +36,7 @@ Middleware pages in `src/pages/middlewares/`: `authenticate.tsx` (auth guard + r
- **`src/pages/`** — Route-level components organized by product feature (secret-manager, cert-manager, kms, pam, secret-scanning, organization, project, admin, auth). Each has `route.tsx` + page component + local `components/`.
- **`src/views/`** — Reusable page-level UI composed into multiple pages. Pages import views with configuration props.
-- **`src/components/v3/`** — Latest shared UI component library (preferred). Contains `generic/` (Accordion, Alert, Button, Dialog, Select, Table, etc.) and `platform/` (domain-specific components such as `PageHeader`, scope icons, `ProjectPermissionSubjects`, and `SecretManagerResources`). **Always use v3 components for new code.** Only use v2 components when a v3 equivalent does not exist. Policy group tiles look up `getProjectPermissionSubjectPresentation`. Secret Manager overview resources (name/slug/icon/color) come from `SecretManagerResources`, which points at that subject catalog.
-- **`src/components/v2/`** — Legacy shared UI components built on Radix UI primitives + Tailwind. Uses `cva` (class-variance-authority) for variants and `tailwind-merge` for class conflict resolution. Being superseded by v3 — do not use for new features if a v3 alternative exists.
+- **`src/components/v3/`** — Latest shared UI component library (preferred). Contains `generic/` (Accordion, Alert, Button, Dialog, Select, Table, etc.) and `platform/` (domain-specific components such as `PageHeader`, scope icons, `ProjectPermissionSubjects`, and `SecretManagerResources`). **Always use v3 components.** The v2 library has been removed. Policy group tiles look up `getProjectPermissionSubjectPresentation`. Secret Manager overview resources (name/slug/icon/color) come from `SecretManagerResources`, which points at that subject catalog.
### API Layer (React Query + Axios)
diff --git a/frontend/scripts/audit-v2-ui.mjs b/frontend/scripts/audit-v2-ui.mjs
index 4a225be8d8..1c122bf631 100644
--- a/frontend/scripts/audit-v2-ui.mjs
+++ b/frontend/scripts/audit-v2-ui.mjs
@@ -221,16 +221,9 @@ for (const sourcePath of sourcePaths) {
visit(source);
}
-const outsideLegacy = [
- "frontend/src/components/basic/InputField.tsx",
- "frontend/src/components/basic/Error.tsx",
- "frontend/src/components/integrations/NoEnvironmentsBanner.tsx",
- "frontend/src/components/navigation/SecretDashboardPathBreadcrumb.tsx",
- "frontend/src/components/tags/CreateTagModal/CreateTagModal.tsx",
- "frontend/src/pages/secret-manager/OverviewPage/components/SecretSearchInput/SecretSearchInput.tsx",
- "frontend/src/pages/secret-manager/OverviewPage/components/SecretSearchInput/index.tsx",
- "frontend/src/legacy.css"
-].filter((file) => existsSync(path.join(root, file)));
+const outsideLegacy = ["frontend/src/legacy.css"].filter((file) =>
+ existsSync(path.join(root, file))
+);
const result = {
head: execFileSync("git", ["rev-parse", "HEAD"], { cwd: root, encoding: "utf8" }).trim(),
workingTree: execFileSync("git", ["status", "--porcelain"], {
diff --git a/frontend/src/components/COMPONENT_LIFECYCLE.md b/frontend/src/components/COMPONENT_LIFECYCLE.md
index ff49944c2d..e880566419 100644
--- a/frontend/src/components/COMPONENT_LIFECYCLE.md
+++ b/frontend/src/components/COMPONENT_LIFECYCLE.md
@@ -1,25 +1,16 @@
# Shared component lifecycle ledger
-This ledger records lifecycle decisions that aren't obvious from component source or Storybook. Use the V2 and V3 barrel exports to find the current component catalog, and use V3 stories as the API and usage reference. A component not listed here has no special lifecycle decision recorded.
+This ledger records lifecycle decisions that aren't obvious from component source or Storybook. Use the V3 barrel exports to find the current component catalog, and use V3 stories as the API and usage reference. A component not listed here has no special lifecycle decision recorded.
The [V3 migration ledger](V3_MIGRATION.md) tracks source removal, coverage, and validation. A blocked replacement is work to complete, not a permanent exemption. Keep supported behavior until its replacement is verified; completion requires deleting the legacy implementation and export surface.
## V2
-| Components | Status | Direction |
-| -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------- |
-| `FilterableSelect` | Deprecated | Use V3 `Combobox` where its contract fits. |
-| `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. |
-| `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`. |
+| Components | Status | Direction |
+| --- | --- | --- |
+| All V2 families and the `@app/components/v2` root barrel | Removed | Deleted the remaining `Accordion`, `Alert`, `Button`, `Card`, `Checkbox`, `ContentLoader`, `CopyButton`, `Dropdown`, `EmptyState`, `FilterableSelect`, `FormControl`, `GenericFieldLabel`, `IconButton`, `Input`, `Modal`, `Pagination`, `Select`, `Skeleton`, `Spinner`, `Table`, `Tabs`, `Tag`, `TextArea`, and `Tooltip` implementations with the `components/v2` folder. At `e434f2fdfdd608f97cd4041af84062991d2645cf` their only external consumer was the root `TooltipProvider`, which now uses the V3 provider. Use the V3 replacements in the [V3 migration ledger](V3_MIGRATION.md#family-coverage); don't reintroduce V2 sources or imports. |
-### Removed unused V2 families
-
-The 2026-10-04 source audit found no external consumers of `Blur`, `CreatableSelect`, `DatePicker`, `Divider`, `Drawer`, `Editor`, `FontAwesomeSymbol`, `HeaderResizer`, `HighlightText`, `HoverCard`, `NoticeBanner`, `PasswordGenerator`, `Popover`, `RadioGroup`, or `Stepper`. `Popoverv2` was used only by the unused `DatePicker`; `Slider` was used only by the unused `PasswordGenerator`. Their implementations, private helpers, and exports have been deleted. The canonical shared `utilities/HighlightText` remains; only its unused V2 re-export was removed. No active date-input or specialist editor contract was replaced in this cleanup.
+Earlier removals: `ConfirmActionModal`, `DeleteActionModal`, `HoverCardv2`, `SecretInput`, and `Switch` (no consumers at `becbf4813816bb3686111b2537009201b0a90c81`), `SecretPathInput`, `NoticeBannerV2`, and the 2026-10-04 first wave (`Blur`, `CreatableSelect`, `DatePicker`, `Divider`, `Drawer`, `Editor`, `FontAwesomeSymbol`, `HeaderResizer`, `HighlightText` re-export, `HoverCard`, `NoticeBanner`, `PasswordGenerator`, `Popover`, `Popoverv2`, `RadioGroup`, `Slider`, `Stepper`). The canonical shared `utilities/HighlightText` remains.
## V3
diff --git a/frontend/src/components/V3_MIGRATION.md b/frontend/src/components/V3_MIGRATION.md
index 22cadd06fd..8ac4b47462 100644
--- a/frontend/src/components/V3_MIGRATION.md
+++ b/frontend/src/components/V3_MIGRATION.md
@@ -2,6 +2,12 @@
The migration is complete only when the legacy UI implementations, exports, imports, aliases, and private dependencies are removed from the latest `main`. Migrating a consumer in an open PR does not mean its legacy family is removed on `main`. Moving an implementation into V3, renaming it, or wrapping it does not establish parity or removal.
+## Status on main
+
+The `components/v2` tree and its `@app/components/v2` root barrel are deleted. The last census before deletion, at `e434f2fdfdd608f97cd4041af84062991d2645cf`, found 24 families, 50 files, and one external consumer: the root `TooltipProvider` in `pages/root.tsx`, which now uses the V3 `TooltipProvider` with the same 700 ms delay and 300 ms skip delay. Every other V2 import was between V2 families.
+
+`legacy.css` is also deleted, so `audit-v2-ui.mjs --assert-zero` passes: zero V2 files, zero legacy module edges, zero known outside paths, and zero computed imports. The family coverage and product-surface tables below are the 2026-10-04 baseline record; keep using them for replacement guidance, not as current consumer counts.
+
## Baseline and measurement
Baseline: `infisical/infisical` `origin/main` **70e06365043ae3b6f49ef6c95a8b9997b20f4a34**, fetched **2026-10-04**. The September 24 design audit is historical context, not current acceptance evidence.
diff --git a/frontend/src/components/secret-syncs/index.ts b/frontend/src/components/secret-syncs/index.ts
index e9f8c37bc0..cbb894c716 100644
--- a/frontend/src/components/secret-syncs/index.ts
+++ b/frontend/src/components/secret-syncs/index.ts
@@ -1,4 +1,3 @@
-export * from "../v2/GenericFieldLabel";
export * from "./CreateSecretSyncModal";
export * from "./DeleteSecretSyncModal";
export * from "./EditSecretSyncModal";
diff --git a/frontend/src/components/v2/Accordion/Accordion.tsx b/frontend/src/components/v2/Accordion/Accordion.tsx
deleted file mode 100644
index a821026c27..0000000000
--- a/frontend/src/components/v2/Accordion/Accordion.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-import { forwardRef } from "react";
-import { faChevronDown } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import * as AccordionPrimitive from "@radix-ui/react-accordion";
-import { twMerge } from "tailwind-merge";
-
-export const AccordionItem = forwardRef<HTMLDivElement, AccordionPrimitive.AccordionItemProps>(
- ({ children, className, ...props }, forwardedRef) => (
- <AccordionPrimitive.Item
- className={twMerge(
- "mt-px overflow-hidden border-transparent transition-all first:mt-0 data-[state=open]:border-l data-[state=open]:border-project",
- className
- )}
- {...props}
- ref={forwardedRef}
- >
- {children}
- </AccordionPrimitive.Item>
- )
-);
-AccordionItem.displayName = "AccordionItem";
-
-export const AccordionTrigger = forwardRef<
- HTMLButtonElement,
- AccordionPrimitive.AccordionTriggerProps
->(({ children, className, ...props }, forwardedRef) => (
- <AccordionPrimitive.Header className="flex">
- <AccordionPrimitive.Trigger
- className={twMerge(
- "group flex h-11 flex-1 items-center justify-between px-4 py-2 outline-hidden hover:text-project data-[state=open]:text-project",
- className
- )}
- {...props}
- ref={forwardedRef}
- >
- {children}
- <FontAwesomeIcon
- icon={faChevronDown}
- className="text-sm transition-transform duration-300 ease-[cubic-bezier(0.87,0,0.13,1)] group-data-[state=open]:rotate-180"
- aria-hidden
- />
- </AccordionPrimitive.Trigger>
- </AccordionPrimitive.Header>
-));
-
-AccordionTrigger.displayName = "AccordionTrigger";
-
-export const AccordionContent = forwardRef<
- HTMLDivElement,
- AccordionPrimitive.AccordionContentProps & {
- childrenClassName?: string;
- }
->(({ children, className, childrenClassName, ...props }, forwardedRef) => (
- <AccordionPrimitive.Content
- className={twMerge(
- "data-[state=closed]:animate-slide-up data-[state=open]:animate-slide-down overflow-hidden",
- className
- )}
- {...props}
- ref={forwardedRef}
- >
- <div className={twMerge("px-4 py-2 text-sm", childrenClassName)}>{children}</div>
- </AccordionPrimitive.Content>
-));
-
-AccordionContent.displayName = "AccordionContent";
-
-// ref: https://www.radix-ui.com/primitives/docs/components/accordion#root
-export const Accordion = ({
- children,
- ...props
-}: AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) => (
- <AccordionPrimitive.Root
- {...props}
- className={twMerge("w-80 text-label-secondary", props.className)}
- >
- {children}
- </AccordionPrimitive.Root>
-);
diff --git a/frontend/src/components/v2/Accordion/index.tsx b/frontend/src/components/v2/Accordion/index.tsx
deleted file mode 100644
index fd2e2ddd37..0000000000
--- a/frontend/src/components/v2/Accordion/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./Accordion";
diff --git a/frontend/src/components/v2/Alert/Alert.tsx b/frontend/src/components/v2/Alert/Alert.tsx
deleted file mode 100644
index 3ef407834b..0000000000
--- a/frontend/src/components/v2/Alert/Alert.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-import { forwardRef } from "react";
-import {
- faExclamationCircle,
- faExclamationTriangle,
- faInfoCircle
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { cva, type VariantProps } from "cva";
-import { twMerge } from "tailwind-merge";
-
-const alertVariants = cva(
- "w-full bg-surface-raised rounded-lg border border-border-secondary-strong px-4 py-3 text-sm flex items-center gap-x-3",
- {
- variants: {
- variant: {
- default: "",
- danger: "text-danger border-danger",
- warning: "text-warning border-warning"
- }
- },
- defaultVariants: {
- variant: "default"
- }
- }
-);
-
-type AlertProps = {
- title?: string;
- hideTitle?: boolean;
- icon?: React.ReactNode;
- iconClassName?: string;
-};
-
-const variantTitleMap = {
- default: "Info",
- danger: "Danger",
- warning: "Warning"
-};
-
-const variantIconMap = {
- default: faInfoCircle,
- danger: faExclamationCircle,
- warning: faExclamationTriangle
-};
-
-const Alert = forwardRef<
- HTMLDivElement,
- React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants> & AlertProps
->(
- (
- { className, variant, title, icon, hideTitle = false, children, iconClassName, ...props },
- ref
- ) => {
- const defaultTitle = title ?? variantTitleMap[variant ?? "default"];
- return (
- <div
- ref={ref}
- role="alert"
- className={twMerge(alertVariants({ variant }), className)}
- {...props}
- >
- <div>
- {typeof icon !== "undefined" ? (
- <>{icon} </>
- ) : (
- <FontAwesomeIcon
- className={twMerge("text-lg text-project", iconClassName)}
- icon={variantIconMap[variant ?? "default"]}
- />
- )}
- </div>
- <div className="flex flex-col gap-y-1">
- {hideTitle ? null : (
- <h5 className="leading-6 font-normal tracking-tight" {...props}>
- {defaultTitle}
- </h5>
- )}
- {children}
- </div>
- </div>
- );
- }
-);
-Alert.displayName = "Alert";
-
-const AlertDescription = forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes<HTMLParagraphElement>
->(({ className, ...props }, ref) => (
- <div ref={ref} className={twMerge("text-sm", className)} {...props} />
-));
-AlertDescription.displayName = "AlertDescription";
-
-export { Alert, AlertDescription };
diff --git a/frontend/src/components/v2/Alert/index.tsx b/frontend/src/components/v2/Alert/index.tsx
deleted file mode 100644
index 7851a0943f..0000000000
--- a/frontend/src/components/v2/Alert/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { Alert, AlertDescription } from "./Alert";
diff --git a/frontend/src/components/v2/Button/Button.tsx b/frontend/src/components/v2/Button/Button.tsx
deleted file mode 100644
index 90a02bb5bb..0000000000
--- a/frontend/src/components/v2/Button/Button.tsx
+++ /dev/null
@@ -1,241 +0,0 @@
-import { ButtonHTMLAttributes, forwardRef, type JSX, ReactNode } from "react";
-import { cva, VariantProps } from "cva";
-import { twMerge } from "tailwind-merge";
-
-import { Loader } from "../../v3/generic/Loader";
-
-type Props = {
- children: ReactNode;
- isDisabled?: boolean;
- leftIcon?: ReactNode;
- rightIcon?: ReactNode;
- // loading state
- isLoading?: boolean;
-};
-
-// refactor(akhilmhdh): both color and size variants are together need to split it
-// colorSchema should handle all color class names
-// variant should handle how the button padding and other types should be set
-const buttonVariants = cva(
- [
- "button",
- "transition-all",
- "font-sans font-medium",
- "cursor-pointer",
- "inline-flex items-center justify-center",
- "relative",
- "whitespace-nowrap"
- ],
- {
- variants: {
- colorSchema: {
- primary: ["bg-project", "text-black", "border-project bg-opacity-90 hover:bg-opacity-100"],
- secondary: [
- "bg-surface-selected",
- "text-label-cool",
- "border-border-strong hover:bg-opacity-80"
- ],
- danger: ["bg-danger!", "text-white!", "border-danger! hover:!bg-opacity-90"],
- gray: ["bg-surface-recessed", "text-foreground-soft"]
- },
- variant: {
- solid: "",
- outline: ["bg-transparent", "border-2", "border-solid"],
- plain: "",
- selected: "",
- outline_bg: "",
- // a constant color not in use on hover or click goes colorSchema color
- star: "text-foreground-soft bg-surface-hover border-border-control",
- link: "text-project p-0! bg-transparent outline-hidden border-none"
- },
- isDisabled: {
- true: "bg-surface-hover border border-border-control text-foreground-inverse opacity-50 cursor-not-allowed",
- false: "border"
- },
- isFullWidth: {
- true: "w-full",
- false: ""
- },
- isRounded: {
- true: "rounded-md",
- false: ""
- },
- size: {
- xs: ["text-xs", "py-1", "px-2"],
- sm: ["text-sm", "py-2", "px-4"],
- md: ["text-md", "py-2", "px-5"],
- lg: ["text-lg", "py-2", "px-6"]
- }
- },
- compoundVariants: [
- {
- colorSchema: "primary",
- variant: "star",
- className:
- "bg-surface-hover border border-border-control hover:bg-project hover:text-black hover:border-project duration-100"
- },
- {
- colorSchema: "primary",
- variant: "solid",
- className: "text-black bg-project bg-opacity-90 hover:bg-project hover:text-black"
- },
- {
- colorSchema: "primary",
- variant: "selected",
- className: "bg-project/10 border border-project/50 text-foreground-soft"
- },
- {
- colorSchema: "primary",
- variant: "outline_bg",
- className:
- "bg-surface-active border border-border-strong hover:bg-project/10 hover:border-project/40 text-foreground-soft"
- },
- {
- colorSchema: "secondary",
- variant: "star",
- className:
- "bg-surface-hover border border-border-control hover:bg-surface-selected hover:text-foreground-inverse"
- },
- {
- colorSchema: "danger",
- variant: "star",
- className: "hover:bg-danger hover:text-white"
- },
- {
- colorSchema: "primary",
- variant: "outline",
- className: "text-project hover:bg-project hover:text-black"
- },
- {
- colorSchema: "secondary",
- variant: "outline",
- className: "border-border-subtle hover:border-border-strong"
- },
- {
- colorSchema: "danger",
- variant: "outline",
- className: "text-danger hover:bg-danger hover:text-black"
- },
- {
- colorSchema: "danger",
- variant: "outline_bg",
- className:
- "bg-surface-active border border-danger/40 hover:bg-danger/15 bg-danger/10 hover:border-danger text-danger"
- },
- {
- colorSchema: "primary",
- variant: "plain",
- className: "text-project"
- },
- {
- colorSchema: "gray",
- variant: "plain",
- className: "bg-transparent text-foreground-soft"
- },
- {
- colorSchema: "secondary",
- variant: "plain",
- className: "text-label hover:text-foreground-secondary border-none"
- },
- {
- colorSchema: "danger",
- variant: "plain",
- className: "text-danger"
- },
- {
- colorSchema: ["danger", "primary", "secondary"],
- variant: ["plain"],
- className: "bg-transparent py-1 px-1"
- }
- ]
- }
-);
-
-export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &
- VariantProps<typeof buttonVariants> &
- Props;
-
-export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
- (
- {
- children,
- isDisabled = false,
- className = "",
- size = "sm",
- variant = "solid",
- isFullWidth,
- isRounded = true,
- leftIcon,
- rightIcon,
- isLoading,
- colorSchema = "primary",
- ...props
- },
- ref
- ): JSX.Element => {
- const loadingToggleClass = isLoading ? "opacity-0" : "opacity-100";
-
- return (
- <button
- ref={ref}
- aria-disabled={isDisabled}
- type="button"
- className={twMerge(
- buttonVariants({
- colorSchema,
- size,
- variant,
- isRounded,
- isDisabled,
- isFullWidth,
- className
- })
- )}
- disabled={isDisabled}
- aria-busy={isLoading || undefined}
- {...props}
- >
- {isLoading && (
- <Loader
- aria-hidden
- variant={variant === "solid" && colorSchema === "primary" ? "inverse" : "brand"}
- size="sm"
- className="absolute rounded-xl opacity-80 shadow-xs"
- />
- )}
- {leftIcon && (
- <div
- className={twMerge(
- "pointer-events-none inline-flex shrink-0 items-center justify-center transition-all",
- loadingToggleClass,
- size === "xs" ? "mr-1" : "mr-2"
- )}
- >
- {leftIcon}
- </div>
- )}
- <span
- className={twMerge(
- "transition-all",
- isFullWidth ? "w-full" : "w-min",
- loadingToggleClass
- )}
- >
- {children}
- </span>
- {rightIcon && (
- <div
- className={twMerge(
- "inline-flex shrink-0 cursor-pointer items-center justify-center transition-all",
- loadingToggleClass
- )}
- >
- {rightIcon}
- </div>
- )}
- </button>
- );
- }
-);
-
-Button.displayName = "Button";
diff --git a/frontend/src/components/v2/Button/index.tsx b/frontend/src/components/v2/Button/index.tsx
deleted file mode 100644
index b3cb34cc8e..0000000000
--- a/frontend/src/components/v2/Button/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { ButtonProps } from "./Button";
-export { Button } from "./Button";
diff --git a/frontend/src/components/v2/Card/Card.tsx b/frontend/src/components/v2/Card/Card.tsx
deleted file mode 100644
index 73c398576b..0000000000
--- a/frontend/src/components/v2/Card/Card.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import { CSSProperties, forwardRef, type JSX, ReactNode } from "react";
-import { twMerge } from "tailwind-merge";
-
-export type CardTitleProps = {
- children: ReactNode;
- subTitle?: ReactNode;
- className?: string;
-};
-
-export const CardTitle = ({ children, className, subTitle }: CardTitleProps) => (
- <div
- className={twMerge(
- "mb-5 border-b border-border-control px-6 py-4 font-alliance text-lg font-normal break-words",
- className
- )}
- >
- {children}
- {subTitle && <p className="pt-2 text-sm font-normal text-muted-cool">{subTitle}</p>}
- </div>
-);
-
-export type CardFooterProps = {
- children: ReactNode;
- className?: string;
-};
-
-export const CardFooter = ({ children, className }: CardFooterProps) => (
- <div className={twMerge("p-4 pt-0", className)}>{children}</div>
-);
-
-export type CardBodyProps = {
- children: ReactNode;
- className?: string;
- style?: CSSProperties;
-};
-
-export const CardBody = ({ children, className, style }: CardBodyProps) => (
- <div className={twMerge("px-6 pt-0 pb-6", className)} style={style}>
- {children}
- </div>
-);
-
-export type CardProps = {
- children: ReactNode;
- className?: string;
- isFullHeight?: boolean;
- isRounded?: boolean;
- isPlain?: boolean;
- isHoverable?: boolean;
- style?: CSSProperties;
-};
-
-export const Card = forwardRef<HTMLDivElement, CardProps>(
- (
- { children, isFullHeight, isRounded, isHoverable, isPlain, className, style },
- ref
- ): JSX.Element => {
- return (
- <div
- ref={ref}
- className={twMerge(
- "flex w-full flex-col bg-surface-raised font-sans text-foreground-cool shadow-md",
- isFullHeight && "h-full",
- isRounded && "rounded-md",
- isPlain && "shadow-none",
- isHoverable && "hover:shadow-xl",
- className
- )}
- style={style}
- >
- {children}
- </div>
- );
- }
-);
-
-Card.displayName = "Card";
diff --git a/frontend/src/components/v2/Card/index.tsx b/frontend/src/components/v2/Card/index.tsx
deleted file mode 100644
index 48b09705df..0000000000
--- a/frontend/src/components/v2/Card/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { CardBodyProps, CardFooterProps, CardProps, CardTitleProps } from "./Card";
-export { Card, CardBody, CardFooter, CardTitle } from "./Card";
diff --git a/frontend/src/components/v2/Checkbox/Checkbox.tsx b/frontend/src/components/v2/Checkbox/Checkbox.tsx
deleted file mode 100644
index b6cae8c139..0000000000
--- a/frontend/src/components/v2/Checkbox/Checkbox.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-import { type JSX, ReactNode } from "react";
-import { faCheck, faMinus } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
-import { twMerge } from "tailwind-merge";
-
-export type CheckboxProps = Omit<
- CheckboxPrimitive.CheckboxProps,
- "checked" | "disabled" | "required"
-> & {
- children?: ReactNode;
- id: string;
- isDisabled?: boolean;
- isChecked?: boolean;
- isRequired?: boolean;
- checkIndicatorBg?: string | undefined;
- isError?: boolean;
- isIndeterminate?: boolean;
- containerClassName?: string;
- indicatorClassName?: string;
- allowMultilineLabel?: boolean;
-};
-
-export const Checkbox = ({
- children,
- className,
- id,
- isChecked,
- isDisabled,
- isRequired,
- checkIndicatorBg,
- isError,
- isIndeterminate,
- containerClassName,
- indicatorClassName,
- allowMultilineLabel,
- ...props
-}: CheckboxProps): JSX.Element => {
- return (
- <div
- className={twMerge("flex items-center font-sans text-label-secondary", containerClassName)}
- >
- <CheckboxPrimitive.Root
- className={twMerge(
- "flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-border-emphasis/50 bg-surface-hover shadow-sm transition-all hover:bg-surface-selected",
- isDisabled && "cursor-not-allowed bg-surface-active opacity-40",
- isChecked && "border-project/50 bg-project/30",
- Boolean(children) && "mr-3",
- className
- )}
- required={isRequired}
- checked={isChecked}
- disabled={isDisabled}
- {...props}
- id={id}
- >
- <CheckboxPrimitive.Indicator
- className={twMerge(
- `${checkIndicatorBg || "mt-[0.1rem] text-foreground-secondary"}`,
- indicatorClassName
- )}
- >
- {isIndeterminate ? (
- <FontAwesomeIcon icon={faMinus} size="sm" />
- ) : (
- <FontAwesomeIcon icon={faCheck} size="sm" />
- )}
- </CheckboxPrimitive.Indicator>
- </CheckboxPrimitive.Root>
- <label
- className={twMerge(
- "text-sm",
- !allowMultilineLabel && "truncate whitespace-nowrap",
- isError && "text-danger"
- )}
- htmlFor={id}
- >
- {children}
- {isRequired && <span className="pl-1 text-danger">*</span>}
- </label>
- </div>
- );
-};
diff --git a/frontend/src/components/v2/Checkbox/index.tsx b/frontend/src/components/v2/Checkbox/index.tsx
deleted file mode 100644
index 374e8e394b..0000000000
--- a/frontend/src/components/v2/Checkbox/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { CheckboxProps } from "./Checkbox";
-export { Checkbox } from "./Checkbox";
diff --git a/frontend/src/components/v2/ContentLoader/ContentLoader.tsx b/frontend/src/components/v2/ContentLoader/ContentLoader.tsx
deleted file mode 100644
index a2e143ce8f..0000000000
--- a/frontend/src/components/v2/ContentLoader/ContentLoader.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-// this will show a loading animation with text below
-// if you pass array it will say it one by one giving user clear instruction on what's happening
-
-import { useEffect, useState } from "react";
-import { AnimatePresence, motion } from "motion/react";
-import { twMerge } from "tailwind-merge";
-
-import { Loader } from "../../v3/generic/Loader";
-
-type Props = {
- text?: string | string[];
- frequency?: number;
- className?: string;
- lottieClassName?: string;
-};
-
-export const ContentLoader = ({ text, frequency = 2000, className, lottieClassName }: Props) => {
- const [pos, setPos] = useState(0);
- const isTextArray = Array.isArray(text);
- useEffect(() => {
- let interval: NodeJS.Timeout;
- if (isTextArray) {
- interval = setInterval(() => {
- setPos((state) => (state + 1) % text.length);
- }, frequency);
- }
- return () => clearInterval(interval);
- }, []);
-
- return (
- <div
- className={twMerge(
- "relative container mx-auto flex h-screen w-full flex-col items-center justify-center space-y-8 px-8 text-foreground-bright dark:scheme-dark",
- className
- )}
- >
- <Loader variant="brand" size="lg" className={twMerge("h-32", lottieClassName)} />
- {text && isTextArray && (
- <AnimatePresence mode="wait">
- <motion.div
- className="text-project"
- key={`content-loader-${pos}`}
- initial={{ opacity: 0, translateY: 20 }}
- animate={{ opacity: 1, translateY: 0 }}
- exit={{ opacity: 0, translateY: -20 }}
- >
- {text[pos]}
- </motion.div>
- </AnimatePresence>
- )}
- {text && !isTextArray && <div className="text-xs text-project">{text}</div>}
- </div>
- );
-};
diff --git a/frontend/src/components/v2/ContentLoader/index.tsx b/frontend/src/components/v2/ContentLoader/index.tsx
deleted file mode 100644
index 78b373523c..0000000000
--- a/frontend/src/components/v2/ContentLoader/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { ContentLoader } from "./ContentLoader";
diff --git a/frontend/src/components/v2/CopyButton/CopyButton.tsx b/frontend/src/components/v2/CopyButton/CopyButton.tsx
deleted file mode 100644
index 135dec3663..0000000000
--- a/frontend/src/components/v2/CopyButton/CopyButton.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import { faCheck, faCopy, IconDefinition } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { twMerge } from "tailwind-merge";
-
-import { useTimedReset } from "@app/hooks";
-
-import { IconButton } from "../IconButton";
-import { Tooltip } from "../Tooltip";
-
-export type CopyButtonProps = {
- value: string;
- size?: "xs" | "sm" | "md" | "lg";
- variant?: "solid" | "outline" | "plain" | "star" | "outline_bg";
- color?: string;
- name?: string;
- icon?: IconDefinition;
-};
-
-export const CopyButton = ({
- value,
- size = "sm",
- variant = "solid",
- color,
- name,
- icon = faCopy
-}: CopyButtonProps) => {
- const [copyText, isCopying, setCopyText] = useTimedReset<string>({
- initialState: name ? `Copy ${name}` : "Copy to clipboard"
- });
-
- async function handleCopyText() {
- setCopyText("Copied");
- navigator.clipboard.writeText(value);
- }
-
- return (
- <div>
- <Tooltip content={copyText} size={size === "xs" || size === "sm" ? "sm" : "md"}>
- <IconButton
- ariaLabel={copyText}
- variant={variant}
- className={twMerge("group relative", color)}
- size={size}
- onClick={(e) => {
- e.stopPropagation();
- handleCopyText();
- }}
- >
- <FontAwesomeIcon icon={isCopying ? faCheck : icon} />
- </IconButton>
- </Tooltip>
- </div>
- );
-};
-
-CopyButton.displayName = "CopyButton";
diff --git a/frontend/src/components/v2/CopyButton/index.tsx b/frontend/src/components/v2/CopyButton/index.tsx
deleted file mode 100644
index 9a7bc59916..0000000000
--- a/frontend/src/components/v2/CopyButton/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { CopyButtonProps } from "./CopyButton";
-export { CopyButton } from "./CopyButton";
diff --git a/frontend/src/components/v2/Dropdown/Dropdown.tsx b/frontend/src/components/v2/Dropdown/Dropdown.tsx
deleted file mode 100644
index b843de5e3c..0000000000
--- a/frontend/src/components/v2/Dropdown/Dropdown.tsx
+++ /dev/null
@@ -1,170 +0,0 @@
-import { ComponentPropsWithRef, ElementType, forwardRef, ReactNode, Ref } from "react";
-import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
-import { twMerge } from "tailwind-merge";
-
-// Main menu or parent container
-export type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps;
-export const DropdownMenu = DropdownMenuPrimitive.Root;
-
-export type DropdownSubMenuProps = DropdownMenuPrimitive.DropdownMenuSubProps;
-export const DropdownSubMenu = DropdownMenuPrimitive.Sub;
-
-// trigger
-export type DropdownMenuTriggerProps = DropdownMenuPrimitive.DropdownMenuTriggerProps;
-export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
-
-// item container
-export type DropdownMenuContentProps = DropdownMenuPrimitive.DropdownMenuContentProps;
-export const DropdownMenuContent = forwardRef<HTMLDivElement, DropdownMenuContentProps>(
- ({ children, className, ...props }, forwardedRef) => {
- return (
- <DropdownMenuPrimitive.Portal>
- <DropdownMenuPrimitive.Content
- sideOffset={-8}
- {...props}
- ref={forwardedRef}
- className={twMerge(
- "data-[side=bottom]:animate-slide-up-and-fade data-[side=left]:animate-slide-right-and-fade data-[side=right]:animate-slide-left-and-fade data-[side=top]:animate-slide-down-and-fade z-[60] min-w-[220px] overflow-y-auto rounded-md border border-border-control bg-surface-base text-label-secondary shadow-sm will-change-auto",
- className
- )}
- >
- {children}
- </DropdownMenuPrimitive.Content>
- </DropdownMenuPrimitive.Portal>
- );
- }
-);
-
-DropdownMenuContent.displayName = "DropdownMenuContent";
-
-// item container
-export type DropdownSubMenuContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;
-export const DropdownSubMenuContent = forwardRef<HTMLDivElement, DropdownSubMenuContentProps>(
- ({ children, className, ...props }, forwardedRef) => {
- return (
- <DropdownMenuPrimitive.Portal>
- <DropdownMenuPrimitive.SubContent
- sideOffset={2}
- {...props}
- ref={forwardedRef}
- className={twMerge(
- "data-[side=bottom]:animate-slide-up-and-fade data-[side=left]:animate-slide-right-and-fade data-[side=right]:animate-slide-left-and-fade data-[side=top]:animate-slide-down-and-fade z-[60] min-w-[220px] rounded-md border border-border-control bg-surface-base text-label-secondary shadow-sm will-change-auto",
- className
- )}
- >
- {children}
- </DropdownMenuPrimitive.SubContent>
- </DropdownMenuPrimitive.Portal>
- );
- }
-);
-
-DropdownSubMenuContent.displayName = "DropdownMenuContent";
-
-// item label component
-export type DropdownLabelProps = DropdownMenuPrimitive.DropdownMenuLabelProps;
-export const DropdownMenuLabel = ({ className, ...props }: DropdownLabelProps) => (
- <DropdownMenuPrimitive.Label
- {...props}
- className={twMerge("px-4 pt-2 pb-1 text-xs text-muted-secondary", className)}
- />
-);
-
-// dropdown items
-export type DropdownMenuItemProps<T extends ElementType> =
- DropdownMenuPrimitive.DropdownMenuContentProps & {
- icon?: ReactNode;
- as?: T;
- inputRef?: Ref<T>;
- iconPos?: "left" | "right";
- };
-
-export const DropdownMenuItem = <T extends ElementType = "button">({
- children,
- inputRef,
- className,
- icon,
- as: Item = "button",
- iconPos = "left",
- isDisabled = false,
- ...props
-}: DropdownMenuItemProps<T> & ComponentPropsWithRef<T> & { isDisabled?: boolean }) => (
- <DropdownMenuPrimitive.Item
- {...props}
- className={twMerge(
- "block cursor-pointer rounded-xs px-4 py-2 font-sans text-xs text-foreground-secondary outline-hidden data-highlighted:bg-surface-hover",
- className,
- isDisabled ? "pointer-events-none cursor-not-allowed opacity-50" : ""
- )}
- >
- <Item type="button" role="menuitem" className="flex w-full items-center" ref={inputRef}>
- {icon && iconPos === "left" && <span className="mr-2 flex items-center">{icon}</span>}
- <span className="grow text-left">{children}</span>
- {icon && iconPos === "right" && <span className="ml-2 flex items-center">{icon}</span>}
- </Item>
- </DropdownMenuPrimitive.Item>
-);
-
-// trigger
-export type DropdownSubMenuTriggerProps<T extends ElementType> =
- DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {
- icon?: ReactNode;
- as?: T;
- inputRef?: Ref<T>;
- iconPos?: "left" | "right";
- };
-
-export const DropdownSubMenuTrigger = <T extends ElementType = "button">({
- children,
- inputRef,
- className,
- icon,
- as: Item = "button",
- iconPos = "left",
- ...props
-}: DropdownMenuItemProps<T> & ComponentPropsWithRef<T>) => (
- <DropdownMenuPrimitive.SubTrigger
- {...props}
- className={twMerge(
- "block cursor-pointer rounded-xs px-4 py-2 font-sans text-xs text-foreground-secondary outline-hidden data-highlighted:bg-surface-hover",
- className
- )}
- >
- <Item type="button" role="menuitem" className="flex w-full items-center" ref={inputRef}>
- {icon && iconPos === "left" && <span className="mr-2 flex items-center">{icon}</span>}
- <span className="grow text-left">{children}</span>
- {icon && iconPos === "right" && <span className="ml-2 flex items-center">{icon}</span>}
- </Item>
- </DropdownMenuPrimitive.SubTrigger>
-);
-
-// grouping items into 1
-export type DropdownMenuGroupProps = DropdownMenuPrimitive.DropdownMenuGroupProps;
-
-export const DropdownMenuGroup = forwardRef<HTMLDivElement, DropdownMenuGroupProps>(
- ({ ...props }, ref) => (
- <DropdownMenuPrimitive.Group
- {...props}
- className={twMerge("py-2 pl-3 text-xs", props.className)}
- ref={ref}
- />
- )
-);
-
-DropdownMenuGroup.displayName = "DropdownMenuGroup";
-
-// Divider
-export const DropdownMenuSeparator = forwardRef<
- HTMLDivElement,
- DropdownMenuPrimitive.DropdownMenuSeparatorProps
->(({ className, ...props }, ref) => (
- <DropdownMenuPrimitive.Separator
- ref={ref}
- {...props}
- className={twMerge("m-1 h-px bg-surface-cool-selected", className)}
- />
-));
-
-DropdownMenuSeparator.displayName = "DropdownMenuSeperator";
-
-DropdownMenuSeparator.displayName = "DropdownMenuSeperator";
diff --git a/frontend/src/components/v2/Dropdown/index.tsx b/frontend/src/components/v2/Dropdown/index.tsx
deleted file mode 100644
index bde01449e8..0000000000
--- a/frontend/src/components/v2/Dropdown/index.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-export type {
- DropdownLabelProps,
- DropdownMenuContentProps,
- DropdownMenuGroupProps,
- DropdownMenuItemProps,
- DropdownMenuProps,
- DropdownMenuTriggerProps,
- DropdownSubMenuContentProps,
- DropdownSubMenuProps,
- DropdownSubMenuTriggerProps
-} from "./Dropdown";
-export {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
- DropdownSubMenu,
- DropdownSubMenuContent,
- DropdownSubMenuTrigger
-} from "./Dropdown";
diff --git a/frontend/src/components/v2/EmptyState/EmptyState.tsx b/frontend/src/components/v2/EmptyState/EmptyState.tsx
deleted file mode 100644
index 87f3fb28c9..0000000000
--- a/frontend/src/components/v2/EmptyState/EmptyState.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { ReactNode } from "react";
-import { SizeProp } from "@fortawesome/fontawesome-svg-core";
-import { faCubesStacked, IconDefinition } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { twMerge } from "tailwind-merge";
-
-type Props = {
- title: ReactNode;
- className?: string;
- children?: ReactNode;
- icon?: IconDefinition;
- iconSize?: SizeProp;
- titleClassName?: string;
-};
-
-export const EmptyState = ({
- title,
- className,
- children,
- icon = faCubesStacked,
- iconSize = "2x",
- titleClassName
-}: Props) => (
- <div
- className={twMerge(
- "flex w-full flex-col items-center bg-surface-raised px-2 pt-4 text-label-secondary",
- className
- )}
- >
- <FontAwesomeIcon icon={icon} size={iconSize} />
- <div className="flex flex-col items-center py-4">
- <div className={twMerge("text-sm text-label-secondary", titleClassName)}>{title}</div>
- <div>{children}</div>
- </div>
- </div>
-);
diff --git a/frontend/src/components/v2/EmptyState/index.tsx b/frontend/src/components/v2/EmptyState/index.tsx
deleted file mode 100644
index aac2d4d676..0000000000
--- a/frontend/src/components/v2/EmptyState/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { EmptyState } from "./EmptyState";
diff --git a/frontend/src/components/v2/FilterableSelect/FilterableSelect.tsx b/frontend/src/components/v2/FilterableSelect/FilterableSelect.tsx
deleted file mode 100644
index e06b1383dd..0000000000
--- a/frontend/src/components/v2/FilterableSelect/FilterableSelect.tsx
+++ /dev/null
@@ -1,130 +0,0 @@
-import Select, { Props } from "react-select";
-import { twMerge } from "tailwind-merge";
-
-import {
- ClearIndicator,
- DropdownIndicator,
- Group,
- MultiValueRemove,
- Option
-} from "../Select/components";
-
-/**
- * @deprecated Migrate searchable single- and multi-select callsites to the v3 `Combobox` when its
- * contract fits. Creatable, grouped, and advanced compatibility consumers remain supported.
- */
-export const FilterableSelect = <T,>({
- isMulti,
- closeMenuOnSelect,
- tabSelectsValue = false,
- groupBy = null,
- getGroupHeaderLabel = null,
- options = [],
- menuListClassName,
- ...props
-}: Props<T> & {
- groupBy?: string | null;
- getGroupHeaderLabel?: ((groupValue: any) => string) | null;
- menuListClassName?: string;
-}) => {
- let processedOptions = options;
-
- if (groupBy && Array.isArray(options)) {
- const groupedOptions = options.reduce((acc, option) => {
- const groupValue = option[groupBy];
- const groupKey = groupValue?.toString() || "undefined";
-
- if (!acc[groupKey]) {
- acc[groupKey] = {
- label: getGroupHeaderLabel ? getGroupHeaderLabel(groupValue) : groupValue,
- options: []
- };
- }
-
- acc[groupKey].options.push(option);
- return acc;
- }, {});
-
- processedOptions = Object.values(groupedOptions);
- }
-
- return (
- <Select
- isMulti={isMulti}
- closeMenuOnSelect={closeMenuOnSelect ?? !isMulti}
- hideSelectedOptions={false}
- unstyled
- options={processedOptions}
- styles={{
- input: (base) => ({
- ...base,
- "input:focus": {
- boxShadow: "none"
- }
- }),
- multiValueLabel: (base) => ({
- ...base,
- whiteSpace: "normal",
- overflow: "visible"
- }),
- control: (base) => ({
- ...base,
- transition: "none"
- }),
- menuPortal: (provided) => ({
- ...provided,
- zIndex: 99999
- })
- }}
- tabSelectsValue={tabSelectsValue}
- components={{
- DropdownIndicator,
- ClearIndicator,
- MultiValueRemove,
- Option,
- Group,
- ...props.components
- }}
- classNames={{
- container: ({ isDisabled }) =>
- twMerge("w-full font-sans text-sm", isDisabled && "pointer-events-auto! opacity-50"),
- control: ({ isFocused, isDisabled }) =>
- twMerge(
- isFocused ? "border-project/50" : "border-border-control",
- `w-full rounded-md border bg-surface-base p-0.5 font-sans text-foreground-secondary ${
- isDisabled
- ? "cursor-not-allowed!"
- : "hover:cursor-pointer hover:border-border-cool-emphasis"
- } `
- ),
- placeholder: () => `${isMulti ? "py-[0.22rem]" : "leading-7"} text-muted text-sm pl-1`,
- input: () => `pl-1 ${isMulti ? "py-[0.22rem]" : ""}`,
- valueContainer: () =>
- `px-1 max-h-[8.2rem] ${
- isMulti ? "overflow-y-auto! thin-scrollbar py-1" : "py-[0.1rem]"
- } gap-1`,
- singleValue: () => "leading-7 ml-1",
- multiValue: () => "bg-surface-active text-sm rounded-sm items-center py-0.5 px-2 gap-1.5",
- multiValueLabel: () => "leading-6 text-sm",
- multiValueRemove: () => "hover:text-danger text-muted-secondary",
- indicatorsContainer: () => "p-1 gap-1",
- clearIndicator: () => "p-1 hover:text-danger text-muted-secondary",
- indicatorSeparator: () => "bg-muted-secondary",
- dropdownIndicator: () => "text-foreground-soft p-1",
- menuList: () => twMerge("flex flex-col gap-1", menuListClassName),
- menu: () =>
- "my-2 p-2 border text-sm text-foreground-secondary thin-scrollbar bg-surface-base border-border-control rounded-md",
- groupHeading: () => "ml-3 mt-2 mb-1 text-muted text-sm",
- option: ({ isFocused, isSelected }) =>
- twMerge(
- isFocused && "bg-surface-hover active:bg-surface-active",
- isSelected && "text-foreground-secondary",
- "rounded-sm px-3 py-2 text-xs hover:cursor-pointer"
- ),
- noOptionsMessage: () => "text-muted p-2 rounded-md",
- loadingMessage: () => "text-muted p-2 rounded-md"
- }}
- {...props}
- />
- );
-};
diff --git a/frontend/src/components/v2/FilterableSelect/index.tsx b/frontend/src/components/v2/FilterableSelect/index.tsx
deleted file mode 100644
index 03113e4fd9..0000000000
--- a/frontend/src/components/v2/FilterableSelect/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./FilterableSelect";
diff --git a/frontend/src/components/v2/FormControl/FormControl.tsx b/frontend/src/components/v2/FormControl/FormControl.tsx
deleted file mode 100644
index d1a3ba5d81..0000000000
--- a/frontend/src/components/v2/FormControl/FormControl.tsx
+++ /dev/null
@@ -1,123 +0,0 @@
-import { cloneElement, type JSX, ReactElement, ReactNode } from "react";
-import { faExclamationTriangle, faQuestionCircle } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import * as Label from "@radix-ui/react-label";
-import { twMerge } from "tailwind-merge";
-
-import { Tooltip } from "../Tooltip";
-
-export type FormLabelProps = {
- id?: string;
- isRequired?: boolean;
- isOptional?: boolean;
- label?: ReactNode;
- icon?: ReactNode;
- className?: string;
- tooltipClassName?: string;
- tooltipText?: ReactNode;
-};
-
-export const FormLabel = ({
- id,
- label,
- isRequired,
- icon,
- className,
- isOptional,
- tooltipClassName,
- tooltipText
-}: FormLabelProps) => (
- <Label.Root
- className={twMerge("mb-0.5 flex items-center text-sm font-normal text-muted", className)}
- htmlFor={id}
- >
- {label}
- {isRequired && <span className="ml-1 text-danger">*</span>}
- {isOptional && (
- <span className="ml-1 text-xs text-muted-cool-secondary italic">- Optional</span>
- )}
- {icon && !tooltipText && (
- <span className="ml-2 cursor-default text-label hover:text-foreground-secondary">{icon}</span>
- )}
- {tooltipText && (
- <Tooltip content={tooltipText} className={tooltipClassName}>
- <FontAwesomeIcon icon={faQuestionCircle} size="sm" className="ml-1" />
- </Tooltip>
- )}
- </Label.Root>
-);
-
-export type FormHelperTextProps = {
- isError?: boolean;
- text?: ReactNode;
-};
-
-export const FormHelperText = ({ isError, text }: FormHelperTextProps) => (
- <div
- className={twMerge(
- "text-opacity-90 mt-2 flex items-center font-sans text-xs text-label",
- isError && "text-danger"
- )}
- >
- {isError && (
- <span>
- <FontAwesomeIcon icon={faExclamationTriangle} size="sm" className="mr-1" />
- </span>
- )}
- <span>{text}</span>
- </div>
-);
-
-export type FormControlProps = {
- id?: string;
- isRequired?: boolean;
- isOptional?: boolean;
- isError?: boolean;
- label?: ReactNode;
- helperText?: ReactNode;
- errorText?: ReactNode;
- children: JSX.Element;
- className?: string;
- icon?: ReactNode;
- tooltipText?: ReactElement | string;
- tooltipClassName?: string;
- labelClassName?: string;
-};
-
-export const FormControl = ({
- children,
- isRequired,
- isOptional,
- label,
- helperText,
- errorText,
- id,
- isError,
- icon,
- className,
- tooltipText,
- tooltipClassName,
- labelClassName
-}: FormControlProps): JSX.Element => {
- return (
- <div className={twMerge("mb-4", className)}>
- {typeof label === "string" ? (
- <FormLabel
- label={label}
- isOptional={isOptional}
- isRequired={isRequired}
- id={id}
- icon={icon}
- tooltipText={tooltipText}
- tooltipClassName={tooltipClassName}
- className={labelClassName}
- />
- ) : (
- label
- )}
- {cloneElement(children, { isRequired, "data-required": isRequired, isError })}
- {!isError && helperText && <FormHelperText isError={isError} text={helperText} />}
- {isError && errorText && <FormHelperText isError={isError} text={errorText} />}
- </div>
- );
-};
diff --git a/frontend/src/components/v2/FormControl/index.tsx b/frontend/src/components/v2/FormControl/index.tsx
deleted file mode 100644
index b48b788d4b..0000000000
--- a/frontend/src/components/v2/FormControl/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { FormControlProps, FormHelperTextProps, FormLabelProps } from "./FormControl";
-export { FormControl, FormHelperText, FormLabel } from "./FormControl";
diff --git a/frontend/src/components/v2/GenericFieldLabel/GenericFieldLabel.tsx b/frontend/src/components/v2/GenericFieldLabel/GenericFieldLabel.tsx
deleted file mode 100644
index 97887e06df..0000000000
--- a/frontend/src/components/v2/GenericFieldLabel/GenericFieldLabel.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { ReactNode } from "react";
-import { IconDefinition } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { twMerge } from "tailwind-merge";
-
-type Props = {
- label: string;
- children?: ReactNode;
- className?: string;
- labelClassName?: string;
- truncate?: boolean;
- icon?: IconDefinition;
-};
-
-export const GenericFieldLabel = ({
- label,
- children,
- className,
- labelClassName,
- truncate,
- icon
-}: Props) => {
- return (
- <div className={twMerge("min-w-0", className)}>
- <div className="flex items-center gap-1.5">
- {icon && <FontAwesomeIcon icon={icon} className="text-muted" size="sm" />}
- <p className={twMerge("text-xs font-medium text-muted", labelClassName)}>{label}</p>
- </div>
- {children ? (
- <p className={twMerge("text-sm text-foreground", truncate ? "truncate" : "break-words")}>
- {children}
- </p>
- ) : (
- <p className="text-sm text-muted/50 italic">None</p>
- )}
- </div>
- );
-};
diff --git a/frontend/src/components/v2/GenericFieldLabel/index.ts b/frontend/src/components/v2/GenericFieldLabel/index.ts
deleted file mode 100644
index d08d61e751..0000000000
--- a/frontend/src/components/v2/GenericFieldLabel/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./GenericFieldLabel";
diff --git a/frontend/src/components/v2/IconButton/IconButton.tsx b/frontend/src/components/v2/IconButton/IconButton.tsx
deleted file mode 100644
index 3a1ed929c4..0000000000
--- a/frontend/src/components/v2/IconButton/IconButton.tsx
+++ /dev/null
@@ -1,153 +0,0 @@
-import { ButtonHTMLAttributes, forwardRef, type JSX, ReactNode } from "react";
-import { cva, VariantProps } from "cva";
-import { twMerge } from "tailwind-merge";
-
-type Props = {
- children: ReactNode;
- // This is kept as required because by accessibility convention and eslint
- // when button doesn't have text an aria-label needs to be passed
- ariaLabel: string;
- isDisabled?: boolean;
-};
-
-const iconButtonVariants = cva(
- [
- "button",
- "transition-all",
- "font-sans font-medium user-select-none",
- "cursor-pointer",
- "inline-flex items-center justify-center",
- "relative"
- ],
- {
- variants: {
- colorSchema: {
- primary: ["bg-project", "text-black", "border-project hover:opacity-80"],
- secondary: [
- "bg-surface-selected",
- "text-label-cool",
- "border-border-strong hover:bg-muted-secondary"
- ],
- danger: ["bg-danger", "text-white", "border-danger"]
- },
- variant: {
- solid: "",
- outline: ["bg-transparent", "border-2", "border-solid"],
- plain: "",
- star: "text-foreground-soft bg-surface-selected",
- outline_bg: ""
- },
- isDisabled: {
- true: "bg-opacity-70 cursor-not-allowed",
- false: ""
- },
- isRounded: {
- true: "rounded-md",
- false: ""
- },
- size: {
- xs: ["text-xs", "rounded-xs", "py-1.5", "px-2"],
- sm: ["text-sm", "py-3", "px-3"],
- md: ["text-md", "py-4", "px-4"],
- lg: ["text-lg", "py-6", "px-6"]
- }
- },
- compoundVariants: [
- {
- colorSchema: "primary",
- variant: "star",
- className: "hover:bg-project hover:text-black"
- },
- {
- colorSchema: "primary",
- variant: "outline_bg",
- className:
- "bg-surface-hover border border-border-control hover:bg-project/15 hover:border-project/60 text-foreground-soft hover:text-foreground-default duration-100"
- },
- {
- colorSchema: "danger",
- variant: "star",
- className: "hover:bg-danger hover:text-white"
- },
- {
- colorSchema: "primary",
- variant: "outline",
- className: "text-project hover:bg-project hover:text-black"
- },
- {
- colorSchema: "secondary",
- variant: "outline",
- className: "hover:bg-surface-selected"
- },
- {
- colorSchema: "danger",
- variant: "outline",
- className: "text-danger hover:bg-danger hover:text-black"
- },
- {
- colorSchema: "primary",
- variant: "plain",
- className: "hover:text-project"
- },
- {
- colorSchema: "secondary",
- variant: "plain",
- className: "text-surface-selected"
- },
- {
- colorSchema: "danger",
- variant: "plain",
- className: "hover:text-danger"
- },
- {
- colorSchema: ["danger", "primary", "secondary"],
- variant: ["plain"],
- className: "bg-transparent py-1 px-1 text-label-secondary"
- }
- ]
- }
-);
-
-export type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> &
- VariantProps<typeof iconButtonVariants> &
- Props;
-
-export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
- (
- {
- children,
- ariaLabel,
- isDisabled = false,
- className,
- size = "sm",
- variant = "solid",
- isRounded = true,
- colorSchema = "primary",
- ...props
- },
- ref
- ): JSX.Element => (
- <button
- ref={ref}
- aria-disabled={isDisabled}
- type="button"
- aria-label={ariaLabel}
- className={twMerge(
- iconButtonVariants({
- className,
- colorSchema,
- size,
- variant,
- isRounded,
- isDisabled
- })
- )}
- disabled={isDisabled}
- {...props}
- >
- {children}
- </button>
- )
-);
-
-IconButton.displayName = "IconButton";
diff --git a/frontend/src/components/v2/IconButton/index.tsx b/frontend/src/components/v2/IconButton/index.tsx
deleted file mode 100644
index a12a262b37..0000000000
--- a/frontend/src/components/v2/IconButton/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { IconButtonProps } from "./IconButton";
-export { IconButton } from "./IconButton";
diff --git a/frontend/src/components/v2/Input/Input.tsx b/frontend/src/components/v2/Input/Input.tsx
deleted file mode 100644
index 789f137f91..0000000000
--- a/frontend/src/components/v2/Input/Input.tsx
+++ /dev/null
@@ -1,141 +0,0 @@
-import { FormEvent, forwardRef, InputHTMLAttributes, type JSX, ReactNode } from "react";
-import { cva, VariantProps } from "cva";
-import { twMerge } from "tailwind-merge";
-
-type Props = {
- placeholder?: string;
- isFullWidth?: boolean;
- isRequired?: boolean;
- leftIcon?: ReactNode;
- rightIcon?: ReactNode;
- isDisabled?: boolean;
- isReadOnly?: boolean;
- autoCapitalization?: boolean;
- containerClassName?: string;
- warning?: ReactNode;
-};
-
-const inputVariants = cva(
- "input w-full py-1.5 text-muted-cool placeholder:text-sm placeholder:text-muted-cool-secondary/50 outline-hidden focus:ring-2 hover:ring-muted-secondary/60 duration-100",
- {
- variants: {
- size: {
- xs: ["text-xs"],
- sm: ["text-sm"],
- md: ["text-md"],
- lg: ["text-lg"]
- },
- isRounded: {
- true: ["rounded-md"],
- false: ""
- },
- variant: {
- filled: ["bg-surface-base", "text-muted-cool"],
- outline: ["bg-transparent"],
- plain: "bg-transparent outline-hidden"
- },
- isError: {
- true: "focus:ring-danger/50 placeholder:text-danger",
- false: "focus:ring-project/50 focus:ring-1"
- }
- },
- compoundVariants: []
- }
-);
-
-const inputParentContainerVariants = cva("inline-flex font-sans items-center border relative", {
- variants: {
- isRounded: {
- true: ["rounded-md"],
- false: ""
- },
- isError: {
- true: "border-danger",
- false: "border-border-strong"
- },
- isFullWidth: {
- true: "w-full",
- false: ""
- },
- variant: {
- filled: ["bg-page", "text-muted-cool"],
- outline: ["bg-transparent"],
- plain: "border-none"
- }
- }
-});
-
-const data1pIgnore = (autoComplete?: string) => {
- if (!autoComplete) return true;
-
- return !autoComplete.match(/(email|password|username)/i);
-};
-
-export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> &
- VariantProps<typeof inputVariants> &
- Props;
-
-export const Input = forwardRef<HTMLInputElement, InputProps>(
- (
- {
- className,
- containerClassName,
- isRounded = true,
- isFullWidth = true,
- isDisabled,
- isError = false,
- isRequired,
- leftIcon,
- rightIcon,
- variant = "filled",
- size = "md",
- isReadOnly,
- autoCapitalization,
- warning,
- autoComplete,
- ...props
- },
- ref
- ): JSX.Element => {
- const handleInput = (event: FormEvent<HTMLInputElement>) => {
- if (autoCapitalization) {
- // eslint-disable-next-line no-param-reassign
- event.currentTarget.value = event.currentTarget.value.toUpperCase();
- }
- };
-
- return (
- <div
- className={inputParentContainerVariants({
- isRounded,
- isError,
- isFullWidth,
- variant,
- className: containerClassName
- })}
- >
- {leftIcon && <span className="absolute left-0 ml-3 text-sm">{leftIcon}</span>}
- <input
- {...props}
- required={isRequired}
- aria-required={isRequired}
- ref={ref}
- readOnly={isReadOnly}
- disabled={isDisabled}
- onInput={handleInput}
- autoComplete={autoComplete}
- data-1p-ignore={data1pIgnore(autoComplete)}
- className={twMerge(
- leftIcon ? "pl-10" : "pl-2.5",
- rightIcon || warning ? "pr-10" : "pr-2.5",
- inputVariants({ className, isError, size, isRounded, variant })
- )}
- />
- {Boolean(warning) && !rightIcon && warning}
- {rightIcon && <span className="absolute right-0 mr-3">{rightIcon}</span>}
- </div>
- );
- }
-);
-
-Input.displayName = "Input";
diff --git a/frontend/src/components/v2/Input/index.tsx b/frontend/src/components/v2/Input/index.tsx
deleted file mode 100644
index ef5c3cc4e3..0000000000
--- a/frontend/src/components/v2/Input/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { InputProps } from "./Input";
-export { Input } from "./Input";
diff --git a/frontend/src/components/v2/Modal/Modal.tsx b/frontend/src/components/v2/Modal/Modal.tsx
deleted file mode 100644
index 48a1ba124d..0000000000
--- a/frontend/src/components/v2/Modal/Modal.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import { forwardRef, ReactNode } from "react";
-import { faTimes } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import * as DialogPrimitive from "@radix-ui/react-dialog";
-import { twMerge } from "tailwind-merge";
-
-import { Card, CardBody, CardFooter, CardTitle } from "../Card";
-import { IconButton } from "../IconButton";
-
-export type ModalContentProps = Omit<DialogPrimitive.DialogContentProps, "title"> & {
- title?: ReactNode;
- subTitle?: ReactNode;
- footerContent?: ReactNode;
- bodyClassName?: string;
- onClose?: () => void;
- overlayClassName?: string;
- showCloseButton?: boolean;
- closeOnOutsideClick?: boolean;
-};
-
-export const ModalContent = forwardRef<HTMLDivElement, ModalContentProps>(
- (
- {
- children,
- title,
- subTitle,
- className,
- overlayClassName,
- footerContent,
- bodyClassName,
- onClose,
- showCloseButton = true,
- closeOnOutsideClick = true,
- ...props
- },
- forwardedRef
- ) => (
- <DialogPrimitive.Portal>
- <DialogPrimitive.Overlay
- className={twMerge("animate-fade-in fixed inset-0 z-[60] h-full w-full", overlayClassName)}
- style={{ backgroundColor: "rgba(0, 0, 0, 0.7)" }}
- />
- <DialogPrimitive.Content
- {...props}
- ref={forwardedRef}
- onPointerDownOutside={(e) => {
- const target = e.target as HTMLElement;
- const toastElement = target.closest("[data-sonner-toast]");
- if (toastElement) {
- e.preventDefault();
- return;
- }
-
- if (closeOnOutsideClick && onClose) {
- onClose();
- }
- props.onPointerDownOutside?.(e);
- }}
- >
- <Card
- isRounded
- className={twMerge(
- "animate-pop-in fixed top-1/2 left-1/2 z-[60] thin-scrollbar max-w-xl -translate-x-2/4 -translate-y-2/4 border border-border-control bg-surface-raised drop-shadow-2xl dark:scheme-dark",
- className
- )}
- style={{ maxHeight: "90%" }}
- >
- {title && (
- <DialogPrimitive.Title>
- <CardTitle subTitle={subTitle}>
- <div className={showCloseButton ? "pr-8" : undefined}>{title}</div>
- </CardTitle>
- </DialogPrimitive.Title>
- )}
- <CardBody
- className={twMerge("overflow-x-hidden overflow-y-auto", bodyClassName)}
- style={{ maxHeight: "90%" }}
- >
- {children}
- </CardBody>
- {footerContent && <CardFooter>{footerContent}</CardFooter>}
- {showCloseButton && (
- <DialogPrimitive.Close aria-label="Close" asChild onClick={onClose}>
- <IconButton
- variant="plain"
- ariaLabel="close"
- className="absolute top-4 right-6 rounded-sm text-muted-secondary hover:text-foreground-emphasis"
- >
- <FontAwesomeIcon icon={faTimes} size="lg" className="cursor-pointer" />
- </IconButton>
- </DialogPrimitive.Close>
- )}
- </Card>
- </DialogPrimitive.Content>
- </DialogPrimitive.Portal>
- )
-);
-
-ModalContent.displayName = "ModalContent";
-
-export type ModalProps = Omit<DialogPrimitive.DialogProps, "open"> & {
- isOpen?: boolean;
-};
-export const Modal = ({ isOpen, ...props }: ModalProps) => (
- <DialogPrimitive.Root open={isOpen} {...props} />
-);
-
-export const ModalTrigger = DialogPrimitive.Trigger;
-export type ModalTriggerProps = DialogPrimitive.DialogTriggerProps;
-
-export const ModalClose = DialogPrimitive.Close;
-export type ModalCloseProps = DialogPrimitive.DialogCloseProps;
diff --git a/frontend/src/components/v2/Modal/index.tsx b/frontend/src/components/v2/Modal/index.tsx
deleted file mode 100644
index bb03f6be89..0000000000
--- a/frontend/src/components/v2/Modal/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { ModalCloseProps, ModalContentProps, ModalProps, ModalTriggerProps } from "./Modal";
-export { Modal, ModalClose, ModalContent, ModalTrigger } from "./Modal";
diff --git a/frontend/src/components/v2/Pagination/Pagination.tsx b/frontend/src/components/v2/Pagination/Pagination.tsx
deleted file mode 100644
index 6f112b524f..0000000000
--- a/frontend/src/components/v2/Pagination/Pagination.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-import { ReactElement } from "react";
-import {
- faCaretDown,
- faCheck,
- faChevronLeft,
- faChevronRight
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { twMerge } from "tailwind-merge";
-
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger
-} from "../Dropdown";
-import { IconButton } from "../IconButton";
-
-export type PaginationProps = {
- count: number;
- page: number;
- perPage?: number;
- onChangePage: (pageNumber: number) => void;
- onChangePerPage: (newRows: number) => void;
- className?: string;
- perPageList?: number[];
- startAdornment?: ReactElement;
-};
-
-export const Pagination = ({
- count,
- page = 1,
- perPage = 20,
- onChangePage,
- onChangePerPage,
- perPageList = [10, 20, 50, 100],
- className,
- startAdornment
-}: PaginationProps) => {
- const prevPageNumber = Math.max(1, page - 1);
- const canGoPrev = page > 1;
-
- const upperLimit = Math.ceil(count / perPage);
- const nextPageNumber = Math.min(upperLimit, page + 1);
- const canGoNext = page + 1 <= upperLimit;
- const canGoFirst = page > 1;
- const canGoLast = page < upperLimit;
-
- return (
- <div
- className={twMerge(
- "flex w-full items-center justify-end border-t border-border-control bg-surface-raised px-4 py-3 text-foreground-inverse",
- className
- )}
- >
- {startAdornment}
- <div className={twMerge("mr-4 flex items-center space-x-2", startAdornment && "ml-auto")}>
- <div className="text-xs">
- {(page - 1) * perPage + 1} - {Math.min((page - 1) * perPage + perPage, count)} of {count}
- </div>
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton ariaLabel="per-page-list" variant="plain">
- <FontAwesomeIcon className="text-xs" icon={faCaretDown} />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent sideOffset={2} className="min-w-fit">
- {perPageList.map((perPageOption) => (
- <DropdownMenuItem
- key={`pagination-per-page-options-${perPageOption}`}
- icon={perPage === perPageOption && <FontAwesomeIcon size="sm" icon={faCheck} />}
- iconPos="right"
- onClick={() => {
- const totalPages = Math.ceil(count / perPageOption);
-
- if (page > totalPages) {
- onChangePage(totalPages);
- }
-
- onChangePerPage(perPageOption);
- }}
- >
- {perPageOption} rows per page
- </DropdownMenuItem>
- ))}
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
- <div className="flex items-center space-x-4">
- <IconButton
- variant="plain"
- ariaLabel="pagination-first"
- className="relative"
- onClick={() => onChangePage(1)}
- isDisabled={!canGoFirst}
- >
- <FontAwesomeIcon className="absolute top-1 left-2.5 text-xs" icon={faChevronLeft} />
- <FontAwesomeIcon className="text-xs" icon={faChevronLeft} />
- </IconButton>
- <IconButton
- variant="plain"
- ariaLabel="pagination-prev"
- onClick={() => onChangePage(prevPageNumber)}
- isDisabled={!canGoPrev}
- >
- <FontAwesomeIcon className="text-xs" icon={faChevronLeft} />
- </IconButton>
- <IconButton
- variant="plain"
- ariaLabel="pagination-next"
- onClick={() => onChangePage(nextPageNumber)}
- isDisabled={!canGoNext}
- >
- <FontAwesomeIcon className="text-xs" icon={faChevronRight} />
- </IconButton>
- <IconButton
- variant="plain"
- ariaLabel="pagination-last"
- className="relative"
- onClick={() => onChangePage(upperLimit)}
- isDisabled={!canGoLast}
- >
- <FontAwesomeIcon className="absolute top-1 left-2.5 text-xs" icon={faChevronRight} />
- <FontAwesomeIcon className="text-xs" icon={faChevronRight} />
- </IconButton>
- </div>
- </div>
- );
-};
diff --git a/frontend/src/components/v2/Pagination/index.tsx b/frontend/src/components/v2/Pagination/index.tsx
deleted file mode 100644
index 583a0b5501..0000000000
--- a/frontend/src/components/v2/Pagination/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { PaginationProps } from "./Pagination";
-export { Pagination } from "./Pagination";
diff --git a/frontend/src/components/v2/Select/Select.tsx b/frontend/src/components/v2/Select/Select.tsx
deleted file mode 100644
index 08c299b30c..0000000000
--- a/frontend/src/components/v2/Select/Select.tsx
+++ /dev/null
@@ -1,196 +0,0 @@
-import { forwardRef, type JSX, ReactNode } from "react";
-import { IconProp } from "@fortawesome/fontawesome-svg-core";
-import { faCaretDown, faCaretUp, faCheck } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { LucideIcon } from "lucide-react";
-import { Select as SelectPrimitive } from "radix-ui";
-import { twMerge } from "tailwind-merge";
-
-import { Spinner } from "../Spinner";
-
-type Props = {
- children: ReactNode;
- placeholder?: string;
- className?: string;
- dropdownContainerClassName?: string;
- containerClassName?: string;
- isLoading?: boolean;
- position?: "item-aligned" | "popper";
- isDisabled?: boolean;
- icon?: IconProp;
- isMulti?: boolean;
- iconClassName?: string;
- LucideIcon?: LucideIcon;
- dropdownContainerStyle?: React.CSSProperties;
- side?: SelectPrimitive.SelectContentProps["side"];
-};
-
-export type SelectProps = Omit<SelectPrimitive.SelectProps, "disabled"> & Props;
-
-export const Select = forwardRef<HTMLButtonElement, SelectProps>(
- (
- {
- children,
- placeholder,
- className,
- isLoading,
- isDisabled,
- dropdownContainerClassName,
- position,
- containerClassName,
- iconClassName,
- dropdownContainerStyle,
- side,
- LucideIcon: Lucide,
- ...props
- },
- ref
- ): JSX.Element => {
- return (
- <div className={twMerge("flex items-center", containerClassName)}>
- <SelectPrimitive.Root
- {...props}
- onValueChange={(value) => {
- if (!props.onValueChange) return;
-
- const newValue = value === "EMPTY-VALUE" ? "" : value;
- props.onValueChange(newValue);
- }}
- disabled={isDisabled}
- >
- <SelectPrimitive.Trigger
- ref={ref}
- className={twMerge(
- "inline-flex items-center justify-between rounded-md border border-border-control bg-surface-base px-3 py-2 font-sans text-sm font-normal text-foreground-soft outline-hidden focus:bg-surface-hover/80 data-placeholder:text-muted",
- className,
- isDisabled && "cursor-not-allowed opacity-50"
- )}
- >
- <div className="flex items-center space-x-2 overflow-hidden text-ellipsis whitespace-nowrap">
- {props.icon && <FontAwesomeIcon icon={props.icon} className={iconClassName} />}
- {Lucide && <Lucide className={twMerge("size-3.5", iconClassName)} />}
- <div className="flex-1 truncate">
- <SelectPrimitive.Value placeholder={placeholder} />
- </div>
- </div>
-
- <SelectPrimitive.Icon className="ml-3">
- <FontAwesomeIcon
- icon={faCaretDown}
- size="sm"
- className={twMerge(isDisabled && "opacity-30")}
- />
- </SelectPrimitive.Icon>
- </SelectPrimitive.Trigger>
- <SelectPrimitive.Portal>
- <SelectPrimitive.Content
- side={side}
- className={twMerge(
- "relative top-1 z-100 max-w-sm overflow-hidden rounded-md border border-border-control bg-surface-base font-sans text-foreground-default shadow-md",
- position === "popper" && "max-h-72",
- dropdownContainerClassName
- )}
- position={position}
- style={dropdownContainerStyle ?? { width: "var(--radix-select-trigger-width)" }}
- >
- <SelectPrimitive.ScrollUpButton>
- <div className="flex items-center justify-center">
- <FontAwesomeIcon icon={faCaretUp} size="sm" />
- </div>
- </SelectPrimitive.ScrollUpButton>
- <SelectPrimitive.Viewport className="p-1">
- {isLoading ? (
- <div className="flex items-center justify-center">
- <Spinner size="xs" />
- <span className="ml-2 text-xs text-muted-cool-secondary">Loading...</span>
- </div>
- ) : (
- children
- )}
- </SelectPrimitive.Viewport>
- <SelectPrimitive.ScrollDownButton>
- <div className="flex items-center justify-center">
- <FontAwesomeIcon icon={faCaretDown} size="sm" />
- </div>
- </SelectPrimitive.ScrollDownButton>
- </SelectPrimitive.Content>
- </SelectPrimitive.Portal>
- </SelectPrimitive.Root>
- </div>
- );
- }
-);
-
-Select.displayName = "Select";
-
-export type SelectItemProps = Omit<SelectPrimitive.SelectItemProps, "disabled"> & {
- isDisabled?: boolean;
- isSelected?: boolean;
- customIcon?: IconProp;
-};
-
-export const SelectItem = forwardRef<HTMLDivElement, SelectItemProps>(
- ({ children, className, isSelected, isDisabled, ...props }, forwardedRef) => {
- return (
- <SelectPrimitive.Item
- {...props}
- disabled={isDisabled}
- className={twMerge(
- "relative mb-0.5 cursor-pointer items-center truncate overflow-hidden rounded-md py-2 pr-4 pl-10 text-sm outline-hidden transition-all select-none hover:bg-surface-selected data-highlighted:bg-surface-hover/80",
- isSelected && "bg-project",
- isDisabled &&
- "cursor-not-allowed text-surface-cool-active opacity-80 hover:bg-transparent!",
- className
- )}
- ref={forwardedRef}
- >
- <SelectPrimitive.ItemIndicator className="absolute left-3.5 text-project">
- <FontAwesomeIcon icon={props.customIcon ? props.customIcon : faCheck} />
- </SelectPrimitive.ItemIndicator>
- <SelectPrimitive.ItemText className="">{children}</SelectPrimitive.ItemText>
- </SelectPrimitive.Item>
- );
- }
-);
-
-SelectItem.displayName = "SelectItem";
-
-export type SelectClearProps = Omit<SelectItemProps, "disabled" | "value"> & {
- onClear: () => void;
- selectValue: string;
-};
-
-export const SelectClear = forwardRef<HTMLDivElement, SelectClearProps>(
- (
- { children, className, isSelected, isDisabled, onClear, selectValue, ...props },
- forwardedRef
- ) => {
- return (
- <SelectPrimitive.Item
- {...props}
- value="EMPTY-VALUE"
- onSelect={() => onClear()}
- onClick={() => onClear()}
- className={twMerge(
- "relative mb-0.5 flex cursor-pointer items-center rounded-md py-2 pr-4 pl-10 text-sm outline-hidden transition-all select-none hover:bg-surface-selected data-highlighted:bg-surface-hover/80",
- isSelected && "bg-project",
- isDisabled &&
- "cursor-not-allowed text-surface-cool-active hover:bg-transparent hover:text-surface-active",
- className
- )}
- ref={forwardedRef}
- >
- <div
- className={twMerge(
- "absolute left-3.5 text-project",
- selectValue === "" ? "visible" : "hidden"
- )}
- >
- <FontAwesomeIcon icon={faCheck} />
- </div>
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
- </SelectPrimitive.Item>
- );
- }
-);
-SelectClear.displayName = "SelectClear";
diff --git a/frontend/src/components/v2/Select/components/index.tsx b/frontend/src/components/v2/Select/components/index.tsx
deleted file mode 100644
index 27e3218892..0000000000
--- a/frontend/src/components/v2/Select/components/index.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import {
- ClearIndicatorProps,
- components,
- DropdownIndicatorProps,
- GroupProps,
- MultiValueRemoveProps,
- OptionProps
-} from "react-select";
-import { faCheckCircle, faCircleXmark } from "@fortawesome/free-regular-svg-icons";
-import { faChevronDown, faXmark } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-
-export const DropdownIndicator = <T,>(props: DropdownIndicatorProps<T>) => {
- return (
- <components.DropdownIndicator {...props}>
- <FontAwesomeIcon icon={faChevronDown} size="xs" />
- </components.DropdownIndicator>
- );
-};
-
-export const ClearIndicator = <T,>(props: ClearIndicatorProps<T>) => {
- return (
- <components.ClearIndicator {...props}>
- <FontAwesomeIcon icon={faCircleXmark} />
- </components.ClearIndicator>
- );
-};
-
-export const MultiValueRemove = (props: MultiValueRemoveProps) => {
- return (
- <components.MultiValueRemove {...props}>
- <FontAwesomeIcon icon={faXmark} size="xs" />
- </components.MultiValueRemove>
- );
-};
-
-export const Option = <T,>({ isSelected, children, ...props }: OptionProps<T>) => {
- return (
- <components.Option isSelected={isSelected} {...props}>
- <div className="flex flex-row items-center justify-between">
- <p className="truncate">{children}</p>
- {isSelected && (
- <FontAwesomeIcon className="ml-2 text-project" icon={faCheckCircle} size="sm" />
- )}
- </div>
- </components.Option>
- );
-};
-
-export const Group = <T,>(props: GroupProps<T>) => {
- return <components.Group {...props} />;
-};
diff --git a/frontend/src/components/v2/Select/index.tsx b/frontend/src/components/v2/Select/index.tsx
deleted file mode 100644
index 3765851d5c..0000000000
--- a/frontend/src/components/v2/Select/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { SelectItemProps, SelectProps } from "./Select";
-export { Select, SelectClear, SelectItem } from "./Select";
diff --git a/frontend/src/components/v2/Skeleton/Skeleton.tsx b/frontend/src/components/v2/Skeleton/Skeleton.tsx
deleted file mode 100644
index fe049a058b..0000000000
--- a/frontend/src/components/v2/Skeleton/Skeleton.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { twMerge } from "tailwind-merge";
-
-export type Props = {
- className?: string;
-};
-
-// To show something is coming up
-// Can be used with cards
-// Tables etc
-export const Skeleton = ({ className }: Props) => (
- <div className={twMerge("h-6 w-full animate-pulse rounded-md bg-surface-raised", className)} />
-);
diff --git a/frontend/src/components/v2/Skeleton/index.tsx b/frontend/src/components/v2/Skeleton/index.tsx
deleted file mode 100644
index 0ea7701226..0000000000
--- a/frontend/src/components/v2/Skeleton/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { Skeleton } from "./Skeleton";
diff --git a/frontend/src/components/v2/Spinner/Spinner.tsx b/frontend/src/components/v2/Spinner/Spinner.tsx
deleted file mode 100644
index fdb6f27266..0000000000
--- a/frontend/src/components/v2/Spinner/Spinner.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import type { JSX } from "react";
-import { twMerge } from "tailwind-merge";
-
-type SizeOptions = "xs" | "sm" | "md" | "lg";
-
-type Props = {
- className?: string;
- size?: SizeOptions;
-};
-
-const sizeChart: Record<SizeOptions, string> = {
- xs: "w-4 h-4",
- sm: "w-6 h-6",
- md: "w-8 h-8",
- lg: "w-12 h-12"
-};
-
-export const Spinner = ({ className, size = "md" }: Props): JSX.Element => {
- return (
- <div role="status">
- <svg
- aria-hidden="true"
- className={twMerge(
- "m-1 animate-spin fill-project text-foreground-cool dark:text-surface-cool-active",
- sizeChart[size],
- className
- )}
- viewBox="0 0 100 101"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
- fill="currentColor"
- />
- <path
- d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
- fill="currentFill"
- />
- </svg>
- </div>
- );
-};
diff --git a/frontend/src/components/v2/Spinner/index.tsx b/frontend/src/components/v2/Spinner/index.tsx
deleted file mode 100644
index 47cb73c768..0000000000
--- a/frontend/src/components/v2/Spinner/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { Spinner } from "./Spinner";
diff --git a/frontend/src/components/v2/Table/Table.tsx b/frontend/src/components/v2/Table/Table.tsx
deleted file mode 100644
index 36e2d3b562..0000000000
--- a/frontend/src/components/v2/Table/Table.tsx
+++ /dev/null
@@ -1,170 +0,0 @@
-import {
- DetailedHTMLProps,
- forwardRef,
- HTMLAttributes,
- type JSX,
- ReactNode,
- TdHTMLAttributes
-} from "react";
-import { twMerge } from "tailwind-merge";
-
-import { Skeleton } from "../Skeleton";
-
-export type TableContainerProps = {
- children: ReactNode;
- isRounded?: boolean;
- className?: string;
-} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
-
-export const TableContainer = forwardRef<HTMLDivElement, TableContainerProps>(
- ({ children, className, isRounded = true, ...props }, ref): JSX.Element => (
- <div
- ref={ref}
- className={twMerge(
- "relative w-full overflow-x-auto border border-solid border-border-subtle bg-surface-raised font-sans",
- isRounded && "rounded-lg",
- className
- )}
- {...props}
- >
- {children}
- </div>
- )
-);
-
-// main parent table
-export type TableProps = {
- className?: string;
- children: ReactNode;
-};
-
-export const Table = ({ children, className }: TableProps): JSX.Element => (
- <table
- className={twMerge("w-full bg-surface-raised p-2 text-left text-sm text-label-cool", className)}
- >
- {children}
- </table>
-);
-
-// table head
-export type THeadProps = {
- children: ReactNode;
- className?: string;
- style?: React.CSSProperties;
-};
-
-export const THead = ({ children, className, style }: THeadProps): JSX.Element => (
- <thead
- className={twMerge("bg-surface-raised text-xs text-label-secondary uppercase", className)}
- style={style}
- >
- {children}
- </thead>
-);
-
-export type TFootProps = {
- children: ReactNode;
- className?: string;
-};
-
-export const TFoot = ({ children, className }: TFootProps): JSX.Element => (
- <tfoot className={twMerge("bg-surface-raised text-xs text-label-secondary uppercase", className)}>
- {children}
- </tfoot>
-);
-
-// table rows
-export type TrProps = {
- children: ReactNode;
- className?: string;
- isHoverable?: boolean;
- isSelectable?: boolean;
-} & HTMLAttributes<HTMLTableRowElement>;
-
-export const Tr = ({
- children,
- className,
- isHoverable,
- isSelectable,
- ...props
-}: TrProps): JSX.Element => (
- <tr
- className={twMerge(
- "cursor-default border-b border-solid border-border-control last:border-b-0",
- isHoverable && "hover:bg-surface-active",
- isSelectable && "cursor-pointer",
- className
- )}
- {...props}
- >
- {children}
- </tr>
-);
-
-// table head columns
-export type ThProps = {
- children?: ReactNode;
- className?: string;
- style?: React.CSSProperties;
-};
-
-export const Th = ({ children, className, style }: ThProps): JSX.Element => (
- <th
- className={twMerge(
- "border-b-2 border-border-control bg-surface-raised px-5 pt-4 pb-3.5 font-medium",
- className
- )}
- style={style}
- >
- {children}
- </th>
-);
-
-// table body
-export type TBodyProps = {
- children: ReactNode;
- className?: string;
-};
-
-export const TBody = ({ children, className }: TBodyProps): JSX.Element => (
- <tbody className={twMerge(className)}>{children}</tbody>
-);
-
-// table body columns
-export type TdProps = {
- children?: ReactNode;
- className?: string;
-} & TdHTMLAttributes<HTMLTableCellElement>;
-
-export const Td = ({ children, className, ...props }: TdProps): JSX.Element => (
- <td className={twMerge("px-5 py-3 text-left", className)} {...props}>
- {children}
- </td>
-);
-
-export type TBodyLoader = {
- rows?: number;
- columns: number;
- className?: string;
- // unique key for mapping
- innerKey: string;
-};
-
-export const TableSkeleton = ({
- rows = 3,
- columns,
- innerKey,
- className
-}: TBodyLoader): JSX.Element => (
- <>
- {Array.apply(0, Array(rows)).map((_x, i) => (
- <Tr key={`${innerKey}-skeleton-rows-${i + 1}`}>
- {Array.apply(0, Array(columns)).map((_y, j) => (
- <Td key={`${innerKey}-skeleton-rows-${i + 1}-column-${j + 1}`}>
- <Skeleton className={className} />
- </Td>
- ))}
- </Tr>
- ))}
- </>
-);
diff --git a/frontend/src/components/v2/Table/index.tsx b/frontend/src/components/v2/Table/index.tsx
deleted file mode 100644
index ef3987cc01..0000000000
--- a/frontend/src/components/v2/Table/index.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-export type {
- TableContainerProps,
- TableProps,
- TBodyProps,
- TdProps,
- TFootProps,
- THeadProps,
- ThProps,
- TrProps
-} from "./Table";
-export { Table, TableContainer, TableSkeleton, TBody, Td, TFoot, Th, THead, Tr } from "./Table";
diff --git a/frontend/src/components/v2/Tabs/Tabs.tsx b/frontend/src/components/v2/Tabs/Tabs.tsx
deleted file mode 100644
index bb427e9673..0000000000
--- a/frontend/src/components/v2/Tabs/Tabs.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import { IconDefinition } from "@fortawesome/free-brands-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import * as TabsPrimitive from "@radix-ui/react-tabs";
-import { twMerge } from "tailwind-merge";
-
-export type TabsProps = TabsPrimitive.TabsProps;
-
-export const Tabs = ({ className, children, ...props }: TabsProps) => (
- <TabsPrimitive.Root
- className={twMerge(
- "flex",
- className,
- props.orientation === "vertical" ? "flex-col xl:flex-row xl:gap-x-12" : "flex-col"
- )}
- {...props}
- >
- {children}
- </TabsPrimitive.Root>
-);
-
-export type TabListProps = TabsPrimitive.TabsListProps;
-
-export const TabList = ({ className, children, ...props }: TabListProps) => (
- <TabsPrimitive.List
- className={twMerge(
- "no-scrollbar flex shrink-0 overflow-auto border-b-2 border-border-faint",
- "data-[orientation=vertical]:xl:flex-col data-[orientation=vertical]:xl:items-start data-[orientation=vertical]:xl:gap-y-6 data-[orientation=vertical]:xl:border-b-0",
- className
- )}
- {...props}
- >
- {children}
- </TabsPrimitive.List>
-);
-
-export type TabProps = TabsPrimitive.TabsTriggerProps;
-
-export const Tab = ({
- className,
- children,
- variant = "project",
- icon,
- ...props
-}: TabProps & {
- icon?: IconDefinition;
- variant?: "project" | "namespace" | "org" | "instance";
-}) => (
- <TabsPrimitive.Trigger
- className={twMerge(
- "flex h-11 cursor-pointer items-center justify-center border-transparent",
- "px-3 text-sm font-medium whitespace-nowrap text-label/75 transition-all select-none",
- "data-[orientation=vertical]:xl:h-5 data-[orientation=vertical]:xl:border-b-0 data-[orientation=vertical]:xl:border-l",
- "border-b hover:text-foreground-secondary",
- "data-[state=active]:border-border-emphasis data-[state=active]:text-foreground-inverse",
- "hover:border-border-emphasis",
- variant === "project" && "data-[state=active]:border-project",
- variant === "namespace" && "data-[state=active]:border-sub-org",
- variant === "org" && "data-[state=active]:border-org",
- variant === "instance" && "data-[state=active]:border-border-bright",
- className
- )}
- {...props}
- >
- {icon && <FontAwesomeIcon icon={icon} className="mr-2" size="xs" />}
- {children}
- </TabsPrimitive.Trigger>
-);
-
-export type TabPanelProps = TabsPrimitive.TabsContentProps;
-
-export const TabPanel = ({ className, children, ...props }: TabPanelProps) => (
- <TabsPrimitive.Content
- className={twMerge(
- "grow rounded-br-md rounded-bl-md py-5 outline-hidden data-[orientation=vertical]:xl:overflow-x-hidden data-[orientation=vertical]:xl:py-0",
- className
- )}
- {...props}
- >
- {children}
- </TabsPrimitive.Content>
-);
diff --git a/frontend/src/components/v2/Tabs/index.tsx b/frontend/src/components/v2/Tabs/index.tsx
deleted file mode 100644
index 0a17c0dcac..0000000000
--- a/frontend/src/components/v2/Tabs/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { TabListProps, TabPanelProps, TabProps, TabsProps } from "./Tabs";
-export { Tab, TabList, TabPanel, Tabs } from "./Tabs";
diff --git a/frontend/src/components/v2/Tag/Tag.tsx b/frontend/src/components/v2/Tag/Tag.tsx
deleted file mode 100644
index 17a9c09bf3..0000000000
--- a/frontend/src/components/v2/Tag/Tag.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { ReactNode } from "react";
-import { faClose } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { cva, VariantProps } from "cva";
-import { twMerge } from "tailwind-merge";
-
-type Props = {
- children: ReactNode;
- className?: string;
- onClose?: () => void;
-} & VariantProps<typeof tagVariants>;
-
-const tagVariants = cva(
- "inline-flex items-center whitespace-nowrap text-sm rounded-sm mr-1.5 text-foreground-soft text-muted-cool ",
- {
- variants: {
- colorSchema: {
- gray: "bg-surface-selected",
- red: "bg-danger/80 text-foreground-default",
- green: "bg-success text-white"
- },
- size: {
- xs: "text-xs px-1 py-0.5",
- sm: "px-2 py-0.5"
- }
- }
- }
-);
-
-export const Tag = ({ children, className, colorSchema = "gray", size = "sm", onClose }: Props) => (
- <div className={twMerge(tagVariants({ colorSchema, className, size }))}>
- {children}
- {onClose && (
- <button type="button" onClick={onClose} className="ml-2 flex items-center justify-center">
- <FontAwesomeIcon icon={faClose} />
- </button>
- )}
- </div>
-);
diff --git a/frontend/src/components/v2/Tag/index.tsx b/frontend/src/components/v2/Tag/index.tsx
deleted file mode 100644
index 736cac7bef..0000000000
--- a/frontend/src/components/v2/Tag/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { Tag } from "./Tag";
diff --git a/frontend/src/components/v2/TextArea/TextArea.tsx b/frontend/src/components/v2/TextArea/TextArea.tsx
deleted file mode 100644
index e5a99ca78d..0000000000
--- a/frontend/src/components/v2/TextArea/TextArea.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import { forwardRef, type JSX, TextareaHTMLAttributes } from "react";
-import { cva, VariantProps } from "cva";
-import { twMerge } from "tailwind-merge";
-
-type Props = {
- isDisabled?: boolean;
- placeholder?: string;
- isFullWidth?: boolean;
- isRequired?: boolean;
- reSize?: "none" | "both" | "vertical" | "horizontal";
-};
-
-const textAreaVariants = cva(
- "textarea w-full p-2 focus:ring-2 ring-project outline-hidden border text-muted-cool font-sans placeholder:text-muted-cool-secondary/50",
- {
- variants: {
- size: {
- xs: ["text-xs"],
- sm: ["text-sm"],
- md: ["text-md"],
- lg: ["text-lg"]
- },
- isRounded: {
- true: ["rounded-md"],
- false: ""
- },
- variant: {
- filled: ["bg-surface-base", "text-muted-cool"],
- outline: ["bg-transparent"],
- plain: "bg-transparent outline-hidden"
- },
- isError: {
- true: "focus:ring-danger/50 placeholder:text-danger border-danger",
- false: "focus:ring-project/50 focus:ring-1 border-border-strong"
- }
- },
- compoundVariants: [
- {
- variant: "plain",
- isError: [true, false],
- className: "border-none"
- }
- ]
- }
-);
-
-export type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "disabled"> &
- VariantProps<typeof textAreaVariants> &
- Props;
-
-export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
- (
- {
- className,
- isRounded = true,
- isDisabled = false,
- isError = false,
- isRequired,
- variant = "filled",
- size = "md",
- reSize = "both",
- ...props
- },
- ref
- ): JSX.Element => (
- <textarea
- style={{ resize: reSize }}
- required={isRequired}
- ref={ref}
- disabled={isDisabled}
- className={twMerge(textAreaVariants({ className, isError, size, isRounded, variant }))}
- {...props}
- />
- )
-);
-
-TextArea.displayName = "TextArea";
diff --git a/frontend/src/components/v2/TextArea/index.tsx b/frontend/src/components/v2/TextArea/index.tsx
deleted file mode 100644
index 6c44fcbaaa..0000000000
--- a/frontend/src/components/v2/TextArea/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export type { TextAreaProps } from "./TextArea";
-export { TextArea } from "./TextArea";
diff --git a/frontend/src/components/v2/Tooltip/Tooltip.tsx b/frontend/src/components/v2/Tooltip/Tooltip.tsx
deleted file mode 100644
index 8e2491c512..0000000000
--- a/frontend/src/components/v2/Tooltip/Tooltip.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import { ReactNode } from "react";
-import * as TooltipPrimitive from "@radix-ui/react-tooltip";
-import { TooltipProps as RootProps } from "@radix-ui/react-tooltip";
-import { twMerge } from "tailwind-merge";
-
-export type TooltipProps = Omit<TooltipPrimitive.TooltipContentProps, "open" | "content"> & {
- children: ReactNode;
- content?: ReactNode;
- isOpen?: boolean;
- className?: string;
- asChild?: boolean;
- onOpenChange?: (isOpen: boolean) => void;
- defaultOpen?: boolean;
- position?: "top" | "bottom" | "left" | "right";
- isDisabled?: boolean;
- center?: boolean;
- size?: "sm" | "md";
- rootProps?: RootProps;
- delayDuration?: number;
-};
-
-export const Tooltip = ({
- children,
- content,
- isOpen,
- onOpenChange,
- defaultOpen,
- className,
- center,
- asChild = true,
- isDisabled,
- position = "top",
- size = "md",
- rootProps,
- delayDuration = 50,
- ...props
-}: TooltipProps) =>
- // just render children if tooltip content is empty
- content ? (
- <TooltipPrimitive.Root
- delayDuration={delayDuration}
- {...rootProps}
- open={isOpen}
- defaultOpen={defaultOpen}
- onOpenChange={onOpenChange}
- >
- <TooltipPrimitive.Trigger asChild={asChild}>{children}</TooltipPrimitive.Trigger>
- <TooltipPrimitive.Portal>
- <TooltipPrimitive.Content
- side={position}
- align="center"
- sideOffset={5}
- {...props}
- className={twMerge(
- "data-[state=delayed-open]:data-[side=bottom]:animate-slide-up-and-fade data-[state=delayed-open]:data-[side=left]:animate-slide-right-and-fade data-[state=delayed-open]:data-[side=right]:animate-slide-left-and-fade data-[state=delayed-open]:data-[side=top]:animate-slide-down-and-fade z-[70] max-w-60 border border-border-control bg-surface-raised font-light text-foreground-soft shadow-md select-none",
- isDisabled && "hidden!",
- center && "text-center",
- size === "sm" && "rounded-xs px-2 py-1 text-xs",
- size === "md" && "rounded-md px-4 py-2 text-sm",
- className
- )}
- >
- {content}
- <TooltipPrimitive.Arrow width={11} height={5} className="fill-surface-active" />
- </TooltipPrimitive.Content>
- </TooltipPrimitive.Portal>
- </TooltipPrimitive.Root>
- ) : (
- // eslint-disable-next-line react/jsx-no-useless-fragment
- <>{children}</>
- );
-
-export const TooltipProvider = TooltipPrimitive.Provider;
diff --git a/frontend/src/components/v2/Tooltip/index.tsx b/frontend/src/components/v2/Tooltip/index.tsx
deleted file mode 100644
index 348059dad7..0000000000
--- a/frontend/src/components/v2/Tooltip/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { Tooltip, TooltipProvider } from "./Tooltip";
diff --git a/frontend/src/components/v2/index.tsx b/frontend/src/components/v2/index.tsx
deleted file mode 100644
index 03bf65f491..0000000000
--- a/frontend/src/components/v2/index.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-/* eslint-disable react-refresh/only-export-components */
-export * from "./Accordion";
-export * from "./Alert";
-export * from "./Button";
-export * from "./Card";
-export * from "./Checkbox";
-export * from "./ContentLoader";
-export * from "./Dropdown";
-export * from "./EmptyState";
-export * from "./FilterableSelect";
-export * from "./FormControl";
-export * from "./GenericFieldLabel";
-export * from "./IconButton";
-export * from "./Input";
-export * from "./Modal";
-export * from "./Pagination";
-export * from "./Select";
-export * from "./Skeleton";
-export * from "./Spinner";
-export * from "./Table";
-export * from "./Tabs";
-export * from "./Tag";
-export * from "./TextArea";
-export * from "./Tooltip";
diff --git a/frontend/src/pages/root.tsx b/frontend/src/pages/root.tsx
index ea3244fb98..5440e5bd5d 100644
--- a/frontend/src/pages/root.tsx
+++ b/frontend/src/pages/root.tsx
@@ -2,7 +2,7 @@ import type { QueryClient } from "@tanstack/react-query";
import { createRootRouteWithContext, Outlet, useRouterState } from "@tanstack/react-router";
import { NotificationContainer } from "@app/components/notifications";
-import { TooltipProvider } from "@app/components/v2";
+import { TooltipProvider } from "@app/components/v3";
import {
RootCommandMenu,
type RootCommandMenuShell
@@ -51,7 +51,7 @@ const RootPage = () => {
const pathname = useRouterState({ select: (state) => state.location.pathname });
return (
<ThemeProvider pathname={pathname}>
- <TooltipProvider>
+ <TooltipProvider delayDuration={700} skipDelayDuration={300}>
<Outlet />
<RootCommandMenuMount />
<NotificationContainer />