chore: deprecate base/tooltip, base/modal, base/select and restrict imports via eslint

- Add @deprecated JSDoc to base/tooltip, base/modal, base/select
- Add no-restricted-imports patterns for all three in eslint overlay-migration rule
- Regenerate eslint-suppressions.json with bulk-suppressed violations
- Add --pass-on-unpruned-suppressions to lint-staged eslint command
This commit is contained in:
yyh 2026-03-03 15:16:19 +08:00
parent 933e173ac8
commit 174e95cb41
No known key found for this signature in database
7 changed files with 1185 additions and 10 deletions

View File

@ -1,3 +1,8 @@
/**
* @deprecated Use `@/app/components/base/ui/dialog` instead.
* This component will be removed after migration is complete.
* See: https://github.com/langgenius/dify/issues/32767
*/
import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react'
import { noop } from 'es-toolkit/function'
import { Fragment } from 'react'

View File

@ -1,3 +1,8 @@
/**
* @deprecated Use `@/app/components/base/ui/dialog` instead.
* This component will be removed after migration is complete.
* See: https://github.com/langgenius/dify/issues/32767
*/
import type { ButtonProps } from '@/app/components/base/button'
import { noop } from 'es-toolkit/function'
import { memo } from 'react'

View File

@ -1,4 +1,9 @@
'use client'
/**
* @deprecated Use `@/app/components/base/ui/select` instead.
* This component will be removed after migration is complete.
* See: https://github.com/langgenius/dify/issues/32767
*/
import type { FC } from 'react'
import { Combobox, ComboboxButton, ComboboxInput, ComboboxOption, ComboboxOptions, Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/react'
import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/20/solid'
@ -236,7 +241,7 @@ const SimpleSelect: FC<ISelectProps> = ({
}}
className={cn(`flex h-full w-full items-center rounded-lg border-0 bg-components-input-bg-normal pl-3 pr-10 focus-visible:bg-state-base-hover-alt focus-visible:outline-none group-hover/simple-select:bg-state-base-hover-alt sm:text-sm sm:leading-6 ${disabled ? 'cursor-not-allowed' : 'cursor-pointer'}`, className)}
>
<span className={cn('system-sm-regular block truncate text-left text-components-input-text-filled', !selectedItem?.name && 'text-components-input-text-placeholder')}>{selectedItem?.name ?? localPlaceholder}</span>
<span className={cn('block truncate text-left text-components-input-text-filled system-sm-regular', !selectedItem?.name && 'text-components-input-text-placeholder')}>{selectedItem?.name ?? localPlaceholder}</span>
<span className="absolute inset-y-0 right-0 flex items-center pr-2">
{isLoading
? <RiLoader4Line className="h-3.5 w-3.5 animate-spin text-text-secondary" />

View File

@ -1,4 +1,9 @@
'use client'
/**
* @deprecated Use `@/app/components/base/ui/tooltip` instead.
* This component will be removed after migration is complete.
* See: https://github.com/langgenius/dify/issues/32767
*/
import type { OffsetOptions, Placement } from '@floating-ui/react'
import type { FC } from 'react'
import { RiQuestionLine } from '@remixicon/react'
@ -130,7 +135,7 @@ const Tooltip: FC<TooltipProps> = ({
{!!popupContent && (
<div
className={cn(
!noDecoration && 'system-xs-regular relative max-w-[300px] break-words rounded-md bg-components-panel-bg px-3 py-2 text-left text-text-tertiary shadow-lg',
!noDecoration && 'relative max-w-[300px] break-words rounded-md bg-components-panel-bg px-3 py-2 text-left text-text-tertiary shadow-lg system-xs-regular',
popupClassName,
)}
onMouseEnter={() => {

File diff suppressed because it is too large Load Diff

View File

@ -168,6 +168,27 @@ export default antfu(
'**/portal-to-follow-elem/index',
],
message: 'Deprecated: use semantic overlay primitives from @/app/components/base/ui/ instead. See issue #32767.',
}, {
group: [
'**/base/tooltip',
'**/base/tooltip/index',
],
message: 'Deprecated: use @/app/components/base/ui/tooltip instead. See issue #32767.',
}, {
group: [
'**/base/modal',
'**/base/modal/index',
'**/base/modal/modal',
],
message: 'Deprecated: use @/app/components/base/ui/dialog instead. See issue #32767.',
}, {
group: [
'**/base/select',
'**/base/select/index',
'**/base/select/custom',
'**/base/select/pure',
],
message: 'Deprecated: use @/app/components/base/ui/select instead. See issue #32767.',
}],
}],
},

View File

@ -311,6 +311,6 @@
]
},
"lint-staged": {
"*": "eslint --fix"
"*": "eslint --fix --pass-on-unpruned-suppressions"
}
}