UNPKG

2.13 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { OverridableComponent, OverrideProps } from '../OverridableComponent';
4import { Theme } from '../styles';
5import { StepClasses } from './stepClasses';
6
7export interface StepOwnProps {
8 /**
9 * Sets the step as active. Is passed to child components.
10 */
11 active?: boolean;
12 /**
13 * Should be `Step` sub-components such as `StepLabel`, `StepContent`.
14 */
15 children?: React.ReactNode;
16 /**
17 * Override or extend the styles applied to the component.
18 */
19 classes?: Partial<StepClasses>;
20 /**
21 * Mark the step as completed. Is passed to child components.
22 */
23 completed?: boolean;
24 /**
25 * If `true`, the step is disabled, will also disable the button if
26 * `StepButton` is a child of `Step`. Is passed to child components.
27 */
28 disabled?: boolean;
29 /**
30 * Expand the step.
31 * @default false
32 */
33 expanded?: boolean;
34 /**
35 * The position of the step.
36 * The prop defaults to the value inherited from the parent Stepper component.
37 */
38 index?: number;
39 /**
40 * If `true`, the Step is displayed as rendered last.
41 * The prop defaults to the value inherited from the parent Stepper component.
42 */
43 last?: boolean;
44 /**
45 * The system prop that allows defining system overrides as well as additional CSS styles.
46 */
47 sx?: SxProps<Theme>;
48}
49
50export interface StepTypeMap<
51 AdditionalProps = {},
52 RootComponent extends React.ElementType = 'div',
53> {
54 props: AdditionalProps & StepOwnProps;
55 defaultComponent: RootComponent;
56}
57
58export type StepProps<
59 RootComponent extends React.ElementType = StepTypeMap['defaultComponent'],
60 AdditionalProps = { component?: React.ElementType },
61> = OverrideProps<StepTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
62 component?: React.ElementType;
63};
64
65export type StepClasskey = keyof NonNullable<StepProps['classes']>;
66
67/**
68 *
69 * Demos:
70 *
71 * - [Stepper](https://mui.com/material-ui/react-stepper/)
72 *
73 * API:
74 *
75 * - [Step API](https://mui.com/material-ui/api/step/)
76 */
77declare const Step: OverridableComponent<StepTypeMap>;
78
79export default Step;