diff --git a/apps/docs/lib/utils.ts b/apps/docs/lib/utils.ts deleted file mode 100644 index 9ad0df426..000000000 --- a/apps/docs/lib/utils.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type ClassValue, clsx } from 'clsx'; -import { twMerge } from 'tailwind-merge'; - -export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); -} diff --git a/apps/docs/package.json b/apps/docs/package.json index 53324cea4..34a472b11 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -10,12 +10,10 @@ }, "dependencies": { "@bigcommerce/reactant": "workspace:^", - "clsx": "^2.0.0", "lucide-react": "^0.294.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "storybook": "^7.6.4", - "tailwind-merge": "^2.1.0" + "storybook": "^7.6.4" }, "devDependencies": { "@bigcommerce/catalyst-configs": "workspace:^", diff --git a/apps/docs/stories/NavigationMenu.stories.tsx b/apps/docs/stories/NavigationMenu.stories.tsx index 99dad2948..9be11f7b3 100644 --- a/apps/docs/stories/NavigationMenu.stories.tsx +++ b/apps/docs/stories/NavigationMenu.stories.tsx @@ -1,4 +1,5 @@ import { Badge } from '@bigcommerce/reactant/Badge'; +import { cn } from '@bigcommerce/reactant/cn'; import { NavigationMenu, NavigationMenuCollapsed, @@ -12,8 +13,6 @@ import { import type { Meta, StoryObj } from '@storybook/react'; import { ChevronDown, MenuSquare, Search, ShoppingCart, User, XSquare } from 'lucide-react'; -import { cn } from '~/lib/utils'; - const meta = { component: NavigationMenu, tags: ['autodocs'], diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json index c61e45cb6..1f2365821 100644 --- a/apps/docs/tsconfig.json +++ b/apps/docs/tsconfig.json @@ -20,9 +20,7 @@ "jsx": "preserve", "incremental": true, "baseUrl": ".", - "paths": { - "~/lib/*": ["./lib/*"] - }, + "paths": {}, "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, "include": [ diff --git a/packages/reactant/package.json b/packages/reactant/package.json index 3d8a4f7fd..ee3b56b6b 100644 --- a/packages/reactant/package.json +++ b/packages/reactant/package.json @@ -8,7 +8,7 @@ "./package.json": "./package.json", "./postcss-config": "./postcss.config.js", "./tailwind-config": "./tailwind.config.js", - "./cs": "./src/utils/cs.ts", + "./cn": "./src/lib/utils.ts", "./*": "./src/components/*/index.ts" }, "scripts": { diff --git a/packages/reactant/src/components/Calendar/Calendar.tsx b/packages/reactant/src/components/Calendar/Calendar.tsx index 730ffb960..45e0c5428 100644 --- a/packages/reactant/src/components/Calendar/Calendar.tsx +++ b/packages/reactant/src/components/Calendar/Calendar.tsx @@ -3,6 +3,7 @@ import * as React from 'react'; import { DayPicker } from 'react-day-picker'; import { cn } from '~/lib/utils'; + import { buttonVariants } from '../Button'; export type CalendarProps = React.ComponentProps; diff --git a/packages/reactant/src/components/FileChooser/FileChooser.tsx b/packages/reactant/src/components/FileChooser/FileChooser.tsx index 787a33962..86f6937bf 100644 --- a/packages/reactant/src/components/FileChooser/FileChooser.tsx +++ b/packages/reactant/src/components/FileChooser/FileChooser.tsx @@ -1,6 +1,7 @@ import { ElementRef, forwardRef } from 'react'; import { cn } from '~/lib/utils'; + import { Input, InputProps } from '../Input'; export const FileChooser = forwardRef, InputProps>( diff --git a/packages/reactant/src/components/Form/Form.tsx b/packages/reactant/src/components/Form/Form.tsx index 430bb55b4..770b6ae44 100644 --- a/packages/reactant/src/components/Form/Form.tsx +++ b/packages/reactant/src/components/Form/Form.tsx @@ -2,6 +2,7 @@ import * as FormPrimitive from '@radix-ui/react-form'; import { ComponentPropsWithRef, ElementRef, forwardRef } from 'react'; import { cn } from '~/lib/utils'; + import { Label } from '../Label'; type ValidationPattern = diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27a95149e..37c75b0b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -156,9 +156,6 @@ importers: '@bigcommerce/reactant': specifier: workspace:^ version: link:../../packages/reactant - clsx: - specifier: ^2.0.0 - version: 2.0.0 lucide-react: specifier: ^0.294.0 version: 0.294.0(react@18.2.0) @@ -171,9 +168,6 @@ importers: storybook: specifier: ^7.6.4 version: 7.6.4 - tailwind-merge: - specifier: ^2.1.0 - version: 2.1.0 devDependencies: '@bigcommerce/catalyst-configs': specifier: workspace:^ @@ -8352,7 +8346,7 @@ packages: doctrine: 2.1.0 eslint: 8.55.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.59.8)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.55.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.55.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3