Skip to content

Commit eb28158

Browse files
chore: Update passing api (#501)
* chore: bump package.json * chore: pass props to trigger * docs: update ci * Update src/Tooltip.tsx Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 6558417 commit eb28158

File tree

5 files changed

+54
-8
lines changed

5 files changed

+54
-8
lines changed

.dumirc.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { defineConfig } from 'dumi';
22
import path from 'path';
33

4-
const isProdSite =
5-
// 不是预览模式 同时是生产环境
6-
process.env.PREVIEW !== 'true' && process.env.NODE_ENV === 'production';
4+
// const isProdSite =
5+
// // 不是预览模式 同时是生产环境
6+
// process.env.PREVIEW !== 'true' && process.env.NODE_ENV === 'production';
77

8-
const name = 'tooltip';
8+
// const name = 'tooltip';
99

1010
export default defineConfig({
1111
alias: {
@@ -18,6 +18,6 @@ export default defineConfig({
1818
name: 'Tooltip',
1919
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
2020
},
21-
base: isProdSite ? `/${name}/` : '/',
22-
publicPath: isProdSite ? `/${name}/` : '/',
21+
// base: isProdSite ? `/${name}/` : '/',
22+
// publicPath: isProdSite ? `/${name}/` : '/',
2323
});

docs/demo/twoButtons.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Two Buttons
3+
order: 8
4+
---
5+
6+
Demonstrates two buttons with different tooltips on hover.
7+
8+
```jsx
9+
import TwoButtonsDemo from '../examples/twoButtons';
10+
11+
export default () => <TwoButtonsDemo />;
12+
```

docs/examples/twoButtons.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { UniqueProvider } from '@rc-component/trigger';
2+
import React from 'react';
3+
import '../../assets/bootstrap.less';
4+
import Tooltip from '../../src';
5+
6+
const TwoButtonsDemo = () => (
7+
<UniqueProvider>
8+
<div style={{ margin: 100 }}>
9+
<Tooltip
10+
placement="top"
11+
trigger={['hover']}
12+
overlay="This is the first tooltip"
13+
motion={{ motionName: 'rc-tooltip-zoom' }}
14+
>
15+
<button type="button">Button 1</button>
16+
</Tooltip>
17+
<Tooltip
18+
placement="top"
19+
trigger={['hover']}
20+
overlay="This is the second tooltip"
21+
motion={{ motionName: 'rc-tooltip-zoom' }}
22+
>
23+
<button type="button">Button 2</button>
24+
</Tooltip>
25+
</div>
26+
</UniqueProvider>
27+
);
28+
29+
export default TwoButtonsDemo;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"test": "rc-test"
4242
},
4343
"dependencies": {
44-
"@rc-component/trigger": "^3.0.0",
45-
"@rc-component/util": "^1.0.1",
44+
"@rc-component/trigger": "^3.6.0",
45+
"@rc-component/util": "^1.3.0",
4646
"classnames": "^2.3.1"
4747
},
4848
"devDependencies": {

src/Tooltip.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export interface TooltipProps
4545
zIndex?: number;
4646
styles?: TooltipStyles;
4747
classNames?: TooltipClassNames;
48+
/**
49+
* Configures Tooltip to reuse the background for transition usage.
50+
* This is an experimental API and may not be stable.
51+
*/
52+
unique?: TriggerProps['unique'];
4853
}
4954

5055
export interface TooltipStyles {

0 commit comments

Comments
 (0)