From 38474628fd7f97770f87d577443fc5fb5a411f5c Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Sat, 15 Jul 2023 12:57:03 +0800 Subject: [PATCH] feat: prepend use-client directive for with Next.js App Router (#43573) * fix: prepend use-client directive for with Next.js App Router * Update components/affix/index.tsx Co-authored-by: MadCcc <1075746765@qq.com> Signed-off-by: lijianan <574980606@qq.com> * Update components/badge/index.tsx Co-authored-by: MadCcc <1075746765@qq.com> Signed-off-by: lijianan <574980606@qq.com> * Update components/divider/index.tsx Co-authored-by: MadCcc <1075746765@qq.com> Signed-off-by: lijianan <574980606@qq.com> * Update components/cascader/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/list/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/mentions/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/mentions/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/mentions/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/mentions/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/qrcode/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/spin/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/select/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/spin/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/spin/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/steps/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/time-picker/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/transfer/index.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/tree-select/index.tsx Signed-off-by: lijianan <574980606@qq.com> --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: MadCcc <1075746765@qq.com> --- components/affix/index.tsx | 2 ++ components/alert/index.ts | 2 ++ components/anchor/index.ts | 2 ++ components/app/index.tsx | 2 ++ components/auto-complete/index.tsx | 8 +------- components/avatar/index.ts | 2 ++ components/back-top/index.tsx | 6 ++++-- components/badge/index.tsx | 2 ++ components/breadcrumb/index.ts | 2 ++ components/button/index.ts | 2 ++ components/calendar/index.ts | 2 ++ components/card/index.ts | 2 ++ components/carousel/index.tsx | 2 ++ components/cascader/index.tsx | 2 ++ components/checkbox/index.ts | 4 +++- components/col/index.ts | 2 ++ components/collapse/index.ts | 2 ++ components/color-picker/index.ts | 4 +++- components/config-provider/index.tsx | 2 ++ components/date-picker/index.ts | 2 ++ components/descriptions/index.tsx | 2 ++ components/divider/index.tsx | 2 ++ components/drawer/index.tsx | 4 +++- components/dropdown/index.ts | 2 ++ components/empty/index.tsx | 2 ++ components/float-button/index.ts | 4 +++- components/form/index.ts | 16 +++++++++------- components/grid/index.ts | 4 +++- components/image/index.tsx | 2 ++ components/index.ts | 2 ++ components/input-number/index.tsx | 2 ++ components/input/index.ts | 2 ++ components/layout/index.ts | 2 ++ components/list/index.tsx | 2 ++ components/locale/index.tsx | 2 ++ components/mentions/index.tsx | 2 ++ components/menu/index.tsx | 8 +++++--- components/message/index.tsx | 2 ++ components/modal/index.tsx | 2 ++ components/notification/index.tsx | 2 ++ components/pagination/index.ts | 2 ++ components/popconfirm/index.tsx | 2 ++ components/popover/index.tsx | 2 ++ components/progress/index.tsx | 2 ++ components/qrcode/index.tsx | 2 ++ components/radio/index.tsx | 2 ++ components/rate/index.tsx | 2 ++ components/result/index.tsx | 2 ++ components/row/index.tsx | 2 ++ components/segmented/index.tsx | 2 ++ components/select/index.tsx | 2 ++ components/skeleton/index.tsx | 2 ++ components/slider/index.tsx | 2 ++ components/space/index.tsx | 2 ++ components/spin/index.tsx | 4 +++- components/statistic/index.tsx | 4 +++- components/steps/index.tsx | 2 ++ components/style/index.ts | 2 ++ components/switch/index.tsx | 2 ++ components/table/index.ts | 6 ++++-- components/tabs/index.tsx | 2 ++ components/tag/index.tsx | 2 ++ components/theme/index.ts | 2 ++ components/time-picker/index.tsx | 2 ++ components/timeline/index.ts | 2 ++ components/tooltip/index.tsx | 2 ++ components/tour/index.tsx | 2 ++ components/transfer/index.tsx | 2 ++ components/tree-select/index.tsx | 2 ++ components/tree/index.ts | 12 +++++++----- components/typography/index.ts | 2 ++ components/upload/index.ts | 2 ++ 72 files changed, 169 insertions(+), 33 deletions(-) diff --git a/components/affix/index.tsx b/components/affix/index.tsx index f07f3da8d3..9f60cdf666 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import ResizeObserver from 'rc-resize-observer'; import omit from 'rc-util/lib/omit'; diff --git a/components/alert/index.ts b/components/alert/index.ts index 5bb8dd2dbe..77038aea22 100644 --- a/components/alert/index.ts +++ b/components/alert/index.ts @@ -1,3 +1,5 @@ +'use client'; + import type { AlertProps } from './Alert'; import InternalAlert from './Alert'; import ErrorBoundary from './ErrorBoundary'; diff --git a/components/anchor/index.ts b/components/anchor/index.ts index 8fa68a45ec..6812dc61cb 100644 --- a/components/anchor/index.ts +++ b/components/anchor/index.ts @@ -1,3 +1,5 @@ +'use client'; + import InternalAnchor from './Anchor'; import AnchorLink from './AnchorLink'; diff --git a/components/app/index.tsx b/components/app/index.tsx index 56df12b953..347dfe3086 100644 --- a/components/app/index.tsx +++ b/components/app/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import type { ReactNode } from 'react'; import React, { useContext } from 'react'; diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index 613d41b416..a4a618e223 100755 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -1,10 +1,4 @@ -/** - * TODO: 4.0 - * - * - Remove `dataSource` - * - `size` not work with customizeInput - * - CustomizeInput not feedback `ENTER` key since accessibility enhancement - */ +'use client'; import classNames from 'classnames'; import type { BaseSelectRef } from 'rc-select'; diff --git a/components/avatar/index.ts b/components/avatar/index.ts index ea2fa43580..8f015a7cdc 100644 --- a/components/avatar/index.ts +++ b/components/avatar/index.ts @@ -1,3 +1,5 @@ +'use client'; + import type { ForwardRefExoticComponent, RefAttributes } from 'react'; import type { AvatarProps } from './avatar'; import InternalAvatar from './avatar'; diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx index eeee024195..97b11277e6 100644 --- a/components/back-top/index.tsx +++ b/components/back-top/index.tsx @@ -1,15 +1,17 @@ +'use client'; + import VerticalAlignTopOutlined from '@ant-design/icons/VerticalAlignTopOutlined'; import classNames from 'classnames'; import CSSMotion from 'rc-motion'; import omit from 'rc-util/lib/omit'; import * as React from 'react'; -import type { ConfigConsumerProps } from '../config-provider'; -import { ConfigContext } from '../config-provider'; import getScroll from '../_util/getScroll'; import { cloneElement } from '../_util/reactNode'; import scrollTo from '../_util/scrollTo'; import throttleByAnimationFrame from '../_util/throttleByAnimationFrame'; import warning from '../_util/warning'; +import type { ConfigConsumerProps } from '../config-provider'; +import { ConfigContext } from '../config-provider'; import useStyle from './style'; export interface BackTopProps { diff --git a/components/badge/index.tsx b/components/badge/index.tsx index 1784d29766..0af4dc831b 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classnames from 'classnames'; import CSSMotion from 'rc-motion'; import * as React from 'react'; diff --git a/components/breadcrumb/index.ts b/components/breadcrumb/index.ts index 202800b19c..90f3843f1e 100644 --- a/components/breadcrumb/index.ts +++ b/components/breadcrumb/index.ts @@ -1,3 +1,5 @@ +'use client'; + import Breadcrumb from './Breadcrumb'; export type { BreadcrumbProps } from './Breadcrumb'; diff --git a/components/button/index.ts b/components/button/index.ts index 1283a0d6f6..bc70690877 100644 --- a/components/button/index.ts +++ b/components/button/index.ts @@ -1,3 +1,5 @@ +'use client'; + import Button from './button'; export type { SizeType as ButtonSize } from '../config-provider/SizeContext'; diff --git a/components/calendar/index.ts b/components/calendar/index.ts index 9933d970d3..4f282637f6 100644 --- a/components/calendar/index.ts +++ b/components/calendar/index.ts @@ -1,3 +1,5 @@ +'use client'; + import type { Dayjs } from 'dayjs'; import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs'; import type { CalendarProps } from './generateCalendar'; diff --git a/components/card/index.ts b/components/card/index.ts index f3a1ccbe8e..c599a656db 100644 --- a/components/card/index.ts +++ b/components/card/index.ts @@ -1,3 +1,5 @@ +'use client'; + import InternalCard from './Card'; import Grid from './Grid'; import Meta from './Meta'; diff --git a/components/carousel/index.tsx b/components/carousel/index.tsx index abcb408275..fde5f4335c 100644 --- a/components/carousel/index.tsx +++ b/components/carousel/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import type { Settings } from '@ant-design/react-slick'; import SlickCarousel from '@ant-design/react-slick'; import classNames from 'classnames'; diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 5fe66a369f..33794723f7 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import LeftOutlined from '@ant-design/icons/LeftOutlined'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import RightOutlined from '@ant-design/icons/RightOutlined'; diff --git a/components/checkbox/index.ts b/components/checkbox/index.ts index ff9f918c11..283aacfcea 100644 --- a/components/checkbox/index.ts +++ b/components/checkbox/index.ts @@ -1,11 +1,13 @@ +'use client'; + import type * as React from 'react'; import type { CheckboxProps } from './Checkbox'; import InternalCheckbox from './Checkbox'; import Group from './Group'; +export type { CheckboxRef } from 'rc-checkbox'; export type { CheckboxChangeEvent, CheckboxProps } from './Checkbox'; export type { CheckboxGroupProps, CheckboxOptionType } from './Group'; -export type { CheckboxRef } from 'rc-checkbox'; type CompoundedComponent = React.ForwardRefExoticComponent< CheckboxProps & React.RefAttributes diff --git a/components/col/index.ts b/components/col/index.ts index 413ae4d2be..96021b9eaa 100644 --- a/components/col/index.ts +++ b/components/col/index.ts @@ -1,3 +1,5 @@ +'use client'; + import { Col, type ColProps, type ColSize } from '../grid'; export type { ColProps, ColSize }; diff --git a/components/collapse/index.ts b/components/collapse/index.ts index 9232a92c71..d5b6c97af4 100644 --- a/components/collapse/index.ts +++ b/components/collapse/index.ts @@ -1,3 +1,5 @@ +'use client'; + import Collapse from './Collapse'; export type { CollapseProps } from './Collapse'; diff --git a/components/color-picker/index.ts b/components/color-picker/index.ts index c0b77e6bdb..411285ce94 100644 --- a/components/color-picker/index.ts +++ b/components/color-picker/index.ts @@ -1,6 +1,8 @@ +'use client'; + import ColorPicker from './ColorPicker'; -export type { Color } from './color'; export type { ColorPickerProps } from './ColorPicker'; +export type { Color } from './color'; export default ColorPicker; diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 56c5602670..623963f116 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import { createTheme } from '@ant-design/cssinjs'; import IconContext from '@ant-design/icons/lib/components/Context'; import type { ValidateMessages } from 'rc-field-form/lib/interface'; diff --git a/components/date-picker/index.ts b/components/date-picker/index.ts index 08ff863589..31055d12d4 100755 --- a/components/date-picker/index.ts +++ b/components/date-picker/index.ts @@ -1,3 +1,5 @@ +'use client'; + import type { Dayjs } from 'dayjs'; import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs'; import genPurePanel from '../_util/PurePanel'; diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index ca8c685eb7..3c9c82e2b8 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -1,3 +1,5 @@ +'use client'; + /* eslint-disable react/no-array-index-key */ import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; diff --git a/components/divider/index.tsx b/components/divider/index.tsx index 5140bd3aa6..5e32f73dc8 100644 --- a/components/divider/index.tsx +++ b/components/divider/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import * as React from 'react'; import warning from '../_util/warning'; diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index 65df947873..103ecb2dc3 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import type { DrawerProps as RcDrawerProps } from 'rc-drawer'; import RcDrawer from 'rc-drawer'; @@ -15,7 +17,7 @@ import { NoCompactStyle } from '../space/Compact'; import useStyle from './style'; const SizeTypes = ['default', 'large'] as const; -type sizeType = (typeof SizeTypes)[number]; +type sizeType = typeof SizeTypes[number]; export interface PushState { distance: string | number; diff --git a/components/dropdown/index.ts b/components/dropdown/index.ts index a7f2ea4669..994ae7f389 100644 --- a/components/dropdown/index.ts +++ b/components/dropdown/index.ts @@ -1,3 +1,5 @@ +'use client'; + import InternalDropdown from './dropdown'; import DropdownButton from './dropdown-button'; diff --git a/components/empty/index.tsx b/components/empty/index.tsx index 5ed64457b3..fe242f139f 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import * as React from 'react'; import { ConfigContext } from '../config-provider'; diff --git a/components/float-button/index.ts b/components/float-button/index.ts index d3f6bdccb8..2e44354731 100644 --- a/components/float-button/index.ts +++ b/components/float-button/index.ts @@ -1,6 +1,8 @@ +'use client'; + +import BackTop from './BackTop'; import FloatButton from './FloatButton'; import FloatButtonGroup from './FloatButtonGroup'; -import BackTop from './BackTop'; import PurePanel from './PurePanel'; FloatButton.BackTop = BackTop; diff --git a/components/form/index.ts b/components/form/index.ts index 0db1262972..167f3fd07c 100644 --- a/components/form/index.ts +++ b/components/form/index.ts @@ -1,14 +1,16 @@ +'use client'; + import type { Rule, RuleObject, RuleRender } from 'rc-field-form/lib/interface'; import warning from '../_util/warning'; -import { FormProvider } from './context'; import ErrorList, { type ErrorListProps } from './ErrorList'; -import InternalForm, { type FormInstance, type FormProps, useForm, useWatch } from './Form'; +import InternalForm, { useForm, useWatch, type FormInstance, type FormProps } from './Form'; import Item, { type FormItemProps } from './FormItem'; import List, { type FormListFieldData, type FormListOperation, type FormListProps, } from './FormList'; +import { FormProvider } from './context'; import useFormInstance from './hooks/useFormInstance'; type InternalFormType = typeof InternalForm; @@ -44,16 +46,16 @@ Form.create = () => { }; export type { + ErrorListProps, FormInstance, - FormProps, FormItemProps, - ErrorListProps, + FormListFieldData, + FormListOperation, + FormListProps, + FormProps, Rule, RuleObject, RuleRender, - FormListProps, - FormListFieldData, - FormListOperation, }; export default Form; diff --git a/components/grid/index.ts b/components/grid/index.ts index 70bac60e2e..d8b5a655bd 100644 --- a/components/grid/index.ts +++ b/components/grid/index.ts @@ -1,3 +1,5 @@ +'use client'; + import Col from './col'; import useInternalBreakpoint from './hooks/useBreakpoint'; import Row from './row'; @@ -9,6 +11,6 @@ function useBreakpoint() { export type { ColProps, ColSize } from './col'; export type { RowProps } from './row'; -export { Row, Col }; +export { Col, Row }; export default { useBreakpoint }; diff --git a/components/image/index.tsx b/components/image/index.tsx index 4a6a58a0d9..827c4c63f8 100644 --- a/components/image/index.tsx +++ b/components/image/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import EyeOutlined from '@ant-design/icons/EyeOutlined'; import classNames from 'classnames'; import RcImage, { type ImageProps } from 'rc-image'; diff --git a/components/index.ts b/components/index.ts index e11d45bca9..302dbe5a4f 100644 --- a/components/index.ts +++ b/components/index.ts @@ -1,3 +1,5 @@ +'use client'; + export type { Breakpoint } from './_util/responsiveObserver'; export { default as Affix } from './affix'; export type { AffixProps } from './affix'; diff --git a/components/input-number/index.tsx b/components/input-number/index.tsx index f7bc82e343..c87d7ffdc9 100644 --- a/components/input-number/index.tsx +++ b/components/input-number/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import DownOutlined from '@ant-design/icons/DownOutlined'; import UpOutlined from '@ant-design/icons/UpOutlined'; import type { ValueType } from '@rc-component/mini-decimal'; diff --git a/components/input/index.ts b/components/input/index.ts index e0da843930..e82a0cf4b2 100644 --- a/components/input/index.ts +++ b/components/input/index.ts @@ -1,3 +1,5 @@ +'use client'; + import type * as React from 'react'; import Group from './Group'; import type { InputProps, InputRef } from './Input'; diff --git a/components/layout/index.ts b/components/layout/index.ts index 1cd8a7a70e..a07f39a0b9 100644 --- a/components/layout/index.ts +++ b/components/layout/index.ts @@ -1,3 +1,5 @@ +'use client'; + import InternalLayout, { Content, Footer, Header } from './layout'; import Sider from './Sider'; diff --git a/components/list/index.tsx b/components/list/index.tsx index 410286d4c6..260e7c0d84 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; // eslint-disable-next-line import/no-named-as-default import * as React from 'react'; diff --git a/components/locale/index.tsx b/components/locale/index.tsx index 3725bed11c..9bc4a4bb30 100644 --- a/components/locale/index.tsx +++ b/components/locale/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import type { ValidateMessages } from 'rc-field-form/lib/interface'; import * as React from 'react'; import warning from '../_util/warning'; diff --git a/components/mentions/index.tsx b/components/mentions/index.tsx index a05c0c818c..2d221fbabe 100644 --- a/components/mentions/index.tsx +++ b/components/mentions/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import RcMentions from 'rc-mentions'; import type { diff --git a/components/menu/index.tsx b/components/menu/index.tsx index f6e80ddc57..623c889ded 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -1,19 +1,21 @@ +'use client'; + import type { MenuRef as RcMenuRef } from 'rc-menu'; import { ItemGroup } from 'rc-menu'; import * as React from 'react'; import { forwardRef, useImperativeHandle, useRef } from 'react'; -import type { MenuProps } from './menu'; -import InternalMenu from './menu'; import { SiderContext } from '../layout/Sider'; import type { MenuTheme } from './MenuContext'; import MenuDivider from './MenuDivider'; import Item, { type MenuItemProps } from './MenuItem'; import SubMenu, { type SubMenuProps } from './SubMenu'; import type { ItemType, MenuItemType } from './hooks/useItems'; +import type { MenuProps } from './menu'; +import InternalMenu from './menu'; export type { MenuItemGroupProps } from 'rc-menu'; export type { MenuDividerProps } from './MenuDivider'; -export type { MenuTheme, SubMenuProps, MenuItemProps, MenuProps }; +export type { MenuItemProps, MenuProps, MenuTheme, SubMenuProps }; export type MenuRef = { menu: RcMenuRef | null; diff --git a/components/message/index.tsx b/components/message/index.tsx index c0fc527c88..a9c5e13457 100755 --- a/components/message/index.tsx +++ b/components/message/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import { render } from 'rc-util/lib/React/render'; import * as React from 'react'; import ConfigProvider, { globalConfig, warnContext } from '../config-provider'; diff --git a/components/modal/index.tsx b/components/modal/index.tsx index e28acd1138..65a0a60b43 100644 --- a/components/modal/index.tsx +++ b/components/modal/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import type { ModalStaticFunctions } from './confirm'; import confirm, { modalGlobalConfig, diff --git a/components/notification/index.tsx b/components/notification/index.tsx index 41f4bf71f7..dd852fea56 100755 --- a/components/notification/index.tsx +++ b/components/notification/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import { render } from 'rc-util/lib/React/render'; import * as React from 'react'; import ConfigProvider, { globalConfig, warnContext } from '../config-provider'; diff --git a/components/pagination/index.ts b/components/pagination/index.ts index 3ea001b0c4..63185d14d7 100644 --- a/components/pagination/index.ts +++ b/components/pagination/index.ts @@ -1,3 +1,5 @@ +'use client'; + import Pagination from './Pagination'; export type { PaginationConfig, PaginationProps } from './Pagination'; diff --git a/components/popconfirm/index.tsx b/components/popconfirm/index.tsx index 5e3e8b5661..c8ec0aec5a 100644 --- a/components/popconfirm/index.tsx +++ b/components/popconfirm/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import classNames from 'classnames'; import KeyCode from 'rc-util/lib/KeyCode'; diff --git a/components/popover/index.tsx b/components/popover/index.tsx index 42a7ddf9f6..af3f2e5f89 100644 --- a/components/popover/index.tsx +++ b/components/popover/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import * as React from 'react'; import type { RenderFunction } from '../_util/getRenderPropValue'; diff --git a/components/progress/index.tsx b/components/progress/index.tsx index 94570e886a..4311c803be 100644 --- a/components/progress/index.tsx +++ b/components/progress/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import Progress from './progress'; export type { ProgressAriaProps, ProgressProps } from './progress'; diff --git a/components/qrcode/index.tsx b/components/qrcode/index.tsx index f25b46a0f2..11ebb27159 100644 --- a/components/qrcode/index.tsx +++ b/components/qrcode/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import { ReloadOutlined } from '@ant-design/icons'; import classNames from 'classnames'; import { QRCodeCanvas, QRCodeSVG } from 'qrcode.react'; diff --git a/components/radio/index.tsx b/components/radio/index.tsx index bae4f15ede..cb25df7b37 100644 --- a/components/radio/index.tsx +++ b/components/radio/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import type * as React from 'react'; import Group from './group'; import type { RadioProps } from './interface'; diff --git a/components/rate/index.tsx b/components/rate/index.tsx index f813658466..82b74dd202 100644 --- a/components/rate/index.tsx +++ b/components/rate/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import StarFilled from '@ant-design/icons/StarFilled'; import classNames from 'classnames'; import RcRate from 'rc-rate'; diff --git a/components/result/index.tsx b/components/result/index.tsx index f657dd7f2a..07fe5028ad 100644 --- a/components/result/index.tsx +++ b/components/result/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; diff --git a/components/row/index.tsx b/components/row/index.tsx index 81cf63c1f2..b555816033 100644 --- a/components/row/index.tsx +++ b/components/row/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import { Row, type RowProps } from '../grid'; export type { RowProps }; diff --git a/components/segmented/index.tsx b/components/segmented/index.tsx index e607be06f1..3f5391328c 100644 --- a/components/segmented/index.tsx +++ b/components/segmented/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import type { SegmentedLabeledOption as RcSegmentedLabeledOption, diff --git a/components/select/index.tsx b/components/select/index.tsx index 61754110ac..5f3f1b7367 100755 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -1,3 +1,5 @@ +'use client'; + // TODO: 4.0 - codemod should help to change `filterOption` to support node props. import classNames from 'classnames'; import type { BaseSelectRef, SelectProps as RcSelectProps } from 'rc-select'; diff --git a/components/skeleton/index.tsx b/components/skeleton/index.tsx index 14c93f4d97..a37a3c9330 100644 --- a/components/skeleton/index.tsx +++ b/components/skeleton/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import Skeleton from './Skeleton'; export type { SkeletonProps } from './Skeleton'; diff --git a/components/slider/index.tsx b/components/slider/index.tsx index e47218e5fe..572b6c8a64 100644 --- a/components/slider/index.tsx +++ b/components/slider/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import type { SliderProps as RcSliderProps } from 'rc-slider'; import RcSlider from 'rc-slider'; diff --git a/components/space/index.tsx b/components/space/index.tsx index 4ffd25b527..6bfe74fd15 100644 --- a/components/space/index.tsx +++ b/components/space/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; import * as React from 'react'; diff --git a/components/spin/index.tsx b/components/spin/index.tsx index 33708204ab..24de3fb8ca 100644 --- a/components/spin/index.tsx +++ b/components/spin/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; import * as React from 'react'; @@ -9,7 +11,7 @@ import { ConfigContext } from '../config-provider'; import useStyle from './style/index'; const SpinSizes = ['small', 'default', 'large'] as const; -export type SpinSize = (typeof SpinSizes)[number]; +export type SpinSize = typeof SpinSizes[number]; export type SpinIndicator = React.ReactElement; export interface SpinProps { diff --git a/components/statistic/index.tsx b/components/statistic/index.tsx index 6ebcd58c50..c55cd80f62 100644 --- a/components/statistic/index.tsx +++ b/components/statistic/index.tsx @@ -1,9 +1,11 @@ +'use client'; + import type { CountdownProps } from './Countdown'; import Countdown from './Countdown'; import type { StatisticProps } from './Statistic'; import Statistic from './Statistic'; -export type { StatisticProps, CountdownProps }; +export type { CountdownProps, StatisticProps }; type CompoundedComponent = { Countdown: typeof Countdown; diff --git a/components/steps/index.tsx b/components/steps/index.tsx index 62f165604e..8be96627e2 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; diff --git a/components/style/index.ts b/components/style/index.ts index 43a975d37d..7e9eb6c8e3 100644 --- a/components/style/index.ts +++ b/components/style/index.ts @@ -1,3 +1,5 @@ +'use client'; + /* eslint-disable import/prefer-default-export */ import type { CSSObject } from '@ant-design/cssinjs'; import type { AliasToken, DerivativeToken } from '../theme/internal'; diff --git a/components/switch/index.tsx b/components/switch/index.tsx index e9458a11a4..7833b1efe1 100755 --- a/components/switch/index.tsx +++ b/components/switch/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import classNames from 'classnames'; import RcSwitch from 'rc-switch'; diff --git a/components/table/index.ts b/components/table/index.ts index 5852ca9550..8edeb0c048 100644 --- a/components/table/index.ts +++ b/components/table/index.ts @@ -1,8 +1,10 @@ +'use client'; + import { type TablePaginationConfig, type TableProps } from './InternalTable'; import Table from './Table'; export type { ColumnProps } from './Column'; -export type { ColumnGroupType, ColumnsType, ColumnType } from './interface'; -export type { TableProps, TablePaginationConfig }; +export type { ColumnGroupType, ColumnType, ColumnsType } from './interface'; +export type { TablePaginationConfig, TableProps }; export default Table; diff --git a/components/tabs/index.tsx b/components/tabs/index.tsx index 78b59c8497..afe8ee6e72 100755 --- a/components/tabs/index.tsx +++ b/components/tabs/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import CloseOutlined from '@ant-design/icons/CloseOutlined'; import EllipsisOutlined from '@ant-design/icons/EllipsisOutlined'; import PlusOutlined from '@ant-design/icons/PlusOutlined'; diff --git a/components/tag/index.tsx b/components/tag/index.tsx index d26f5d2aa1..0a93b179c5 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; import * as React from 'react'; diff --git a/components/theme/index.ts b/components/theme/index.ts index 799126fb04..eeb6d9c3ec 100644 --- a/components/theme/index.ts +++ b/components/theme/index.ts @@ -1,3 +1,5 @@ +'use client'; + /* eslint-disable import/prefer-default-export */ import getDesignToken from './getDesignToken'; import type { GlobalToken } from './interface'; diff --git a/components/time-picker/index.tsx b/components/time-picker/index.tsx index cf5283eb11..2962158edc 100644 --- a/components/time-picker/index.tsx +++ b/components/time-picker/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import type { Dayjs } from 'dayjs'; import * as React from 'react'; import genPurePanel from '../_util/PurePanel'; diff --git a/components/timeline/index.ts b/components/timeline/index.ts index 236af06211..bef127a48c 100644 --- a/components/timeline/index.ts +++ b/components/timeline/index.ts @@ -1,3 +1,5 @@ +'use client'; + import Timeline from './Timeline'; export type { TimelineProps } from './Timeline'; diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index 4d3b402837..f70a33e081 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import type { BuildInPlacements } from '@rc-component/trigger'; import classNames from 'classnames'; import RcTooltip from 'rc-tooltip'; diff --git a/components/tour/index.tsx b/components/tour/index.tsx index 3f4c5c9f07..7020e1b3e6 100644 --- a/components/tour/index.tsx +++ b/components/tour/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import RCTour from '@rc-component/tour'; import classNames from 'classnames'; import React, { useContext } from 'react'; diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx index 6b8366a062..9815fe86d5 100644 --- a/components/transfer/index.tsx +++ b/components/transfer/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import type { ChangeEvent, CSSProperties } from 'react'; import React, { useCallback, useContext } from 'react'; diff --git a/components/tree-select/index.tsx b/components/tree-select/index.tsx index c04b8f3991..017494a1cd 100644 --- a/components/tree-select/index.tsx +++ b/components/tree-select/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import classNames from 'classnames'; import type { BaseSelectRef } from 'rc-select'; import type { Placement } from 'rc-select/lib/BaseSelect'; diff --git a/components/tree/index.ts b/components/tree/index.ts index 8764911025..cab82d9681 100644 --- a/components/tree/index.ts +++ b/components/tree/index.ts @@ -1,28 +1,30 @@ +'use client'; + import type RcTree from 'rc-tree'; -import { TreeNode } from 'rc-tree'; import type { BasicDataNode } from 'rc-tree'; +import { TreeNode } from 'rc-tree'; import type { DataNode } from 'rc-tree/lib/interface'; +import DirectoryTree from './DirectoryTree'; import type { TreeProps } from './Tree'; import TreePure from './Tree'; -import DirectoryTree from './DirectoryTree'; -export type { DataNode }; export type { EventDataNode } from 'rc-tree/lib/interface'; export type { - DirectoryTreeProps, ExpandAction as DirectoryTreeExpandAction, + DirectoryTreeProps, } from './DirectoryTree'; export type { - AntdTreeNodeAttribute, AntTreeNode, AntTreeNodeCheckedEvent, AntTreeNodeExpandedEvent, AntTreeNodeMouseEvent, AntTreeNodeProps, AntTreeNodeSelectedEvent, + AntdTreeNodeAttribute, TreeProps, } from './Tree'; +export type { DataNode }; type CompoundedComponent = (( props: React.PropsWithChildren> & { ref?: React.Ref }, diff --git a/components/typography/index.ts b/components/typography/index.ts index 9f9f3084cb..fdae240e06 100644 --- a/components/typography/index.ts +++ b/components/typography/index.ts @@ -1,3 +1,5 @@ +'use client'; + import Link from './Link'; import Paragraph from './Paragraph'; import Text from './Text'; diff --git a/components/upload/index.ts b/components/upload/index.ts index 98a5a8b200..6546d8da30 100644 --- a/components/upload/index.ts +++ b/components/upload/index.ts @@ -1,3 +1,5 @@ +'use client'; + import Dragger from './Dragger'; import type { UploadProps } from './Upload'; import InternalUpload, { LIST_IGNORE } from './Upload';