diff --git a/.dumirc.ts b/.dumirc.ts index e6e98c8..1e597f0 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,11 +1,11 @@ import { defineConfig } from 'dumi'; import path from 'path'; -const isProdSite = - // 不是预览模式 同时是生产环境 - process.env.PREVIEW !== 'true' && process.env.NODE_ENV === 'production'; +// const isProdSite = +// // 不是预览模式 同时是生产环境 +// process.env.PREVIEW !== 'true' && process.env.NODE_ENV === 'production'; -const name = 'tooltip'; +// const name = 'tooltip'; export default defineConfig({ alias: { @@ -18,6 +18,6 @@ export default defineConfig({ name: 'Tooltip', logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, - base: isProdSite ? `/${name}/` : '/', - publicPath: isProdSite ? `/${name}/` : '/', + // base: isProdSite ? `/${name}/` : '/', + // publicPath: isProdSite ? `/${name}/` : '/', }); diff --git a/docs/demo/twoButtons.md b/docs/demo/twoButtons.md new file mode 100644 index 0000000..cc438c8 --- /dev/null +++ b/docs/demo/twoButtons.md @@ -0,0 +1,12 @@ +--- +title: Two Buttons +order: 8 +--- + +Demonstrates two buttons with different tooltips on hover. + +```jsx +import TwoButtonsDemo from '../examples/twoButtons'; + +export default () => ; +``` diff --git a/docs/examples/twoButtons.tsx b/docs/examples/twoButtons.tsx new file mode 100644 index 0000000..25b39bc --- /dev/null +++ b/docs/examples/twoButtons.tsx @@ -0,0 +1,29 @@ +import { UniqueProvider } from '@rc-component/trigger'; +import React from 'react'; +import '../../assets/bootstrap.less'; +import Tooltip from '../../src'; + +const TwoButtonsDemo = () => ( + +
+ + + + + + +
+
+); + +export default TwoButtonsDemo; diff --git a/package.json b/package.json index ab74697..81028fe 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,8 @@ "test": "rc-test" }, "dependencies": { - "@rc-component/trigger": "^3.0.0", - "@rc-component/util": "^1.0.1", + "@rc-component/trigger": "^3.6.0", + "@rc-component/util": "^1.3.0", "classnames": "^2.3.1" }, "devDependencies": { diff --git a/src/Tooltip.tsx b/src/Tooltip.tsx index c0d98b2..bc14731 100644 --- a/src/Tooltip.tsx +++ b/src/Tooltip.tsx @@ -45,6 +45,11 @@ export interface TooltipProps zIndex?: number; styles?: TooltipStyles; classNames?: TooltipClassNames; + /** + * Configures Tooltip to reuse the background for transition usage. + * This is an experimental API and may not be stable. + */ + unique?: TriggerProps['unique']; } export interface TooltipStyles {