From ebaaddbcc1ebf87285be7d413ef843a93c56e1cc Mon Sep 17 00:00:00 2001 From: nmchaves Date: Sat, 28 Jul 2018 10:25:00 -0700 Subject: [PATCH 1/3] remove number from snackbar anchorOrigin propTypes and TS declarations --- packages/material-ui/src/Snackbar/Snackbar.d.ts | 4 ++-- packages/material-ui/src/Snackbar/Snackbar.js | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/material-ui/src/Snackbar/Snackbar.d.ts b/packages/material-ui/src/Snackbar/Snackbar.d.ts index de09adddc52ccb..4a215f04a96350 100644 --- a/packages/material-ui/src/Snackbar/Snackbar.d.ts +++ b/packages/material-ui/src/Snackbar/Snackbar.d.ts @@ -4,8 +4,8 @@ import { SnackbarContentProps } from '../SnackbarContent'; import { TransitionHandlerProps, TransitionProps } from '../transitions/transition'; export type SnackbarOrigin = { - horizontal: 'left' | 'center' | 'right' | number; - vertical: 'top' | 'center' | 'bottom' | number; + horizontal: 'left' | 'center' | 'right'; + vertical: 'top' | 'center' | 'bottom'; }; export interface SnackbarProps diff --git a/packages/material-ui/src/Snackbar/Snackbar.js b/packages/material-ui/src/Snackbar/Snackbar.js index 1c8a1fe26f6398..ace3016a5e35ae 100644 --- a/packages/material-ui/src/Snackbar/Snackbar.js +++ b/packages/material-ui/src/Snackbar/Snackbar.js @@ -282,12 +282,8 @@ Snackbar.propTypes = { * The anchor of the `Snackbar`. */ anchorOrigin: PropTypes.shape({ - horizontal: PropTypes.oneOfType([ - PropTypes.number, - PropTypes.oneOf(['left', 'center', 'right']), - ]).isRequired, - vertical: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(['top', 'center', 'bottom'])]) - .isRequired, + horizontal: PropTypes.oneOf(['left', 'center', 'right']).isRequired, + vertical: PropTypes.oneOf(['top', 'center', 'bottom']).isRequired, }), /** * The number of milliseconds to wait before automatically calling the From 0aae92f3e9bfe8ebc6dfaf3b57f376bf090fa312 Mon Sep 17 00:00:00 2001 From: nmchaves Date: Sat, 28 Jul 2018 10:25:25 -0700 Subject: [PATCH 2/3] update Snackbar API docs --- pages/api/snackbar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/snackbar.md b/pages/api/snackbar.md index 2b53e186b5cb6f..3c9c534da2680c 100644 --- a/pages/api/snackbar.md +++ b/pages/api/snackbar.md @@ -16,7 +16,7 @@ title: Snackbar API | Name | Type | Default | Description | |:-----|:-----|:--------|:------------| | action | node |   | The action to display. | -| anchorOrigin | { horizontal: union: number |
 enum: 'left' |
 'center' |
 'right'

, vertical: union: number |
 enum: 'top' |
 'center' |
 'bottom'

} | { vertical: 'bottom', horizontal: 'center',} | The anchor of the `Snackbar`. | +| anchorOrigin | { horizontal: enum: 'left' |
 'center' |
 'right'
, vertical: enum: 'top' |
 'center' |
 'bottom'
} | { vertical: 'bottom', horizontal: 'center',} | The anchor of the `Snackbar`. | | autoHideDuration | number |   | The number of milliseconds to wait before automatically calling the `onClose` function. `onClose` should then set the state of the `open` prop to hide the Snackbar. This behavior is disabled by default with the `null` value. | | children | element |   | If you wish the take control over the children of the component you can use this property. When used, you replace the `SnackbarContent` component with the children. | | classes | object |   | Override or extend the styles applied to the component. See [CSS API](#css-api) below for more details. | From e052a7cb3311fb7832150c1bc681515d33826cbe Mon Sep 17 00:00:00 2001 From: nmchaves Date: Sat, 28 Jul 2018 10:30:26 -0700 Subject: [PATCH 3/3] prettier updates --- .../material-ui/src/DialogContentText/DialogContentText.d.ts | 2 +- packages/material-ui/test/typescript/components.spec.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/material-ui/src/DialogContentText/DialogContentText.d.ts b/packages/material-ui/src/DialogContentText/DialogContentText.d.ts index e00b87c7ba2f37..174923182f7c01 100644 --- a/packages/material-ui/src/DialogContentText/DialogContentText.d.ts +++ b/packages/material-ui/src/DialogContentText/DialogContentText.d.ts @@ -3,7 +3,7 @@ import { StandardProps } from '..'; import { TypographyProps } from '../Typography'; export interface DialogContentTextProps -extends StandardProps {} + extends StandardProps {} export type DialogContentTextClassKey = 'root'; diff --git a/packages/material-ui/test/typescript/components.spec.tsx b/packages/material-ui/test/typescript/components.spec.tsx index 6c15dd899355bb..027338ececd712 100644 --- a/packages/material-ui/test/typescript/components.spec.tsx +++ b/packages/material-ui/test/typescript/components.spec.tsx @@ -283,7 +283,7 @@ const DialogTest = () => { - + Some text