Skip to content

Commit d26d860

Browse files
authored
Avoid rc package deep imports (#246)
* fix: avoid rc package deep imports * chore: merge trigger imports
1 parent 99ae51a commit d26d860

5 files changed

Lines changed: 14 additions & 15 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
},
4646
"dependencies": {
4747
"@rc-component/trigger": "^3.0.0",
48-
"@rc-component/util": "^1.2.1",
48+
"@rc-component/util": "^1.11.1",
4949
"clsx": "^2.1.1"
5050
},
5151
"devDependencies": {
52-
"@rc-component/father-plugin": "^2.0.2",
52+
"@rc-component/father-plugin": "^2.2.0",
5353
"@rc-component/menu": "^1.0.0",
5454
"@rc-component/np": "^1.0.3",
5555
"@rc-component/resize-observer": "^1.0.0",

src/Dropdown.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { TriggerProps, TriggerRef } from '@rc-component/trigger';
2-
import Trigger from '@rc-component/trigger';
3-
import type {
4-
ActionType,
5-
AlignType,
6-
AnimationType,
7-
BuildInPlacements,
8-
} from '@rc-component/trigger/lib/interface';
9-
import { composeRef, getNodeRef, supportRef } from '@rc-component/util/lib/ref';
1+
import Trigger, {
2+
type ActionType,
3+
type AlignType,
4+
type AnimationType,
5+
type BuildInPlacements,
6+
type TriggerProps,
7+
type TriggerRef,
8+
} from '@rc-component/trigger';
9+
import { composeRef, getNodeRef, supportRef } from '@rc-component/util';
1010
import { clsx } from 'clsx';
1111
import React from 'react';
1212
import useAccessibility from './hooks/useAccessibility';

src/Overlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { composeRef, getNodeRef, supportRef } from '@rc-component/util/lib/ref';
1+
import { composeRef, getNodeRef, supportRef } from '@rc-component/util';
22
import React, { forwardRef, useMemo } from 'react';
33
import type { DropdownProps } from './Dropdown';
44

src/hooks/useAccessibility.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import KeyCode from '@rc-component/util/lib/KeyCode';
2-
import raf from '@rc-component/util/lib/raf';
1+
import { KeyCode, raf } from '@rc-component/util';
32
import * as React from 'react';
43

54
const { ESC, TAB } = KeyCode;

tests/basic.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { MenuRef } from '@rc-component/menu';
33
import Menu, { Divider, Item as MenuItem } from '@rc-component/menu';
44
import { _rs } from '@rc-component/resize-observer';
5-
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
5+
import { spyElementPrototypes } from '@rc-component/util';
66
import { act, fireEvent } from '@testing-library/react';
77
import type { HTMLAttributes } from 'react';
88
import * as React from 'react';

0 commit comments

Comments
 (0)