@mui/material 5.14.7 → 5.14.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +2 -2
- package/AccordionSummary/AccordionSummary.d.ts +22 -20
- package/AlertTitle/AlertTitle.d.ts +1 -0
- package/AppBar/AppBar.d.ts +33 -31
- package/Avatar/Avatar.d.ts +49 -50
- package/Backdrop/Backdrop.d.ts +87 -85
- package/Badge/Badge.d.ts +2 -2
- package/BottomNavigation/BottomNavigation.d.ts +35 -33
- package/BottomNavigationAction/BottomNavigationAction.d.ts +39 -37
- package/Breadcrumbs/Breadcrumbs.d.ts +70 -67
- package/Button/Button.d.ts +72 -73
- package/Button/Button.js +4 -1
- package/ButtonBase/ButtonBase.d.ts +83 -81
- package/ButtonGroup/ButtonGroup.d.ts +72 -70
- package/ButtonGroup/ButtonGroup.js +86 -54
- package/ButtonGroup/ButtonGroupButtonContext.d.ts +6 -0
- package/ButtonGroup/ButtonGroupButtonContext.js +9 -0
- package/ButtonGroup/buttonGroupClasses.d.ts +6 -0
- package/ButtonGroup/buttonGroupClasses.js +1 -1
- package/CHANGELOG.md +235 -38
- package/Card/Card.d.ts +19 -18
- package/CardActionArea/CardActionArea.d.ts +15 -13
- package/CardContent/CardContent.d.ts +18 -16
- package/CardHeader/CardHeader.d.ts +77 -67
- package/CardMedia/CardMedia.d.ts +30 -28
- package/Chip/Chip.d.ts +84 -82
- package/CircularProgress/CircularProgress.d.ts +1 -1
- package/CircularProgress/CircularProgress.js +1 -1
- package/Container/Container.d.ts +35 -33
- package/DialogContentText/DialogContentText.d.ts +14 -12
- package/DialogTitle/DialogTitle.d.ts +19 -16
- package/Divider/Divider.d.ts +49 -50
- package/Fab/Fab.d.ts +59 -56
- package/FormControl/FormControl.d.ts +74 -72
- package/FormHelperText/FormHelperText.d.ts +52 -50
- package/FormLabel/FormLabel.d.ts +7 -4
- package/Grid/Grid.d.ts +69 -68
- package/Hidden/Hidden.d.ts +10 -10
- package/Icon/Icon.d.ts +50 -48
- package/IconButton/IconButton.d.ts +52 -50
- package/ImageList/ImageList.d.ts +41 -39
- package/ImageListItem/ImageListItem.d.ts +28 -26
- package/ImageListItem/ImageListItem.js +2 -1
- package/InputAdornment/InputAdornment.d.ts +39 -37
- package/InputBase/InputBase.js +1 -1
- package/InputLabel/InputLabel.d.ts +58 -56
- package/InputLabel/InputLabel.js +2 -1
- package/Link/Link.d.ts +37 -39
- package/List/List.d.ts +34 -35
- package/ListItem/ListItem.d.ts +53 -49
- package/ListItemButton/ListItemButton.d.ts +9 -3
- package/ListSubheader/ListSubheader.d.ts +38 -36
- package/MenuItem/MenuItem.d.ts +47 -44
- package/MenuList/MenuList.d.ts +37 -35
- package/Modal/Modal.d.ts +172 -178
- package/Modal/Modal.js +1 -1
- package/PaginationItem/PaginationItem.d.ts +85 -83
- package/Paper/Paper.d.ts +2 -2
- package/README.md +9 -198
- package/Radio/Radio.js +3 -2
- package/Radio/radioClasses.d.ts +2 -0
- package/Radio/radioClasses.js +1 -1
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +25 -23
- package/Select/SelectInput.js +9 -5
- package/Skeleton/Skeleton.d.ts +42 -40
- package/Slider/Slider.d.ts +249 -247
- package/Slider/Slider.js +9 -86
- package/Stack/Stack.d.ts +39 -38
- package/Step/Step.d.ts +46 -44
- package/StepButton/StepButton.d.ts +27 -25
- package/Stepper/Stepper.d.ts +45 -44
- package/SvgIcon/SvgIcon.d.ts +77 -75
- package/SwipeableDrawer/SwipeableDrawer.js +4 -4
- package/Tab/Tab.d.ts +52 -50
- package/TabScrollButton/TabScrollButton.d.ts +3 -2
- package/Table/Table.d.ts +35 -33
- package/TableBody/TableBody.d.ts +18 -16
- package/TableContainer/TableContainer.d.ts +18 -16
- package/TableFooter/TableFooter.d.ts +18 -16
- package/TableHead/TableHead.d.ts +18 -16
- package/TablePagination/TablePagination.d.ts +113 -112
- package/TableRow/TableRow.d.ts +28 -26
- package/TableSortLabel/TableSortLabel.d.ts +40 -36
- package/Tabs/Tabs.d.ts +153 -150
- package/Tabs/Tabs.js +1 -4
- package/ToggleButton/ToggleButton.d.ts +72 -70
- package/Toolbar/Toolbar.d.ts +29 -27
- package/Typography/Typography.d.ts +2 -2
- package/index.js +1 -1
- package/legacy/Button/Button.js +4 -1
- package/legacy/ButtonGroup/ButtonGroup.js +81 -56
- package/legacy/ButtonGroup/ButtonGroupButtonContext.js +9 -0
- package/legacy/ButtonGroup/buttonGroupClasses.js +1 -1
- package/legacy/CircularProgress/CircularProgress.js +1 -1
- package/legacy/ImageListItem/ImageListItem.js +2 -1
- package/legacy/InputBase/InputBase.js +1 -1
- package/legacy/InputLabel/InputLabel.js +2 -1
- package/legacy/Modal/Modal.js +3 -1
- package/legacy/Radio/Radio.js +3 -2
- package/legacy/Radio/radioClasses.js +1 -1
- package/legacy/Select/SelectInput.js +9 -5
- package/legacy/Slider/Slider.js +9 -86
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +4 -4
- package/legacy/Tabs/Tabs.js +1 -4
- package/legacy/index.js +1 -1
- package/legacy/useTouchRipple/useTouchRipple.js +4 -4
- package/modern/Button/Button.js +4 -1
- package/modern/ButtonGroup/ButtonGroup.js +86 -54
- package/modern/ButtonGroup/ButtonGroupButtonContext.js +9 -0
- package/modern/ButtonGroup/buttonGroupClasses.js +1 -1
- package/modern/CircularProgress/CircularProgress.js +1 -1
- package/modern/ImageListItem/ImageListItem.js +2 -1
- package/modern/InputBase/InputBase.js +1 -1
- package/modern/InputLabel/InputLabel.js +2 -1
- package/modern/Modal/Modal.js +1 -1
- package/modern/Radio/Radio.js +3 -2
- package/modern/Radio/radioClasses.js +1 -1
- package/modern/Select/SelectInput.js +8 -5
- package/modern/Slider/Slider.js +9 -86
- package/modern/SwipeableDrawer/SwipeableDrawer.js +4 -4
- package/modern/Tabs/Tabs.js +1 -4
- package/modern/index.js +1 -1
- package/node/Button/Button.js +4 -1
- package/node/ButtonGroup/ButtonGroup.js +86 -54
- package/node/ButtonGroup/ButtonGroupButtonContext.js +18 -0
- package/node/ButtonGroup/buttonGroupClasses.js +1 -1
- package/node/CircularProgress/CircularProgress.js +1 -1
- package/node/ImageListItem/ImageListItem.js +2 -1
- package/node/InputBase/InputBase.js +1 -1
- package/node/InputLabel/InputLabel.js +2 -1
- package/node/Modal/Modal.js +1 -1
- package/node/Radio/Radio.js +3 -2
- package/node/Radio/radioClasses.js +1 -1
- package/node/Select/SelectInput.js +9 -5
- package/node/Slider/Slider.js +3 -73
- package/node/SwipeableDrawer/SwipeableDrawer.js +4 -4
- package/node/Tabs/Tabs.js +1 -4
- package/node/index.js +1 -1
- package/node/useTouchRipple/useTouchRipple.js +4 -4
- package/package.json +16 -16
- package/umd/material-ui.development.js +258 -254
- package/umd/material-ui.production.min.js +18 -18
- package/useTouchRipple/useTouchRipple.js +4 -4
|
@@ -12,77 +12,79 @@ export interface BreadcrumbsOwnerState extends BreadcrumbsProps {
|
|
|
12
12
|
expanded: boolean;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export interface
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
export interface BreadcrumbsOwnProps {
|
|
16
|
+
/**
|
|
17
|
+
* The content of the component.
|
|
18
|
+
*/
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Override or extend the styles applied to the component.
|
|
22
|
+
*/
|
|
23
|
+
classes?: Partial<BreadcrumbsClasses>;
|
|
24
|
+
/**
|
|
25
|
+
* The components used for each slot inside the Breadcumb.
|
|
26
|
+
* Either a string to use a HTML element or a component.
|
|
27
|
+
* @default {}
|
|
28
|
+
*/
|
|
29
|
+
slots?: {
|
|
30
|
+
CollapsedIcon?: React.ElementType;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The props used for each slot inside the Breadcumb.
|
|
34
|
+
* @default {}
|
|
35
|
+
*/
|
|
36
|
+
slotProps?: {
|
|
36
37
|
/**
|
|
37
|
-
*
|
|
38
|
+
* Props applied to the CollapsedIcon slot.
|
|
38
39
|
* @default {}
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
collapsedIcon?: SlotComponentProps<
|
|
46
|
-
typeof SvgIcon,
|
|
47
|
-
BreadcrumbsCollapsedIconSlotPropsOverrides,
|
|
48
|
-
BreadcrumbsOwnerState
|
|
49
|
-
>;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Override the default label for the expand button.
|
|
53
|
-
*
|
|
54
|
-
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
|
55
|
-
* @default 'Show path'
|
|
56
|
-
*/
|
|
57
|
-
expandText?: string;
|
|
58
|
-
/**
|
|
59
|
-
* If max items is exceeded, the number of items to show after the ellipsis.
|
|
60
|
-
* @default 1
|
|
61
|
-
*/
|
|
62
|
-
itemsAfterCollapse?: number;
|
|
63
|
-
/**
|
|
64
|
-
* If max items is exceeded, the number of items to show before the ellipsis.
|
|
65
|
-
* @default 1
|
|
66
|
-
*/
|
|
67
|
-
itemsBeforeCollapse?: number;
|
|
68
|
-
/**
|
|
69
|
-
* Specifies the maximum number of breadcrumbs to display. When there are more
|
|
70
|
-
* than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
|
|
71
|
-
* will be shown, with an ellipsis in between.
|
|
72
|
-
* @default 8
|
|
73
|
-
*/
|
|
74
|
-
maxItems?: number;
|
|
75
|
-
/**
|
|
76
|
-
* Custom separator node.
|
|
77
|
-
* @default '/'
|
|
78
|
-
*/
|
|
79
|
-
separator?: React.ReactNode;
|
|
80
|
-
/**
|
|
81
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
82
|
-
*/
|
|
83
|
-
sx?: SxProps<Theme>;
|
|
41
|
+
collapsedIcon?: SlotComponentProps<
|
|
42
|
+
typeof SvgIcon,
|
|
43
|
+
BreadcrumbsCollapsedIconSlotPropsOverrides,
|
|
44
|
+
BreadcrumbsOwnerState
|
|
45
|
+
>;
|
|
84
46
|
};
|
|
85
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Override the default label for the expand button.
|
|
49
|
+
*
|
|
50
|
+
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
|
51
|
+
* @default 'Show path'
|
|
52
|
+
*/
|
|
53
|
+
expandText?: string;
|
|
54
|
+
/**
|
|
55
|
+
* If max items is exceeded, the number of items to show after the ellipsis.
|
|
56
|
+
* @default 1
|
|
57
|
+
*/
|
|
58
|
+
itemsAfterCollapse?: number;
|
|
59
|
+
/**
|
|
60
|
+
* If max items is exceeded, the number of items to show before the ellipsis.
|
|
61
|
+
* @default 1
|
|
62
|
+
*/
|
|
63
|
+
itemsBeforeCollapse?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the maximum number of breadcrumbs to display. When there are more
|
|
66
|
+
* than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
|
|
67
|
+
* will be shown, with an ellipsis in between.
|
|
68
|
+
* @default 8
|
|
69
|
+
*/
|
|
70
|
+
maxItems?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Custom separator node.
|
|
73
|
+
* @default '/'
|
|
74
|
+
*/
|
|
75
|
+
separator?: React.ReactNode;
|
|
76
|
+
/**
|
|
77
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
78
|
+
*/
|
|
79
|
+
sx?: SxProps<Theme>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface BreadcrumbsTypeMap<
|
|
83
|
+
AdditionalProps = {},
|
|
84
|
+
RootComponent extends React.ElementType = 'nav',
|
|
85
|
+
> {
|
|
86
|
+
props: AdditionalProps & BreadcrumbsOwnProps;
|
|
87
|
+
defaultComponent: RootComponent;
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
/**
|
|
@@ -94,6 +96,7 @@ export interface BreadcrumbsTypeMap<
|
|
|
94
96
|
* API:
|
|
95
97
|
*
|
|
96
98
|
* - [Breadcrumbs API](https://mui.com/material-ui/api/breadcrumbs/)
|
|
99
|
+
* - inherits [Typography API](https://mui.com/material-ui/api/typography/)
|
|
97
100
|
*/
|
|
98
101
|
declare const Breadcrumbs: OverridableComponent<BreadcrumbsTypeMap>;
|
|
99
102
|
|
package/Button/Button.d.ts
CHANGED
|
@@ -12,82 +12,81 @@ export interface ButtonPropsColorOverrides {}
|
|
|
12
12
|
|
|
13
13
|
export interface ButtonPropsSizeOverrides {}
|
|
14
14
|
|
|
15
|
+
export interface ButtonOwnProps {
|
|
16
|
+
/**
|
|
17
|
+
* The content of the component.
|
|
18
|
+
*/
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Override or extend the styles applied to the component.
|
|
22
|
+
*/
|
|
23
|
+
classes?: Partial<ButtonClasses>;
|
|
24
|
+
/**
|
|
25
|
+
* The color of the component.
|
|
26
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
27
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
28
|
+
* @default 'primary'
|
|
29
|
+
*/
|
|
30
|
+
color?: OverridableStringUnion<
|
|
31
|
+
'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning',
|
|
32
|
+
ButtonPropsColorOverrides
|
|
33
|
+
>;
|
|
34
|
+
/**
|
|
35
|
+
* If `true`, the component is disabled.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If `true`, no elevation is used.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
disableElevation?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* If `true`, the keyboard focus ripple is disabled.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
disableFocusRipple?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Element placed after the children.
|
|
51
|
+
*/
|
|
52
|
+
endIcon?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* If `true`, the button will take up the full width of its container.
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
fullWidth?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The URL to link to when the button is clicked.
|
|
60
|
+
* If defined, an `a` element will be used as the root node.
|
|
61
|
+
*/
|
|
62
|
+
href?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The size of the component.
|
|
65
|
+
* `small` is equivalent to the dense button styling.
|
|
66
|
+
* @default 'medium'
|
|
67
|
+
*/
|
|
68
|
+
size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonPropsSizeOverrides>;
|
|
69
|
+
/**
|
|
70
|
+
* Element placed before the children.
|
|
71
|
+
*/
|
|
72
|
+
startIcon?: React.ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
75
|
+
*/
|
|
76
|
+
sx?: SxProps<Theme>;
|
|
77
|
+
/**
|
|
78
|
+
* The variant to use.
|
|
79
|
+
* @default 'text'
|
|
80
|
+
*/
|
|
81
|
+
variant?: OverridableStringUnion<'text' | 'outlined' | 'contained', ButtonPropsVariantOverrides>;
|
|
82
|
+
}
|
|
83
|
+
|
|
15
84
|
export type ButtonTypeMap<
|
|
16
85
|
AdditionalProps = {},
|
|
17
|
-
|
|
86
|
+
RootComponent extends React.ElementType = 'button',
|
|
18
87
|
> = ExtendButtonBaseTypeMap<{
|
|
19
|
-
props: AdditionalProps &
|
|
20
|
-
|
|
21
|
-
* The content of the component.
|
|
22
|
-
*/
|
|
23
|
-
children?: React.ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
* Override or extend the styles applied to the component.
|
|
26
|
-
*/
|
|
27
|
-
classes?: Partial<ButtonClasses>;
|
|
28
|
-
/**
|
|
29
|
-
* The color of the component.
|
|
30
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
|
31
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
32
|
-
* @default 'primary'
|
|
33
|
-
*/
|
|
34
|
-
color?: OverridableStringUnion<
|
|
35
|
-
'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning',
|
|
36
|
-
ButtonPropsColorOverrides
|
|
37
|
-
>;
|
|
38
|
-
/**
|
|
39
|
-
* If `true`, the component is disabled.
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
disabled?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* If `true`, no elevation is used.
|
|
45
|
-
* @default false
|
|
46
|
-
*/
|
|
47
|
-
disableElevation?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* If `true`, the keyboard focus ripple is disabled.
|
|
50
|
-
* @default false
|
|
51
|
-
*/
|
|
52
|
-
disableFocusRipple?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Element placed after the children.
|
|
55
|
-
*/
|
|
56
|
-
endIcon?: React.ReactNode;
|
|
57
|
-
/**
|
|
58
|
-
* If `true`, the button will take up the full width of its container.
|
|
59
|
-
* @default false
|
|
60
|
-
*/
|
|
61
|
-
fullWidth?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* The URL to link to when the button is clicked.
|
|
64
|
-
* If defined, an `a` element will be used as the root node.
|
|
65
|
-
*/
|
|
66
|
-
href?: string;
|
|
67
|
-
/**
|
|
68
|
-
* The size of the component.
|
|
69
|
-
* `small` is equivalent to the dense button styling.
|
|
70
|
-
* @default 'medium'
|
|
71
|
-
*/
|
|
72
|
-
size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonPropsSizeOverrides>;
|
|
73
|
-
/**
|
|
74
|
-
* Element placed before the children.
|
|
75
|
-
*/
|
|
76
|
-
startIcon?: React.ReactNode;
|
|
77
|
-
/**
|
|
78
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
79
|
-
*/
|
|
80
|
-
sx?: SxProps<Theme>;
|
|
81
|
-
/**
|
|
82
|
-
* The variant to use.
|
|
83
|
-
* @default 'text'
|
|
84
|
-
*/
|
|
85
|
-
variant?: OverridableStringUnion<
|
|
86
|
-
'text' | 'outlined' | 'contained',
|
|
87
|
-
ButtonPropsVariantOverrides
|
|
88
|
-
>;
|
|
89
|
-
};
|
|
90
|
-
defaultComponent: DefaultComponent;
|
|
88
|
+
props: AdditionalProps & ButtonOwnProps;
|
|
89
|
+
defaultComponent: RootComponent;
|
|
91
90
|
}>;
|
|
92
91
|
|
|
93
92
|
/**
|
package/Button/Button.js
CHANGED
|
@@ -15,6 +15,7 @@ import ButtonBase from '../ButtonBase';
|
|
|
15
15
|
import capitalize from '../utils/capitalize';
|
|
16
16
|
import buttonClasses, { getButtonUtilityClass } from './buttonClasses';
|
|
17
17
|
import ButtonGroupContext from '../ButtonGroup/ButtonGroupContext';
|
|
18
|
+
import ButtonGroupButtonContext from '../ButtonGroup/ButtonGroupButtonContext';
|
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
21
|
const useUtilityClasses = ownerState => {
|
|
@@ -221,6 +222,7 @@ const ButtonEndIcon = styled('span', {
|
|
|
221
222
|
const Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {
|
|
222
223
|
// props priority: `inProps` > `contextProps` > `themeDefaultProps`
|
|
223
224
|
const contextProps = React.useContext(ButtonGroupContext);
|
|
225
|
+
const buttonGroupButtonContextPositionClassName = React.useContext(ButtonGroupButtonContext);
|
|
224
226
|
const resolvedProps = resolveProps(contextProps, inProps);
|
|
225
227
|
const props = useThemeProps({
|
|
226
228
|
props: resolvedProps,
|
|
@@ -265,9 +267,10 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {
|
|
|
265
267
|
ownerState: ownerState,
|
|
266
268
|
children: endIconProp
|
|
267
269
|
});
|
|
270
|
+
const positionClassName = buttonGroupButtonContextPositionClassName || '';
|
|
268
271
|
return /*#__PURE__*/_jsxs(ButtonRoot, _extends({
|
|
269
272
|
ownerState: ownerState,
|
|
270
|
-
className: clsx(contextProps.className, classes.root, className),
|
|
273
|
+
className: clsx(contextProps.className, classes.root, className, positionClassName),
|
|
271
274
|
component: component,
|
|
272
275
|
disabled: disabled,
|
|
273
276
|
focusRipple: !disableFocusRipple,
|
|
@@ -5,90 +5,92 @@ import { TouchRippleActions, TouchRippleProps } from './TouchRipple';
|
|
|
5
5
|
import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent';
|
|
6
6
|
import { ButtonBaseClasses } from './buttonBaseClasses';
|
|
7
7
|
|
|
8
|
+
export interface ButtonBaseOwnProps {
|
|
9
|
+
/**
|
|
10
|
+
* A ref for imperative actions.
|
|
11
|
+
* It currently only supports `focusVisible()` action.
|
|
12
|
+
*/
|
|
13
|
+
action?: React.Ref<ButtonBaseActions>;
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, the ripples are centered.
|
|
16
|
+
* They won't start at the cursor interaction position.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
centerRipple?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The content of the component.
|
|
22
|
+
*/
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Override or extend the styles applied to the component.
|
|
26
|
+
*/
|
|
27
|
+
classes?: Partial<ButtonBaseClasses>;
|
|
28
|
+
/**
|
|
29
|
+
* If `true`, the component is disabled.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* If `true`, the ripple effect is disabled.
|
|
35
|
+
*
|
|
36
|
+
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
37
|
+
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
disableRipple?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* If `true`, the touch ripple effect is disabled.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
disableTouchRipple?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* If `true`, the base button will have a keyboard focus ripple.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
focusRipple?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* This prop can help identify which element has keyboard focus.
|
|
53
|
+
* The class name will be applied when the element gains the focus through keyboard interaction.
|
|
54
|
+
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
|
55
|
+
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
|
56
|
+
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
|
57
|
+
* if needed.
|
|
58
|
+
*/
|
|
59
|
+
focusVisibleClassName?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The component used to render a link when the `href` prop is provided.
|
|
62
|
+
* @default 'a'
|
|
63
|
+
*/
|
|
64
|
+
LinkComponent?: React.ElementType;
|
|
65
|
+
/**
|
|
66
|
+
* Callback fired when the component is focused with a keyboard.
|
|
67
|
+
* We trigger a `onFocus` callback too.
|
|
68
|
+
*/
|
|
69
|
+
onFocusVisible?: React.FocusEventHandler<any>;
|
|
70
|
+
/**
|
|
71
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
72
|
+
*/
|
|
73
|
+
sx?: SxProps<Theme>;
|
|
74
|
+
/**
|
|
75
|
+
* @default 0
|
|
76
|
+
*/
|
|
77
|
+
tabIndex?: NonNullable<React.HTMLAttributes<any>['tabIndex']>;
|
|
78
|
+
/**
|
|
79
|
+
* Props applied to the `TouchRipple` element.
|
|
80
|
+
*/
|
|
81
|
+
TouchRippleProps?: Partial<TouchRippleProps>;
|
|
82
|
+
/**
|
|
83
|
+
* A ref that points to the `TouchRipple` element.
|
|
84
|
+
*/
|
|
85
|
+
touchRippleRef?: React.Ref<TouchRippleActions>;
|
|
86
|
+
}
|
|
87
|
+
|
|
8
88
|
export interface ButtonBaseTypeMap<
|
|
9
89
|
AdditionalProps = {},
|
|
10
|
-
|
|
90
|
+
RootComponent extends React.ElementType = 'button',
|
|
11
91
|
> {
|
|
12
|
-
props: AdditionalProps &
|
|
13
|
-
|
|
14
|
-
* A ref for imperative actions.
|
|
15
|
-
* It currently only supports `focusVisible()` action.
|
|
16
|
-
*/
|
|
17
|
-
action?: React.Ref<ButtonBaseActions>;
|
|
18
|
-
/**
|
|
19
|
-
* If `true`, the ripples are centered.
|
|
20
|
-
* They won't start at the cursor interaction position.
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
centerRipple?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* The content of the component.
|
|
26
|
-
*/
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
/**
|
|
29
|
-
* Override or extend the styles applied to the component.
|
|
30
|
-
*/
|
|
31
|
-
classes?: Partial<ButtonBaseClasses>;
|
|
32
|
-
/**
|
|
33
|
-
* If `true`, the component is disabled.
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* If `true`, the ripple effect is disabled.
|
|
39
|
-
*
|
|
40
|
-
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
41
|
-
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
disableRipple?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* If `true`, the touch ripple effect is disabled.
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
disableTouchRipple?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* If `true`, the base button will have a keyboard focus ripple.
|
|
52
|
-
* @default false
|
|
53
|
-
*/
|
|
54
|
-
focusRipple?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* This prop can help identify which element has keyboard focus.
|
|
57
|
-
* The class name will be applied when the element gains the focus through keyboard interaction.
|
|
58
|
-
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
|
59
|
-
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
|
60
|
-
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
|
61
|
-
* if needed.
|
|
62
|
-
*/
|
|
63
|
-
focusVisibleClassName?: string;
|
|
64
|
-
/**
|
|
65
|
-
* The component used to render a link when the `href` prop is provided.
|
|
66
|
-
* @default 'a'
|
|
67
|
-
*/
|
|
68
|
-
LinkComponent?: React.ElementType;
|
|
69
|
-
/**
|
|
70
|
-
* Callback fired when the component is focused with a keyboard.
|
|
71
|
-
* We trigger a `onFocus` callback too.
|
|
72
|
-
*/
|
|
73
|
-
onFocusVisible?: React.FocusEventHandler<any>;
|
|
74
|
-
/**
|
|
75
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
76
|
-
*/
|
|
77
|
-
sx?: SxProps<Theme>;
|
|
78
|
-
/**
|
|
79
|
-
* @default 0
|
|
80
|
-
*/
|
|
81
|
-
tabIndex?: NonNullable<React.HTMLAttributes<any>['tabIndex']>;
|
|
82
|
-
/**
|
|
83
|
-
* Props applied to the `TouchRipple` element.
|
|
84
|
-
*/
|
|
85
|
-
TouchRippleProps?: Partial<TouchRippleProps>;
|
|
86
|
-
/**
|
|
87
|
-
* A ref that points to the `TouchRipple` element.
|
|
88
|
-
*/
|
|
89
|
-
touchRippleRef?: React.Ref<TouchRippleActions>;
|
|
90
|
-
};
|
|
91
|
-
defaultComponent: DefaultComponent;
|
|
92
|
+
props: AdditionalProps & ButtonBaseOwnProps;
|
|
93
|
+
defaultComponent: RootComponent;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
/**
|
|
@@ -9,79 +9,81 @@ export interface ButtonGroupPropsColorOverrides {}
|
|
|
9
9
|
export interface ButtonGroupPropsVariantOverrides {}
|
|
10
10
|
export interface ButtonGroupPropsSizeOverrides {}
|
|
11
11
|
|
|
12
|
+
export interface ButtonGroupOwnProps {
|
|
13
|
+
/**
|
|
14
|
+
* The content of the component.
|
|
15
|
+
*/
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Override or extend the styles applied to the component.
|
|
19
|
+
*/
|
|
20
|
+
classes?: Partial<ButtonGroupClasses>;
|
|
21
|
+
/**
|
|
22
|
+
* The color of the component.
|
|
23
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
24
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
25
|
+
* @default 'primary'
|
|
26
|
+
*/
|
|
27
|
+
color?: OverridableStringUnion<
|
|
28
|
+
'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
|
|
29
|
+
ButtonGroupPropsColorOverrides
|
|
30
|
+
>;
|
|
31
|
+
/**
|
|
32
|
+
* If `true`, the component is disabled.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* If `true`, no elevation is used.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
disableElevation?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* If `true`, the button keyboard focus ripple is disabled.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
disableFocusRipple?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* If `true`, the button ripple effect is disabled.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
disableRipple?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* If `true`, the buttons will take up the full width of its container.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
fullWidth?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The component orientation (layout flow direction).
|
|
58
|
+
* @default 'horizontal'
|
|
59
|
+
*/
|
|
60
|
+
orientation?: 'vertical' | 'horizontal';
|
|
61
|
+
/**
|
|
62
|
+
* The size of the component.
|
|
63
|
+
* `small` is equivalent to the dense button styling.
|
|
64
|
+
* @default 'medium'
|
|
65
|
+
*/
|
|
66
|
+
size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonGroupPropsSizeOverrides>;
|
|
67
|
+
/**
|
|
68
|
+
* The variant to use.
|
|
69
|
+
* @default 'outlined'
|
|
70
|
+
*/
|
|
71
|
+
variant?: OverridableStringUnion<
|
|
72
|
+
'text' | 'outlined' | 'contained',
|
|
73
|
+
ButtonGroupPropsVariantOverrides
|
|
74
|
+
>;
|
|
75
|
+
/**
|
|
76
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
77
|
+
*/
|
|
78
|
+
sx?: SxProps<Theme>;
|
|
79
|
+
}
|
|
80
|
+
|
|
12
81
|
export interface ButtonGroupTypeMap<
|
|
13
82
|
AdditionalProps = {},
|
|
14
|
-
|
|
83
|
+
RootComponent extends React.ElementType = 'div',
|
|
15
84
|
> {
|
|
16
|
-
props: AdditionalProps &
|
|
17
|
-
|
|
18
|
-
* The content of the component.
|
|
19
|
-
*/
|
|
20
|
-
children?: React.ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Override or extend the styles applied to the component.
|
|
23
|
-
*/
|
|
24
|
-
classes?: Partial<ButtonGroupClasses>;
|
|
25
|
-
/**
|
|
26
|
-
* The color of the component.
|
|
27
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
|
28
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
29
|
-
* @default 'primary'
|
|
30
|
-
*/
|
|
31
|
-
color?: OverridableStringUnion<
|
|
32
|
-
'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
|
|
33
|
-
ButtonGroupPropsColorOverrides
|
|
34
|
-
>;
|
|
35
|
-
/**
|
|
36
|
-
* If `true`, the component is disabled.
|
|
37
|
-
* @default false
|
|
38
|
-
*/
|
|
39
|
-
disabled?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* If `true`, no elevation is used.
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
disableElevation?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* If `true`, the button keyboard focus ripple is disabled.
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
disableFocusRipple?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* If `true`, the button ripple effect is disabled.
|
|
52
|
-
* @default false
|
|
53
|
-
*/
|
|
54
|
-
disableRipple?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* If `true`, the buttons will take up the full width of its container.
|
|
57
|
-
* @default false
|
|
58
|
-
*/
|
|
59
|
-
fullWidth?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* The component orientation (layout flow direction).
|
|
62
|
-
* @default 'horizontal'
|
|
63
|
-
*/
|
|
64
|
-
orientation?: 'vertical' | 'horizontal';
|
|
65
|
-
/**
|
|
66
|
-
* The size of the component.
|
|
67
|
-
* `small` is equivalent to the dense button styling.
|
|
68
|
-
* @default 'medium'
|
|
69
|
-
*/
|
|
70
|
-
size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonGroupPropsSizeOverrides>;
|
|
71
|
-
/**
|
|
72
|
-
* The variant to use.
|
|
73
|
-
* @default 'outlined'
|
|
74
|
-
*/
|
|
75
|
-
variant?: OverridableStringUnion<
|
|
76
|
-
'text' | 'outlined' | 'contained',
|
|
77
|
-
ButtonGroupPropsVariantOverrides
|
|
78
|
-
>;
|
|
79
|
-
/**
|
|
80
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
81
|
-
*/
|
|
82
|
-
sx?: SxProps<Theme>;
|
|
83
|
-
};
|
|
84
|
-
defaultComponent: DefaultComponent;
|
|
85
|
+
props: AdditionalProps & ButtonGroupOwnProps;
|
|
86
|
+
defaultComponent: RootComponent;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
/**
|