Skip to content

Commit

Permalink
[Joy] Remove label prop
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj committed Mar 31, 2022
1 parent aff936c commit 03c1201
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/mui-joy/src/AvatarGroup/AvatarGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ AvatarGroup.propTypes /* remove-proptypes */ = {
component: PropTypes.elementType,
/**
* The size of the component.
* It accepts theme values between 'xs' and 'xl'.
* It accepts theme values between 'sm' and 'lg'.
* @default 'md'
*/
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
Expand Down
19 changes: 5 additions & 14 deletions packages/mui-joy/src/Chip/Chip.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { unstable_composeClasses as composeClasses } from '@mui/base';
import ButtonBase from '@mui/material/ButtonBase';
import { OverridableComponent } from '@mui/types';
import {
unstable_capitalize as capitalize,
unstable_unsupportedProp as unsupportedProp,
unstable_useForkRef as useForkRef,
} from '@mui/utils';
import { unstable_capitalize as capitalize, unstable_useForkRef as useForkRef } from '@mui/utils';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import * as React from 'react';
Expand Down Expand Up @@ -152,12 +148,12 @@ const ChipLabel = styled('span', {
const Chip = React.forwardRef(function Chip(inProps, ref) {
const props = useThemeProps<typeof inProps & ChipProps>({ props: inProps, name: 'MuiChip' });
const {
children,
className,
clickable: clickableProp,
color = 'neutral',
component: ComponentProp,
disabled = false,
label,
onClick,
size = 'md',
variant = 'light',
Expand Down Expand Up @@ -206,7 +202,7 @@ const Chip = React.forwardRef(function Chip(inProps, ref) {
>
{startDecorator}
<ChipLabel className={clsx(classes.label)} ownerState={ownerState}>
{label}
{children}
</ChipLabel>
{endDecorator}
</ChipRoot>
Expand All @@ -219,10 +215,9 @@ Chip.propTypes /* remove-proptypes */ = {
// | To update them edit TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* This prop isn't supported.
* Use the `component` prop if you need to change the children structure.
* The content of the component.
*/
children: unsupportedProp,
children: PropTypes.node,
/**
* @ignore
*/
Expand Down Expand Up @@ -258,10 +253,6 @@ Chip.propTypes /* remove-proptypes */ = {
* Element placed after the children.
*/
endDecorator: PropTypes.node,
/**
* The content of the component.
*/
label: PropTypes.node,
/**
* @ignore
*/
Expand Down
9 changes: 2 additions & 7 deletions packages/mui-joy/src/Chip/ChipProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ export interface ChipPropsVariantOverrides {}
export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> {
props: P & {
/**
* This prop isn't supported.
* Use the `component` prop if you need to change the children structure.
* The content of the component.
*/
children?: null;
children?: React.ReactNode;
/**
* If `true`, the chip will appear clickable, and will raise when pressed,
* even if the onClick prop is not defined.
Expand All @@ -39,10 +38,6 @@ export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> {
* Element placed after the children.
*/
endDecorator?: React.ReactNode;
/**
* The content of the component.
*/
label?: React.ReactNode;
/**
* The size of the component.
* It accepts theme values between 'sm' and 'lg'.
Expand Down

0 comments on commit 03c1201

Please sign in to comment.