repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/util.ts | components/notification/__tests__/util.ts | import { act, fireEvent } from '../../../tests/utils';
export async function awaitPromise() {
for (let i = 0; i < 10; i += 1) {
await Promise.resolve();
}
}
export async function triggerMotionEnd(runAllTimers = true) {
await awaitPromise();
if (runAllTimers) {
// Flush css motion state update
for... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/static-warning.test.tsx | components/notification/__tests__/static-warning.test.tsx | import React from 'react';
import notification, { actWrapper } from '..';
import { act, render, waitFakeTimer, waitFakeTimer19 } from '../../../tests/utils';
import ConfigProvider from '../../config-provider';
import { awaitPromise, triggerMotionEnd } from './util';
// TODO: Remove this. Mock for React 19
jest.mock('... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/image.test.ts | components/notification/__tests__/image.test.ts | import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Notification image', () => {
imageDemoTest('notification');
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/demo.test.ts | components/notification/__tests__/demo.test.ts | import demoTest from '../../../tests/shared/demoTest';
demoTest('notification', {
testRootProps: false,
nameCheckPathOnly: true,
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/hooks.test.tsx | components/notification/__tests__/hooks.test.tsx | import React from 'react';
import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs';
import { render as testLibRender } from '@testing-library/react';
import notification from '..';
import { act, fireEvent, pureRender, render } from '../../../tests/utils';
import ConfigProvider from '../../config... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/demo-extend.test.ts | components/notification/__tests__/demo-extend.test.ts | import { extendTest } from '../../../tests/shared/demoTest';
extendTest('notification');
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/config.test.tsx | components/notification/__tests__/config.test.tsx | import React from 'react';
import notification, { actDestroy, actWrapper } from '..';
import { act } from '../../../tests/utils';
import App from '../../app';
import ConfigProvider from '../../config-provider';
import { awaitPromise, triggerMotionEnd } from './util';
// TODO: Remove this. Mock for React 19
jest.mock(... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/semantic.test.tsx | components/notification/__tests__/semantic.test.tsx | import React from 'react';
import { SmileOutlined } from '@ant-design/icons';
import notification, { actWrapper } from '..';
import { act, fireEvent, render } from '../../../tests/utils';
import ConfigProvider from '../../config-provider';
import { awaitPromise, triggerMotionEnd } from './util';
import type { ArgsProp... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/with-btn.tsx | components/notification/demo/with-btn.tsx | import React from 'react';
import { Button, notification, Space } from 'antd';
const close = () => {
console.log(
'Notification was closed. Either the close button was clicked or duration time elapsed.',
);
};
const App: React.FC = () => {
const [api, contextHolder] = notification.useNotification();
cons... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/duration.tsx | components/notification/demo/duration.tsx | import React from 'react';
import { Button, notification } from 'antd';
const App: React.FC = () => {
const [api, contextHolder] = notification.useNotification();
const openNotification = () => {
api.open({
title: 'Notification Title',
description:
'I will never close automatically. This i... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/_semantic.tsx | components/notification/demo/_semantic.tsx | import React from 'react';
import { Button, notification } from 'antd';
import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview';
import useLocale from '../../../.dumi/hooks/useLocale';
const { _InternalPanelDoNotUseOrYouWillBeFired: InternalPanel } = notification;
const locales = {
cn: {
root... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/stack.tsx | components/notification/demo/stack.tsx | import React, { useMemo } from 'react';
import { Button, Divider, InputNumber, notification, Space, Switch } from 'antd';
const Context = React.createContext({ name: 'Default' });
const App: React.FC = () => {
const [enabled, setEnabled] = React.useState(true);
const [threshold, setThreshold] = React.useState(3);... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/render-panel.tsx | components/notification/demo/render-panel.tsx | import React from 'react';
import { Button, notification } from 'antd';
/** Test usage. Do not use in your production. */
const { _InternalPanelDoNotUseOrYouWillBeFired: InternalPanel } = notification;
export default () => (
<InternalPanel
title="Hello World!"
description="Hello World?"
type="success"
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/show-with-progress.tsx | components/notification/demo/show-with-progress.tsx | import React from 'react';
import { Button, notification, Space } from 'antd';
const App: React.FC = () => {
const [api, contextHolder] = notification.useNotification();
const openNotification = (pauseOnHover: boolean) => () => {
api.open({
title: 'Notification Title',
description:
'This i... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/update.tsx | components/notification/demo/update.tsx | import React from 'react';
import { Button, notification } from 'antd';
const key = 'updatable';
const App: React.FC = () => {
const [api, contextHolder] = notification.useNotification();
const openNotification = () => {
api.open({
key,
title: 'Notification Title',
description: 'description.... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/with-icon.tsx | components/notification/demo/with-icon.tsx | import React from 'react';
import { Button, Flex, notification } from 'antd';
type NotificationType = 'success' | 'info' | 'warning' | 'error';
const App: React.FC = () => {
const [api, contextHolder] = notification.useNotification();
const openNotificationWithIcon = (type: NotificationType) => {
api[type]({... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/custom-style.tsx | components/notification/demo/custom-style.tsx | import React from 'react';
import { Button, notification } from 'antd';
const App: React.FC = () => {
const [api, contextHolder] = notification.useNotification();
const openNotification = () => {
api.open({
title: 'Notification Title',
description:
'This is the content of the notification.... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/component-token.tsx | components/notification/demo/component-token.tsx | import React from 'react';
import { Button, ConfigProvider, Flex, notification } from 'antd';
type NotificationType = 'success' | 'info' | 'warning' | 'error';
const CustomThemeDemo: React.FC = () => {
const [api, contextHolder] = notification.useNotification();
const openNotificationWithIcon = (type: Notificati... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/placement.tsx | components/notification/demo/placement.tsx | import React from 'react';
import {
BorderBottomOutlined,
BorderTopOutlined,
RadiusBottomleftOutlined,
RadiusBottomrightOutlined,
RadiusUpleftOutlined,
RadiusUprightOutlined,
} from '@ant-design/icons';
import { Button, Divider, notification, Space } from 'antd';
import type { NotificationArgsProps } from '... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/basic.tsx | components/notification/demo/basic.tsx | import React from 'react';
import { Button, notification } from 'antd';
const openNotification = () => {
notification.open({
title: 'Notification Title',
description:
'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
onClic... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/hooks.tsx | components/notification/demo/hooks.tsx | import React, { useMemo } from 'react';
import {
RadiusBottomleftOutlined,
RadiusBottomrightOutlined,
RadiusUpleftOutlined,
RadiusUprightOutlined,
} from '@ant-design/icons';
import { Button, Divider, notification, Space } from 'antd';
import type { NotificationArgsProps } from 'antd';
type NotificationPlaceme... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/progress-color.tsx | components/notification/demo/progress-color.tsx | import React from 'react';
import { Button, ConfigProvider, notification } from 'antd';
import { createStyles } from 'antd-style';
const COLOR_BG = 'linear-gradient(135deg,#6253e1, #04befe)';
const useStyle = createStyles(({ prefixCls, css }) => ({
linearGradientButton: css`
&.${prefixCls}-btn-primary:not([disa... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/custom-icon.tsx | components/notification/demo/custom-icon.tsx | import React from 'react';
import { SmileOutlined } from '@ant-design/icons';
import { Button, notification } from 'antd';
const App: React.FC = () => {
const [api, contextHolder] = notification.useNotification();
const openNotification = () => {
api.open({
title: 'Notification Title',
description... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/demo/style-class.tsx | components/notification/demo/style-class.tsx | import React from 'react';
import { Button, notification, Space } from 'antd';
import type { NotificationArgsProps } from 'antd';
import { createStyles } from 'antd-style';
const useStyle = createStyles(({ css }) => ({
root: css`
border: 2px dashed #ccc;
`,
}));
const styleFn: NotificationArgsProps['styles'] ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/SizeContext.tsx | components/config-provider/SizeContext.tsx | import * as React from 'react';
export type SizeType = 'small' | 'middle' | 'large' | undefined;
const SizeContext = React.createContext<SizeType>(undefined);
export interface SizeContextProps {
size?: SizeType;
children?: React.ReactNode;
}
export const SizeContextProvider: React.FC<SizeContextProps> = ({ chil... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/DisabledContext.tsx | components/config-provider/DisabledContext.tsx | import * as React from 'react';
const DisabledContext = React.createContext<boolean>(false);
export interface DisabledContextProps {
disabled?: boolean;
children?: React.ReactNode;
}
export const DisabledContextProvider: React.FC<DisabledContextProps> = ({ children, disabled }) => {
const originDisabled = Reac... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/index.tsx | components/config-provider/index.tsx | import * as React from 'react';
import { createTheme, StyleContext as CssInJsStyleContext } from '@ant-design/cssinjs';
import IconContext from '@ant-design/icons/lib/components/Context';
import { merge } from '@rc-component/util';
import useMemo from '@rc-component/util/lib/hooks/useMemo';
import warning, { devUseWar... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/defaultRenderEmpty.tsx | components/config-provider/defaultRenderEmpty.tsx | import React, { useContext } from 'react';
import type { ConfigConsumerProps } from '.';
import { ConfigContext } from '.';
import Empty from '../empty';
type ComponentName =
| 'Table'
| 'Table.filter' /* 👈 5.20.0+ */
| 'List'
| 'Select'
| 'TreeSelect'
| 'Cascader'
| 'Transfer'
| 'Mentions';
interfa... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/MotionWrapper.tsx | components/config-provider/MotionWrapper.tsx | import * as React from 'react';
import { Provider as MotionProvider } from '@rc-component/motion';
import { useToken } from '../theme/internal';
const MotionCacheContext = React.createContext(true);
if (process.env.NODE_ENV !== 'production') {
MotionCacheContext.displayName = 'MotionCacheContext';
}
export interfa... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/context.ts | components/config-provider/context.ts | import * as React from 'react';
import type { MaskType } from '../_util/hooks';
import type { AnyObject } from '../_util/type';
import type { WarningContextProps } from '../_util/warning';
import type { ShowWaveEffect } from '../_util/wave/interface';
import type { AlertProps } from '../alert';
import type { AnchorPro... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/PropWarning.tsx | components/config-provider/PropWarning.tsx | import * as React from 'react';
import { devUseWarning } from '../_util/warning';
export interface PropWarningProps {
dropdownMatchSelectWidth?: boolean;
}
/**
* Warning for ConfigProviderProps.
* This will be empty function in production.
*/
const PropWarning = React.memo(({ dropdownMatchSelectWidth }: PropWar... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/style/index.ts | components/config-provider/style/index.ts | export { useResetIconStyle as default } from '../../theme/internal';
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/hooks/useCSSVarCls.ts | components/config-provider/hooks/useCSSVarCls.ts | /**
* This hook is only for cssVar to add root className for components.
* If root ClassName is needed, this hook could be refactored with `-root`
* @param prefixCls
*/
const useCSSVarCls = (prefixCls: string) => `${prefixCls}-css-var`;
export default useCSSVarCls;
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/hooks/useTheme.ts | components/config-provider/hooks/useTheme.ts | import { useId } from 'react';
import useMemo from '@rc-component/util/lib/hooks/useMemo';
import isEqual from '@rc-component/util/lib/isEqual';
import { devUseWarning } from '../../_util/warning';
import type { OverrideToken } from '../../theme/interface';
import { defaultConfig } from '../../theme/internal';
import t... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/hooks/useConfig.ts | components/config-provider/hooks/useConfig.ts | import { useContext } from 'react';
import DisabledContext from '../DisabledContext';
import SizeContext from '../SizeContext';
function useConfig() {
const componentDisabled = useContext(DisabledContext);
const componentSize = useContext(SizeContext);
return {
componentDisabled,
componentSize,
};
}
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/hooks/useSize.ts | components/config-provider/hooks/useSize.ts | import React from 'react';
import type { SizeType } from '../SizeContext';
import SizeContext from '../SizeContext';
const useSize = <T extends string | undefined | number | object>(
customSize?: T | ((ctxSize: SizeType) => T),
): T => {
const size = React.useContext<SizeType>(SizeContext);
const mergedSize = R... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/a11y.test.ts | components/config-provider/__tests__/a11y.test.ts | import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
accessibilityDemoTest('config-provider', {
// we actually can ignore it
skip: true,
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/style.test.tsx | components/config-provider/__tests__/style.test.tsx | import React from 'react';
import Masonry from 'antd/es/masonry';
import ConfigProvider from '..';
import type { SemanticClassNames, SemanticStyles } from '../../_util/hooks';
import { fireEvent, render } from '../../../tests/utils';
import Alert from '../../alert';
import Anchor from '../../anchor';
import Avatar fro... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | true |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/nonce.test.tsx | components/config-provider/__tests__/nonce.test.tsx | import React from 'react';
import { createCache, StyleProvider } from '@ant-design/cssinjs';
import { SmileOutlined } from '@ant-design/icons';
import IconContext from '@ant-design/icons/lib/components/Context';
import ConfigProvider from '..';
import { render } from '../../../tests/utils';
import Button from '../../b... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/button.test.tsx | components/config-provider/__tests__/button.test.tsx | import React from 'react';
import { SearchOutlined } from '@ant-design/icons';
import Button from 'antd/es/button';
import ConfigProvider from '..';
import { render } from '../../../tests/utils';
describe('ConfigProvider.button', () => {
beforeEach(() => {
(global as any).triggerProps = null;
});
it('Confi... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/theme.test.tsx | components/config-provider/__tests__/theme.test.tsx | import React, { useEffect } from 'react';
import { Modal } from 'antd';
import ConfigProvider from '..';
import { Button, InputNumber, Select } from '../..';
import { render, waitFakeTimer } from '../../../tests/utils';
import theme from '../../theme';
import type { GlobalToken } from '../../theme/internal';
import { ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/target.test.tsx | components/config-provider/__tests__/target.test.tsx | import React from 'react';
import ConfigProvider from '..';
import { act, render } from '../../../tests/utils';
import Affix from '../../affix';
import Anchor from '../../anchor';
describe('ConfigProvider.getTargetContainer', () => {
it('Affix', () => {
jest.useFakeTimers();
const getTargetContainer = jest.... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/container.test.tsx | components/config-provider/__tests__/container.test.tsx | import React from 'react';
import ConfigProvider from '..';
import { fireEvent, render } from '../../../tests/utils';
import Cascader from '../../cascader';
import DatePicker from '../../date-picker';
import Drawer from '../../drawer';
import Slider from '../../slider';
describe('ConfigProvider.GetPopupContainer', ()... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/popup.test.tsx | components/config-provider/__tests__/popup.test.tsx | import React from 'react';
import type { TriggerProps, TriggerRef } from '@rc-component/trigger';
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import ConfigProvider from '..';
import { fireEvent, getByRole, render } from '../../../tests/utils';
import Cascader from '../../... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/index.test.tsx | components/config-provider/__tests__/index.test.tsx | import React, { useState } from 'react';
import { SmileOutlined } from '@ant-design/icons';
import type { ConfigConsumerProps, RenderEmptyHandler } from '..';
import ConfigProvider, { ConfigContext } from '..';
import { resetWarned } from '../../_util/warning';
import mountTest from '../../../tests/shared/mountTest';
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/motion.test.tsx | components/config-provider/__tests__/motion.test.tsx | import React from 'react';
import ConfigProvider from '..';
import { pureRender } from '../../../tests/utils';
let MotionProviderRun = 0;
jest.mock('@rc-component/motion', () => {
const RcMotion = jest.requireActual('@rc-component/motion');
const MotionProvider = RcMotion.Provider;
return {
...RcMotion,
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/cssinjs.test.tsx | components/config-provider/__tests__/cssinjs.test.tsx | import * as React from 'react';
import { createCache, StyleProvider } from '@ant-design/cssinjs';
import { SmileOutlined } from '@ant-design/icons';
import ConfigProvider from '..';
import { render } from '../../../tests/utils';
import Button from '../../button';
import Divider from '../../divider';
describe('ConfigP... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/useConfig.test.tsx | components/config-provider/__tests__/useConfig.test.tsx | import React from 'react';
import { Button } from 'antd';
import ConfigProvider from '..';
import { resetWarned } from '../../_util/warning';
import { render } from '../../../tests/utils';
import Form from '../../form';
describe('ConfigProvider.useConfig', () => {
it('useConfig - componentSize', () => {
let siz... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/locale.test.tsx | components/config-provider/__tests__/locale.test.tsx | import React, { useEffect, useState } from 'react';
import ConfigProvider from '..';
import { act, fireEvent, render } from '../../../tests/utils';
import DatePicker from '../../date-picker';
import { closePicker, openPicker, selectCell } from '../../date-picker/__tests__/utils';
import type { Locale } from '../../loc... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/image.test.ts | components/config-provider/__tests__/image.test.ts | import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('ConfigProvider image', () => {
imageDemoTest('config-provider', { skip: ['direction.tsx', 'theme.tsx'] });
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/wave.test.tsx | components/config-provider/__tests__/wave.test.tsx | import React from 'react';
import ConfigProvider from '..';
import { fireEvent, render, waitFakeTimer } from '../../../tests/utils';
import Button from '../../button';
jest.mock('@rc-component/util/lib/Dom/isVisible', () => () => true);
describe('ConfigProvider.Wave', () => {
beforeEach(() => {
jest.useFakeTim... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/pagination.test.tsx | components/config-provider/__tests__/pagination.test.tsx | import React from 'react';
import ConfigProvider from '..';
import { render } from '../../../tests/utils';
import Pagination from '../../pagination';
describe('ConfigProvider.Pagination', () => {
it('showSizeChanger', () => {
// Default have
const sharedNode = <Pagination total={1000} />;
const { contai... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/form.test.tsx | components/config-provider/__tests__/form.test.tsx | import React from 'react';
import type { ValidateMessages } from '@rc-component/form/lib/interface';
import scrollIntoView from 'scroll-into-view-if-needed';
import ConfigProvider from '..';
import { act, fireEvent, render, waitFakeTimer } from '../../../tests/utils';
import Button from '../../button';
import type { F... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/static.test.ts | components/config-provider/__tests__/static.test.ts | import ConfigProvider, { defaultPrefixCls, globalConfig } from '..';
describe('ConfigProvider.config', () => {
it('rootPrefixCls', () => {
expect(globalConfig().getRootPrefixCls()).toEqual(defaultPrefixCls);
ConfigProvider.config({
prefixCls: 'light',
});
expect(globalConfig().getRootPrefixCls... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/useSize.test.tsx | components/config-provider/__tests__/useSize.test.tsx | import React from 'react';
import { render } from '../../../tests/utils';
import useSize from '../hooks/useSize';
describe('useSize', () => {
it('useSize', () => {
const Demo: React.FC<{ size?: any }> = ({ size }) => <div>{useSize(size)}</div>;
const { container, rerender } = render(<Demo />);
expect(co... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/components.test.tsx | components/config-provider/__tests__/components.test.tsx | import React from 'react';
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import ConfigProvider from '..';
import { render } from '../../../tests/utils';
import Alert from '../../alert';
import Anchor from '../../anchor';
import AutoComplete from '../../auto-complete';
impor... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/memo.test.tsx | components/config-provider/__tests__/memo.test.tsx | import React from 'react';
import ConfigProvider from '..';
import { fireEvent, pureRender } from '../../../tests/utils';
import Tooltip from '../../tooltip';
interface Props {
spy: () => void;
}
// https://github.com/ant-design/ant-design/issues/27617
describe('ConfigProvider', () => {
const Child: React.FC<Pro... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/__tests__/renderEmpty.test.tsx | components/config-provider/__tests__/renderEmpty.test.tsx | import React from 'react';
import RenderEmpty from '../defaultRenderEmpty';
import { render } from '../../../tests/utils';
describe('renderEmpty', () => {
it.each([
'Table',
'Table.filter' /* 👈 5.19.0+ */,
'List',
'Select',
'TreeSelect',
'Cascader',
'Transfer',
'Mentions',
])('shou... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/useConfig.tsx | components/config-provider/demo/useConfig.tsx | import React, { useState } from 'react';
import { Checkbox, ConfigProvider, Divider, Form, Input, Radio, Space } from 'antd';
import type { ConfigProviderProps } from 'antd';
type SizeType = ConfigProviderProps['componentSize'];
const ConfigDisplay = () => {
const { componentDisabled, componentSize } = ConfigProvid... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/holderRender.tsx | components/config-provider/demo/holderRender.tsx | import React, { useContext, useLayoutEffect } from 'react';
import { StyleProvider } from '@ant-design/cssinjs';
import { ExclamationCircleFilled } from '@ant-design/icons';
import { App, Button, ConfigProvider, message, Modal, notification, Space } from 'antd';
const Demo: React.FC = () => {
const { locale, theme }... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/prefixCls.tsx | components/config-provider/demo/prefixCls.tsx | import React, { useState } from 'react';
import { SmileOutlined } from '@ant-design/icons';
import { Button, Checkbox, ConfigProvider, Radio, Select } from 'antd';
// Ant Design site use `es` module for view
// but do not replace related lib `lib` with `es`
// which do not show correct in site.
// We may need do conve... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/theme.tsx | components/config-provider/demo/theme.tsx | import React from 'react';
import {
Button,
ColorPicker,
ConfigProvider,
Divider,
Form,
Input,
InputNumber,
Space,
Switch,
} from 'antd';
import type { ColorPickerProps, GetProp } from 'antd';
type Color = Extract<GetProp<ColorPickerProps, 'value'>, { cleared: any }>;
type ThemeData = {
borderRadi... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/locale.tsx | components/config-provider/demo/locale.tsx | import React, { useState } from 'react';
import { EllipsisOutlined } from '@ant-design/icons';
import type {
ConfigProviderProps,
RadioChangeEvent,
TableProps,
TourProps,
UploadFile,
} from 'antd';
import {
Button,
Calendar,
ConfigProvider,
DatePicker,
Divider,
Form,
Image,
Input,
InputNumbe... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/warning.tsx | components/config-provider/demo/warning.tsx | import React from 'react';
import { Alert, ConfigProvider, Input, Typography } from 'antd';
const App: React.FC = () => (
<>
<Typography.Title level={4}>Open single page to check the console</Typography.Title>
<ConfigProvider warning={{ strict: false }}>
<Alert closeText="deprecated" />
<Input.Gr... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/size.tsx | components/config-provider/demo/size.tsx | import React, { useState } from 'react';
import {
Button,
Card,
ConfigProvider,
DatePicker,
Divider,
Input,
Radio,
Select,
Space,
Table,
Tabs,
} from 'antd';
import type { ConfigProviderProps } from 'antd';
type SizeType = ConfigProviderProps['componentSize'];
const App: React.FC = () => {
con... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/direction.tsx | components/config-provider/demo/direction.tsx | import React, { useState } from 'react';
import {
DownloadOutlined,
LeftOutlined,
MinusOutlined,
PlusOutlined,
RightOutlined,
SearchOutlined as SearchIcon,
SmileOutlined,
} from '@ant-design/icons';
import type { ConfigProviderProps, RadioChangeEvent } from 'antd';
import {
Badge,
Button,
Cascader,
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/config-provider/demo/wave.tsx | components/config-provider/demo/wave.tsx | import React from 'react';
import { HappyProvider } from '@ant-design/happy-work-theme';
import { Button, ConfigProvider, Flex } from 'antd';
import type { ConfigProviderProps, GetProp } from 'antd';
type WaveConfig = GetProp<ConfigProviderProps, 'wave'>;
// Prepare effect holder
const createHolder = (node: HTMLEleme... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/placementArrow.ts | components/style/placementArrow.ts | import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs';
import type { AliasToken, TokenWithCommonCls } from '../theme/internal';
import type { ArrowToken } from './roundedArrow';
import { genRoundedArrow } from './roundedArrow';
export const MAX_VERTICAL_CON... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/index.tsx | components/style/index.tsx | import { unit } from '@ant-design/cssinjs';
import type { CSSObject } from '@ant-design/cssinjs';
import type { AliasToken } from '../theme/internal';
export const textEllipsis: CSSObject = {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
};
export const resetComponent = (token: AliasToken... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/roundedArrow.ts | components/style/roundedArrow.ts | import type { CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs';
import type { AliasToken } from '../theme/interface';
import type { CSSUtil } from '../theme/internal';
export interface ArrowToken {
/** @internal */
arrowShadowWidth: number;
/** @internal */
arrowPath: string;... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/compact-item.ts | components/style/compact-item.ts | import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type { AliasToken, CSSUtil, FullToken, OverrideComponent } from '../theme/internal';
interface CompactItemOptions {
componentCls?: string;
focus?: boolean;
/**
* Some component borders are implemented on child elements
* like ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/compact-item-vertical.ts | components/style/compact-item-vertical.ts | import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type { AliasToken, CSSUtil, FullToken, OverrideComponent } from '../theme/internal';
function compactItemVerticalBorder(
token: AliasToken & CSSUtil,
parentCls: string,
prefixCls: string,
): CSSObject {
return {
// border colla... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/motion/zoom.ts | components/style/motion/zoom.ts | import type { CSSInterpolation } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import { initMotion } from './motion';
export const zoomIn = new Keyframes('antZoomIn', {
'0%': {
transform: 'scale(0.2)',
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/motion/motion.ts | components/style/motion/motion.ts | import type { CSSObject, Keyframes } from '@ant-design/cssinjs';
const initMotionCommon = (duration: string): CSSObject => ({
animationDuration: duration,
animationFillMode: 'both',
});
// FIXME: origin less code seems same as initMotionCommon. Maybe we can safe remove
const initMotionCommonLeave = (duration: str... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/motion/collapse.ts | components/style/motion/collapse.ts | import type { AliasToken, GenerateStyle, TokenWithCommonCls } from '../../theme/internal';
const genCollapseMotion: GenerateStyle<TokenWithCommonCls<AliasToken>> = (token) => ({
[token.componentCls]: {
// For common/openAnimation
[`${token.antCls}-motion-collapse-legacy`]: {
overflow: 'hidden',
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/motion/move.ts | components/style/motion/move.ts | import type { CSSInterpolation } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import { initMotion } from './motion';
export const moveDownIn = new Keyframes('antMoveDownIn', {
'0%': {
transform: 'translat... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/motion/fade.ts | components/style/motion/fade.ts | import type { CSSInterpolation } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import { initMotion } from './motion';
export const fadeIn = new Keyframes('antFadeIn', {
'0%': {
opacity: 0,
},
'100%': {... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/motion/index.ts | components/style/motion/index.ts | import genCollapseMotion from './collapse';
import { fadeIn, fadeOut, initFadeMotion } from './fade';
import {
initMoveMotion,
moveDownIn,
moveDownOut,
moveLeftIn,
moveLeftOut,
moveRightIn,
moveRightOut,
moveUpIn,
moveUpOut,
} from './move';
import {
initSlideMotion,
slideDownIn,
slideDownOut,
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/style/motion/slide.ts | components/style/motion/slide.ts | import type { CSSInterpolation } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import { initMotion } from './motion';
export const slideUpIn = new Keyframes('antSlideUpIn', {
'0%': {
transform: 'scaleY(0.8... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/Card.tsx | components/card/Card.tsx | import * as React from 'react';
import type { Tab, TabBarExtraContent } from '@rc-component/tabs/lib/interface';
import { omit, toArray } from '@rc-component/util';
import { clsx } from 'clsx';
import { useMergeSemantic } from '../_util/hooks';
import type { SemanticClassNamesType, SemanticStylesType } from '../_util/... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/index.tsx | components/card/index.tsx | import InternalCard from './Card';
import CardGrid from './CardGrid';
import CardMeta from './CardMeta';
export type { CardProps, CardTabListType } from './Card';
export type { CardGridProps } from './CardGrid';
export type { CardMetaProps } from './CardMeta';
type InternalCardType = typeof InternalCard;
export inte... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/CardGrid.tsx | components/card/CardGrid.tsx | import * as React from 'react';
import { clsx } from 'clsx';
import { ConfigContext } from '../config-provider';
import type { ConfigConsumerProps } from '../config-provider';
export interface CardGridProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;
className?: string;
hoverable?: boolea... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/CardMeta.tsx | components/card/CardMeta.tsx | import * as React from 'react';
import { clsx } from 'clsx';
import { useMergeSemantic } from '../_util/hooks';
import type { SemanticClassNamesType, SemanticStylesType } from '../_util/hooks';
import { useComponentConfig } from '../config-provider/context';
export type SemanticName = 'root' | 'section' | 'avatar' | ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/style/index.ts | components/card/style/index.ts | import { unit } from '@ant-design/cssinjs';
import type { CSSObject } from '@ant-design/cssinjs';
import { clearFix, resetComponent, textEllipsis } from '../../style';
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal'... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/__tests__/a11y.test.ts | components/card/__tests__/a11y.test.ts | import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
accessibilityDemoTest('card', {
disabledRules: ['button-name', 'image-alt'],
skip: ['tabs.tsx'],
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/__tests__/index.test.tsx | components/card/__tests__/index.test.tsx | import '@testing-library/jest-dom';
import React from 'react';
import type { TabBarExtraContent } from '@rc-component/tabs/lib/interface';
import userEvent from '@testing-library/user-event';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
import { fireEve... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/__tests__/type.test.tsx | components/card/__tests__/type.test.tsx | import * as React from 'react';
import Card from '../index';
describe('Card.typescript', () => {
it('ref', () => {
function Demo() {
const cardRef = React.useRef<HTMLDivElement>(null);
return <Card ref={cardRef} />;
}
expect(Demo).toBeTruthy();
});
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/__tests__/image.test.ts | components/card/__tests__/image.test.ts | import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Card image', () => {
imageDemoTest('card');
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/__tests__/demo.test.ts | components/card/__tests__/demo.test.ts | import demoTest from '../../../tests/shared/demoTest';
demoTest('card');
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/__tests__/demo-extend.test.ts | components/card/__tests__/demo-extend.test.ts | import { extendTest } from '../../../tests/shared/demoTest';
extendTest('card');
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/__tests__/semantic.test.tsx | components/card/__tests__/semantic.test.tsx | import React from 'react';
import Card from '..';
import { render } from '../../../tests/utils';
import Button from '../../button';
describe('Card.Semantic', () => {
it('should support useMergeSemantic with mergedProps', () => {
const semanticClassNames = {
root: 'semantic-card-root',
header: 'seman... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/grid-card.tsx | components/card/demo/grid-card.tsx | import React from 'react';
import { Card } from 'antd';
const gridStyle: React.CSSProperties = {
width: '25%',
textAlign: 'center',
};
const App: React.FC = () => (
<Card title="Card Title">
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid hoverable={false} style={gridStyle}>
Content
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/_semantic.tsx | components/card/demo/_semantic.tsx | import React from 'react';
import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons';
import { Avatar, Card } from 'antd';
import type { CardProps } from 'antd';
import useLocale from '../../../.dumi/hooks/useLocale';
import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview';
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/inner.tsx | components/card/demo/inner.tsx | import React from 'react';
import { Card } from 'antd';
const App: React.FC = () => (
<Card title="Card title">
<Card type="inner" title="Inner Card title" extra={<a href="#">More</a>}>
Inner Card content
</Card>
<Card
style={{ marginTop: 16 }}
type="inner"
title="Inner Card title... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/tabs.tsx | components/card/demo/tabs.tsx | import React, { useState } from 'react';
import { Card } from 'antd';
const tabList = [
{
key: 'tab1',
tab: 'tab1',
},
{
key: 'tab2',
tab: 'tab2',
},
];
const contentList: Record<string, React.ReactNode> = {
tab1: <p>content1</p>,
tab2: <p>content2</p>,
};
const tabListNoTitle = [
{
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/_semantic_meta.tsx | components/card/demo/_semantic_meta.tsx | import React from 'react';
import { Avatar, Card } from 'antd';
import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview';
import useLocale from '../../../.dumi/hooks/useLocale';
const { Meta } = Card;
const locales = {
cn: {
root: '设置元信息根元素',
section: '设置元信息内容元素',
avatar: '设置元信息图标',
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/border-less.tsx | components/card/demo/border-less.tsx | import React from 'react';
import { Card } from 'antd';
const App: React.FC = () => (
<Card title="Card title" variant="borderless" style={{ width: 300 }}>
<p>Card content</p>
<p>Card content</p>
<p>Card content</p>
</Card>
);
export default App;
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/component-token.tsx | components/card/demo/component-token.tsx | import React from 'react';
import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons';
import { Card, ConfigProvider } from 'antd';
export default () => (
<ConfigProvider
theme={{
components: {
Card: {
headerBg: '#e6f4ff',
bodyPaddingSM: 22,
he... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/basic.tsx | components/card/demo/basic.tsx | import React from 'react';
import { Card, Space } from 'antd';
const App: React.FC = () => (
<Space vertical size={16}>
<Card title="Default size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
<p>Card content</p>
<p>Card content</p>
<p>Card content</p>
</Card>
<Card size="sm... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/card/demo/flexible-content.tsx | components/card/demo/flexible-content.tsx | import React from 'react';
import { Card } from 'antd';
const { Meta } = Card;
const App: React.FC = () => (
<Card
hoverable
style={{ width: 240 }}
cover={
<img
draggable={false}
alt="example"
src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png"
/>
}
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.