Skip to content

Commit 21300f2

Browse files
committed
Revert "refactor: replace antd Input with @cherrystudio/ui Input across components"
This reverts commit f7f689b.
1 parent 7fd7fc2 commit 21300f2

File tree

93 files changed

+118
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+118
-192
lines changed

eslint.config.mjs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,12 @@ export default defineConfig([
146146
'error',
147147
{
148148
paths: [
149-
{
150-
name: 'antd',
151-
importNames: ['Input'],
152-
message:
153-
'❌ Do not import this component from antd. Use our custom components instead: import { ... } from "@cherrystudio/ui"'
154-
},
155-
{
156-
name: '@heroui/react',
157-
importNames: ['Input'],
158-
message:
159-
'❌ Do not import components from heroui directly. Use our wrapped components instead: import { ... } from "@cherrystudio/ui"'
160-
}
149+
// {
150+
// name: 'antd',
151+
// importNames: ['Flex', 'Switch', 'message', 'Button', 'Tooltip'],
152+
// message:
153+
// '❌ Do not import this component from antd. Use our custom components instead: import { ... } from "@cherrystudio/ui"'
154+
// }
161155
]
162156
}
163157
]

packages/ui/src/components/composites/CollapsibleSearchBar/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// Original path: src/renderer/src/components/CollapsibleSearchBar.tsx
2+
import type { InputRef } from 'antd'
3+
import { Input } from 'antd'
24
import { Search } from 'lucide-react'
35
import { motion } from 'motion/react'
46
import React, { memo, useCallback, useEffect, useRef, useState } from 'react'
57

6-
import { Input } from '../../primitives/input'
78
import { Tooltip } from '../../primitives/tooltip'
89

910
interface CollapsibleSearchBarProps {
@@ -29,7 +30,7 @@ const CollapsibleSearchBar = ({
2930
}: CollapsibleSearchBarProps) => {
3031
const [searchVisible, setSearchVisible] = useState(false)
3132
const [searchText, setSearchText] = useState('')
32-
const inputRef = useRef<HTMLInputElement>(null)
33+
const inputRef = useRef<InputRef>(null)
3334

3435
const handleTextChange = useCallback(
3536
(text: string) => {

src/renderer/src/components/CollapsibleSearchBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Tooltip } from '@cherrystudio/ui'
2-
import { Input } from '@cherrystudio/ui'
32
import i18n from '@renderer/i18n'
43
import type { InputRef } from 'antd'
4+
import { Input } from 'antd'
55
import { Search } from 'lucide-react'
66
import { motion } from 'motion/react'
77
import React, { memo, useCallback, useEffect, useRef, useState } from 'react'

src/renderer/src/components/LocalBackupModals.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Button } from '@cherrystudio/ui'
2-
import { Input } from '@cherrystudio/ui'
32
import { loggerService } from '@logger'
43
import { backupToLocal } from '@renderer/services/BackupService'
5-
import { Modal } from 'antd'
4+
import { Input, Modal } from 'antd'
65
import dayjs from 'dayjs'
76
import { useCallback, useState } from 'react'
87
import { useTranslation } from 'react-i18next'

src/renderer/src/components/NutstorePathSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { RowFlex } from '@cherrystudio/ui'
22
import { Button } from '@cherrystudio/ui'
3-
import { Input } from '@cherrystudio/ui'
43
import { loggerService } from '@logger'
54
import { FolderIcon as NutstoreFolderIcon } from '@renderer/components/Icons/NutstoreIcons'
5+
import { Input } from 'antd'
66
import { useCallback, useEffect, useState } from 'react'
77
import { useTranslation } from 'react-i18next'
88
import styled from 'styled-components'

src/renderer/src/components/ObsidianExportDialog.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Switch } from '@cherrystudio/ui'
2-
import { Input } from '@cherrystudio/ui'
32
import { usePreference } from '@data/hooks/usePreference'
43
import { loggerService } from '@logger'
54
import i18n from '@renderer/i18n'
@@ -12,7 +11,7 @@ import {
1211
messageToMarkdownWithReasoning,
1312
topicToMarkdown
1413
} from '@renderer/utils/export'
15-
import { Alert, Empty, Form, Modal, Select, Spin, TreeSelect } from 'antd'
14+
import { Alert, Empty, Form, Input, Modal, Select, Spin, TreeSelect } from 'antd'
1615
import React, { useEffect, useState } from 'react'
1716
const logger = loggerService.withContext('ObsidianExportDialog')
1817

src/renderer/src/components/Popups/AddAssistantPopup.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { RowFlex } from '@cherrystudio/ui'
2-
import { Input } from '@cherrystudio/ui'
32
import { TopView } from '@renderer/components/TopView'
43
import { useAssistants, useDefaultAssistant } from '@renderer/hooks/useAssistant'
54
import { useAssistantPresets } from '@renderer/hooks/useAssistantPresets'
@@ -10,7 +9,7 @@ import { EVENT_NAMES, EventEmitter } from '@renderer/services/EventService'
109
import type { Assistant, AssistantPreset } from '@renderer/types'
1110
import { uuid } from '@renderer/utils'
1211
import type { InputRef } from 'antd'
13-
import { Divider, Modal, Tag } from 'antd'
12+
import { Divider, Input, Modal, Tag } from 'antd'
1413
import { take } from 'lodash'
1514
import { Search } from 'lucide-react'
1615
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'

src/renderer/src/components/Popups/ApiKeyListPopup/item.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { Button, Flex, Tooltip } from '@cherrystudio/ui'
2-
import { Input } from '@cherrystudio/ui'
32
import { type HealthResult, HealthStatusIndicator } from '@renderer/components/HealthStatusIndicator'
43
import { EditIcon } from '@renderer/components/Icons'
54
import { StreamlineGoodHealthAndWellBeing } from '@renderer/components/Icons/SVGIcon'
65
import type { ApiKeyWithStatus } from '@renderer/types/healthCheck'
76
import { maskApiKey } from '@renderer/utils/api'
87
import type { InputRef } from 'antd'
9-
import { List, Popconfirm, Typography } from 'antd'
8+
import { Input, List, Popconfirm, Typography } from 'antd'
109
import { Check, Minus, X } from 'lucide-react'
1110
import type { FC } from 'react'
1211
import { memo, useEffect, useRef, useState } from 'react'

src/renderer/src/components/Popups/PromptPopup.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Box } from '@cherrystudio/ui'
2-
import { Input } from '@cherrystudio/ui'
3-
import { Modal } from 'antd'
2+
import { Input, Modal } from 'antd'
43
import type { TextAreaProps } from 'antd/es/input'
54
import type { ReactNode } from 'react'
65
import { useRef, useState } from 'react'

src/renderer/src/components/Popups/SelectModelPopup/searchbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { RowFlex } from '@cherrystudio/ui'
2-
import { Input } from '@cherrystudio/ui'
32
import type { InputRef } from 'antd'
3+
import { Input } from 'antd'
44
import { Search } from 'lucide-react'
55
import React, { memo, useCallback, useEffect, useRef, useState } from 'react'
66
import { useTranslation } from 'react-i18next'

0 commit comments

Comments
 (0)