Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-next][ButtonGroup] Copy ButtonGroup to material next #39716

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions packages/mui-material-next/src/ButtonGroup/ButtonGroup.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { OverridableStringUnion, OverridableComponent, OverrideProps } from '@mui/types';
import { Theme } from '..';
import { ButtonGroupClasses } from './buttonGroupClasses';

export interface ButtonGroupPropsColorOverrides {}
export interface ButtonGroupPropsVariantOverrides {}
export interface ButtonGroupPropsSizeOverrides {}

export interface ButtonGroupOwnProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<ButtonGroupClasses>;
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
* @default 'primary'
*/
color?: OverridableStringUnion<
'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
ButtonGroupPropsColorOverrides
>;
/**
* If `true`, the component is disabled.
* @default false
*/
disabled?: boolean;
/**
* If `true`, no elevation is used.
* @default false
*/
disableElevation?: boolean;
/**
* If `true`, the button keyboard focus ripple is disabled.
* @default false
*/
disableFocusRipple?: boolean;
/**
* If `true`, the button ripple effect is disabled.
* @default false
*/
disableRipple?: boolean;
/**
* If `true`, the buttons will take up the full width of its container.
* @default false
*/
fullWidth?: boolean;
/**
* The component orientation (layout flow direction).
* @default 'horizontal'
*/
orientation?: 'vertical' | 'horizontal';
/**
* The size of the component.
* `small` is equivalent to the dense button styling.
* @default 'medium'
*/
size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonGroupPropsSizeOverrides>;
/**
* The variant to use.
* @default 'outlined'
*/
variant?: OverridableStringUnion<
'text' | 'outlined' | 'contained',
ButtonGroupPropsVariantOverrides
>;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
}

export interface ButtonGroupTypeMap<
AdditionalProps = {},
RootComponent extends React.ElementType = 'div',
> {
props: AdditionalProps & ButtonGroupOwnProps;
defaultComponent: RootComponent;
}

/**
*
* Demos:
*
* - [Button Group](https://mui.com/material-ui/react-button-group/)
*
* API:
*
* - [ButtonGroup API](https://mui.com/material-ui/api/button-group/)
*/
declare const ButtonGroup: OverridableComponent<ButtonGroupTypeMap>;

export type ButtonGroupProps<
RootComponent extends React.ElementType = ButtonGroupTypeMap['defaultComponent'],
AdditionalProps = {},
> = OverrideProps<ButtonGroupTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType;
};

export default ButtonGroup;
Loading
Loading