UNPKG

1.94 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
4import { OverrideProps } from '../OverridableComponent';
5import { Theme } from '../styles';
6import { StepButtonClasses } from './stepButtonClasses';
7
8/**
9 * @deprecated use `StepButtonProps['icon']` instead.
10 */
11export type StepButtonIcon = React.ReactNode;
12
13export interface StepButtonOwnProps {
14 /**
15 * Can be a `StepLabel` or a node to place inside `StepLabel` as children.
16 */
17 children?: React.ReactNode;
18 /**
19 * Override or extend the styles applied to the component.
20 */
21 classes?: Partial<StepButtonClasses>;
22 /**
23 * The icon displayed by the step label.
24 */
25 icon?: React.ReactNode;
26 /**
27 * The optional node to display.
28 */
29 optional?: React.ReactNode;
30 /**
31 * The system prop that allows defining system overrides as well as additional CSS styles.
32 */
33 sx?: SxProps<Theme>;
34}
35
36export type StepButtonTypeMap<
37 AdditionalProps,
38 RootComponent extends React.ElementType,
39> = ExtendButtonBaseTypeMap<{
40 props: AdditionalProps & StepButtonOwnProps;
41 defaultComponent: RootComponent;
42
43 ignoredProps: 'disabled';
44}>;
45
46/**
47 *
48 * Demos:
49 *
50 * - [Stepper](https://mui.com/material-ui/react-stepper/)
51 *
52 * API:
53 *
54 * - [StepButton API](https://mui.com/material-ui/api/step-button/)
55 * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
56 */
57declare const StepButton: ExtendButtonBase<
58 StepButtonTypeMap<{}, ButtonBaseTypeMap['defaultComponent']>
59>;
60
61export type StepButtonClasskey = keyof NonNullable<StepButtonProps['classes']>;
62
63export type StepButtonProps<
64 RootComponent extends React.ElementType = ButtonBaseTypeMap['defaultComponent'],
65 AdditionalProps = {},
66> = OverrideProps<StepButtonTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
67 component?: React.ElementType;
68};
69
70export default StepButton;