{"versions":{"1.0.0":{"name":"@rc-component/rate","version":"1.0.0","description":"React Star Rate Component","keywords":["react","react-component","react-rate","rate"],"homepage":"https://github.com/react-component/rate","bugs":{"url":"https://github.com/react-component/rate/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/rate.git"},"license":"MIT","main":"./lib/index","module":"./es/index","scripts":{"compile":"father build && lessc assets/index.less assets/index.css","coverage":"rc-test --coverage","docs:build":"dumi build","docs:deploy":"gh-pages -d .doc","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","now-build":"npm run docs:build","prepare":"dumi setup","prepublishOnly":"npm run compile && rc-np","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","postpublish":"npm run docs:build && npm run docs:deploy","start":"dumi dev","test":"rc-test","tsc":"bunx tsc --noEmit"},"dependencies":{"@rc-component/util":"^1.3.0","classnames":"^2.2.5"},"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/react":"^17.0.15","@types/react-dom":"^17.0.9","@umijs/fabric":"^3.0.0","cheerio":"1.0.0-rc.12","cross-env":"^7.0.0","dumi":"^2.1.2","enzyme":"^3.1.1","enzyme-adapter-react-16":"^1.15.6","enzyme-to-json":"^3.1.2","eslint":"^7.1.0","father":"^4.0.0","gh-pages":"^3.1.0","less":"^3.0.0","rc-test":"^7.0.15","react":"^16.0.0","react-dom":"^16.0.0","typescript":"^5.0.4"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"_id":"@rc-component/rate@1.0.0","gitHead":"23ebec0db4b95d00d741d501012c1d981b44d386","types":"./lib/index.d.ts","_nodeVersion":"22.15.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-X6LPdN67Sjsya/MxnM7bTYJ3wmua9FYt1wgw9L08oM9FfmsiTYSIHJy8D8aMWyDl99LBVq3vTIu135ghCwWkEA==","shasum":"89fe758fcbd713ec47a0437981eb968cd6f61fdb","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@rc-component/rate/-/rate-1.0.0.tgz","fileCount":24,"unpackedSize":34806,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD3QBFgGK5fL1WAwSTG60BIjiZYUyoWSscV4hMWplfzIgIhAOCjwrCeKXpVgnp1pjldCkPQ7fIlRTc6rWGnydo8/xtl"}],"size":8047},"_npmUser":{"name":"anonymous","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"smith3816@gmail.com"},{"name":"anonymous","email":"afc163@gmail.com"},{"name":"anonymous","email":"1075746765@qq.com"},{"name":"anonymous","email":"scdzwyxst@gmail.com"},{"name":"anonymous","email":"wasd2144@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rate_1.0.0_1757988190937_0.3095677628790561"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-16T02:03:11.132Z","publish_time":1757988191132,"_source_registry_name":"default","contributors":[]},"1.0.1":{"name":"@rc-component/rate","version":"1.0.1","description":"React Star Rate Component","keywords":["react","react-component","react-rate","rate"],"homepage":"https://github.com/react-component/rate","bugs":{"url":"https://github.com/react-component/rate/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/rate.git"},"license":"MIT","main":"./lib/index","module":"./es/index","scripts":{"compile":"father build && lessc assets/index.less assets/index.css","coverage":"rc-test --coverage","docs:build":"dumi build","docs:deploy":"gh-pages -d dist","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","now-build":"npm run docs:build","prepare":"dumi setup","prepublishOnly":"npm run compile && rc-np","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","postpublish":"npm run docs:build && npm run docs:deploy","start":"dumi dev","test":"rc-test","tsc":"bunx tsc --noEmit"},"dependencies":{"@rc-component/util":"^1.3.0","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/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","cheerio":"1.0.0-rc.12","cross-env":"^7.0.0","dumi":"^2.1.2","enzyme":"^3.1.1","enzyme-adapter-react-16":"^1.15.6","enzyme-to-json":"^3.1.2","eslint":"^7.1.0","father":"^4.0.0","gh-pages":"^3.1.0","less":"^3.0.0","rc-test":"^7.0.15","react":"^16.0.0","react-dom":"^16.0.0","typescript":"^5.0.4"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"_id":"@rc-component/rate@1.0.1","gitHead":"87c72e7781fa0e3060d3575e7fd5910f26696e3a","types":"./lib/index.d.ts","_nodeVersion":"22.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-bkXxeBqDpl5IOC7yL7GcSYjQx9G8H+6kLYQnNZWeBYq2OYIv1MONd6mqKTjnnJYpV0cQIU2z3atdW0j1kttpTw==","shasum":"836c3c0bea69047f4234383e2ce6ab83a02ee26a","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@rc-component/rate/-/rate-1.0.1.tgz","fileCount":24,"unpackedSize":34677,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDVrvzSRgAkcsCTjYhxAwje4oQuKdmgu5Lu5U2dUSIxigIhAM02jQAShfoHz17w6DHkwYN66Bvt51CkOfvRaUCpKobW"}],"size":8047},"_npmUser":{"name":"anonymous","email":"afc163@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"smith3816@gmail.com"},{"name":"anonymous","email":"afc163@gmail.com"},{"name":"anonymous","email":"1075746765@qq.com"},{"name":"anonymous","email":"scdzwyxst@gmail.com"},{"name":"anonymous","email":"wasd2144@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rate_1.0.1_1764298809243_0.03140475958992672"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-28T03:00:09.457Z","publish_time":1764298809457,"_source_registry_name":"default","contributors":[]},"1.0.2":{"_id":"@rc-component/rate@1.0.2","bugs":{"url":"https://github.com/react-component/rate/issues"},"dist":{"shasum":"358d09208a788ed0b0c484d51255375d08cbe009","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@rc-component/rate/-/rate-1.0.2.tgz","fileCount":26,"integrity":"sha512-teUQ02Irg6Ho20JdnN7vstX+bPHwSBdVP/63lpGVJVuJPEfbK5sEjJ/rz8Rgfa7FYO2fRPKMUcKMrPcdQakzeQ==","signatures":[{"sig":"MEQCIBhqlvc0I2hZtzFnTdrfvBXt6DSMEGP+Zv2dw8U27FoaAiARKhmETxY6JbnvQQATAyZahiezhJJ2OYymzRpQGEWS+w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC5Eg8xdSbFXClD4UOf7KIvzoFR1yrjB+xwwdUoSIIJ+AIgN9C/fUqbGcHUO/JEBolZBaQcD81ondV+6UeUngcA+WU="}],"unpackedSize":40726,"size":10260},"main":"./lib/index","name":"@rc-component/rate","types":"./es/index.d.ts","module":"./es/index","engines":{"node":">=8.x"},"gitHead":"4c45db6cb96c414a259851ce61ff4884662452a3","license":"MIT","scripts":{"tsc":"tsc --noEmit","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","test":"rc-test","build":"npm run docs:build","start":"dumi dev","compile":"father build && lessc assets/index.less assets/index.css","prepare":"husky && dumi setup","coverage":"rc-test --coverage","gh-pages":"cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy","prettier":"prettier --write --ignore-unknown .","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","postpublish":"npm run gh-pages","prepublishOnly":"npm run compile && rc-np"},"version":"1.0.2","_npmUser":{"name":"anonymous","email":"smith3816@gmail.com"},"homepage":"https://react-component.github.io/rate","keywords":["react","react-component","react-rate","rate"],"repository":{"url":"git+https://github.com/react-component/rate.git","type":"git"},"_npmVersion":"11.19.1","description":"React Star Rate Component","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown"},"maintainers":[{"name":"anonymous","email":"smith3816@gmail.com"},{"name":"anonymous","email":"afc163@gmail.com"},{"name":"anonymous","email":"1075746765@qq.com"},{"name":"anonymous","email":"scdzwyxst@gmail.com"},{"name":"anonymous","email":"wasd2144@hotmail.com"}],"_nodeVersion":"26.9.0","dependencies":{"clsx":"^2.1.1","@rc-component/util":"^1.11.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.38","less":"^4.6.7","husky":"^9.1.7","react":"^19.2.7","eslint":"^10.6.0","father":"^4.6.24","globals":"^17.7.0","rc-test":"^7.1.3","gh-pages":"^6.3.0","prettier":"^3.9.4","cross-env":"^10.1.0","react-dom":"^19.2.7","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/jest":"^30.0.0","@types/node":"^26.0.1","lint-staged":"^17.0.8","@types/react":"^19.2.17","@eslint/compat":"^2.1.0","@rc-component/np":"^1.0.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.62.1","eslint-plugin-jest":"^29.15.4","eslint-plugin-react":"^7.37.5","@testing-library/dom":"^10.4.1","@rc-component/tooltip":"^1.2.1","@testing-library/react":"^16.3.2","eslint-config-prettier":"^10.1.8","@testing-library/jest-dom":"^6.9.1","eslint-plugin-react-hooks":"^7.1.1","@rc-component/father-plugin":"^2.2.0"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rate_1.0.2_1796229808119_0.38303202850323004"},"_cnpmcore_publish_time":"2026-12-02T16:43:28.217Z","publish_time":1796229808217,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.0.2"},"name":"@rc-component/rate","time":{"created":"2025-09-16T02:03:17.101Z","modified":"2026-12-02T16:43:46.982Z","1.0.0":"2025-09-16T02:03:11.132Z","1.0.1":"2025-11-28T03:00:09.457Z","1.0.2":"2026-12-02T16:43:28.217Z"},"readme":"<div align=\"center\">\n  <h1>@rc-component/rate</h1>\n  <p><sub><a href=\"https://ant.design\"><img alt=\"Ant Design\" height=\"14\" src=\"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg\" style=\"vertical-align: -0.125em;\" /></a> Part of the Ant Design ecosystem.</sub></p>\n  <p>📦 ⭐ Accessible React rating component with half-star and keyboard support.</p>\n\n  <p>\n    <a href=\"https://npmjs.org/package/@rc-component/rate\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/rate.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/rate\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/rate.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/rate/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/rate/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/rate\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/rate/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/rate\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/rate?style=flat-square\"></a>\n    <a href=\"https://github.com/umijs/dumi\"><img alt=\"dumi\" src=\"https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\"></a>\n  </p>\n</div>\n\n<p align=\"center\">English | <a href=\"./README.zh-CN.md\">简体中文</a></p>\n\n## Highlights\n\n- Controlled and uncontrolled rating values.\n- Half-star selection, custom characters, and custom character rendering.\n- Keyboard interaction, focus/blur methods, disabled state, and RTL support.\n- TypeScript definitions for props and imperative refs.\n\n## Install\n\n```bash\nnpm install @rc-component/rate\n```\n\n## Usage\n\n```tsx | pure\nimport Rate from '@rc-component/rate';\nexport default () => <Rate defaultValue={2.5} allowHalf />;\n```\n\n```tsx | pure\nimport Rate from '@rc-component/rate';\nexport default () => (\n  <Rate\n    count={5}\n    defaultValue={3}\n    character={({ index }) => index + 1}\n    onChange={(value) => {\n      console.log('selected', value);\n    }}\n  />\n);\n```\n\n## Examples\n\nRun the local dumi site:\n\n```bash\nnpm install\nnpm start\n```\n\nThen open `http://localhost:8000`.\n\n## API\n\n### Rate\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `allowClear` | boolean | true | Clear the value when clicking the selected item again. |\n| `allowHalf` | boolean | false | Enable half item selection. |\n| `autoFocus` | boolean | false | Focus the rating on mount. |\n| `character` | ReactNode \\| (props: StarProps) => ReactNode | `'★'` | Custom character for each item. |\n| `characterRender` | (origin: ReactElement, props: StarProps) => ReactNode | - | Custom renderer for each item. |\n| `className` | string | - | Additional class name. |\n| `count` | number | 5 | Number of rating items. |\n| `defaultValue` | number | 0 | Initial uncontrolled value. |\n| `direction` | string | `'ltr'` | Layout direction. Use `'rtl'` for right-to-left display. |\n| `disabled` | boolean | false | Disable interaction. |\n| `id` | string | - | Root element id. |\n| `keyboard` | boolean | true | Enable keyboard control. |\n| `prefixCls` | string | `'rc-rate'` | Prefix class name. |\n| `style` | React.CSSProperties | - | Root style. |\n| `tabIndex` | number | 0 | Root tab index. |\n| `value` | number | - | Controlled value. |\n| `onBlur` | () => void | - | Blur callback. |\n| `onChange` | (value: number) => void | - | Value change callback. |\n| `onFocus` | () => void | - | Focus callback. |\n| `onHoverChange` | (value: number) => void | - | Hover value callback. |\n| `onKeyDown` | `React.KeyboardEventHandler<HTMLUListElement>` | - | Keydown callback. |\n| `onMouseEnter` | `React.MouseEventHandler<HTMLUListElement>` | - | Mouse enter callback. |\n| `onMouseLeave` | `React.MouseEventHandler<HTMLUListElement>` | - | Mouse leave callback. |\n\n### Ref\n\n| Name    | Type       | Description                   |\n| ------- | ---------- | ----------------------------- |\n| `blur`  | () => void | Remove focus from the rating. |\n| `focus` | () => void | Focus the rating.             |\n\n## Development\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run tsc\nnpm run compile\nnpm run build\n```\n\nThe dumi site runs at `http://localhost:8000` by default.\n\n## Release\n\n```bash\nnpm run prepublishOnly\n```\n\nThe release flow is handled by `@rc-component/np` through the `rc-np` command after the package build.\n\n## License\n\n@rc-component/rate is released under the [MIT](./LICENSE) license.","users":{}}