diff --git a/apps/web/package.json b/apps/web/package.json index b6b18d3..70bbf1f 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -18,6 +18,7 @@ "@labjm/utilities": "workspace:*", "@vercel/analytics": "^2.0.1", "ai": "7.0.19", + "cnfast": "^0.1.0", "hono": "4.12.25", "motion": "12.40.0", "next": "16.3.0", diff --git a/apps/web/src/app/(projects)/ai-widget/_components/ai-widget/ai-widget-form.tsx b/apps/web/src/app/(projects)/ai-widget/_components/ai-widget/ai-widget-form.tsx index 59bf360..9eb7edd 100644 --- a/apps/web/src/app/(projects)/ai-widget/_components/ai-widget/ai-widget-form.tsx +++ b/apps/web/src/app/(projects)/ai-widget/_components/ai-widget/ai-widget-form.tsx @@ -2,12 +2,11 @@ import type { Dispatch, FC, RefObject, SetStateAction, SubmitEventHandler } from 'react'; +import { cn } from 'cnfast'; import { AnimatePresence, motion } from 'motion/react'; import { useEffect, useState } from 'react'; import useMeasure from 'react-use-measure'; -import { cn } from '@labjm/utilities/cn'; - import type { ModelChoice, ThinkingIntensity } from './types'; import { AIWidgetModelSelector } from './ai-widget-model-selector'; import { AIWidgetSubmitButton } from './ai-widget-submit-button'; diff --git a/apps/web/src/app/(projects)/ai-widget/_components/ai-widget/ai-widget-thinking-intensity-selector.tsx b/apps/web/src/app/(projects)/ai-widget/_components/ai-widget/ai-widget-thinking-intensity-selector.tsx index 40be746..ebd2ab5 100644 --- a/apps/web/src/app/(projects)/ai-widget/_components/ai-widget/ai-widget-thinking-intensity-selector.tsx +++ b/apps/web/src/app/(projects)/ai-widget/_components/ai-widget/ai-widget-thinking-intensity-selector.tsx @@ -2,7 +2,7 @@ import type { FC } from 'react'; -import { cn } from '@labjm/utilities/cn'; +import { cn } from 'cnfast'; import type { ThinkingIntensity } from './types'; import { THINKING_INTENSITIES } from './constants'; diff --git a/apps/web/src/app/(projects)/ai-widget/_components/loading-text.tsx b/apps/web/src/app/(projects)/ai-widget/_components/loading-text.tsx index bd7c665..64ec555 100644 --- a/apps/web/src/app/(projects)/ai-widget/_components/loading-text.tsx +++ b/apps/web/src/app/(projects)/ai-widget/_components/loading-text.tsx @@ -2,10 +2,9 @@ import type { CSSProperties, FC } from 'react'; +import { cn } from 'cnfast'; import { useEffect, useState } from 'react'; -import { cn } from '@labjm/utilities/cn'; - import styles from './loading-text.module.css'; type LoadingTextProps = { diff --git a/apps/web/src/app/_components/api-status.tsx b/apps/web/src/app/_components/api-status.tsx index 7959d93..d23dbeb 100644 --- a/apps/web/src/app/_components/api-status.tsx +++ b/apps/web/src/app/_components/api-status.tsx @@ -1,4 +1,4 @@ -import { cn } from '@labjm/utilities'; +import { cn } from 'cnfast'; import { apiClient } from '@/infrastructure/api'; import { Skeleton } from '@/ui/skeleton'; diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 2e6ec6d..3743d9c 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -2,10 +2,10 @@ import type { Metadata } from 'next'; import type { FC, PropsWithChildren } from 'react'; import { Analytics } from '@vercel/analytics/next'; +import { cn } from 'cnfast'; import localFont from 'next/font/local'; import { Suspense } from 'react'; -import { cn } from '@labjm/utilities/cn'; import { url } from '@labjm/utilities/url-composer'; import { Footer } from '@/ui/footer'; diff --git a/apps/web/src/ui/skeleton.tsx b/apps/web/src/ui/skeleton.tsx index 3a7ec9f..c9f5fed 100644 --- a/apps/web/src/ui/skeleton.tsx +++ b/apps/web/src/ui/skeleton.tsx @@ -1,7 +1,6 @@ +import { cn } from 'cnfast'; import { type FC, type HTMLAttributes } from 'react'; -import { cn } from '@labjm/utilities/cn'; - type SkeletonProps = HTMLAttributes & { bgColor?: string }; export const Skeleton: FC = (props) => { diff --git a/packages/utilities/package.json b/packages/utilities/package.json index e089e7b..bb188c5 100644 --- a/packages/utilities/package.json +++ b/packages/utilities/package.json @@ -10,13 +10,10 @@ }, "exports": { ".": "./src/index.ts", - "./cn": "./src/cn/index.ts", "./url-composer": "./src/url-composer/index.ts" }, "dependencies": { - "@labjm/schemas": "workspace:*", - "classnames": "^2.5.1", - "tailwind-merge": "^3.6.0" + "@labjm/schemas": "workspace:*" }, "devDependencies": { "@labjm/jest-config": "workspace:*", diff --git a/packages/utilities/src/cn/cn.test.ts b/packages/utilities/src/cn/cn.test.ts deleted file mode 100644 index 45d8010..0000000 --- a/packages/utilities/src/cn/cn.test.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { cn } from '.'; - -describe('cn', () => { - it('should return an empty string when no arguments are passed', () => { - expect(cn()).toEqual(''); - }); - - it('should concatenate class names when multiple arguments are passed', () => { - expect(cn('foo', 'bar')).toEqual('foo bar'); - }); - - it('should handle object arguments', () => { - expect(cn({ foo: true, bar: false })).toEqual('foo'); - expect(cn({ foo: true, bar: false }, 'baz')).toEqual('foo baz'); - }); - - it('should handle array arguments', () => { - expect(cn(['foo', 'bar'])).toEqual('foo bar'); - expect(cn(['foo', { bar: true }])).toEqual('foo bar'); - }); - - it('should handle combination of arguments', () => { - expect(cn('foo', { bar: true }, ['baz', { qux: true }])).toEqual('foo bar baz qux'); - }); - - it('should handle falsy arguments', () => { - expect(cn('foo', null, undefined, false, 0, '', { bar: false }, [])).toEqual('foo'); - }); -}); diff --git a/packages/utilities/src/cn/index.ts b/packages/utilities/src/cn/index.ts deleted file mode 100644 index cc54906..0000000 --- a/packages/utilities/src/cn/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import classNames from 'classnames'; -import { twMerge } from 'tailwind-merge'; - -export const cn = (...args: classNames.ArgumentArray) => { - return twMerge(classNames(...args)); -}; diff --git a/packages/utilities/src/index.ts b/packages/utilities/src/index.ts index 98428b8..ab41320 100644 --- a/packages/utilities/src/index.ts +++ b/packages/utilities/src/index.ts @@ -1,2 +1 @@ -export * from './cn'; export * from './url-composer'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6fe0755..1127f62 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -217,6 +217,9 @@ importers: ai: specifier: 7.0.19 version: 7.0.19(zod@4.4.3) + cnfast: + specifier: ^0.1.0 + version: 0.1.0 hono: specifier: 4.12.25 version: 4.12.25 @@ -421,12 +424,6 @@ importers: '@labjm/schemas': specifier: workspace:* version: link:../schemas - classnames: - specifier: ^2.5.1 - version: 2.5.1 - tailwind-merge: - specifier: ^3.6.0 - version: 3.6.0 devDependencies: '@labjm/jest-config': specifier: workspace:* @@ -3799,9 +3796,6 @@ packages: cjs-module-lexer@2.2.0: resolution: {integrity: sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==} - classnames@2.5.1: - resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} - cli-boxes@3.0.0: resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} engines: {node: '>=10'} @@ -3833,6 +3827,10 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} + cnfast@0.1.0: + resolution: {integrity: sha512-rH0jBKeLkVrK7NsZ5Ba2l7WdMBmm1k0FMpABeXUU1PgTUxbz3261gEuCSsrYuXo4BwAe3yCcIbQ93YyS52lOGQ==} + hasBin: true + co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} @@ -11007,8 +11005,6 @@ snapshots: cjs-module-lexer@2.2.0: {} - classnames@2.5.1: {} - cli-boxes@3.0.0: {} cli-cursor@5.0.0: @@ -11042,6 +11038,8 @@ snapshots: clsx@2.1.1: {} + cnfast@0.1.0: {} + co@4.6.0: {} collect-v8-coverage@1.0.3: {}