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

[docs] Fix Drawer and Popover api docs #8442

Merged
merged 4 commits into from Sep 28, 2017
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 pages/api/drawer.md
Expand Up @@ -18,7 +18,7 @@
| onRequestClose | Function | | Callback fired when the component requests to be closed.<br><br>**Signature:**<br>`function(event: object) => void`<br>*event:* The event source of the callback |
| open | boolean | false | If `true`, the drawer is open. |
| <span style="color: #31a148">theme *</span> | Object | | |
| <span style="color: #31a148">type *</span> | union:&nbsp;'permanent'<br>&nbsp;'persistent'<br>&nbsp;'temporary'<br> | 'temporary' | The type of drawer. |
| type | union:&nbsp;'permanent'<br>&nbsp;'persistent'<br>&nbsp;'temporary'<br> | 'temporary' | The type of drawer. |

Any other properties supplied will be [spread to the root element](/customization/api#spread).

Expand Down
2 changes: 1 addition & 1 deletion pages/api/linear-progress.md
Expand Up @@ -10,7 +10,7 @@
| classes | Object | | Useful to extend the style applied to components. |
| color | union:&nbsp;'primary'<br>&nbsp;'accent'<br> | 'primary' | The color of the component. It's using the theme palette when that makes sense. |
| mode | union:&nbsp;'determinate'<br>&nbsp;'indeterminate'<br>&nbsp;'buffer'<br>&nbsp;'query'<br> | 'indeterminate' | The mode of show your progress, indeterminate for when there is no value for progress. |
| value | number | 0 | The value of progress, only works in determinate and buffer mode. Value between 0 and 100. |
| value | number | | The value of progress, only works in determinate and buffer mode. Value between 0 and 100. |
| valueBuffer | number | | The value of buffer, only works in buffer mode. Value between 0 and 100. |

Any other properties supplied will be [spread to the root element](/customization/api#spread).
Expand Down
4 changes: 2 additions & 2 deletions pages/api/popover.md
Expand Up @@ -9,7 +9,7 @@
|:-----|:-----|:--------|:------------|
| PaperProps | Object | | Properties applied to the `Paper` element. |
| anchorEl | Object | | This is the DOM element that will be used to set the position of the popover. |
| <span style="color: #31a148">anchorOrigin *</span> | signature | { vertical: 'top', horizontal: 'left',} | This is the point on the anchor where the popover's `anchorEl` will attach to.<br>Options: vertical: [top, center, bottom]; horizontal: [left, center, right]. |
| anchorOrigin | signature | { vertical: 'top', horizontal: 'left',} | This is the point on the anchor where the popover's `anchorEl` will attach to.<br>Options: vertical: [top, center, bottom]; horizontal: [left, center, right]. |
| <span style="color: #31a148">children *</span> | Node | | The content of the component. |
| classes | Object | | Useful to extend the style applied to components. |
| elevation | number | 8 | The elevation of the popover. |
Expand All @@ -25,7 +25,7 @@
| onExiting | TransitionCallback | | Callback fired when the component is exiting |
| onRequestClose | Function | | Callback fired when the component requests to be closed.<br><br>**Signature:**<br>`function(event: object) => void`<br>*event:* The event source of the callback |
| open | boolean | false | If `true`, the popover is visible. |
| <span style="color: #31a148">transformOrigin *</span> | signature | { vertical: 'top', horizontal: 'left',} | This is the point on the popover which will attach to the anchor's origin.<br>Options: vertical: [top, center, bottom, x(px)]; horizontal: [left, center, right, x(px)]. |
| transformOrigin | signature | { vertical: 'top', horizontal: 'left',} | This is the point on the popover which will attach to the anchor's origin.<br>Options: vertical: [top, center, bottom, x(px)]; horizontal: [left, center, right, x(px)]. |
| transitionDuration | union:&nbsp;number<br>&nbsp;'auto'<br> | 'auto' | Set to 'auto' to automatically calculate transition time based on height |

Any other properties supplied will be [spread to the root element](/customization/api#spread).
Expand Down
3 changes: 2 additions & 1 deletion pages/api/typography.md
Expand Up @@ -10,7 +10,7 @@
| align | union:&nbsp;'inherit', 'left', 'center', 'right', 'justify'<br> | 'inherit' | |
| children | Node | | |
| classes | Object | | Useful to extend the style applied to components. |
| color | union:&nbsp;'inherit'<br>&nbsp;'secondary'<br>&nbsp;'accent'<br>&nbsp;'default'<br> | 'default' | The color of the component. It's using the theme palette when that makes sense. |
| color | union:&nbsp;'inherit', 'primary', 'secondary', 'accent', 'default'<br> | 'default' | The color of the component. It's using the theme palette when that makes sense. |
| component | ElementType | | The component used for the root node. Either a string to use a DOM element or a component. By default we map the type to a good default headline component. |
| gutterBottom | boolean | false | If `true`, the text will have a bottom margin. |
| headlineMapping | signature | { display4: 'h1', display3: 'h1', display2: 'h1', display1: 'h1', headline: 'h1', title: 'h2', subheading: 'h3', body2: 'aside', body1: 'p',} | We are empirically mapping the type property to a range of different DOM element type. For instance, h1 to h6. If you wish to change that mapping, you can provide your own. Alternatively, you can use the `component` property. |
Expand Down Expand Up @@ -44,6 +44,7 @@ This property accepts the following keys:
- `gutterBottom`
- `paragraph`
- `colorInherit`
- `colorPrimary`
- `colorSecondary`
- `colorAccent`

Expand Down
2 changes: 1 addition & 1 deletion src/Drawer/Drawer.d.ts
Expand Up @@ -12,7 +12,7 @@ export interface DrawerProps extends ModalProps {
open?: boolean;
SlideProps?: SlideProps & StyledComponentProps<any>;
theme?: Theme;
type: 'permanent' | 'persistent' | 'temporary';
type?: 'permanent' | 'persistent' | 'temporary';
}

declare const Drawer: StyledComponent<DrawerProps>;
Expand Down
2 changes: 1 addition & 1 deletion src/Drawer/Drawer.js
Expand Up @@ -142,7 +142,7 @@ export type Props = {
/**
* The type of drawer.
*/
type: Type,
type?: Type,
};

type State = {
Expand Down
6 changes: 4 additions & 2 deletions src/Popover/Popover.js
Expand Up @@ -80,6 +80,8 @@ type Origin = {

type DefaultProps = {
classes: Object,
anchorOrigin: Origin,
transformOrigin: Origin,
};

export type Props = {
Expand All @@ -96,7 +98,7 @@ export type Props = {
* vertical: [top, center, bottom];
* horizontal: [left, center, right].
*/
anchorOrigin: Origin,
anchorOrigin?: Origin,
/**
* The content of the component.
*/
Expand Down Expand Up @@ -183,7 +185,7 @@ export type Props = {
* vertical: [top, center, bottom, x(px)];
* horizontal: [left, center, right, x(px)].
*/
transformOrigin: Origin,
transformOrigin?: Origin,
/**
* Set to 'auto' to automatically calculate transition time based on height
*/
Expand Down