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 33 commits
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
5 changes: 4 additions & 1 deletion docs/pages/api-docs/autocomplete.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@
"renderTags": { "type": { "name": "func" } },
"selectOnFocus": { "type": { "name": "bool" }, "default": "!props.freeSolo" },
"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
9 changes: 6 additions & 3 deletions docs/pages/api-docs/checkbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"classes": { "type": { "name": "object" } },
"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": "'secondary'"
},
Expand All @@ -22,7 +22,10 @@
"onChange": { "type": { "name": "func" } },
"required": { "type": { "name": "bool" } },
"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
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
8 changes: 4 additions & 4 deletions docs/pages/api-docs/fab.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"classes": { "type": { "name": "object" } },
"color": {
"type": {
"name": "enum",
"description": "'default'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'"
"name": "union",
"description": "'default'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
},
"default": "'default'"
},
Expand All @@ -16,8 +16,8 @@
"href": { "type": { "name": "string" } },
"size": {
"type": {
"name": "enum",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'"
"name": "union",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'large'"
},
Expand Down
7 changes: 6 additions & 1 deletion docs/pages/api-docs/filled-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"autoComplete": { "type": { "name": "string" } },
"autoFocus": { "type": { "name": "bool" } },
"classes": { "type": { "name": "object" } },
"color": { "type": { "name": "enum", "description": "'primary'<br>&#124;&nbsp;'secondary'" } },
"color": {
"type": {
"name": "union",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
}
},
"defaultValue": { "type": { "name": "any" } },
"disabled": { "type": { "name": "bool" } },
"disableUnderline": { "type": { "name": "bool" } },
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/api-docs/icon.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"classes": { "type": { "name": "object" } },
"color": {
"type": {
"name": "enum",
"description": "'action'<br>&#124;&nbsp;'disabled'<br>&#124;&nbsp;'error'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'"
"name": "union",
"description": "'action'<br>&#124;&nbsp;'disabled'<br>&#124;&nbsp;'error'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
},
"default": "'inherit'"
},
"component": { "type": { "name": "elementType" } },
"fontSize": {
"type": {
"name": "enum",
"description": "'inherit'<br>&#124;&nbsp;'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'"
"name": "union",
"description": "'inherit'<br>&#124;&nbsp;'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
Expand Down
7 changes: 6 additions & 1 deletion docs/pages/api-docs/input-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"autoComplete": { "type": { "name": "string" } },
"autoFocus": { "type": { "name": "bool" } },
"classes": { "type": { "name": "object" } },
"color": { "type": { "name": "enum", "description": "'primary'<br>&#124;&nbsp;'secondary'" } },
"color": {
"type": {
"name": "union",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
}
},
"components": {
"type": { "name": "shape", "description": "{ Input?: elementType, Root?: elementType }" },
"default": "{}"
Expand Down
7 changes: 6 additions & 1 deletion docs/pages/api-docs/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"autoComplete": { "type": { "name": "string" } },
"autoFocus": { "type": { "name": "bool" } },
"classes": { "type": { "name": "object" } },
"color": { "type": { "name": "enum", "description": "'primary'<br>&#124;&nbsp;'secondary'" } },
"color": {
"type": {
"name": "union",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
}
},
"defaultValue": { "type": { "name": "any" } },
"disabled": { "type": { "name": "bool" } },
"disableUnderline": { "type": { "name": "bool" } },
Expand Down
7 changes: 6 additions & 1 deletion docs/pages/api-docs/outlined-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"autoComplete": { "type": { "name": "string" } },
"autoFocus": { "type": { "name": "bool" } },
"classes": { "type": { "name": "object" } },
"color": { "type": { "name": "enum", "description": "'primary'<br>&#124;&nbsp;'secondary'" } },
"color": {
"type": {
"name": "union",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
}
},
"defaultValue": { "type": { "name": "any" } },
"disabled": { "type": { "name": "bool" } },
"endAdornment": { "type": { "name": "node" } },
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/api-docs/pagination-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"classes": { "type": { "name": "object" } },
"color": {
"type": {
"name": "enum",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;'standard'"
"name": "union",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;'standard'<br>&#124;&nbsp;string"
},
"default": "'standard'"
},
Expand All @@ -18,8 +18,8 @@
},
"size": {
"type": {
"name": "enum",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'"
"name": "union",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/api-docs/pagination.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"classes": { "type": { "name": "object" } },
"color": {
"type": {
"name": "enum",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;'standard'"
"name": "union",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;'standard'<br>&#124;&nbsp;string"
},
"default": "'standard'"
},
Expand All @@ -30,8 +30,8 @@
"siblingCount": { "type": { "name": "custom", "description": "integer" }, "default": "1" },
"size": {
"type": {
"name": "enum",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'"
"name": "union",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
Expand Down
9 changes: 6 additions & 3 deletions docs/pages/api-docs/radio.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"classes": { "type": { "name": "object" } },
"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": "'secondary'"
},
Expand All @@ -20,7 +20,10 @@
"onChange": { "type": { "name": "func" } },
"required": { "type": { "name": "bool" } },
"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
5 changes: 4 additions & 1 deletion docs/pages/api-docs/slider.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"aria-valuetext": { "type": { "name": "custom", "description": "string" } },
"classes": { "type": { "name": "object" } },
"color": {
"type": { "name": "enum", "description": "'primary'<br>&#124;&nbsp;'secondary'" },
"type": {
"name": "union",
"description": "'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
},
"default": "'primary'"
},
"component": { "type": { "name": "elementType" } },
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/api-docs/svg-icon.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"classes": { "type": { "name": "object" } },
"color": {
"type": {
"name": "enum",
"description": "'action'<br>&#124;&nbsp;'disabled'<br>&#124;&nbsp;'error'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'"
"name": "union",
"description": "'action'<br>&#124;&nbsp;'disabled'<br>&#124;&nbsp;'error'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;string"
},
"default": "'inherit'"
},
"component": { "type": { "name": "elementType" } },
"fontSize": {
"type": {
"name": "enum",
"description": "'inherit'<br>&#124;&nbsp;'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'"
"name": "union",
"description": "'inherit'<br>&#124;&nbsp;'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
Expand Down
9 changes: 6 additions & 3 deletions docs/pages/api-docs/switch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"classes": { "type": { "name": "object" } },
"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": "'secondary'"
},
Expand All @@ -27,7 +27,10 @@
"onChange": { "type": { "name": "func" } },
"required": { "type": { "name": "bool" } },
"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
5 changes: 4 additions & 1 deletion docs/pages/api-docs/table.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"default": "'normal'"
},
"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'"
},
"stickyHeader": { "type": { "name": "bool" } },
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/api-docs/toggle-button-group.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
},
"size": {
"type": {
"name": "enum",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'"
"name": "union",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/api-docs/toggle-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"selected": { "type": { "name": "bool" } },
"size": {
"type": {
"name": "enum",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'"
"name": "union",
"description": "'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
Expand Down
24 changes: 9 additions & 15 deletions framer/Material-UI.framerfx/code/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@ import FormControlLabel from '@material-ui/core/FormControlLabel';

interface Props {
checked: boolean;
color: 'default' | 'primary' | 'secondary';
defaultChecked?: boolean;
disabled: boolean;
size: 'medium' | 'small';
label: string;
width: number | string;
height: number;
onChange?: React.ChangeEventHandler<HTMLInputElement>;
}

export function Checkbox(props: Props): JSX.Element {
const { checked: checkedProp, label, onChange, size, ...other } = props;
const {
checked: checkedProp,
label,
onChange,
// @ts-ignore -- untyped
size,
...other
} = props;

const [checked, setChecked] = React.useState(false);

const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -37,9 +43,7 @@ export function Checkbox(props: Props): JSX.Element {

Checkbox.defaultProps = {
checked: false,
color: 'secondary' as 'secondary',
disabled: false,
size: 'medium' as 'medium',
label: 'Checkbox',
width: 100,
height: 42,
Expand All @@ -50,11 +54,6 @@ addPropertyControls(Checkbox, {
type: ControlType.Boolean,
title: 'Checked',
},
color: {
type: ControlType.Enum,
title: 'Color',
options: ['default', 'primary', 'secondary'],
},
defaultChecked: {
type: ControlType.Boolean,
title: 'Default checked',
Expand All @@ -63,11 +62,6 @@ addPropertyControls(Checkbox, {
type: ControlType.Boolean,
title: 'Disabled',
},
size: {
type: ControlType.Enum,
title: 'Size',
options: ['medium', 'small'],
},
label: {
type: ControlType.String,
title: 'Label',
Expand Down
Loading