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/_util/ContextIsolator.tsx | components/_util/ContextIsolator.tsx | import React from 'react';
import { NoFormStyle } from '../form/context';
import { NoCompactStyle } from '../space/Compact';
import isNonNullable from './isNonNullable';
const ContextIsolator: React.FC<
Readonly<React.PropsWithChildren<Partial<Record<'space' | 'form', boolean>>>>
> = (props) => {
const { space, 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/_util/motion.ts | components/_util/motion.ts | import type {
CSSMotionProps,
MotionEndEventHandler,
MotionEventHandler,
} from '@rc-component/motion';
import type { MotionEvent } from '@rc-component/motion/lib/interface';
import { defaultPrefixCls } from '../config-provider';
// ================== Collapse Motion ==================
const getCollapsedHeight:... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/type.ts | components/_util/type.ts | import type React from 'react';
export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
/** https://github.com/Microsoft/TypeScript/issues/29729 */
export type LiteralUnion<T, U extends Primitive = string> = T | (U & Record<never, never>);
export type AnyObject = Record<PropertyKey, a... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/throttleByAnimationFrame.ts | components/_util/throttleByAnimationFrame.ts | import raf from '@rc-component/util/lib/raf';
function throttleByAnimationFrame<T extends any[]>(fn: (...args: T) => void) {
let requestId: number | null = null;
const later = (args: T) => () => {
requestId = null;
fn(...args);
};
const throttled = (...args: T) => {
if (requestId === null) {
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/isPrimitive.ts | components/_util/isPrimitive.ts | const isPrimitive = (value: unknown) =>
(typeof value !== 'object' && typeof value !== 'function') || value === null;
export default isPrimitive;
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/scrollTo.ts | components/_util/scrollTo.ts | import raf from '@rc-component/util/lib/raf';
import { easeInOutCubic } from './easings';
import getScroll, { isWindow } from './getScroll';
interface ScrollToOptions {
/** Scroll container, default as window */
getContainer?: () => HTMLElement | Window | Document;
/** Scroll end callback */
callback?: () => ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/responsiveObserver.ts | components/_util/responsiveObserver.ts | import React from 'react';
import type { GlobalToken } from '../theme/internal';
import { useToken } from '../theme/internal';
export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
export type BreakpointMap = Record<Breakpoint, string>;
export type ScreenMap = Partial<Record<Breakpoint, boolean>>;
export... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/gapSize.ts | components/_util/gapSize.ts | import type { SizeType } from '../config-provider/SizeContext';
export function isPresetSize(size?: SizeType | string | number): size is SizeType {
return ['small', 'middle', 'large'].includes(size as string);
}
export function isValidGapNumber(size?: SizeType | string | number): size is number {
if (!size) {
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/capitalize.ts | components/_util/capitalize.ts | export default function capitalize<T extends string>(str: T): Capitalize<T> {
if (typeof str !== 'string') {
return str;
}
const ret = str.charAt(0).toUpperCase() + str.slice(1);
return ret as Capitalize<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/_util/isNonNullable.ts | components/_util/isNonNullable.ts | // \b([A-Za-z_$][\w$]*)\s*!==\s*(?:undefined\s*&&\s*\1\s*!==\s*null|null\s*&&\s*\1\s*!==\s*undefined)\b
// \b([A-Za-z_$][\w$\.]*)\s*===\s*(?:undefined|null)\s*\|\|\s*\1\s*===\s*(?:undefined|null)\b
const isNonNullable = <T>(val: T): val is NonNullable<T> => {
return val !== undefined && val !== null;
};
export defau... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/copy.ts | components/_util/copy.ts | import warning from './warning';
const execCopy = (text: string, isHtmlFormat: boolean) => {
let copySuccess = false;
const onCopy = (event: ClipboardEvent) => {
event.stopPropagation();
event.preventDefault();
event.clipboardData?.clearData();
event.clipboardData?.setData('text/plain', text);
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/easings.ts | components/_util/easings.ts | export function easeInOutCubic(t: number, b: number, c: number, d: number) {
const cc = c - b;
t /= d / 2;
if (t < 1) {
return (cc / 2) * t * t * t + b;
}
// biome-ignore lint: it is a common easing function
return (cc / 2) * ((t -= 2) * t * t + 2) + 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/_util/placements.ts | components/_util/placements.ts | import type { AlignType, BuildInPlacements } from '@rc-component/trigger';
import { getArrowOffsetToken } from '../style/placementArrow';
export interface AdjustOverflow {
adjustX?: 0 | 1;
adjustY?: 0 | 1;
}
export interface PlacementsConfig {
arrowWidth: number;
arrowPointAtCenter?: boolean;
autoAdjustOve... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/extendsObject.ts | components/_util/extendsObject.ts | // copied https://github.com/ant-design/ant-design-mobile/blob/d3b3bae/src/utils/with-default-props.tsx
function mergeProps<A, B>(a: A, b: B): B & A;
function mergeProps<A, B, C>(a: A, b: B, c: C): C & B & A;
function mergeProps<A, B, C, D>(a: A, b: B, c: C, d: D): D & C & B & A;
function mergeProps(...items: any[]) {
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/transKeys.ts | components/_util/transKeys.ts | import type { TransferKey } from '../transfer/interface';
export const groupKeysMap = (keys: TransferKey[]) => {
const map = new Map<TransferKey, number>();
keys.forEach((key, index) => {
map.set(key, index);
});
return map;
};
export const groupDisabledKeysMap = <RecordType extends any[]>(dataSource: Rec... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/colors.ts | components/_util/colors.ts | import type { PresetColorKey } from '../theme/interface';
import { PresetColors } from '../theme/interface';
type InverseColor = `${PresetColorKey}-inverse`;
const inverseColors = PresetColors.map<InverseColor>((color) => `${color}-inverse`);
export const PresetStatusColors = ['success', 'processing', 'error', 'defau... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/reactNode.ts | components/_util/reactNode.ts | import React from 'react';
import type { AnyObject } from './type';
export function isFragment(child: any): boolean {
return child && React.isValidElement(child) && child.type === React.Fragment;
}
type RenderProps = AnyObject | ((originProps: AnyObject) => AnyObject | undefined);
export const replaceElement = <P... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/getReactMajorVersionCanDelMe.ts | components/_util/getReactMajorVersionCanDelMe.ts | // ZombieJ: This is only warn for React 17 not support.
// But Jest mock React 17 will cause many issues in testing,
// Can be safe to remove in next major version.
import { version } from 'react';
export default function getReactMajorVersion() {
const majorVersion = Number.parseInt(version.split('.')[0], 10);
re... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/getScroll.ts | components/_util/getScroll.ts | import isNonNullable from './isNonNullable';
export function isWindow(obj: any): obj is Window {
return isNonNullable(obj) && obj === obj.window;
}
const getScroll = (target: HTMLElement | Window | Document | null): number => {
if (typeof window === 'undefined') {
/* istanbul ignore next */
return 0;
}
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/getRenderPropValue.ts | components/_util/getRenderPropValue.ts | import type * as React from 'react';
export type RenderFunction = () => React.ReactNode;
export const getRenderPropValue = (
propValue?: React.ReactNode | RenderFunction,
): React.ReactNode => {
if (!propValue) {
return null;
}
return typeof propValue === 'function' ? propValue() : propValue;
};
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/ActionButton.tsx | components/_util/ActionButton.tsx | import * as React from 'react';
import useState from '@rc-component/util/lib/hooks/useState';
import Button from '../button/Button';
import type { ButtonProps, LegacyButtonType } from '../button/Button';
import { convertLegacyProps } from '../button/buttonHelpers';
export interface ActionButtonProps {
type?: Legacy... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/zindexContext.ts | components/_util/zindexContext.ts | import React from 'react';
const zIndexContext = React.createContext<number | undefined>(undefined);
if (process.env.NODE_ENV !== 'production') {
zIndexContext.displayName = 'zIndexContext';
}
export default zIndexContext;
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/convertToTooltipProps.ts | components/_util/convertToTooltipProps.ts | import type { ReactNode } from 'react';
import { isValidElement } from 'react';
import type { TooltipProps } from '../tooltip';
import isNonNullable from './isNonNullable';
const convertToTooltipProps = <P extends TooltipProps>(tooltip: P | ReactNode) => {
if (!isNonNullable(tooltip)) {
return null;
}
if (... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/aria-data-attrs.ts | components/_util/aria-data-attrs.ts | import type * as React from 'react';
export type HTMLAriaDataAttributes = React.AriaAttributes & {
[key: `data-${string}`]: unknown;
} & Pick<React.HTMLAttributes<HTMLDivElement>, 'role'>;
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/styleChecker.ts | components/_util/styleChecker.ts | import canUseDom from '@rc-component/util/lib/Dom/canUseDom';
import { isStyleSupport } from '@rc-component/util/lib/Dom/styleChecker';
export const canUseDocElement = () => canUseDom() && window.document.documentElement;
export { isStyleSupport };
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/warning.ts | components/_util/warning.ts | import * as React from 'react';
import { warning as rcWarning } from '@rc-component/util';
export function noop() {}
const { resetWarned: rcResetWarned } = rcWarning;
let deprecatedWarnList: Record<string, string[]> | null = null;
export function resetWarned() {
deprecatedWarnList = null;
rcResetWarned();
}
typ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/toList.ts | components/_util/toList.ts | import isNonNullable from './isNonNullable';
const toList = <T>(candidate: T | T[], skipEmpty = false): T[] => {
if (skipEmpty && !isNonNullable(candidate)) {
return [];
}
return Array.isArray(candidate) ? candidate : [candidate];
};
export default toList;
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/PurePanel.tsx | components/_util/PurePanel.tsx | import * as React from 'react';
import { useControlledState } from '@rc-component/util';
import ConfigProvider, { ConfigContext } from '../config-provider';
import type { AnyObject } from './type';
export function withPureRenderTheme<T extends AnyObject = AnyObject>(Component: React.FC<T>) {
return (props: 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/_util/wave/WaveEffect.tsx | components/_util/wave/WaveEffect.tsx | import * as React from 'react';
import CSSMotion from '@rc-component/motion';
import raf from '@rc-component/util/lib/raf';
import { render, unmount } from '@rc-component/util/lib/React/render';
import { composeRef } from '@rc-component/util/lib/ref';
import { clsx } from 'clsx';
import type { WaveProps } from '.';
im... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/wave/util.ts | components/_util/wave/util.ts | export function isValidWaveColor(
color: CSSStyleDeclaration[keyof CSSStyleDeclaration],
): color is string {
return (color &&
typeof color === 'string' &&
color !== '#fff' &&
color !== '#ffffff' &&
color !== 'rgb(255, 255, 255)' &&
color !== 'rgba(255, 255, 255, 1)' &&
!/rgba\((?:\d*, ){3}0... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/wave/useWave.ts | components/_util/wave/useWave.ts | import * as React from 'react';
import { useEvent } from '@rc-component/util';
import raf from '@rc-component/util/lib/raf';
import type { WaveProps } from '.';
import { ConfigContext } from '../../config-provider';
import useToken from '../../theme/useToken';
import { TARGET_CLS } from './interface';
import type { Sh... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/wave/interface.ts | components/_util/wave/interface.ts | import type { WaveProps } from '.';
import { defaultPrefixCls } from '../../config-provider';
import type { GlobalToken } from '../../theme/internal';
export const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
export type ShowWaveEffect = (
element: HTMLElement,
info: {
className: string;
token: GlobalT... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/wave/index.ts | components/_util/wave/index.ts | import React, { useContext, useRef } from 'react';
import isVisible from '@rc-component/util/lib/Dom/isVisible';
import { composeRef, getNodeRef, supportRef } from '@rc-component/util/lib/ref';
import { clsx } from 'clsx';
import type { ConfigConsumerProps } from '../../config-provider';
import { ConfigContext } 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/_util/wave/style.ts | components/_util/wave/style.ts | import { genComponentStyleHook } from '../../theme/internal';
import type { FullToken, GenerateStyle } from '../../theme/internal';
// biome-ignore lint/suspicious/noEmptyInterface: ComponentToken need to be empty by default
export interface ComponentToken {}
export interface WaveToken extends FullToken<'Wave'> {}
c... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/useMergeSemantic.ts | components/_util/hooks/useMergeSemantic.ts | import * as React from 'react';
import { clsx } from 'clsx';
import type { AnyObject, EmptyObject, ValidChar } from '../type';
export type SemanticSchema = { _default?: string } & {
[key: `${ValidChar}${string}`]: SemanticSchema;
};
export type SemanticClassNames<Name extends string> = Partial<Record<Name, 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/_util/hooks/useSyncState.ts | components/_util/hooks/useSyncState.ts | import * as React from 'react';
import { useForceUpdate } from './useForceUpdate';
type UseSyncStateProps<T> = readonly [() => T, (newValue: T) => void];
export const useSyncState = <T>(initialValue: T): UseSyncStateProps<T> => {
const ref = React.useRef<T>(initialValue);
const [, forceUpdate] = useForceUpdate()... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/useZIndex.ts | components/_util/hooks/useZIndex.ts | import React from 'react';
import useToken from '../../theme/useToken';
import { devUseWarning } from '../warning';
import zIndexContext from '../zindexContext';
export type ZIndexContainer =
| 'Modal'
| 'Drawer'
| 'Popover'
| 'Popconfirm'
| 'Tooltip'
| 'Tour'
| 'FloatButton';
export type ZIndexConsume... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/useProxyImperativeHandle.ts | components/_util/hooks/useProxyImperativeHandle.ts | // Proxy the dom ref with `{ nativeElement, otherFn }` type
// ref: https://github.com/ant-design/ant-design/discussions/45242
import { useImperativeHandle } from 'react';
import type { Ref } from 'react';
const fillProxy = (
element: HTMLElement & { _antProxy?: Record<string, any> },
handler: Record<string, any>... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/useClosable.tsx | components/_util/hooks/useClosable.tsx | import type { ReactNode } from 'react';
import React from 'react';
import CloseOutlined from '@ant-design/icons/CloseOutlined';
import type { DialogProps } from '@rc-component/dialog';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import { useLocale } from '../../locale';
import defaultLocale from '../../l... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/useOrientation.ts | components/_util/hooks/useOrientation.ts | import { useMemo } from 'react';
export type Orientation = 'horizontal' | 'vertical';
const isValidOrientation = (orientation?: Orientation) => {
return orientation === 'horizontal' || orientation === 'vertical';
};
export const useOrientation = (
orientation?: Orientation,
vertical?: boolean,
legacyDirectio... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/usePatchElement.ts | components/_util/hooks/usePatchElement.ts | import * as React from 'react';
export const usePatchElement = (): [
React.ReactElement[],
(element: React.ReactElement) => () => void,
] => {
const [elements, setElements] = React.useState<React.ReactElement[]>([]);
const patchElement = React.useCallback((element: React.ReactElement) => {
// append a new... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/useMultipleSelect.ts | components/_util/hooks/useMultipleSelect.ts | import { useCallback, useState } from 'react';
export type PrevSelectedIndex = null | number;
/**
* @title multipleSelect hooks
* @description multipleSelect by hold down shift key
*/
export const useMultipleSelect = <T, K>(getKey: (item: T, index: number, array: T[]) => K) => {
const [prevSelectedIndex, setPrev... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/useMergedMask.ts | components/_util/hooks/useMergedMask.ts | import { useMemo } from 'react';
export interface MaskConfig {
enabled?: boolean;
blur?: boolean;
}
export type MaskType = MaskConfig | boolean;
const normalizeMaskConfig = (mask?: MaskType): MaskConfig => {
if (mask && typeof mask === 'object') {
return mask;
}
if (typeof mask === 'boolean') {
retu... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/index.ts | components/_util/hooks/index.ts | export * from './useClosable';
export * from './useForceUpdate';
export * from './useMergedMask';
export * from './useMergeSemantic';
export * from './useMultipleSelect';
export * from './useOrientation';
export * from './usePatchElement';
export * from './useProxyImperativeHandle';
export * from './useSyncState';
expo... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/hooks/useForceUpdate.ts | components/_util/hooks/useForceUpdate.ts | import React from 'react';
export const useForceUpdate = () => {
return React.useReducer((ori) => ori + 1, 0);
};
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/copy.test.ts | components/_util/__tests__/copy.test.ts | import { fireEvent } from '../../../tests/utils';
import copy from '../copy';
describe('Test copy', () => {
beforeEach(() => {
Object.defineProperty(global, 'navigator', {
value: {
clipboard: {
writeText: jest.fn(),
write: jest.fn(),
},
},
configurable: 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/_util/__tests__/warning.test.tsx | components/_util/__tests__/warning.test.tsx | import React from 'react';
import { render } from '@testing-library/react';
import { devUseWarning as useWarning } from '../warning';
describe('Test warning', () => {
let spy: jest.SpyInstance;
beforeAll(() => {
spy = jest.spyOn(console, 'error').mockImplementation(() => {});
});
beforeEach(() => {
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/useMergeSemantic.test.tsx | components/_util/__tests__/useMergeSemantic.test.tsx | import { renderHook } from '@testing-library/react';
import { mergeClassNames, useMergeSemantic } from '../hooks';
const mockSchema = {
_default: 'root',
container: {
_default: 'container-root',
header: {
_default: 'header-root',
},
},
};
describe('useMergeSemantic', () => {
it('mergeClassN... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/easings.test.ts | components/_util/__tests__/easings.test.ts | import { easeInOutCubic } from '../easings';
describe('Test easings', () => {
it('easeInOutCubic return value', () => {
const nums: number[] = [];
for (let index = 0; index < 5; index++) {
nums.push(easeInOutCubic(index, 1, 5, 4));
}
expect(nums).toEqual([1, 1.25, 3, 4.75, 5]);
});
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/type.test.tsx | components/_util/__tests__/type.test.tsx | import * as React from 'react';
import type { GetProp, GetProps, GetRef } from '../type';
describe('type', () => {
class CC extends React.Component<{ bamboo?: number }> {
render() {
return this.props.bamboo;
}
}
interface TestRef {
nativeElement: HTMLDivElement;
}
const RefFC = React.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/_util/__tests__/reactNode.test.tsx | components/_util/__tests__/reactNode.test.tsx | import React from 'react';
import { cloneElement, isFragment, replaceElement } from '../reactNode';
describe('reactNode test', () => {
it('isFragment', () => {
expect(isFragment(<p>test</p>)).toBe(false);
expect(isFragment(<>test</>)).toBe(true);
});
it('replaceElement', () => {
const node = <p>test... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/util.test.tsx | components/_util/__tests__/util.test.tsx | import { waitFakeTimer } from '../../../tests/utils';
import { isStyleSupport } from '../styleChecker';
import throttleByAnimationFrame from '../throttleByAnimationFrame';
import toList from '../toList';
describe('Test utils function', () => {
describe('throttle', () => {
beforeAll(() => {
jest.useFakeTime... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/wave.test.tsx | components/_util/__tests__/wave.test.tsx | import React from 'react';
import { clsx } from 'clsx';
import mountTest from '../../../tests/shared/mountTest';
import { act, fireEvent, getByText, render, waitFakeTimer } from '../../../tests/utils';
import Checkbox from '../../checkbox';
import Wave from '../wave';
import { TARGET_CLS } from '../wave/interface';
(... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/responsiveObserve.test.tsx | components/_util/__tests__/responsiveObserve.test.tsx | import React from 'react';
import { render } from '../../../tests/utils';
import useResponsiveObserver from '../responsiveObserver';
describe('Test ResponsiveObserve', () => {
it('test ResponsiveObserve subscribe and unsubscribe', () => {
let responsiveRef: any = null;
const Demo: React.FC = () => {
c... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/ContextIsolator.test.tsx | components/_util/__tests__/ContextIsolator.test.tsx | import React from 'react';
import { render } from '../../../tests/utils';
import ContextIsolator from '../ContextIsolator';
describe('ContextIsolator component', () => {
it('ContextIsolator should work when Children is null', () => {
[undefined, null].forEach((item) => {
expect(() => {
render(<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/_util/__tests__/hooks.test.tsx | components/_util/__tests__/hooks.test.tsx | import React, { useEffect } from 'react';
import { CloseOutlined } from '@ant-design/icons';
import { render, renderHook } from '@testing-library/react';
import { computeClosable, useClosable, useOrientation } from '../hooks';
import type { ClosableType, Orientation } from '../hooks';
describe('hooks test', () => {
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/wave-util.test.tsx | components/_util/__tests__/wave-util.test.tsx | import { getTargetWaveColor, isValidWaveColor } from '../wave/util';
describe('wave util', () => {
describe('isValidWaveColor', () => {
it('should return false for transparent colors', () => {
expect(isValidWaveColor('transparent')).toBe(false);
expect(isValidWaveColor('rgba(0, 0, 0, 0)')).toBe(false... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/useSyncState.test.tsx | components/_util/__tests__/useSyncState.test.tsx | import React from 'react';
import { fireEvent, render } from '../../../tests/utils';
import { useSyncState } from '../hooks';
describe('Table', () => {
it('useSyncState', () => {
const Test = () => {
const [getVal, setVal] = useSyncState('light');
return <span onClick={() => setVal('bamboo')}>{getVa... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/capitalize.test.ts | components/_util/__tests__/capitalize.test.ts | import capitalize from '../capitalize';
describe('capitalize', () => {
it('should capitalize the first character of a string', () => {
expect(capitalize('antd')).toBe('Antd');
expect(capitalize('Antd')).toBe('Antd');
expect(capitalize(' antd')).toBe(' antd');
expect(capitalize('')).toBe('');
});
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/getScroll.test.ts | components/_util/__tests__/getScroll.test.ts | import getScroll from '../getScroll';
describe('getScroll', () => {
it('getScroll target null', () => {
expect(getScroll(null)).toBe(0);
});
it('getScroll window', () => {
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
window.pageXOffset = x;
window.pageYOf... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/scrollTo.test.ts | components/_util/__tests__/scrollTo.test.ts | import { waitFakeTimer } from '../../../tests/utils';
import scrollTo from '../scrollTo';
describe('Test ScrollTo function', () => {
const dateNowMock = jest.spyOn(Date, 'now');
beforeAll(() => {
jest.useFakeTimers();
});
beforeEach(() => {
dateNowMock.mockReturnValueOnce(0).mockReturnValueOnce(1000)... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/isPrimitive.test.ts | components/_util/__tests__/isPrimitive.test.ts | /* eslint-disable unicorn/new-for-builtins */
/* eslint-disable no-new-wrappers */
import isPrimitive from '../isPrimitive';
describe('isPrimitive', () => {
it('should return true for primitive types', () => {
expect(isPrimitive('string')).toBe(true);
expect(isPrimitive('')).toBe(true);
expect(isPrimitiv... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/_util/__tests__/useZIndex.test.tsx | components/_util/__tests__/useZIndex.test.tsx | import type { PropsWithChildren } from 'react';
import React, { useEffect } from 'react';
import { render } from '@testing-library/react';
import { waitFakeTimer } from '../../../tests/utils';
import type { ImageProps, MenuProps } from '../../index';
import {
App,
AutoComplete,
Cascader,
ColorPicker,
DatePic... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/serverError.tsx | components/result/serverError.tsx | import * as React from 'react';
const ServerError: React.FC = () => (
<svg width="254" height="294">
<title>Server Error</title>
<g fill="none" fillRule="evenodd">
<path
fill="#E4EBF7"
d="M0 128.1v-2C0 56.5 56.3.2 125.7.2h2.1C197.2.3 253.5 56.6 253.5 126v2.1c0 69.5-56.3 125.7-125.7 125.... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/index.tsx | components/result/index.tsx | import * as React from 'react';
import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled';
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
import WarningFilled from '@ant-design/icons/WarningFilled';
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/result/unauthorized.tsx | components/result/unauthorized.tsx | import * as React from 'react';
const Unauthorized: React.FC = () => (
<svg width="251" height="294">
<title>Unauthorized</title>
<g fill="none" fillRule="evenodd">
<path
fill="#E4EBF7"
d="M0 129v-2C0 58.3 55.6 2.7 124.2 2.7h2c68.6 0 124.2 55.6 124.2 124.1v2.1c0 68.6-55.6 124.2-124.1 12... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/noFound.tsx | components/result/noFound.tsx | import * as React from 'react';
const NoFound: React.FC = () => (
<svg width="252" height="294">
<title>No Found</title>
<g fill="none" fillRule="evenodd">
<circle cx="126.75" cy="128.1" r="126" fill="#E4EBF7" />
<circle cx="31.55" cy="130.8" r="8.3" fill="#FFF" />
<path stroke="#FFF" d="m3... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/style/index.ts | components/result/style/index.ts | import type { CSSProperties } from 'react';
import type { CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
export interface Compon... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/__tests__/a11y.test.ts | components/result/__tests__/a11y.test.ts | import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
accessibilityDemoTest('result');
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/__tests__/index.test.tsx | components/result/__tests__/index.test.tsx | import React from 'react';
import Result from '..';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
import { render } from '../../../tests/utils';
import Button from '../../button';
describe('Result', () => {
mountTest(Result);
rtlTest(Result);
it('... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/__tests__/type.test.tsx | components/result/__tests__/type.test.tsx | import * as React from 'react';
import Result from '..';
describe('Result.typescript', () => {
it('status', () => {
const result = (
<>
<Result status="404" title="404" subTitle="Sorry, the page you visited does not exist." />
<Result status={404} title="404" subTitle="Sorry, the page you ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/__tests__/image.test.ts | components/result/__tests__/image.test.ts | import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Result image', () => {
imageDemoTest('result');
});
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/__tests__/demo.test.ts | components/result/__tests__/demo.test.ts | import demoTest from '../../../tests/shared/demoTest';
demoTest('result');
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/__tests__/demo-extend.test.ts | components/result/__tests__/demo-extend.test.ts | import { extendTest } from '../../../tests/shared/demoTest';
extendTest('result');
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/__tests__/semantic.test.tsx | components/result/__tests__/semantic.test.tsx | import React from 'react';
import type { ResultProps } from '..';
import Result from '..';
import { render } from '../../../tests/utils';
describe('Result.Semantic', () => {
it('should apply custom styles to Result', () => {
const customClassNames: ResultProps['classNames'] = {
root: 'custom-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/result/demo/_semantic.tsx | components/result/demo/_semantic.tsx | import React from 'react';
import { Button, Result } from 'antd';
import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview';
import useLocale from '../../../.dumi/hooks/useLocale';
const locales = {
cn: {
root: '根元素,包含文本对齐、布局样式等基础容器样式',
title: '标题元素,包含字体大小、文字颜色、行高、对齐方式等文字样式',
subTitle: '... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/demo/customIcon.tsx | components/result/demo/customIcon.tsx | import React from 'react';
import { SmileOutlined } from '@ant-design/icons';
import { Button, Result } from 'antd';
const App: React.FC = () => (
<Result
icon={<SmileOutlined />}
title="Great, we have done all the operations!"
extra={<Button type="primary">Next</Button>}
/>
);
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/result/demo/403.tsx | components/result/demo/403.tsx | import React from 'react';
import { Button, Result } from 'antd';
const App: React.FC = () => (
<Result
status="403"
title="403"
subTitle="Sorry, you are not authorized to access this page."
extra={<Button type="primary">Back Home</Button>}
/>
);
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/result/demo/info.tsx | components/result/demo/info.tsx | import React from 'react';
import { Button, Result } from 'antd';
const App: React.FC = () => (
<Result
title="Your operation has been executed"
extra={
<Button type="primary" key="console">
Go Console
</Button>
}
/>
);
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/result/demo/500.tsx | components/result/demo/500.tsx | import React from 'react';
import { Button, Result } from 'antd';
const App: React.FC = () => (
<Result
status="500"
title="500"
subTitle="Sorry, something went wrong."
extra={<Button type="primary">Back Home</Button>}
/>
);
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/result/demo/404.tsx | components/result/demo/404.tsx | import React from 'react';
import { Button, Result } from 'antd';
const App: React.FC = () => (
<Result
status="404"
title="404"
subTitle="Sorry, the page you visited does not exist."
extra={<Button type="primary">Back Home</Button>}
/>
);
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/result/demo/warning.tsx | components/result/demo/warning.tsx | import React from 'react';
import { Button, Result } from 'antd';
const App: React.FC = () => (
<Result
status="warning"
title="There are some problems with your operation."
extra={
<Button type="primary" key="console">
Go Console
</Button>
}
/>
);
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/result/demo/error.tsx | components/result/demo/error.tsx | import React from 'react';
import { CloseCircleOutlined } from '@ant-design/icons';
import { Button, Result, Typography } from 'antd';
const { Paragraph, Text } = Typography;
const App: React.FC = () => (
<Result
status="error"
title="Submission Failed"
subTitle="Please check and modify the following in... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/demo/component-token.tsx | components/result/demo/component-token.tsx | import React from 'react';
import { Button, ConfigProvider, Result } from 'antd';
const App: React.FC = () => (
<ConfigProvider
theme={{
components: {
Result: {
titleFontSize: 18,
subtitleFontSize: 14,
iconFontSize: 48,
extraMargin: `12px 0 0 0`,
},
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/result/demo/success.tsx | components/result/demo/success.tsx | import React from 'react';
import { Button, Result } from 'antd';
const App: React.FC = () => (
<Result
status="success"
title="Successfully Purchased Cloud Server ECS!"
subTitle="Order number: 2017182818828182881 Cloud server configuration takes 1-5 minutes, please wait."
extra={[
<Button 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/result/demo/style-class.tsx | components/result/demo/style-class.tsx | import React from 'react';
import { Button, Result } from 'antd';
import type { ResultProps } from 'antd';
const classNamesObject: ResultProps['classNames'] = {
root: 'demo-result-root',
title: 'demo-result-title',
subTitle: 'demo-result-subtitle',
icon: 'demo-result-icon',
extra: 'demo-result-extra',
body... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/__tests__/index.test.ts | components/__tests__/index.test.ts | const OLD_NODE_ENV = process.env.NODE_ENV;
process.env.NODE_ENV = 'development';
const antd = require('..');
describe('antd', () => {
afterAll(() => {
process.env.NODE_ENV = OLD_NODE_ENV;
});
it('exports modules correctly', () => {
expect(Object.keys(antd)).toMatchSnapshot();
});
it('unstableSetRen... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/__tests__/blog.test.ts | components/__tests__/blog.test.ts | const fs = require('fs');
const path = require('path');
const blogList = [
'check-conduct',
'contributor-development-maintenance-guide',
'css-in-js',
'extract-ssr',
'getContainer',
'github-actions-workflow',
'issue-helper',
'mock-project-build',
'modal-hook-order',
'testing-migrate',
'render-tim... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/__tests__/17.test.ts | components/__tests__/17.test.ts | jest.mock('../_util/getReactMajorVersionCanDelMe', () => {
return () => 17;
});
describe('antd legacy', () => {
it('should warn when React version is below 18', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
require('..');
expect(errorSpy).toHaveBeenCalledWith(
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/__tests__/setup.test.tsx | components/__tests__/setup.test.tsx | import * as React from 'react';
import { render } from '../../tests/utils';
describe('SetUp.Test', () => {
it('diff of React 18 & React 17', () => {
const { container } = render(
<>
<div>{['bamboo', '', 'little']}</div>
<div>{['', '']}</div>
</>,
);
expect(container.childNode... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/__tests__/node.test.tsx | components/__tests__/node.test.tsx | import * as React from 'react';
import { globSync } from 'glob';
import { renderToString } from 'react-dom/server';
import type { Options } from '../../tests/shared/demoTest';
(global as any).testConfig = {};
jest.mock('../../tests/shared/demoTest', () => {
function fakeDemoTest(name: string, option: Options = {})... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/upload/utils.ts | components/upload/utils.ts | import type { InternalUploadFile, RcFile, UploadFile } from './interface';
export function file2Obj(file: RcFile): InternalUploadFile {
return {
...file,
lastModified: file.lastModified,
lastModifiedDate: file.lastModifiedDate,
name: file.name,
size: file.size,
type: file.type,
uid: file.... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/upload/interface.ts | components/upload/interface.ts | import type * as React from 'react';
import type {
AcceptConfig,
RcFile as OriRcFile,
UploadRequestOption as RcCustomRequestOptions,
UploadProps as RcUploadProps,
} from '@rc-component/upload/lib/interface';
import type {
SemanticClassNames,
SemanticClassNamesType,
SemanticStyles,
SemanticStylesType,
}... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/upload/index.tsx | components/upload/index.tsx | import Dragger from './Dragger';
import type { UploadProps } from './Upload';
import InternalUpload, { LIST_IGNORE } from './Upload';
export type { DraggerProps } from './Dragger';
export type {
RcFile,
UploadChangeParam,
UploadFile,
UploadListProps,
UploadProps,
} from './interface';
type InternalUploadTyp... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/upload/Dragger.tsx | components/upload/Dragger.tsx | import * as React from 'react';
import type { UploadProps } from './interface';
import type { UploadRef } from './Upload';
import Upload from './Upload';
export type DraggerProps<T = any> = UploadProps<T> & { height?: number };
const Dragger = React.forwardRef<UploadRef, DraggerProps<any>>((props, ref) => {
const ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/upload/Upload.tsx | components/upload/Upload.tsx | import * as React from 'react';
import { flushSync } from 'react-dom';
import type { UploadProps as RcUploadProps } from '@rc-component/upload';
import RcUpload from '@rc-component/upload';
import { useControlledState } from '@rc-component/util';
import { clsx } from 'clsx';
import { useMergeSemantic } 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/upload/UploadList/index.tsx | components/upload/UploadList/index.tsx | import * as React from 'react';
import FileTwoTone from '@ant-design/icons/FileTwoTone';
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
import PaperClipOutlined from '@ant-design/icons/PaperClipOutlined';
import PictureTwoTone from '@ant-design/icons/PictureTwoTone';
import type { CSSMotionListProps }... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/upload/UploadList/ListItem.tsx | components/upload/UploadList/ListItem.tsx | import * as React from 'react';
import DeleteOutlined from '@ant-design/icons/DeleteOutlined';
import DownloadOutlined from '@ant-design/icons/DownloadOutlined';
import EyeOutlined from '@ant-design/icons/EyeOutlined';
import CSSMotion from '@rc-component/motion';
import { clsx } from 'clsx';
import type { SemanticCla... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/upload/style/rtl.ts | components/upload/style/rtl.ts | import type { UploadToken } from '.';
import type { GenerateStyle } from '../../theme/internal';
// =========================== Motion ===========================
const genRtlStyle: GenerateStyle<UploadToken> = (token) => {
const { componentCls } = token;
return {
[`${componentCls}-rtl`]: {
direction: '... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/upload/style/picture.ts | components/upload/style/picture.ts | import { blue } from '@ant-design/colors';
import { unit } from '@ant-design/cssinjs';
import type { UploadToken } from '.';
import { clearFix, textEllipsis } from '../../style';
import type { GenerateStyle } from '../../theme/internal';
const genPictureStyle: GenerateStyle<UploadToken> = (token) => {
const { compo... | 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.