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

[TextField] Support custom color and size #25088

Merged
merged 8 commits into from Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -216,7 +216,7 @@ jobs:
name: '`yarn docs:i18n` changes committed?'
command: git diff --exit-code
- run:
name: Generate the framer components
name: '`yarn framer:build` changes committed?'
command: yarn workspace framer build
- run:
name: '`yarn workspace framer build` changes committed?'
Expand Down
10 changes: 8 additions & 2 deletions docs/pages/api-docs/form-control.json
Expand Up @@ -3,7 +3,10 @@
"children": { "type": { "name": "node" } },
"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 All @@ -21,7 +24,10 @@
},
"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
12 changes: 10 additions & 2 deletions docs/pages/api-docs/text-field.json
Expand Up @@ -4,7 +4,10 @@
"autoFocus": { "type": { "name": "bool" } },
"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'"
},
"defaultValue": { "type": { "name": "any" } },
Expand Down Expand Up @@ -36,7 +39,12 @@
"rows": { "type": { "name": "union", "description": "number<br>&#124;&nbsp;string" } },
"select": { "type": { "name": "bool" } },
"SelectProps": { "type": { "name": "object" } },
"size": { "type": { "name": "enum", "description": "'medium'<br>&#124;&nbsp;'small'" } },
"size": {
"type": {
"name": "union",
"description": "'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
}
},
"type": { "type": { "name": "string" } },
"value": { "type": { "name": "any" } },
"variant": {
Expand Down
42 changes: 9 additions & 33 deletions docs/src/pages/components/text-fields/CustomizedInputBase.js
@@ -1,5 +1,4 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import InputBase from '@material-ui/core/InputBase';
import Divider from '@material-ui/core/Divider';
Expand All @@ -8,48 +7,25 @@ import MenuIcon from '@material-ui/icons/Menu';
import SearchIcon from '@material-ui/icons/Search';
import DirectionsIcon from '@material-ui/icons/Directions';

const useStyles = makeStyles((theme) => ({
root: {
padding: '2px 4px',
display: 'flex',
alignItems: 'center',
width: 400,
},
input: {
marginLeft: theme.spacing(1),
flex: 1,
},
iconButton: {
padding: 10,
},
divider: {
height: 28,
margin: 4,
},
}));

export default function CustomizedInputBase() {
const classes = useStyles();

return (
<Paper component="form" className={classes.root}>
<IconButton className={classes.iconButton} aria-label="menu">
<Paper
component="form"
sx={{ padding: '2px 4px', display: 'flex', alignItems: 'center', width: 400 }}
>
<IconButton sx={{ p: '10px' }} aria-label="menu">
<MenuIcon />
</IconButton>
<InputBase
className={classes.input}
sx={{ ml: 1, flex: 1 }}
placeholder="Search Google Maps"
inputProps={{ 'aria-label': 'search google maps' }}
/>
<IconButton type="submit" className={classes.iconButton} aria-label="search">
<IconButton type="submit" sx={{ p: '10px' }} aria-label="search">
<SearchIcon />
</IconButton>
<Divider className={classes.divider} orientation="vertical" />
<IconButton
color="primary"
className={classes.iconButton}
aria-label="directions"
>
<Divider sx={{ height: 28, m: 0.5 }} orientation="vertical" />
<IconButton color="primary" sx={{ p: '10px' }} aria-label="directions">
<DirectionsIcon />
</IconButton>
</Paper>
Expand Down
44 changes: 9 additions & 35 deletions docs/src/pages/components/text-fields/CustomizedInputBase.tsx
@@ -1,5 +1,4 @@
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import InputBase from '@material-ui/core/InputBase';
import Divider from '@material-ui/core/Divider';
Expand All @@ -8,50 +7,25 @@ import MenuIcon from '@material-ui/icons/Menu';
import SearchIcon from '@material-ui/icons/Search';
import DirectionsIcon from '@material-ui/icons/Directions';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
padding: '2px 4px',
display: 'flex',
alignItems: 'center',
width: 400,
},
input: {
marginLeft: theme.spacing(1),
flex: 1,
},
iconButton: {
padding: 10,
},
divider: {
height: 28,
margin: 4,
},
}),
);

export default function CustomizedInputBase() {
const classes = useStyles();

return (
<Paper component="form" className={classes.root}>
<IconButton className={classes.iconButton} aria-label="menu">
<Paper
component="form"
sx={{ padding: '2px 4px', display: 'flex', alignItems: 'center', width: 400 }}
>
<IconButton sx={{ p: '10px' }} aria-label="menu">
<MenuIcon />
</IconButton>
<InputBase
className={classes.input}
sx={{ ml: 1, flex: 1 }}
placeholder="Search Google Maps"
inputProps={{ 'aria-label': 'search google maps' }}
/>
<IconButton type="submit" className={classes.iconButton} aria-label="search">
<IconButton type="submit" sx={{ p: '10px' }} aria-label="search">
<SearchIcon />
</IconButton>
<Divider className={classes.divider} orientation="vertical" />
<IconButton
color="primary"
className={classes.iconButton}
aria-label="directions"
>
<Divider sx={{ height: 28, m: 0.5 }} orientation="vertical" />
<IconButton color="primary" sx={{ p: '10px' }} aria-label="directions">
<DirectionsIcon />
</IconButton>
</Paper>
Expand Down