diff --git a/.gitignore b/.gitignore index 0ea0494..7595468 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ lib es coverage package-lock.json +pnpm-lock.yaml yarn.lock .doc .umi diff --git a/package.json b/package.json index 9177018..cef5e8b 100644 --- a/package.json +++ b/package.json @@ -52,16 +52,16 @@ ] }, "dependencies": { - "classnames": "^2.2.3", - "@rc-component/util": "^1.2.1" + "@rc-component/util": "^1.2.1", + "clsx": "^2.1.1" }, "devDependencies": { "@rc-component/father-plugin": "^2.0.2", "@rc-component/np": "^1.0.0", "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^15.0.6", - "@types/classnames": "^2.2.9", "@types/jest": "^29.4.0", + "@types/node": "^24.5.2", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@umijs/fabric": "^4.0.1", diff --git a/src/Rail.tsx b/src/Rail.tsx index 5850146..103aab7 100644 --- a/src/Rail.tsx +++ b/src/Rail.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import cls from 'classnames'; +import { clsx } from 'clsx'; import type { Status } from './Steps'; export interface RailProps { @@ -14,5 +14,5 @@ export default function Rail(props: RailProps) { const railCls = `${prefixCls}-rail`; // ============================= render ============================= - return
; + return ; } diff --git a/src/Step.tsx b/src/Step.tsx index 1ee6078..2d2cd00 100644 --- a/src/Step.tsx +++ b/src/Step.tsx @@ -1,6 +1,6 @@ /* eslint react/prop-types: 0 */ import * as React from 'react'; -import cls from 'classnames'; +import { clsx } from 'clsx'; import KeyCode from '@rc-component/util/lib/KeyCode'; import type { Status, StepItem, StepsProps } from './Steps'; import Rail from './Rail'; @@ -126,7 +126,7 @@ export default function Step(props: StepProps) { const hasTitle = hasContent(title); const hasSubTitle = hasContent(subTitle); - const classString = cls( + const classString = clsx( itemCls, `${itemCls}-${mergedStatus}`, { @@ -152,11 +152,8 @@ export default function Step(props: StepProps) { const wrapperNode = (