UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

72 lines (71 loc) 2.97 kB
import * as React from 'react'; import type { StepsProps as RcStepsProps } from '@rc-component/steps/lib/Steps'; import type { SemanticClassNamesType, SemanticStylesType } from '../_util/hooks'; import type { GetProp } from '../_util/type'; type RcIconRenderTypeInfo = Parameters<NonNullable<RcStepsProps['iconRender']>>[1]; export type IconRenderType = (oriNode: React.ReactNode, info: Pick<RcIconRenderTypeInfo, 'index' | 'active' | 'item' | 'components'>) => React.ReactNode; export type StepsSemanticName = 'root' | 'item' | 'itemWrapper' | 'itemIcon' | 'itemSection' | 'itemHeader' | 'itemTitle' | 'itemSubtitle' | 'itemContent' | 'itemRail'; export type StepsClassNamesType = SemanticClassNamesType<StepsProps, StepsSemanticName>; export type StepsStylesType = SemanticStylesType<StepsProps, StepsSemanticName>; interface StepItem { className?: string; style?: React.CSSProperties; classNames?: GetProp<RcStepsProps, 'items'>[number]['classNames']; styles?: GetProp<RcStepsProps, 'items'>[number]['styles']; /** @deprecated Please use `content` instead */ description?: React.ReactNode; content?: React.ReactNode; icon?: React.ReactNode; onClick?: React.MouseEventHandler<HTMLElement>; status?: 'wait' | 'process' | 'finish' | 'error'; disabled?: boolean; title?: React.ReactNode; subTitle?: React.ReactNode; } export type ProgressDotRender = (iconDot: React.ReactNode, info: { index: number; status: NonNullable<RcStepsProps['status']>; title: React.ReactNode; /** @deprecated Please use `content` instead. */ description: React.ReactNode; content: React.ReactNode; }) => React.ReactNode; export interface BaseStepsProps { className?: string; rootClassName?: string; classNames?: StepsClassNamesType; styles?: StepsStylesType; variant?: 'filled' | 'outlined'; size?: 'default' | 'small'; type?: 'default' | 'navigation' | 'inline' | 'panel' | 'dot'; /** @deprecated Please use `orientation` instead. */ direction?: 'horizontal' | 'vertical'; orientation?: 'horizontal' | 'vertical'; /** @deprecated Please use `titlePlacement` instead. */ labelPlacement?: 'horizontal' | 'vertical'; titlePlacement?: 'horizontal' | 'vertical'; /** @deprecated Please use `type` and `iconRender` instead. */ progressDot?: boolean | ProgressDotRender; responsive?: boolean; ellipsis?: boolean; /** * Set offset cell, only work when `type` is `inline`. */ offset?: number; current?: number; initial?: number; items?: StepItem[]; percent?: number; status?: 'wait' | 'process' | 'finish' | 'error'; iconRender?: IconRenderType; onChange?: (current: number) => void; } export interface StepsProps extends BaseStepsProps { prefixCls?: string; style?: React.CSSProperties; } declare const Steps: { (props: StepsProps): React.JSX.Element; displayName: string; }; export default Steps;