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

[core] Improve support for extended props in theme #25934

Merged
merged 35 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d8b4ffe
Support custom sizes for ToggleButton ToggleButtonGroup Table and Aut…
vicasas Apr 24, 2021
4f1e80c
Add support custom color Slider
vicasas Apr 24, 2021
617802e
fix leaky types
oliviertassinari Apr 24, 2021
ff5c61d
Add support custom color and size Pagination
vicasas Apr 24, 2021
7e1e15e
Fix framer Slider
vicasas Apr 24, 2021
7f1fa8b
Fix framer Slider
vicasas Apr 24, 2021
de467cc
Fix types
vicasas Apr 24, 2021
be00d65
Add support custom color and size PaginationItem
vicasas Apr 24, 2021
a5c3bef
Add support custom color and size Fab
vicasas Apr 24, 2021
ceac217
Add support custom color and size SvgIcon
vicasas Apr 24, 2021
5c15f10
Add support custom color and size Icon
vicasas Apr 24, 2021
25d0a27
Add support custom color and size Chip
vicasas Apr 24, 2021
bc5db41
Add support custom color and size Checkbox
vicasas Apr 25, 2021
507cdb3
Fix framer
vicasas Apr 25, 2021
20a901a
Fix framer
vicasas Apr 25, 2021
c08b395
Fix framer
vicasas Apr 25, 2021
e01c219
Fix framer
vicasas Apr 25, 2021
6ace85a
Revert "Add support custom color and size Checkbox"
vicasas Apr 25, 2021
f4f39c0
Add support custom color and size InputBase
vicasas Apr 25, 2021
0833d0c
Add support custom color and size OutlinedInput
vicasas Apr 25, 2021
d74cc58
Add support custom color and size FilledInput
vicasas Apr 25, 2021
aa8c65c
Add support custom color Input
vicasas Apr 25, 2021
c47f730
Add support custom color and size Switch
vicasas Apr 25, 2021
df75463
Fix framer
vicasas Apr 25, 2021
8c8ef43
yarn workspace framer build
oliviertassinari Apr 25, 2021
33d80d0
it doesn't matter
oliviertassinari Apr 25, 2021
2efb6a5
fix build
oliviertassinari Apr 25, 2021
5dd2e64
Revert "Revert "Add support custom color and size Checkbox""
vicasas Apr 25, 2021
523a20a
Fix framer Checkbox
vicasas Apr 25, 2021
a480ffe
Fix framer
vicasas Apr 25, 2021
c1734af
yarn prettier
vicasas Apr 25, 2021
1c07ec0
Add support custom color and size Radio
vicasas Apr 25, 2021
531c304
Merge branch 'next' into feature/support-custom-part2
mnajdova Apr 26, 2021
5b2757b
Update packages/material-ui/src/Table/Table.d.ts
mnajdova Apr 26, 2021
fedb770
fix wrong padding value
mnajdova Apr 26, 2021
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
9 changes: 6 additions & 3 deletions docs/pages/api-docs/chip.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"clickable": { "type": { "name": "bool" } },
"color": {
"type": {
"name": "enum",
"description": "'default'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'"
"name": "union",
"description": "'default'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
},
"default": "'default'"
},
Expand All @@ -18,7 +18,10 @@
"label": { "type": { "name": "node" } },
"onDelete": { "type": { "name": "func" } },
"size": {
"type": { "name": "enum", "description": "'medium'<br>&#124;&nbsp;'small'" },
"type": {
"name": "union",
"description": "'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
"sx": { "type": { "name": "object" } },
Expand Down
14 changes: 0 additions & 14 deletions framer/Material-UI.framerfx/code/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import { Avatar } from './Avatar';

interface Props {
clickable: boolean;
color: 'default' | 'primary' | 'secondary';
deleteIcon: string;
disabled: boolean;
icon: string;
label: string;
size: 'medium' | 'small';
avatarImageFile: string;
avatarImageUrl: string;
deletable: boolean;
Expand Down Expand Up @@ -50,12 +48,10 @@ export function Chip(props: Props): JSX.Element {

Chip.defaultProps = {
clickable: true,
color: 'default' as 'default',
deleteIcon: '',
disabled: false,
icon: 'star',
label: 'Chip',
size: 'medium' as 'medium',
avatarImageFile: '',
avatarImageUrl: '',
deletable: false,
Expand All @@ -69,11 +65,6 @@ addPropertyControls(Chip, {
type: ControlType.Boolean,
title: 'Clickable',
},
color: {
type: ControlType.Enum,
title: 'Color',
options: ['default', 'primary', 'secondary'],
},
deleteIcon: {
type: ControlType.String,
title: 'Delete icon',
Expand All @@ -90,11 +81,6 @@ addPropertyControls(Chip, {
type: ControlType.String,
title: 'Label',
},
size: {
type: ControlType.Enum,
title: 'Size',
options: ['medium', 'small'],
},
avatarImageFile: {
type: ControlType.Image,
title: 'Avatar Image File',
Expand Down
2 changes: 2 additions & 0 deletions framer/scripts/framerConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ export const componentSettings = {
// FIXME: `Union`
vicasas marked this conversation as resolved.
Show resolved Hide resolved
'sx',
'variant',
'color',
'size',
],
propValues: {
avatarImageFile: "''",
Expand Down
8 changes: 6 additions & 2 deletions packages/material-ui/src/Chip/Chip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';

export interface ChipPropsVariantOverrides {}

export interface ChipPropsSizeOverrides {}

export interface ChipPropsColorOverrides {}

export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> {
props: P & {
/**
Expand Down Expand Up @@ -109,7 +113,7 @@ export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> {
* The color of the component. It supports those theme colors that make sense for this component.
* @default 'default'
*/
color?: Exclude<PropTypes.Color, 'inherit'>;
color?: OverridableStringUnion<Exclude<PropTypes.Color, 'inherit'>, ChipPropsColorOverrides>;
/**
* Override the default delete icon element. Shown only if `onDelete` is set.
*/
Expand All @@ -136,7 +140,7 @@ export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> {
* The size of the component.
* @default 'medium'
*/
size?: 'small' | 'medium';
size?: OverridableStringUnion<'small' | 'medium', ChipPropsSizeOverrides>;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
Expand Down
10 changes: 8 additions & 2 deletions packages/material-ui/src/Chip/Chip.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,10 @@ Chip.propTypes /* remove-proptypes */ = {
* The color of the component. It supports those theme colors that make sense for this component.
* @default 'default'
*/
color: PropTypes.oneOf(['default', 'primary', 'secondary']),
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
PropTypes.oneOf(['default', 'primary', 'secondary']),
PropTypes.string,
]),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
Expand Down Expand Up @@ -563,7 +566,10 @@ Chip.propTypes /* remove-proptypes */ = {
* The size of the component.
* @default 'medium'
*/
size: PropTypes.oneOf(['medium', 'small']),
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
PropTypes.oneOf(['medium', 'small']),
PropTypes.string,
]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
Expand Down