diff --git a/.gitignore b/.gitignore index f5f71dd..2bbb726 100755 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ es coverage yarn.lock package-lock.json +pnpm-lock.yaml .doc/ dist .doc @@ -34,4 +35,4 @@ dist .dumi/tmp-test .dumi/tmp-production -bun.lockb \ No newline at end of file +bun.lockb diff --git a/package.json b/package.json index 4be3381..6cd9171 100644 --- a/package.json +++ b/package.json @@ -41,14 +41,14 @@ }, "dependencies": { "@rc-component/util": "^1.3.0", - "classnames": "^2.2.5" + "clsx": "^2.1.1" }, "devDependencies": { "@rc-component/father-plugin": "^2.1.3", "@rc-component/np": "^1.0.0", "@rc-component/tooltip": "^1.2.1", - "@types/classnames": "^2.2.9", "@types/jest": "^29.5.1", + "@types/node": "^24.5.2", "@types/react": "^17.0.15", "@types/react-dom": "^17.0.9", "@umijs/fabric": "^3.0.0", diff --git a/src/Rate.tsx b/src/Rate.tsx index 85810c1..ba408be 100644 --- a/src/Rate.tsx +++ b/src/Rate.tsx @@ -1,7 +1,7 @@ import useControlledState from '@rc-component/util/lib/hooks/useControlledState'; import KeyCode from '@rc-component/util/lib/KeyCode'; import pickAttrs from '@rc-component/util/lib/pickAttrs'; -import classNames from 'classnames'; +import { clsx } from 'clsx'; import React from 'react'; import type { StarProps } from './Star'; import Star from './Star'; @@ -221,7 +221,7 @@ function Rate(props: RateProps, ref: React.Ref) { /> )); - const classString = classNames(prefixCls, className, { + const classString = clsx(prefixCls, className, { [`${prefixCls}-disabled`]: disabled, [`${prefixCls}-rtl`]: direction === 'rtl', }); diff --git a/src/Star.tsx b/src/Star.tsx index d401ef8..c4314d1 100644 --- a/src/Star.tsx +++ b/src/Star.tsx @@ -1,6 +1,6 @@ import React from 'react'; import KeyCode from '@rc-component/util/lib/KeyCode'; -import classNames from 'classnames'; +import { clsx } from 'clsx'; export interface StarProps { value?: number; @@ -76,8 +76,9 @@ function Star(props: StarProps, ref: React.Ref) { // >>>>> Node const characterNode = typeof character === 'function' ? character(props) : character; + let start: React.ReactNode = ( -
  • +