{"name":"@rc-component/tooltip","version":"1.5.1","keywords":["react","react-component","react-tooltip","tooltip"],"license":"MIT","_id":"@rc-component/tooltip@1.5.1","maintainers":[{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"},{"name":"peachscript","email":"scdzwyxst@gmail.com"},{"name":"chenshuai2144","email":"wasd2144@hotmail.com"}],"homepage":"https://react-component.github.io/tooltip","bugs":{"url":"https://github.com/react-component/tooltip/issues"},"dist":{"shasum":"a5aa6b6fefbb0b5b85e05cfc2f42cf4d6275beed","tarball":"http://registry-npm.ywwl.com/@rc-component/tooltip/download/@rc-component/tooltip-1.5.1.tgz","fileCount":24,"integrity":"sha512-DJnyAkZjOJgluWx29IsyhRufiJVk5AbT7jbPamg6J+b+ciVVa1IEEDqhvEtsa1+eZ7ECsg6M5UdzoDtqwOYsNA==","signatures":[{"sig":"MEYCIQCTooVEUtcG+2nhFdOWP9oYabwJd3N/aUPmTszPsIA4agIhAMTK8rVbIRiAzdeTXXlWo5fsDiiLh59xzhujyQtyN/+V","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIBlJ5C1/2LeDE0TYheLw/GzBhIIfWDmgrs+QHA14ks/kAiEA272haca1vBLVr89WeZ15qDyUshvsSUl0QetL1+YxG0I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54841,"size":10613,"noattachment":false,"key":"/@rc-component/tooltip/-/@rc-component/tooltip-1.5.1.tgz"},"main":"./lib/index","types":"./es/index.d.ts","module":"./es/index","gitHead":"4cc3d616daff6b523151d27c46db2a52938fe5a7","scripts":{"tsc":"tsc --noEmit","lint":"eslint src/ --ext .tsx,.ts,.jsx,.js","test":"rc-test","build":"npm run compile && npm run docs:build","start":"dumi dev","deploy":"npm run gh-pages","compile":"father build && lessc assets/bootstrap.less assets/bootstrap.css && lessc assets/bootstrap_white.less assets/bootstrap_white.css","prepare":"husky","coverage":"rc-test --coverage","gh-pages":"npm run compile && 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","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"madccc","email":"1075746765@qq.com"},"repository":{"url":"git+https://github.com/react-component/tooltip.git","type":"git"},"_npmVersion":"10.9.2","description":"Tooltip UI component for React","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown"},"_nodeVersion":"22.13.1","dependencies":{"clsx":"^2.1.1","@rc-component/util":"^1.11.1","@rc-component/trigger":"^3.10.0"},"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","@types/warning":"^3.0.4","@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","@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":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tooltip_1.5.1_1787800354557_0.8097474957739033","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <h1>@rc-component/tooltip</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> Ant Design 生态的一部分。</sub></p>\n  <p>💡 React 文字提示组件，基于 trigger 定位和弹层能力构建。</p>\n\n  <p>\n    <a href=\"https://npmjs.org/package/@rc-component/tooltip\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/tooltip.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/tooltip\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/tooltip.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/tooltip/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/tooltip/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/tooltip\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/tooltip/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/tooltip\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/tooltip?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\"><a href=\"./README.md\">English</a> | 简体中文</p>\n\n\n## 特性\n\n- 支持悬停、聚焦、单击以及通过一个触发层控制可见性。\n- 提供内置放置、自定义对齐、延迟、箭头和弹层动作。\n- 为根节点、箭头节点和容器节点引入语义 `classNames` 和 `styles` 槽。\n- 通过生成的工具提示 id 和 `aria-describedby` 保留可访问性连接。\n\n## 安装\n\n```bash\nnpm install @rc-component/tooltip\n```\n\n## 使用\n\n```tsx pure\nimport Tooltip from '@rc-component/tooltip';\nimport '@rc-component/tooltip/assets/bootstrap_white.css';\n\nexport default () => (\n  <Tooltip placement=\"top\" overlay={<span>Tooltip content</span>}>\n    <button type=\"button\">Hover me</button>\n  </Tooltip>\n);\n```\n\n在线预览：https://tooltip.react-component.vercel.app/\n\n## 示例\n\n运行本地 dumi 站点：\n\n```bash\nnpm install\nnpm start\n```\n\n然后打开 `http://localhost:8000`。\n\n## API\n\n### Tooltip\n\n| 名称                  | 类型                                                 | 默认值             | 说明                                                |\n| --------------------- | ---------------------------------------------------- | ------------------- | ---------------------------------------------------------- |\n| `afterVisibleChange`  | `(visible: boolean) => void`                         | -                   | 弹层窗口可见性更改后调用。                     |\n| `align`               | AlignType                                            | `{}`                | 额外弹层对齐配置。                              |\n| `arrowContent`        | React.ReactNode                                      | -                   | 自定义箭头内容。                                      |\n| `builtinPlacements`   | TriggerProps['builtinPlacements']                    | built-in placements | 传递给触发器的放置映射。                           |\n| `children`            | React.ReactElement                                   | -                   | 所需的触发元素。                                  |\n| `classNames`          | `Partial<Record<SemanticName, string>>`              | -                   | 根节点、箭头节点和容器节点的语义化类名。 |\n| `defaultVisible`      | boolean                                              | -                   | 初始不受控制的可见状态。                        |\n| `destroyOnHidden`     | boolean                                              | false               | 隐藏时销毁弹层 DOM。                             |\n| `fresh`               | boolean                                              | -                   | 关闭时保持弹层内容新鲜。                      |\n| `getTooltipContainer` | `(node: HTMLElement) => HTMLElement`                 | -                   | 指定弹层容器。                                   |\n| `id`                  | string                                               | generated id        | 用于辅助功能的工具提示 ID。                         |\n| `motion`              | TriggerProps['popupMotion']                          | -                   | 弹层运动配置。                                       |\n| `mouseEnterDelay`     | number                                               | 0                   | 鼠标移入后显示的延迟（秒）。            |\n| `mouseLeaveDelay`     | number                                               | 0.1                 | 鼠标移出后隐藏的延迟（秒）。             |\n| `onPopupAlign`        | TriggerProps['onPopupAlign']                         | -                   | 弹层对齐后调用。                              |\n| `onVisibleChange`     | `(visible: boolean) => void`                         | -                   | 当可见性发生变化时调用。                            |\n| `overlay`             | React.ReactNode \\| `() => React.ReactNode`           | -                   | 提示内容。                                           |\n| `placement`           | string                                               | `'right'`           | 弹层放置。                                           |\n| `prefixCls`           | string                                               | `'rc-tooltip'`      | 前缀 className。                                         |\n| `showArrow`           | boolean \\| ArrowType                                 | true                | 是否显示箭头，或提供箭头配置。             |\n| `styles`              | `Partial<Record<SemanticName, React.CSSProperties>>` | -                   | 根节点、箭头节点和容器节点的语义样式。      |\n| `trigger`             | ActionType \\| ActionType[]                           | `['hover']`         | 显示提示的触发行为。                             |\n| `unique`              | TriggerProps['unique']                               | -                   | 实验性独特的容器重用配置。                |\n| `visible`             | boolean                                              | -                   | 受控可见状态。                                  |\n| `zIndex`              | number                                               | -                   | 弹层 z 索引。                                             |\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run tsc\nnpm run compile\nnpm run build\n```\n\ndumi 站点默认运行在 `http://localhost:8000`。\n\n## 发布\n\n```bash\nnpm run prepublishOnly\n```\n\n包构建完成后，发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。\n\n## 许可证\n\n@rc-component/tooltip 基于 [MIT](./LICENSE) 许可证发布。\n","publish_time":1787800354870,"_cnpm_publish_time":1787800354870,"dist-tags":{"latest":"1.5.2"}}