@@ -208,7 +208,7 @@ export const Placements: Story = {
}
const ControlledDemo = () => {
- const [open, setOpen] = useState(false)
+ const [open, setOpen] = React.useState(false)
return (
diff --git a/packages/dify-ui/src/popover/index.tsx b/packages/dify-ui/src/popover/index.tsx
index aad0bde3d4..a231c3fded 100644
--- a/packages/dify-ui/src/popover/index.tsx
+++ b/packages/dify-ui/src/popover/index.tsx
@@ -1,6 +1,6 @@
'use client'
-import type { ReactNode } from 'react'
+import type * as React from 'react'
import type { Placement } from '../placement'
import { Popover as BasePopover } from '@base-ui/react/popover'
import { cn } from '../cn'
@@ -16,7 +16,7 @@ export const PopoverDescription = BasePopover.Description
export const createPopoverHandle = BasePopover.createHandle
type PopoverContentProps = {
- children: ReactNode
+ children: React.ReactNode
placement?: Placement
sideOffset?: number
alignOffset?: number
diff --git a/packages/dify-ui/src/preview-card/__tests__/index.spec.tsx b/packages/dify-ui/src/preview-card/__tests__/index.spec.tsx
index 5d1e325051..b3515365fd 100644
--- a/packages/dify-ui/src/preview-card/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/preview-card/__tests__/index.spec.tsx
@@ -1,3 +1,4 @@
+import type * as React from 'react'
import { render } from 'vitest-browser-react'
import {
PreviewCard,
@@ -5,7 +6,7 @@ import {
PreviewCardTrigger,
} from '..'
-const renderWithSafeViewport = (ui: import('react').ReactNode) => render(
+const renderWithSafeViewport = (ui: React.ReactNode) => render(
{ui}
,
diff --git a/packages/dify-ui/src/preview-card/index.stories.tsx b/packages/dify-ui/src/preview-card/index.stories.tsx
index 540ac08c1a..c375db3e64 100644
--- a/packages/dify-ui/src/preview-card/index.stories.tsx
+++ b/packages/dify-ui/src/preview-card/index.stories.tsx
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
import type { Placement } from '.'
-import { useState } from 'react'
+import * as React from 'react'
import {
createPreviewCardHandle,
PreviewCard,
@@ -144,7 +144,7 @@ const PLACEMENTS: Placement[] = [
]
const PlacementsDemo = () => {
- const [placement, setPlacement] = useState
('bottom')
+ const [placement, setPlacement] = React.useState('bottom')
return (
diff --git a/packages/dify-ui/src/preview-card/index.tsx b/packages/dify-ui/src/preview-card/index.tsx
index f4448e477a..a3e8b75100 100644
--- a/packages/dify-ui/src/preview-card/index.tsx
+++ b/packages/dify-ui/src/preview-card/index.tsx
@@ -1,6 +1,6 @@
'use client'
-import type { ReactNode } from 'react'
+import type * as React from 'react'
import type { Placement } from '../placement'
import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card'
import { cn } from '../cn'
@@ -27,7 +27,7 @@ export const PreviewCardTrigger = BasePreviewCard.Trigger
export const createPreviewCardHandle = BasePreviewCard.createHandle
type PreviewCardContentProps = {
- children: ReactNode
+ children: React.ReactNode
placement?: Placement
sideOffset?: number
alignOffset?: number
diff --git a/packages/dify-ui/src/progress/index.stories.tsx b/packages/dify-ui/src/progress/index.stories.tsx
index eb9a3326ba..2ee8253ab8 100644
--- a/packages/dify-ui/src/progress/index.stories.tsx
+++ b/packages/dify-ui/src/progress/index.stories.tsx
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
import type { ProgressCircleColor, ProgressCircleSize } from '.'
-import { Fragment } from 'react'
+import * as React from 'react'
import { ProgressCircle } from '.'
const colors: ProgressCircleColor[] = ['gray', 'white', 'blue', 'warning', 'error']
@@ -48,7 +48,7 @@ export const CircleMatrix: Story = {
))}
{colors.map(color => (
-
+
{color}
@@ -61,7 +61,7 @@ export const CircleMatrix: Story = {
aria-label={`${color} ${size} progress`}
/>
))}
-
+
))}
),
diff --git a/packages/dify-ui/src/radio-group/__tests__/index.spec.tsx b/packages/dify-ui/src/radio-group/__tests__/index.spec.tsx
index 423ce95749..dba0c1ae5e 100644
--- a/packages/dify-ui/src/radio-group/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/radio-group/__tests__/index.spec.tsx
@@ -1,4 +1,4 @@
-import { useState } from 'react'
+import * as React from 'react'
import { render } from 'vitest-browser-react'
import { FieldItem, FieldLabel, FieldRoot } from '../../field'
import { FieldsetLegend, FieldsetRoot } from '../../fieldset'
@@ -12,7 +12,7 @@ const clickElement = (element: HTMLElement | SVGElement) => {
describe('RadioGroup', () => {
it('should manage a controlled single selection', async () => {
function StorageDemo() {
- const [value, setValue] = useState('ssd')
+ const [value, setValue] = React.useState('ssd')
return (
diff --git a/packages/dify-ui/src/radio-group/index.stories.tsx b/packages/dify-ui/src/radio-group/index.stories.tsx
index d28d9b06b0..906182918b 100644
--- a/packages/dify-ui/src/radio-group/index.stories.tsx
+++ b/packages/dify-ui/src/radio-group/index.stories.tsx
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
-import { useState } from 'react'
+import * as React from 'react'
import { RadioGroup } from '.'
import {
FieldDescription,
@@ -28,7 +28,7 @@ export default meta
type Story = StoryObj
function StandardFormRowsDemo() {
- const [value, setValue] = useState('vector')
+ const [value, setValue] = React.useState('vector')
return (
@@ -67,7 +67,7 @@ export const StandardFormRows: Story = {
}
function BooleanInlineDemo() {
- const [value, setValue] = useState(true)
+ const [value, setValue] = React.useState(true)
return (
@@ -108,7 +108,7 @@ export const BooleanInline: Story = {
}
function OptionCardsDemo() {
- const [value, setValue] = useState('default')
+ const [value, setValue] = React.useState('default')
return (
@@ -174,7 +174,7 @@ function DynamicFormFieldDemo() {
{ value: 'high_quality', label: 'High quality' },
{ value: 'economy', label: 'Economy' },
]
- const [selected, setSelected] = useState('automatic')
+ const [selected, setSelected] = React.useState('automatic')
return (
diff --git a/packages/dify-ui/src/radio/__tests__/index.spec.tsx b/packages/dify-ui/src/radio/__tests__/index.spec.tsx
index ba02f8a0c4..fc539d6348 100644
--- a/packages/dify-ui/src/radio/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/radio/__tests__/index.spec.tsx
@@ -1,4 +1,4 @@
-import type { ComponentProps, ReactNode } from 'react'
+import type * as React from 'react'
import { render } from 'vitest-browser-react'
import { FieldItem, FieldLabel, FieldRoot } from '../../field'
import { FieldsetLegend, FieldsetRoot } from '../../fieldset'
@@ -15,8 +15,8 @@ const clickElement = (element: HTMLElement | SVGElement) => {
element.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }))
}
-type TestRadioGroupProps = ComponentProps & {
- children: ReactNode
+type TestRadioGroupProps = React.ComponentProps & {
+ children: React.ReactNode
label: string
name?: string
}
@@ -37,8 +37,8 @@ function TestRadioGroup({
)
}
-type TestRadioOptionProps = ComponentProps & {
- children: ReactNode
+type TestRadioOptionProps = React.ComponentProps & {
+ children: React.ReactNode
}
function TestRadioOption({
diff --git a/packages/dify-ui/src/radio/index.stories.tsx b/packages/dify-ui/src/radio/index.stories.tsx
index 58af1bbbc1..ebe27efdbe 100644
--- a/packages/dify-ui/src/radio/index.stories.tsx
+++ b/packages/dify-ui/src/radio/index.stories.tsx
@@ -1,6 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
-import type { ComponentProps } from 'react'
-import { useState } from 'react'
+import * as React from 'react'
import {
Radio,
RadioSkeleton,
@@ -36,8 +35,8 @@ const meta = {
export default meta
type Story = StoryObj
-function RadioDemo(args: Partial>) {
- const [value, setValue] = useState('ssd')
+function RadioDemo(args: Partial>) {
+ const [value, setValue] = React.useState('ssd')
return (
diff --git a/packages/dify-ui/src/radio/index.tsx b/packages/dify-ui/src/radio/index.tsx
index bbe8066c22..84944942de 100644
--- a/packages/dify-ui/src/radio/index.tsx
+++ b/packages/dify-ui/src/radio/index.tsx
@@ -1,7 +1,7 @@
'use client'
import type { Radio as BaseRadioNS } from '@base-ui/react/radio'
-import type { HTMLAttributes } from 'react'
+import type * as React from 'react'
import { Radio as BaseRadio } from '@base-ui/react/radio'
import { cn } from '../cn'
@@ -87,7 +87,7 @@ export function Radio({
}
export type RadioSkeletonProps
- = Omit, 'className'>
+ = Omit, 'className'>
& {
className?: string
}
diff --git a/packages/dify-ui/src/scroll-area/__tests__/index.spec.tsx b/packages/dify-ui/src/scroll-area/__tests__/index.spec.tsx
index ee0f391138..73f2f90719 100644
--- a/packages/dify-ui/src/scroll-area/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/scroll-area/__tests__/index.spec.tsx
@@ -1,3 +1,4 @@
+import * as React from 'react'
import { render } from 'vitest-browser-react'
import {
ScrollArea,
@@ -84,7 +85,7 @@ describe('scroll-area wrapper', () => {
it('should render the convenience wrapper and apply slot props', async () => {
const screen = await render(
- <>
+
Installed apps
{
>
Scrollable content
- >,
+ ,
)
const viewport = screen.getByRole('region', { name: 'Installed apps' })
diff --git a/packages/dify-ui/src/scroll-area/index.stories.tsx b/packages/dify-ui/src/scroll-area/index.stories.tsx
index 28c00bea2a..27f427eb69 100644
--- a/packages/dify-ui/src/scroll-area/index.stories.tsx
+++ b/packages/dify-ui/src/scroll-area/index.stories.tsx
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
-import * as React from 'react'
+import type * as React from 'react'
import {
ScrollAreaContent,
ScrollAreaCorner,
diff --git a/packages/dify-ui/src/scroll-area/index.tsx b/packages/dify-ui/src/scroll-area/index.tsx
index 4e9f9ff01b..1adea78ee3 100644
--- a/packages/dify-ui/src/scroll-area/index.tsx
+++ b/packages/dify-ui/src/scroll-area/index.tsx
@@ -1,6 +1,6 @@
'use client'
-import type { ReactNode } from 'react'
+import type * as React from 'react'
import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area'
import { cn } from '../cn'
@@ -16,7 +16,7 @@ type ScrollAreaSlotClassNames = {
}
type ScrollAreaProps = Omit & {
- children: ReactNode
+ children: React.ReactNode
orientation?: 'vertical' | 'horizontal'
slotClassNames?: ScrollAreaSlotClassNames
label?: string
diff --git a/packages/dify-ui/src/segmented-control/index.stories.tsx b/packages/dify-ui/src/segmented-control/index.stories.tsx
index f03dacc2b9..f2b6f9cc1f 100644
--- a/packages/dify-ui/src/segmented-control/index.stories.tsx
+++ b/packages/dify-ui/src/segmented-control/index.stories.tsx
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
-import type { ReactNode } from 'react'
+import * as React from 'react'
import {
SegmentedControl,
SegmentedControlDivider,
@@ -35,10 +35,10 @@ const Icon = () => (
)
const Item = () => (
- <>
+
Item
- >
+
)
function SegmentedControlExample({
@@ -93,7 +93,7 @@ function SpecPanel({
children,
}: {
className?: string
- children: ReactNode
+ children: React.ReactNode
}) {
return (
diff --git a/packages/dify-ui/src/segmented-control/index.tsx b/packages/dify-ui/src/segmented-control/index.tsx
index ad7fc01e80..ceb3454cc6 100644
--- a/packages/dify-ui/src/segmented-control/index.tsx
+++ b/packages/dify-ui/src/segmented-control/index.tsx
@@ -2,7 +2,7 @@
import type { Toggle as BaseToggleNS } from '@base-ui/react/toggle'
import type { ToggleGroup as BaseToggleGroupNS } from '@base-ui/react/toggle-group'
-import type { HTMLAttributes } from 'react'
+import type * as React from 'react'
import { Toggle as BaseToggle } from '@base-ui/react/toggle'
import { ToggleGroup as BaseToggleGroup } from '@base-ui/react/toggle-group'
import { cn } from '../cn'
@@ -39,7 +39,7 @@ export function SegmentedControlItem
({
)
}
-export type SegmentedControlDividerProps = Omit, 'className'> & {
+export type SegmentedControlDividerProps = Omit, 'className'> & {
className?: string
}
diff --git a/packages/dify-ui/src/select/__tests__/index.spec.tsx b/packages/dify-ui/src/select/__tests__/index.spec.tsx
index d1a89243b6..cdfeffe61b 100644
--- a/packages/dify-ui/src/select/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/select/__tests__/index.spec.tsx
@@ -1,3 +1,4 @@
+import type * as React from 'react'
import { render } from 'vitest-browser-react'
import {
Select,
@@ -13,7 +14,7 @@ import {
} from '../index'
const asHTMLElement = (element: HTMLElement | SVGElement) => element as HTMLElement
-const renderWithSafeViewport = (ui: import('react').ReactNode) => render(
+const renderWithSafeViewport = (ui: React.ReactNode) => render(
{ui}
,
diff --git a/packages/dify-ui/src/select/index.stories.tsx b/packages/dify-ui/src/select/index.stories.tsx
index 62abb0048d..64cd2b8649 100644
--- a/packages/dify-ui/src/select/index.stories.tsx
+++ b/packages/dify-ui/src/select/index.stories.tsx
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
-import { useState } from 'react'
+import * as React from 'react'
import {
Select,
SelectContent,
@@ -263,7 +263,7 @@ export const ReadOnly: Story = {
}
const ControlledDemo = () => {
- const [value, setValue] = useState('balanced')
+ const [value, setValue] = React.useState('balanced')
return (
diff --git a/packages/dify-ui/src/select/index.tsx b/packages/dify-ui/src/select/index.tsx
index ddfd7cf758..046afccf3b 100644
--- a/packages/dify-ui/src/select/index.tsx
+++ b/packages/dify-ui/src/select/index.tsx
@@ -1,7 +1,7 @@
'use client'
import type { VariantProps } from 'class-variance-authority'
-import type { ReactNode } from 'react'
+import type * as React from 'react'
import type { Placement } from '../placement'
import { Select as BaseSelect } from '@base-ui/react/select'
import { cva } from 'class-variance-authority'
@@ -107,7 +107,7 @@ export function SelectSeparator({
}
type SelectContentProps = {
- children: ReactNode
+ children: React.ReactNode
placement?: Placement
sideOffset?: number
alignOffset?: number
diff --git a/packages/dify-ui/src/slider/index.stories.tsx b/packages/dify-ui/src/slider/index.stories.tsx
index 11b22f0de3..8f9c8d7cc9 100644
--- a/packages/dify-ui/src/slider/index.stories.tsx
+++ b/packages/dify-ui/src/slider/index.stories.tsx
@@ -1,6 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
-import type * as React from 'react'
-import { useState } from 'react'
+import * as React from 'react'
import {
Slider,
SliderControl,
@@ -51,7 +50,7 @@ function SliderDemo({
defaultValue: _defaultValue,
...args
}: React.ComponentProps
) {
- const [value, setValue] = useState(initialValue)
+ const [value, setValue] = React.useState(initialValue)
return (
diff --git a/packages/dify-ui/src/status-dot/index.stories.tsx b/packages/dify-ui/src/status-dot/index.stories.tsx
index b44deb9682..c6b6d56e27 100644
--- a/packages/dify-ui/src/status-dot/index.stories.tsx
+++ b/packages/dify-ui/src/status-dot/index.stories.tsx
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
import type { StatusDotSize, StatusDotStatus } from '.'
-import { Fragment } from 'react'
+import * as React from 'react'
import { StatusDot, StatusDotSkeleton } from '.'
const statuses: StatusDotStatus[] = ['success', 'warning', 'error', 'normal', 'disabled']
@@ -39,14 +39,14 @@ export const Matrix: Story = {
Small
Medium
{statuses.map(status => (
-
+
{status}
{sizes.map(size => (
))}
-
+
))}
),
diff --git a/packages/dify-ui/src/status-dot/index.tsx b/packages/dify-ui/src/status-dot/index.tsx
index 087f3da4ba..e2ce1917e6 100644
--- a/packages/dify-ui/src/status-dot/index.tsx
+++ b/packages/dify-ui/src/status-dot/index.tsx
@@ -1,7 +1,7 @@
'use client'
import type { VariantProps } from 'class-variance-authority'
-import type { ComponentProps } from 'react'
+import type * as React from 'react'
import { cva } from 'class-variance-authority'
import { cn } from '../cn'
@@ -49,14 +49,14 @@ export type StatusDotStatus = NonNullable
export type StatusDotSize = NonNullable
export type StatusDotProps
- = Omit, 'children'>
+ = Omit, 'children'>
& {
status?: StatusDotStatus
size?: StatusDotSize
}
export type StatusDotSkeletonProps
- = Omit, 'children'>
+ = Omit, 'children'>
& {
size?: StatusDotSize
}
diff --git a/packages/dify-ui/src/switch/index.stories.tsx b/packages/dify-ui/src/switch/index.stories.tsx
index 2156000bbc..a7537b50b8 100644
--- a/packages/dify-ui/src/switch/index.stories.tsx
+++ b/packages/dify-ui/src/switch/index.stories.tsx
@@ -1,6 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
-import type { ComponentProps } from 'react'
-import { useState, useTransition } from 'react'
+import * as React from 'react'
import { Switch, SwitchSkeleton } from '.'
import {
FieldDescription,
@@ -47,12 +46,12 @@ const meta = {
export default meta
type Story = StoryObj
-type SwitchDemoProps = Partial, 'checked' | 'defaultChecked' | 'onCheckedChange'>> & {
+type SwitchDemoProps = Partial, 'checked' | 'defaultChecked' | 'onCheckedChange'>> & {
checked?: boolean
}
const SwitchDemo = (args: SwitchDemoProps) => {
- const [enabled, setEnabled] = useState(args.checked ?? false)
+ const [enabled, setEnabled] = React.useState(args.checked ?? false)
return (
@@ -167,7 +166,7 @@ export const AllStates: Story = {
}
const SizeComparisonDemo = () => {
- const [states, setStates] = useState({
+ const [states, setStates] = React.useState({
xs: false,
sm: false,
md: true,
@@ -209,7 +208,7 @@ export const SizeComparison: Story = {
}
const LoadingDemo = () => {
- const [loading, setLoading] = useState(true)
+ const [loading, setLoading] = React.useState(true)
return (
@@ -275,7 +274,7 @@ export const Loading: Story = {
const wait = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
function useMockAutoRetrySettingQuery() {
- const [enabled, setEnabled] = useState(false)
+ const [enabled, setEnabled] = React.useState(false)
return {
data: {
@@ -290,8 +289,8 @@ function useMockUpdateAutoRetrySettingMutation({
}: {
onSuccess: (enabled: boolean) => void
}) {
- const [requestCount, setRequestCount] = useState(0)
- const [isPending, startTransition] = useTransition()
+ const [requestCount, setRequestCount] = React.useState(0)
+ const [isPending, startTransition] = React.useTransition()
const mutate = (nextValue: boolean) => {
if (isPending)
diff --git a/packages/dify-ui/src/switch/index.tsx b/packages/dify-ui/src/switch/index.tsx
index 201417a698..d35809ecad 100644
--- a/packages/dify-ui/src/switch/index.tsx
+++ b/packages/dify-ui/src/switch/index.tsx
@@ -2,7 +2,7 @@
import type { Switch as BaseSwitchNS } from '@base-ui/react/switch'
import type { VariantProps } from 'class-variance-authority'
-import type { HTMLAttributes } from 'react'
+import type * as React from 'react'
import { Switch as BaseSwitch } from '@base-ui/react/switch'
import { cva } from 'class-variance-authority'
import { cn } from '../cn'
@@ -134,7 +134,7 @@ const switchSkeletonVariants = cva(
)
export type SwitchSkeletonProps
- = HTMLAttributes
+ = React.ComponentProps<'div'>
& VariantProps
export function SwitchSkeleton({
diff --git a/packages/dify-ui/src/textarea/__tests__/index.spec.tsx b/packages/dify-ui/src/textarea/__tests__/index.spec.tsx
index f8a540a540..ad7ef848aa 100644
--- a/packages/dify-ui/src/textarea/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/textarea/__tests__/index.spec.tsx
@@ -1,4 +1,4 @@
-import type { FocusEvent } from 'react'
+import type * as React from 'react'
import { render } from 'vitest-browser-react'
import {
FieldDescription,
@@ -131,7 +131,7 @@ describe('Textarea', () => {
it('should route field props through Base UI Field.Control and textarea-only props to textarea', async () => {
const onFormSubmit = vi.fn()
- const onBlur = vi.fn((event: FocusEvent) => {
+ const onBlur = vi.fn((event: React.FocusEvent) => {
expect(event.currentTarget.tagName).toBe('TEXTAREA')
})
const screen = await render(
diff --git a/packages/dify-ui/src/textarea/index.stories.tsx b/packages/dify-ui/src/textarea/index.stories.tsx
index 28ddde3c44..b7875c1ea9 100644
--- a/packages/dify-ui/src/textarea/index.stories.tsx
+++ b/packages/dify-ui/src/textarea/index.stories.tsx
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
-import { useState } from 'react'
+import * as React from 'react'
import { Button } from '../button'
import {
FieldDescription,
@@ -91,7 +91,7 @@ export const States: Story = {
}
const FormDemo = () => {
- const [savedDescription, setSavedDescription] = useState(null)
+ const [savedDescription, setSavedDescription] = React.useState(null)
return (
- >
+
)
}
diff --git a/packages/dify-ui/src/toast/index.tsx b/packages/dify-ui/src/toast/index.tsx
index cab9841a32..c97ac3a055 100644
--- a/packages/dify-ui/src/toast/index.tsx
+++ b/packages/dify-ui/src/toast/index.tsx
@@ -5,7 +5,7 @@ import type {
ToastManagerUpdateOptions,
ToastObject,
} from '@base-ui/react/toast'
-import type { ReactNode } from 'react'
+import type * as React from 'react'
import { Toast as BaseToast } from '@base-ui/react/toast'
import { cn } from '../cn'
@@ -64,11 +64,11 @@ type ToastHostProps = {
}
type ToastDismiss = (toastId?: string) => void
-type ToastCall = (title: ReactNode, options?: ToastOptions) => string
-type TypedToastCall = (title: ReactNode, options?: TypedToastOptions) => string
+type ToastCall = (title: React.ReactNode, options?: ToastOptions) => string
+type TypedToastCall = (title: React.ReactNode, options?: TypedToastOptions) => string
type ToastApi = {
- (title: ReactNode, options?: ToastOptions): string
+ (title: React.ReactNode, options?: ToastOptions): string
success: TypedToastCall
error: TypedToastCall
warning: TypedToastCall
diff --git a/packages/dify-ui/src/tooltip/__tests__/index.spec.tsx b/packages/dify-ui/src/tooltip/__tests__/index.spec.tsx
index 043835f697..441da70c92 100644
--- a/packages/dify-ui/src/tooltip/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/tooltip/__tests__/index.spec.tsx
@@ -1,7 +1,8 @@
+import type * as React from 'react'
import { render } from 'vitest-browser-react'
import { Tooltip, TooltipContent, TooltipTrigger } from '../index'
-const renderWithSafeViewport = (ui: import('react').ReactNode) => render(
+const renderWithSafeViewport = (ui: React.ReactNode) => render(
{ui}
,
diff --git a/packages/dify-ui/src/tooltip/index.stories.tsx b/packages/dify-ui/src/tooltip/index.stories.tsx
index 902449d4a4..6b9a2e4c3d 100644
--- a/packages/dify-ui/src/tooltip/index.stories.tsx
+++ b/packages/dify-ui/src/tooltip/index.stories.tsx
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
import type { Placement } from '.'
-import { useState } from 'react'
+import * as React from 'react'
import {
Tooltip,
TooltipContent,
@@ -107,7 +107,7 @@ const PLACEMENTS: Placement[] = [
]
const PlacementsDemo = () => {
- const [placement, setPlacement] = useState('top')
+ const [placement, setPlacement] = React.useState('top')
return (
diff --git a/packages/dify-ui/src/tooltip/index.tsx b/packages/dify-ui/src/tooltip/index.tsx
index 88bd6459f7..36f9fd0f51 100644
--- a/packages/dify-ui/src/tooltip/index.tsx
+++ b/packages/dify-ui/src/tooltip/index.tsx
@@ -1,6 +1,6 @@
'use client'
-import type { ReactNode } from 'react'
+import type * as React from 'react'
import type { Placement } from '../placement'
import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip'
import { cn } from '../cn'
@@ -32,7 +32,7 @@ export const Tooltip = BaseTooltip.Root
export const TooltipTrigger = BaseTooltip.Trigger
type TooltipContentProps = {
- children: ReactNode
+ children: React.ReactNode
placement?: Placement
sideOffset?: number
alignOffset?: number