Skip to content

Commit fbf9f44

Browse files
authored
chore: migrate to cn (#1150)
1 parent 7a91fa3 commit fbf9f44

94 files changed

Lines changed: 123 additions & 142 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"@upstash/ratelimit": "^2.1.0",
5353
"@upstash/redis": "^1.38.4",
5454
"class-variance-authority": "^0.7.1",
55-
"clsx": "^2.1.1",
5655
"cmdk": "^1.1.1",
56+
"cn": "^0.3.0",
5757
"date-fns": "^4.4.0",
5858
"drizzle-orm": "^0.45.2",
5959
"export-to-csv": "^1.5.0",
@@ -72,7 +72,6 @@
7272
"server-only": "^0.0.1",
7373
"shadcn": "4.21.0",
7474
"sonner": "^2.0.8",
75-
"tailwind-merge": "^3.7.0",
7675
"uploadthing": "^7.7.4",
7776
"vaul": "^1.1.2",
7877
"zod": "^4.6.5"

‎pnpm-lock.yaml‎

Lines changed: 10 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎registry.json‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"label",
2424
"skeleton"
2525
],
26-
"dependencies": ["@tanstack/react-table", "lucide-react", "nuqs"],
26+
"dependencies": ["@tanstack/react-table", "lucide-react", "nuqs", "cn"],
2727
"files": [
2828
{
2929
"path": "src/registry/bases/radix/components/data-table/data-table.tsx",
@@ -112,7 +112,7 @@
112112
"popover",
113113
"select"
114114
],
115-
"dependencies": ["@tanstack/react-table", "lucide-react"],
115+
"dependencies": ["@tanstack/react-table", "lucide-react", "cn"],
116116
"files": [
117117
{
118118
"path": "src/registry/bases/radix/components/data-table/data-table-sort-list.tsx",
@@ -160,7 +160,7 @@
160160
"popover",
161161
"select"
162162
],
163-
"dependencies": ["@tanstack/react-table", "lucide-react", "nuqs"],
163+
"dependencies": ["@tanstack/react-table", "lucide-react", "nuqs", "cn"],
164164
"files": [
165165
{
166166
"path": "src/registry/bases/radix/components/data-table/data-table-filter-list.tsx",
@@ -240,7 +240,7 @@
240240
"popover",
241241
"select"
242242
],
243-
"dependencies": ["@tanstack/react-table", "lucide-react", "nuqs"],
243+
"dependencies": ["@tanstack/react-table", "lucide-react", "nuqs", "cn"],
244244
"files": [
245245
{
246246
"path": "src/registry/bases/radix/components/data-table/data-table-filter-menu.tsx",
@@ -317,7 +317,8 @@
317317
"@tanstack/react-table",
318318
"@tanstack/react-virtual",
319319
"lucide-react",
320-
"sonner"
320+
"sonner",
321+
"cn"
321322
],
322323
"files": [
323324
{
@@ -419,7 +420,7 @@
419420
"title": "Data Grid Select Column",
420421
"description": "A reusable select column definition for the data grid with checkbox selection and shift-click support",
421422
"registryDependencies": ["checkbox"],
422-
"dependencies": ["@tanstack/react-table"],
423+
"dependencies": ["@tanstack/react-table", "cn"],
423424
"files": [
424425
{
425426
"path": "src/registry/bases/radix/components/data-grid/data-grid-select-column.tsx",
@@ -448,7 +449,7 @@
448449
"popover",
449450
"select"
450451
],
451-
"dependencies": ["@tanstack/react-table", "lucide-react"],
452+
"dependencies": ["@tanstack/react-table", "lucide-react", "cn"],
452453
"files": [
453454
{
454455
"path": "src/registry/bases/radix/components/data-grid/data-grid-sort-menu.tsx",
@@ -508,7 +509,7 @@
508509
"title": "Data Grid View Menu",
509510
"description": "A view menu component for the data grid to toggle column visibility",
510511
"registryDependencies": ["button", "command", "popover"],
511-
"dependencies": ["@tanstack/react-table", "lucide-react"],
512+
"dependencies": ["@tanstack/react-table", "lucide-react", "cn"],
512513
"files": [
513514
{
514515
"path": "src/registry/bases/radix/components/data-grid/data-grid-view-menu.tsx",
@@ -564,7 +565,7 @@
564565
"popover",
565566
"select"
566567
],
567-
"dependencies": ["@tanstack/react-table", "lucide-react"],
568+
"dependencies": ["@tanstack/react-table", "lucide-react", "cn"],
568569
"files": [
569570
{
570571
"path": "src/registry/bases/radix/components/data-grid/data-grid-filter-menu.tsx",
@@ -613,7 +614,7 @@
613614
"title": "Data Grid Skeleton",
614615
"description": "A composable skeleton component for the data grid with toolbar and grid parts",
615616
"registryDependencies": ["skeleton"],
616-
"dependencies": [],
617+
"dependencies": ["cn"],
617618
"files": [
618619
{
619620
"path": "src/registry/bases/radix/components/data-grid/data-grid-skeleton.tsx",

‎scripts/build-registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function withImportedDependencies(
8585

8686
const next = [...(dependencies ?? [])];
8787

88-
for (const pkg of ["@base-ui/react", "@base-ui/utils"] as const) {
88+
for (const pkg of ["@base-ui/react", "@base-ui/utils", "cn"] as const) {
8989
if (contents.some((content) => content.includes(`"${pkg}`))) {
9090
if (!next.includes(pkg)) next.push(pkg);
9191
}

‎src/lib/utils.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import { type ClassValue, clsx } from "clsx";
2-
import { twMerge } from "tailwind-merge";
3-
4-
export function cn(...inputs: ClassValue[]) {
5-
return twMerge(clsx(inputs));
6-
}
1+
export { cn } from "cn";
72

83
export function getAbsoluteUrl(path: string) {
94
const normalizedPath = path.startsWith("/") ? path : `/${path}`;

‎src/registry/bases/base/components/data-grid/data-grid-cell-variants.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import type { RowData } from "@tanstack/react-table";
44

5+
import { cn } from "cn";
56
import * as React from "react";
67
import { toast } from "sonner";
78

@@ -19,7 +20,6 @@ import {
1920
getUrlHref,
2021
parseLocalDate,
2122
} from "@/lib/data-grid-utils";
22-
import { cn } from "@/lib/utils";
2323
import { DataGridCellWrapper } from "@/registry/bases/base/components/data-grid/data-grid-cell-wrapper";
2424
import { Badge } from "@/registry/bases/base/ui/badge";
2525
import { Button } from "@/registry/bases/base/ui/button";

‎src/registry/bases/base/components/data-grid/data-grid-cell-wrapper.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import type { RowData } from "@tanstack/react-table";
44

55
import { useMergedRefs } from "@base-ui/utils/useMergedRefs";
6+
import { cn } from "cn";
67
import * as React from "react";
78

89
import type { DataGridCellProps } from "@/lib/data-grid-types";
910

1011
import { getCellKey } from "@/lib/data-grid-utils";
11-
import { cn } from "@/lib/utils";
1212
import { useDataGridPresence } from "@/registry/bases/base/components/data-grid/data-grid-presence";
1313

1414
interface DataGridCellWrapperProps<TData extends RowData>

‎src/registry/bases/base/components/data-grid/data-grid-column-header.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import type {
99
Table,
1010
} from "@tanstack/react-table";
1111

12+
import { cn } from "cn";
1213
import * as React from "react";
1314

1415
import type { DataGridFeatures } from "@/lib/data-grid-features";
1516

1617
import { getColumnVariant } from "@/lib/data-grid-utils";
17-
import { cn } from "@/lib/utils";
1818
import {
1919
DropdownMenu,
2020
DropdownMenuCheckboxItem,

‎src/registry/bases/base/components/data-grid/data-grid-filter-menu.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type {
77
Table,
88
} from "@tanstack/react-table";
99

10+
import { cn } from "cn";
1011
import * as React from "react";
1112

1213
import type { DataGridFeatures } from "@/lib/data-grid-features";
@@ -18,7 +19,6 @@ import {
1819
getOperatorsForVariant,
1920
} from "@/lib/data-grid-filters";
2021
import { formatDate } from "@/lib/format";
21-
import { cn } from "@/lib/utils";
2222
import { Badge } from "@/registry/bases/base/ui/badge";
2323
import { Button } from "@/registry/bases/base/ui/button";
2424
import { useDirection } from "@/registry/bases/base/ui/direction";

‎src/registry/bases/base/components/data-grid/data-grid-paste-dialog.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { cn } from "cn";
34
import * as React from "react";
45

56
import type {
@@ -8,7 +9,6 @@ import type {
89
} from "@/lib/data-grid-types";
910

1011
import { useAsRef } from "@/hooks/use-as-ref";
11-
import { cn } from "@/lib/utils";
1212
import { Button } from "@/registry/bases/base/ui/button";
1313
import {
1414
Dialog,

0 commit comments

Comments
 (0)