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 @@ -53,7 +53,7 @@
"@rc-component/motion": "^1.1.3",
"@rc-component/portal": "^2.0.0",
"@rc-component/util": "^1.0.1",
"classnames": "^2.2.6"
"clsx": "^2.1.1"
},
"devDependencies": {
"@rc-component/drawer": "^1.0.0",
Expand Down
14 changes: 7 additions & 7 deletions src/Dialog/Content/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import classNames from 'classnames';
import { clsx } from 'clsx';
import { useComposeRef } from '@rc-component/util/lib/ref';
import React, { useMemo, useRef } from 'react';
import { RefContext } from '../../context';
Expand Down Expand Up @@ -90,7 +90,7 @@ const Panel = React.forwardRef<PanelRef, PanelProps>((props, ref) => {
// ================================ Render ================================
const footerNode = footer ? (
<div
className={classNames(`${prefixCls}-footer`, modalClassNames?.footer)}
className={clsx(`${prefixCls}-footer`, modalClassNames?.footer)}
style={{ ...modalStyles?.footer }}
>
{footer}
Expand All @@ -99,11 +99,11 @@ const Panel = React.forwardRef<PanelRef, PanelProps>((props, ref) => {

const headerNode = title ? (
<div
className={classNames(`${prefixCls}-header`, modalClassNames?.header)}
className={clsx(`${prefixCls}-header`, modalClassNames?.header)}
style={{ ...modalStyles?.header }}
>
<div
className={classNames(`${prefixCls}-title`, modalClassNames?.title)}
className={clsx(`${prefixCls}-title`, modalClassNames?.title)}
id={ariaId}
style={{ ...modalStyles?.title }}
>
Expand Down Expand Up @@ -140,13 +140,13 @@ const Panel = React.forwardRef<PanelRef, PanelProps>((props, ref) => {

const content = (
<div
className={classNames(`${prefixCls}-container`, modalClassNames?.container)}
className={clsx(`${prefixCls}-container`, modalClassNames?.container)}
style={modalStyles?.container}
>
{closerNode}
{headerNode}
<div
className={classNames(`${prefixCls}-body`, modalClassNames?.body)}
className={clsx(`${prefixCls}-body`, modalClassNames?.body)}
style={{ ...bodyStyle, ...modalStyles?.body }}
{...bodyProps}
>
Expand All @@ -164,7 +164,7 @@ const Panel = React.forwardRef<PanelRef, PanelProps>((props, ref) => {
aria-modal="true"
ref={mergedRef}
style={{ ...style, ...contentStyle }}
className={classNames(prefixCls, className)}
className={clsx(prefixCls, className)}
onMouseDown={onMouseDown}
onMouseUp={onMouseUp}
>
Expand Down
4 changes: 2 additions & 2 deletions src/Dialog/Content/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { useRef } from 'react';
import classNames from 'classnames';
import { clsx } from 'clsx';
import CSSMotion from '@rc-component/motion';
import { offset } from '../../util';
import type { PanelProps, PanelRef } from './Panel';
Expand Down Expand Up @@ -82,7 +82,7 @@ const Content = React.forwardRef<ContentRef, ContentProps>((props, ref) => {
prefixCls={prefixCls}
holderRef={motionRef}
style={{ ...motionStyle, ...style, ...contentStyle }}
className={classNames(className, motionClassName)}
className={clsx(className, motionClassName)}
/>
)}
</CSSMotion>
Expand Down
4 changes: 2 additions & 2 deletions src/Dialog/Mask.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import classNames from 'classnames';
import { clsx } from 'clsx';
import CSSMotion from '@rc-component/motion';

export type MaskProps = {
Expand All @@ -24,7 +24,7 @@ const Mask: React.FC<MaskProps> = (props) => {
<div
ref={ref}
style={{ ...motionStyle, ...style }}
className={classNames(`${prefixCls}-mask`, motionClassName, className)}
className={clsx(`${prefixCls}-mask`, motionClassName, className)}
{...maskProps}
/>
)}
Expand Down
6 changes: 3 additions & 3 deletions src/Dialog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import classNames from 'classnames';
import { clsx } from 'clsx';
import contains from '@rc-component/util/lib/Dom/contains';
import useId from '@rc-component/util/lib/hooks/useId';
import KeyCode from '@rc-component/util/lib/KeyCode';
Expand Down Expand Up @@ -187,7 +187,7 @@ const Dialog: React.FC<IDialogPropTypes> = (props) => {
// ========================= Render =========================
return (
<div
className={classNames(`${prefixCls}-root`, rootClassName)}
className={clsx(`${prefixCls}-root`, rootClassName)}
style={rootStyle}
{...pickAttrs(props, { data: true })}
>
Expand All @@ -202,7 +202,7 @@ const Dialog: React.FC<IDialogPropTypes> = (props) => {
<div
tabIndex={-1}
onKeyDown={onWrapperKeyDown}
className={classNames(`${prefixCls}-wrap`, wrapClassName, modalClassNames?.wrapper)}
className={clsx(`${prefixCls}-wrap`, wrapClassName, modalClassNames?.wrapper)}
ref={wrapperRef}
onClick={onWrapperClick}
style={mergedStyle}
Expand Down
Loading