From e20b1dd883235ceb90bacf08c7961824e7d05dbb Mon Sep 17 00:00:00 2001 From: MananTank Date: Wed, 27 Aug 2025 23:18:34 +0000 Subject: [PATCH] packages/ui: Add breadcrumb, tooltip, table (#7926) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR primarily focuses on adding the `@radix-ui/react-tooltip` package and refactoring the tooltip and breadcrumb components across multiple applications to enhance UI functionality and maintainability. ### Detailed summary - Added `@radix-ui/react-tooltip` dependency in `package.json`. - Updated `knip.json` files to include `@radix-ui/react-tooltip` in ignored dependencies. - Refactored tooltip components in `packages/ui/src/components/tooltip.tsx` to utilize `@radix-ui/react-tooltip`. - Created new `Breadcrumb` components in `packages/ui/src/components/breadcrumb.tsx`. - Updated table components in `packages/ui/src/components/table.tsx` to streamline exports and structure. - Removed redundant tooltip component definitions from multiple applications and replaced them with imports from `@workspace/ui/components/tooltip`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- apps/dashboard/knip.json | 39 ++--- .../src/@/components/ui/breadcrumb.tsx | 116 +------------ apps/dashboard/src/@/components/ui/table.tsx | 155 +----------------- .../dashboard/src/@/components/ui/tooltip.tsx | 75 +-------- apps/playground-web/knip.json | 7 +- .../src/components/ui/breadcrumb.tsx | 113 +------------ .../src/components/ui/table.tsx | 155 +----------------- .../src/components/ui/tooltip.tsx | 75 +-------- apps/portal/knip.json | 5 +- apps/portal/src/components/ui/table.tsx | 150 +---------------- apps/portal/src/components/ui/tooltip.tsx | 75 +-------- packages/ui/package.json | 1 + packages/ui/src/components/breadcrumb.tsx | 119 ++++++++++++++ .../ui/src/components}/table.stories.tsx | 10 +- packages/ui/src/components/table.tsx | 155 ++++++++++++++++++ packages/ui/src/components/tooltip.tsx | 70 ++++++++ pnpm-lock.yaml | 32 +--- 17 files changed, 424 insertions(+), 928 deletions(-) create mode 100644 packages/ui/src/components/breadcrumb.tsx rename {apps/dashboard/src/@/components/ui => packages/ui/src/components}/table.stories.tsx (97%) create mode 100644 packages/ui/src/components/table.tsx create mode 100644 packages/ui/src/components/tooltip.tsx diff --git a/apps/dashboard/knip.json b/apps/dashboard/knip.json index 096ded6dc71..9d3a56b9ed3 100644 --- a/apps/dashboard/knip.json +++ b/apps/dashboard/knip.json @@ -1,21 +1,22 @@ { - "$schema": "https://unpkg.com/knip@5/schema.json", - "ignore": [ - "src/@/components/ui/**", - "src/@/components/misc/AnnouncementBanner.tsx", - "src/@/components/cmd-k-search/index.tsx", - "src/@/lib/search.ts" - ], - "ignoreBinaries": ["only-allow"], - "ignoreDependencies": [ - "@thirdweb-dev/service-utils", - "@thirdweb-dev/vault-sdk", - "thirdweb", - "@types/color", - "fast-xml-parser", - "@workspace/ui", - "tailwindcss-animate" - ], - "next": true, - "project": ["src/**"] + "$schema": "https://unpkg.com/knip@5/schema.json", + "ignore": [ + "src/@/components/ui/**", + "src/@/components/misc/AnnouncementBanner.tsx", + "src/@/components/cmd-k-search/index.tsx", + "src/@/lib/search.ts" + ], + "ignoreBinaries": ["only-allow"], + "ignoreDependencies": [ + "@thirdweb-dev/service-utils", + "@thirdweb-dev/vault-sdk", + "thirdweb", + "@types/color", + "fast-xml-parser", + "@workspace/ui", + "tailwindcss-animate", + "@radix-ui/react-tooltip" + ], + "next": true, + "project": ["src/**"] } diff --git a/apps/dashboard/src/@/components/ui/breadcrumb.tsx b/apps/dashboard/src/@/components/ui/breadcrumb.tsx index 60e4b7848a3..81387aa654e 100644 --- a/apps/dashboard/src/@/components/ui/breadcrumb.tsx +++ b/apps/dashboard/src/@/components/ui/breadcrumb.tsx @@ -1,119 +1,9 @@ -import { Slot } from "@radix-ui/react-slot"; -import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"; -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -const Breadcrumb = React.forwardRef< - HTMLElement, - React.ComponentPropsWithoutRef<"nav"> & { - separator?: React.ReactNode; - } ->(({ ...props }, ref) =>