Skip to content
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
]
},
"dependencies": {
"@rc-component/motion": "^1.1.3",
"@rc-component/motion": "^1.3.3",
"@rc-component/portal": "^2.1.0",
"@rc-component/util": "^1.9.0",
"clsx": "^2.1.1"
Expand Down
4 changes: 1 addition & 3 deletions src/Dialog/Content/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { clsx } from 'clsx';
import { useComposeRef } from '@rc-component/util/lib/ref';
import { useLockFocus } from '@rc-component/util/lib/Dom/focus';
import { useComposeRef, useLockFocus, pickAttrs } from '@rc-component/util';
import React, { useMemo, useRef } from 'react';
import { RefContext } from '../../context';
import type { IDialogPropTypes } from '../../IDialogPropTypes';
import MemoChildren from './MemoChildren';
import pickAttrs from '@rc-component/util/lib/pickAttrs';

export interface PanelProps extends Omit<IDialogPropTypes, 'getOpenCount'> {
prefixCls: string;
Expand Down
2 changes: 1 addition & 1 deletion src/Dialog/Content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import * as React from 'react';
import { useRef } from 'react';
import { clsx } from 'clsx';
import CSSMotion from '@rc-component/motion';
import type { CSSMotionRef } from '@rc-component/motion';
import { offset } from '../../util';
import type { PanelProps, PanelRef } from './Panel';
import Panel from './Panel';
import type { CSSMotionRef } from '@rc-component/motion/es/CSSMotion';

export type CSSMotionStateRef = Pick<CSSMotionRef, 'inMotion' | 'enableMotion'>;

Expand Down
5 changes: 1 addition & 4 deletions src/Dialog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { clsx } from 'clsx';
import contains from '@rc-component/util/lib/Dom/contains';
import useId from '@rc-component/util/lib/hooks/useId';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import { contains, useId, pickAttrs, warning } from '@rc-component/util';
import * as React from 'react';
import { useEffect, useRef } from 'react';
import type { IDialogPropTypes } from '../IDialogPropTypes';
import { getMotionName } from '../util';
import Content, { type ContentRef } from './Content';
import Mask from './Mask';
import { warning } from '@rc-component/util/lib/warning';

const Dialog: React.FC<IDialogPropTypes> = (props) => {
const {
Expand Down
2 changes: 1 addition & 1 deletion src/IDialogPropTypes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { GetContainer } from '@rc-component/util/lib/PortalWrapper';
import type { GetContainer } from '@rc-component/util';
import type { CSSProperties, ReactNode, SyntheticEvent } from 'react';

export type SemanticName = 'header' | 'body' | 'footer' | 'container' | 'title' | 'wrapper' | 'mask' | 'close';
Expand Down
6 changes: 3 additions & 3 deletions tests/focus.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import ReactDOM from 'react-dom';
import { act, render } from '@testing-library/react';
import Dialog from '../src';

// Mock: import { useLockFocus } from '@rc-component/util/lib/Dom/focus';
jest.mock('@rc-component/util/lib/Dom/focus', () => {
const actual = jest.requireActual('@rc-component/util/lib/Dom/focus');
// Mock: import { useLockFocus } from '@rc-component/util';
jest.mock('@rc-component/util', () => {
const actual = jest.requireActual('@rc-component/util');

const useLockFocus = (visible: boolean, ...rest: any[]) => {
globalThis.__useLockFocusVisible = visible;
Expand Down
Loading