-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ToggleButton] Move from lab to core (#22784)
- Loading branch information
Showing
40 changed files
with
649 additions
and
561 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/src/pages/components/toggle-button/StandaloneToggleButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/src/pages/components/toggle-button/StandaloneToggleButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 2 additions & 79 deletions
81
packages/material-ui-lab/src/ToggleButton/ToggleButton.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,2 @@ | ||
import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '@material-ui/core/ButtonBase'; | ||
import { OverrideProps } from '@material-ui/core/OverridableComponent'; | ||
|
||
export type ToggleButtonTypeMap< | ||
P = {}, | ||
D extends React.ElementType = 'button' | ||
> = ExtendButtonBaseTypeMap<{ | ||
props: P & { | ||
/** | ||
* The content of the button. | ||
*/ | ||
children?: React.ReactNode; | ||
/** | ||
* Override or extend the styles applied to the component. | ||
*/ | ||
classes?: { | ||
/** Styles applied to the root element. */ | ||
root?: string; | ||
/** Pseudo-class applied to the root element if `disabled={true}`. */ | ||
disabled?: string; | ||
/** Pseudo-class applied to the root element if `selected={true}`. */ | ||
selected?: string; | ||
/** Styles applied to the `label` wrapper element. */ | ||
label?: string; | ||
/** Styles applied to the root element if `size="small"`. */ | ||
sizeSmall?: string; | ||
/** Styles applied to the root element if `size="large"`. */ | ||
sizeLarge?: string; | ||
}; | ||
/** | ||
* If `true`, the button will be disabled. | ||
* @default false | ||
*/ | ||
disabled?: boolean; | ||
/** | ||
* If `true`, the keyboard focus ripple will be disabled. | ||
* @default false | ||
*/ | ||
disableFocusRipple?: boolean; | ||
/** | ||
* If `true`, the button will be rendered in an active state. | ||
*/ | ||
selected?: boolean; | ||
/** | ||
* The size of the button. | ||
* The prop defaults to the value inherited from the parent ToggleButtonGroup component. | ||
* @default 'medium' | ||
*/ | ||
size?: 'small' | 'medium' | 'large'; | ||
/** | ||
* The value to associate with the button when selected in a | ||
* ToggleButtonGroup. | ||
*/ | ||
value: NonNullable<unknown>; | ||
}; | ||
defaultComponent: D; | ||
}>; | ||
|
||
/** | ||
* | ||
* Demos: | ||
* | ||
* - [Toggle Button](https://material-ui.com/components/toggle-button/) | ||
* | ||
* API: | ||
* | ||
* - [ToggleButton API](https://material-ui.com/api/toggle-button/) | ||
* - inherits [ButtonBase API](https://material-ui.com/api/button-base/) | ||
*/ | ||
declare const ToggleButton: ExtendButtonBase<ToggleButtonTypeMap>; | ||
|
||
export type ToggleButtonProps< | ||
D extends React.ElementType = ToggleButtonTypeMap['defaultComponent'], | ||
P = {} | ||
> = OverrideProps<ToggleButtonTypeMap<P, D>, D>; | ||
|
||
export type ToggleButtonClassKey = keyof NonNullable<ToggleButtonTypeMap['props']['classes']>; | ||
|
||
export default ToggleButton; | ||
export { default } from '@material-ui/core/ToggleButton'; | ||
export * from '@material-ui/core/ToggleButton'; |
Oops, something went wrong.