Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/examples/simple.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { ActionType } from '@rc-component/trigger';
import type { OffsetType } from '@rc-component/trigger/lib/interface';
import Tooltip from 'rc-tooltip';
import type { CSSProperties } from 'react';
import React, { Component } from 'react';
import '../../assets/bootstrap.less';
import { placements } from '../../src/placements';

type OffsetType = string | number;

interface TestState {
destroyOnHidden: boolean;
destroyTooltipOptions: { name: string; value: number }[];
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
},
"dependencies": {
"@rc-component/trigger": "^3.7.1",
"@rc-component/util": "^1.3.0",
"@rc-component/util": "^1.11.1",
"clsx": "^2.1.1"
},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.1",
"@rc-component/father-plugin": "^2.2.0",
"@rc-component/np": "^1.0.3",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
Expand Down
34 changes: 19 additions & 15 deletions src/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import type { ArrowType, TriggerProps, TriggerRef } from '@rc-component/trigger';
import type {
ActionType,
AlignType,
ArrowType,
TriggerProps,
TriggerRef,
} from '@rc-component/trigger';
import Trigger from '@rc-component/trigger';
import type { ActionType, AlignType } from '@rc-component/trigger/lib/interface';
import useId from '@rc-component/util/lib/hooks/useId';
import { useId } from '@rc-component/util';
import { clsx } from 'clsx';
import * as React from 'react';
import { useImperativeHandle, useRef } from 'react';
Expand All @@ -10,18 +15,17 @@ import Popup from './Popup';

export type SemanticName = 'root' | 'arrow' | 'container' | 'uniqueContainer';

export interface TooltipProps
extends Pick<
TriggerProps,
| 'onPopupAlign'
| 'builtinPlacements'
| 'fresh'
| 'mouseLeaveDelay'
| 'mouseEnterDelay'
| 'prefixCls'
| 'forceRender'
| 'popupVisible'
> {
export interface TooltipProps extends Pick<
TriggerProps,
| 'onPopupAlign'
| 'builtinPlacements'
| 'fresh'
| 'mouseLeaveDelay'
| 'mouseEnterDelay'
| 'prefixCls'
| 'forceRender'
| 'popupVisible'
> {
children: React.ReactElement;
// Style
classNames?: Partial<Record<SemanticName, string>>;
Expand Down
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Popup from './Popup';
import Tooltip from './Tooltip';

export type { TooltipRef } from './Tooltip';
export type { TooltipProps, TooltipRef } from './Tooltip';
export { placements } from './placements';
export { Popup };

export default Tooltip;