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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
"dependencies": {
"@rc-component/motion": "^1.1.4",
"@rc-component/portal": "^2.1.3",
"@rc-component/util": "^1.9.0",
"@rc-component/util": "^1.11.1",
"clsx": "^2.1.1"
},
"devDependencies": {
"@ant-design/icons": "^5.3.0",
"@rc-component/father-plugin": "^2.0.2",
"@rc-component/father-plugin": "^2.2.0",
"@rc-component/np": "^1.0.0",
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^16.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { PortalProps } from '@rc-component/portal';
import Portal from '@rc-component/portal';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import { useLayoutEffect } from '@rc-component/util';
import * as React from 'react';
import { RefContext } from './context';
import type {
Expand Down
3 changes: 1 addition & 2 deletions src/DrawerPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { clsx } from 'clsx';
import * as React from 'react';
import { RefContext } from './context';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import { useComposeRef } from '@rc-component/util/lib/ref';
import { pickAttrs, useComposeRef } from '@rc-component/util';

export interface DrawerPanelRef {
focus: VoidFunction;
Expand Down
3 changes: 1 addition & 2 deletions src/DrawerPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { clsx } from 'clsx';
import type { CSSMotionProps } from '@rc-component/motion';
import CSSMotion from '@rc-component/motion';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import { pickAttrs, useEvent } from '@rc-component/util';
import * as React from 'react';
import type { DrawerContextProps } from './context';
import DrawerContext from './context';
Expand All @@ -13,7 +13,6 @@ import DrawerPanel from './DrawerPanel';
import useDrag from './hooks/useDrag';
import { parseWidthHeight } from './util';
import type { DrawerClassNames, DrawerStyles } from './inter';
import { useEvent } from '@rc-component/util';
import useFocusable from './hooks/useFocusable';

export type Placement = 'left' | 'right' | 'top' | 'bottom';
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useFocusable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { useLockFocus } from '@rc-component/util/lib/Dom/focus';
import { useLockFocus } from '@rc-component/util';

export default function useFocusable(
getContainer: () => HTMLElement,
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// export this package's api
import Drawer from './Drawer';
import type { DrawerProps, Placement } from './Drawer';
import type { DrawerPopupProps } from './DrawerPopup';

export type { DrawerProps, Placement };
export type { DrawerProps, DrawerPopupProps, Placement };

export default Drawer;
3 changes: 1 addition & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import warning from '@rc-component/util/lib/warning';
import canUseDom from '@rc-component/util/lib/Dom/canUseDom';
import { canUseDom, warning } from '@rc-component/util';
import type { DrawerProps } from './Drawer';

export function parseWidthHeight(value?: number | string) {
Expand Down
4 changes: 2 additions & 2 deletions tests/focus.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import ReactDOM from 'react-dom';
import Drawer from '../src';

// Mock useLockFocus to track calls
jest.mock('@rc-component/util/lib/Dom/focus', () => {
const actual = jest.requireActual('@rc-component/util/lib/Dom/focus');
jest.mock('@rc-component/util', () => {
const actual = jest.requireActual('@rc-component/util');

const useLockFocus = (visible: boolean, ...rest: any[]) => {
(globalThis as any).__useLockFocusVisible = visible;
Expand Down
2 changes: 1 addition & 1 deletion tests/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cleanup, fireEvent, render, act } from '@testing-library/react';
import { resetWarned } from '@rc-component/util/lib/warning';
import { resetWarned } from '@rc-component/util';
import React from 'react';
import type { DrawerProps } from '../src';
import Drawer from '../src';
Expand Down
15 changes: 0 additions & 15 deletions typings/custom.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
declare module '@rc-component/util/lib/KeyCode' {
const Ret: { ESC: any; TAB: any };
export default Ret;
}

declare module '@rc-component/util/lib/getScrollBarSize' {
const Ret: (b: boolean) => number;
export default Ret;
}

declare module '@rc-component/util/lib/*' {
const Ret: any;
export default Ret;
}

declare module 'raf';