├── .gitignore ├── AppBar.js ├── Button.js ├── ButtonBase.js ├── Card.js ├── CardActions.js ├── CardContent.js ├── FormControl.js ├── FormHelperText.js ├── FormLabel.js ├── IconButton.js ├── Input.js ├── InputLabel.js ├── LICENSE ├── Paper.js ├── PropTypes.js ├── README.md ├── Select.js ├── SvgIcon.js ├── Tab.js ├── Tabs.js ├── TextField.js ├── Toolbar.js ├── Typography.js ├── colors ├── common.js └── index.js ├── csstype.js ├── index.js └── styles ├── MuiThemeProvider.js ├── createBreakpoints.js ├── createMixins.js ├── createMuiTheme.js ├── createPalette.js ├── createTypography.js ├── index.js ├── overrides.js ├── shadows.js ├── spacing.js ├── transitions.js ├── withStyles.js ├── withTheme.js └── zIndex.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | -------------------------------------------------------------------------------- /AppBar.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/AppBar" { 3 | 4 | import type {Color} from "@material-ui/core/PropTypes"; 5 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 6 | import type {PaperProps} from "@material-ui/core/Paper"; 7 | 8 | declare export type AppBarClassKey = 9 | | "root" 10 | | "positionFixed" 11 | | "positionAbsolute" 12 | | "positionSticky" 13 | | "positionStatic" 14 | | "colorDefault" 15 | | "colorPrimary" 16 | | "colorSecondary"; 17 | 18 | declare export type AppBarProps = StandardProps & { 19 | color?: Color, 20 | position?: "fixed" | "absolute" | "sticky" | "static" 21 | }; 22 | 23 | declare type AppBar = React$ComponentType; 24 | 25 | declare module.exports: AppBar; 26 | } 27 | -------------------------------------------------------------------------------- /Button.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Button" { 3 | 4 | import type {Color} from "@material-ui/core/PropTypes"; 5 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 6 | import type {ButtonBaseProps} from "@material-ui/core/ButtonBase"; 7 | 8 | declare export type ButtonClassKey = 9 | | "root" 10 | | "label" 11 | | "flatPrimary" 12 | | "flatSecondary" 13 | | "colorInherit" 14 | | "raised" 15 | | "focusVisible" 16 | | "raisedPrimary" 17 | | "raisedSecondary" 18 | | "disabled" 19 | | "fab" 20 | | "mini" 21 | | "sizeSmall" 22 | | "sizeLarge" 23 | | "fullWidth"; 24 | 25 | declare export type ButtonProps = StandardProps & { 26 | color?: Color, 27 | component?: React$ComponentType, 28 | disabled?: boolean, 29 | disableFocusRipple?: boolean, 30 | disableRipple?: boolean, 31 | fullWidth?: boolean, 32 | href?: string, 33 | mini?: boolean, 34 | size?: "small" | "medium" | "large", 35 | type?: string, 36 | variant?: "flat" | "outlined" | "raised" | "fab" 37 | }; 38 | 39 | declare type Button = React$ComponentType; 40 | 41 | declare module.exports: Button; 42 | } 43 | -------------------------------------------------------------------------------- /ButtonBase.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/ButtonBase" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | // import type {TouchRippleProps} from "@material-ui/core/TouchRippleProps"; 6 | 7 | declare export type ButtonBaseClassKey = "root" | "disabled" | "focusVisible"; 8 | 9 | declare export type ButtonBaseActions = { 10 | focusVisible: () => void 11 | }; 12 | 13 | // React$ElementProps & React$ElementProps 14 | declare export type ButtonBaseProps = StandardProps<{}, ButtonBaseClassKey> & { 15 | action?: (actions: ButtonBaseActions) => void, 16 | buttonRef?: React$Ref, 17 | centerRipple?: boolean, 18 | component?: React$ComponentType, 19 | disableRipple?: boolean, 20 | focusRipple?: boolean, 21 | focusVisibleClassName?: string, 22 | onFocusVisible?: SyntheticFocusEvent 23 | // TouchRippleProps?: $Shape; 24 | }; 25 | 26 | declare type ButtonBase = React$ComponentType; 27 | 28 | declare module.exports: ButtonBase; 29 | } 30 | -------------------------------------------------------------------------------- /Card.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Card" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {PaperProps} from "@material-ui/core/Paper"; 6 | 7 | declare export type CardClassKey = "root"; 8 | 9 | declare export type CardProps = StandardProps & { 10 | raised?: boolean 11 | }; 12 | 13 | declare type Card = React$ComponentType; 14 | 15 | declare module.exports: Card; 16 | } 17 | -------------------------------------------------------------------------------- /CardActions.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/CardActions" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | 6 | declare export type CardActionsClassKey = "root" | "action"; 7 | 8 | // React$ElementProps 9 | declare export type CardActionsProps = StandardProps<{}, CardActionsClassKey> & { 10 | disableActionSpacing?: boolean 11 | }; 12 | 13 | declare type CardActions = React$ComponentType; 14 | 15 | declare module.exports: CardActions; 16 | } 17 | -------------------------------------------------------------------------------- /CardContent.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/CardContent" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | 6 | declare export type CardContentClassKey = "root"; 7 | 8 | // React$ElementProps 9 | declare export type CardContentProps = StandardProps<{}, CardContentClassKey>; 10 | 11 | declare type CardContent = React$ComponentType; 12 | 13 | declare module.exports: CardContent; 14 | } 15 | -------------------------------------------------------------------------------- /FormControl.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/FormControl" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {Margin} from "@material-ui/core/PropTypes"; 6 | 7 | declare export type FormControlClassKey = "root" | "marginNormal" | "marginDense" | "fullWidth"; 8 | 9 | // React$ElementProps 10 | declare export type FormControlProps = StandardProps<{}, FormControlClassKey> & { 11 | component?: React$ComponentType, 12 | disabled?: boolean, 13 | error?: boolean, 14 | fullWidth?: boolean, 15 | margin?: Margin, 16 | onBlur?: SyntheticFocusEvent, 17 | onFocus?: SyntheticFocusEvent, 18 | required?: boolean 19 | }; 20 | 21 | declare type FormControl = React$ComponentType; 22 | 23 | declare module.exports: FormControl; 24 | } 25 | -------------------------------------------------------------------------------- /FormHelperText.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/FormHelperText" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type Margin from "@material-ui/core/PropTypes"; 6 | 7 | declare export type FormHelperTextClassKey = "root" | "error" | "disabled" | "marginDense"; 8 | 9 | declare export type FormHelperTextProps = 10 | StandardProps, FormHelperTextClassKey> & { 11 | disabled?: boolean, 12 | error?: boolean, 13 | component?: React$ComponentType, 14 | margin?: "dense" 15 | }; 16 | 17 | declare type FormHelperText = React$ComponentType; 18 | 19 | declare module.exports: FormHelperText; 20 | } 21 | -------------------------------------------------------------------------------- /FormLabel.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/FormLabel" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | 6 | declare export type FormLabelBaseProps = React$ElementProps; 7 | declare export type FormLabelClassKey = "root" | "focused" | "disabled" | "error" | "asterisk"; 8 | 9 | declare export type FormLabelProps = StandardProps & { 10 | component?: React$ComponentType, 11 | disabled?: boolean, 12 | error?: boolean, 13 | focused?: boolean, 14 | required?: boolean 15 | }; 16 | 17 | declare type FormLabel = React$ComponentType; 18 | 19 | declare module.exports: FormLabel; 20 | } 21 | -------------------------------------------------------------------------------- /IconButton.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/IconButton" { 3 | 4 | import type {Color} from "@material-ui/core/PropTypes"; 5 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 6 | import type {ButtonBaseProps} from "@material-ui/core/ButtonBase"; 7 | 8 | declare export type IconButtonClassKey = 9 | | "root" 10 | | "colorInherit" 11 | | "colorPrimary" 12 | | "colorSecondary" 13 | | "disabled" 14 | | "label"; 15 | 16 | declare export type IconButtonProps = StandardProps & { 17 | color?: Color, 18 | disabled?: boolean, 19 | disableRipple?: boolean 20 | }; 21 | 22 | declare type IconButton = React$ComponentType; 23 | 24 | declare module.exports: IconButton; 25 | } 26 | -------------------------------------------------------------------------------- /Input.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Input" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {Margin} from "@material-ui/core/PropTypes"; 6 | 7 | declare export type InputClassKey = | "root" 8 | | "formControl" 9 | | "focused" 10 | | "disabled" 11 | | "underline" 12 | | "error" 13 | | "multiline" 14 | | "fullWidth" 15 | | "input" 16 | | "inputMarginDense" 17 | | "inputDisabled" 18 | | "inputMultiline" 19 | | "inputType" 20 | | "inputTypeSearch"; 21 | 22 | declare export type InputProps = StandardProps, InputClassKey> & { 23 | autoComplete?: string; 24 | autoFocus?: boolean; 25 | defaultValue?: string | number; 26 | disabled?: boolean; 27 | disableUnderline?: boolean; 28 | endAdornment?: React$Node; 29 | error?: boolean; 30 | fullWidth?: boolean; 31 | id?: string; 32 | inputComponent?: React$ComponentType<{ [arbitrary: string]: any }>; 33 | inputProps?: { [arbitrary: string]: any }; 34 | inputRef?: React$Ref; 35 | margin?: 'dense'; 36 | multiline?: boolean; 37 | name?: string; 38 | placeholder?: string; 39 | rows?: string | number; 40 | rowsMax?: string | number; 41 | startAdornment?: React$Node; 42 | type?: string; 43 | value?: Array | string | number; 44 | /** 45 | * `onChange`, `onKeyUp` + `onKeyDown` are applied to the inner `InputComponent`, 46 | * which by default is an input or textarea. Since these handlers differ from the 47 | * ones inherited by `React.HTMLAttributes` we need to omit them. 48 | * 49 | * Note that `blur` and `focus` event handler are applied to the outter `
`. 50 | * So these can just be inherited from the native `
`. 51 | */ 52 | onChange?: SyntheticKeyboardEvent; 53 | onKeyUp?: SyntheticKeyboardEvent; 54 | onKeyDown?: SyntheticKeyboardEvent; 55 | }; 56 | 57 | declare type Input = React$ComponentType; 58 | 59 | declare module.exports: Input; 60 | } 61 | -------------------------------------------------------------------------------- /InputLabel.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/InputLabel" { 3 | 4 | import type {StandardProps, ClassNameMap} from "@material-ui/core/styles/withStyles"; 5 | import type {FormLabelProps, FormLabelClassKey} from "@material-ui/core/FormLabel"; 6 | 7 | declare export type InputLabelClassKey = "root" | "marginNormal" | "marginDense" | "fullWidth"; 8 | 9 | declare export type InputLabelProps = StandardProps & { 10 | disableAnimation?: boolean; 11 | disabled?: boolean; 12 | error?: boolean; 13 | FormLabelClasses?: $Shape>; 14 | focused?: boolean; 15 | required?: boolean; 16 | shrink?: boolean; 17 | }; 18 | 19 | declare type InputLabel = React$ComponentType; 20 | 21 | declare module.exports: InputLabel; 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Paper.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Paper" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | 6 | declare export type PaperClassKey = 7 | | "root" 8 | | "rounded" 9 | | "elevation0" 10 | | "elevation1" 11 | | "elevation2" 12 | | "elevation3" 13 | | "elevation4" 14 | | "elevation5" 15 | | "elevation6" 16 | | "elevation7" 17 | | "elevation8" 18 | | "elevation9" 19 | | "elevation10" 20 | | "elevation11" 21 | | "elevation12" 22 | | "elevation13" 23 | | "elevation14" 24 | | "elevation15" 25 | | "elevation16" 26 | | "elevation17" 27 | | "elevation18" 28 | | "elevation19" 29 | | "elevation20" 30 | | "elevation21" 31 | | "elevation22" 32 | | "elevation23" 33 | | "elevation24"; 34 | 35 | declare export type PaperProps = StandardProps<{}, PaperClassKey> & { 36 | component?: React$ComponentType, 37 | elevation?: number, 38 | square?: boolean 39 | }; 40 | 41 | declare type Paper = React$ComponentType; 42 | 43 | declare module.exports: Paper; 44 | } 45 | -------------------------------------------------------------------------------- /PropTypes.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/PropTypes" { 3 | declare export type Alignment = "inherit" | "left" | "center" | "right" | "justify"; 4 | declare export type Color = "inherit" | "primary" | "secondary" | "default"; 5 | declare export type Margin = "none" | "dense" | "normal"; 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flow Types for Material UI 2 | 3 | This is an attempt to build Flow types for material-ui that are more precise than the one built in the `flow-typed` repository. 4 | I'm looking for help to map some TypeScript types to Flow. 5 | 6 | ## Questions 7 | 8 | Below are some questions that would help me to map of the TS types to Flow 9 | 10 | ### 1 11 | How does the following TS definition: 12 | 13 | ``` 14 | React.HTMLAttributes 15 | ``` 16 | 17 | translate in Flow? 🤔 18 | -------------------------------------------------------------------------------- /Select.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Select" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {InputProps} from "@material-ui/core/Input"; 6 | // import type {MenuProps} from "@material-ui/core/Menu"; 7 | // import type {SelectInputProps} from "@material-ui/core/SelectInput"; 8 | 9 | declare export type SelectClassKey = "root" | "select" | "selectMenu" | "disabled" | "icon"; 10 | 11 | declare export type SelectProps = StandardProps & { 12 | autoWidth?: boolean; 13 | displayEmpty?: boolean; 14 | IconComponent?: React$Component; 15 | input?: React$Node; 16 | // MenuProps?: $Shape; 17 | multiple?: boolean; 18 | native?: boolean; 19 | onClose?: (event: SyntheticEvent<{}>) => void; 20 | onOpen?: (event: SyntheticEvent<{}>) => void; 21 | open?: boolean; 22 | renderValue?: (value: $PropertyType) => React$Node; 23 | SelectDisplayProps?: React$ElementProps; 24 | value?: Array | string | number; 25 | }; 26 | 27 | declare type Select = React$ComponentType; 28 | 29 | declare module.exports: Select; 30 | } 31 | -------------------------------------------------------------------------------- /SvgIcon.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/SvgIcon" { 3 | 4 | import type {Color} from "@material-ui/core/PropTypes"; 5 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 6 | 7 | declare export type SvgIconClassKey = 8 | | "root" 9 | | "colorSecondary" 10 | | "colorAction" 11 | | "colorDisabled" 12 | | "colorError" 13 | | "colorPrimary" 14 | ; 15 | 16 | // React$ElementProps 17 | declare export type SvgIconProps = StandardProps<{}, SvgIconClassKey> & { 18 | color?: Color | "action" | "disabled" | "error", 19 | nativeColor?: string, 20 | titleAccess?: string, 21 | viewBox?: string 22 | }; 23 | 24 | declare type SvgIcon = React$ComponentType; 25 | 26 | declare module.exports: SvgIcon; 27 | } 28 | -------------------------------------------------------------------------------- /Tab.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Tab" { 3 | 4 | import type {Properties as CSSProperties} from "csstype"; 5 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 6 | import type {ButtonBaseProps} from "@material-ui/core/ButtonBase"; 7 | 8 | declare export type TabClassKey = 9 | | "root" 10 | | "labelIcon" 11 | | "textColorInherit" 12 | | "textColorPrimary" 13 | | "textColorSecondary" 14 | | "selected" 15 | | "disabled" 16 | | "fullWidth" 17 | | "wrapper" 18 | | "labelContainer" 19 | | "label" 20 | | "labelWrapped"; 21 | 22 | declare export type TabProps = StandardProps & { 23 | disabled?: boolean, 24 | fullWidth?: boolean, 25 | icon?: string | React$Element, 26 | value?: any, 27 | label?: React$Node, 28 | onChange?: (event: SyntheticEvent<{ checked: boolean }>, value: any) => void, 29 | onClick?: SyntheticEvent, 30 | selected?: boolean, 31 | style?: CSSProperties<*>, 32 | textColor?: string | "secondary" | "primary" | "inherit" 33 | }; 34 | 35 | declare type Tab = React$ComponentType; 36 | 37 | declare module.exports: Tab; 38 | } 39 | -------------------------------------------------------------------------------- /Tabs.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Tabs" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {ButtonBaseProps} from "@material-ui/core/ButtonBase"; 6 | 7 | declare export type TabsClassKey = 8 | | "root" 9 | | "flexContainer" 10 | | "scroller" 11 | | "fixed" 12 | | "scrollable" 13 | | "centered" 14 | | "scrollButtons" 15 | | "scrollButtonsAuto" 16 | | "indicator"; 17 | 18 | declare export type TabsActions = { 19 | updateIndicator: () => void 20 | }; 21 | 22 | declare export type TabsProps = StandardProps & { 23 | action?: (actions: TabsActions) => void, 24 | centered?: boolean, 25 | children?: React$Node, 26 | fullWidth?: boolean, 27 | indicatorColor?: "secondary" | "primary" | string, 28 | onChange?: (event: SyntheticEvent<{}>, value: any) => void, 29 | scrollable?: boolean, 30 | ScrollButtonComponent?: React$ComponentType<*>, 31 | scrollButtons?: "auto" | "on" | "off", 32 | // TabIndicatorProps?: $Shape, 33 | textColor?: "secondary" | "primary" | "inherit" | string, 34 | value: any, 35 | width?: string 36 | }; 37 | 38 | declare type Tabs = React$ComponentType; 39 | 40 | declare module.exports: Tabs; 41 | } 42 | -------------------------------------------------------------------------------- /TextField.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/TextField" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {Margin} from "@material-ui/core/PropTypes"; 6 | import type {FormControlProps} from "@material-ui/core/FormControl"; 7 | import type {FormHelperTextProps} from "@material-ui/core/FormHelperText"; 8 | import type {InputProps} from "@material-ui/core/Input"; 9 | import type {InputLabelProps} from "@material-ui/core/InputLabel"; 10 | import type {FormControlClassKey} from "@material-ui/core/FormControl"; 11 | import type {SelectProps} from "@material-ui/core/Select"; 12 | 13 | declare export type TextFieldClassKey = FormControlClassKey; 14 | 15 | declare export type TextFieldProps = StandardProps & { 16 | autoComplete?: string, 17 | autoFocus?: boolean, 18 | children?: React$Node, 19 | defaultValue?: string | number, 20 | disabled?: boolean, 21 | error?: boolean, 22 | FormHelperTextProps?: $Shape, 23 | fullWidth?: boolean, 24 | helperText?: React$Node, 25 | id?: string, 26 | InputLabelProps?: $Shape, 27 | InputProps?: $Shape, 28 | inputProps?: $PropertyType, 29 | inputRef?: React$Ref, 30 | label?: React$Node, 31 | margin?: Margin, 32 | multiline?: boolean, 33 | name?: string, 34 | onChange?: SyntheticInputEvent => mixed, 35 | placeholder?: string, 36 | required?: boolean, 37 | rows?: string | number, 38 | rowsMax?: string | number, 39 | select?: boolean, 40 | SelectProps?: $Shape, 41 | type?: string, 42 | value?: Array | string | number 43 | }; 44 | 45 | declare type TextField = React$ComponentType; 46 | 47 | declare module.exports: TextField; 48 | } 49 | -------------------------------------------------------------------------------- /Toolbar.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Toolbar" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {PaperProps} from "@material-ui/core/Paper"; 6 | 7 | declare export type ToolbarClassKey = 8 | | "root" 9 | | "gutter"; 10 | 11 | declare export type ToolbarProps = StandardProps<{}, ToolbarClassKey> & { 12 | disableGutters?: boolean 13 | }; 14 | 15 | declare type Toolbar = React$ComponentType; 16 | 17 | declare module.exports: Toolbar; 18 | } 19 | -------------------------------------------------------------------------------- /Typography.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/Typography" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {Style, TextStyle} from "@material-ui/core/styles/createTypography"; 6 | import type {Color, Alignment} from "@material-ui/core/PropTypes"; 7 | 8 | declare export type TypographyClassKey = "root" 9 | | "display4" 10 | | "display3" 11 | | "display2" 12 | | "display1" 13 | | "headline" 14 | | "title" 15 | | "subheading" 16 | | "body2" 17 | | "body1" 18 | | "caption" 19 | | "button" 20 | | "alignLeft" 21 | | "alignCenter" 22 | | "alignRight" 23 | | "alignJustify" 24 | | "noWrap" 25 | | "gutterBottom" 26 | | "paragraph" 27 | | "colorInherit" 28 | | "colorSecondary" 29 | | "colorTextSecondary"; 30 | 31 | // React$ElementProps 32 | declare export type TypographyProps = StandardProps<{}, TypographyClassKey> & { 33 | align?: Alignment; 34 | color?: Color | "textSecondary" | "error"; 35 | component?: React$ComponentType; 36 | gutterBottom?: boolean; 37 | headlineMapping?: { [type: $Keys]: string }; 38 | noWrap?: boolean; 39 | paragraph?: boolean; 40 | variant?: Style | "caption" | "button"; 41 | }; 42 | 43 | declare type Typography = React$ComponentType; 44 | 45 | declare module.exports: Typography; 46 | } 47 | -------------------------------------------------------------------------------- /colors/common.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/colors/common" { 3 | declare type CommonColors = { 4 | black: string, 5 | white: string 6 | }; 7 | 8 | declare module.exports: CommonColors; 9 | } 10 | -------------------------------------------------------------------------------- /colors/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/colors" { 3 | 4 | declare export type Color = { 5 | "50": string, 6 | "100": string, 7 | "200": string, 8 | "300": string, 9 | "400": string, 10 | "500": string, 11 | "600": string, 12 | "700": string, 13 | "800": string, 14 | "900": string, 15 | A100: string, 16 | A200: string, 17 | A400: string, 18 | A700: string 19 | }; 20 | 21 | declare module.exports: { 22 | amber: Color, 23 | blue: Color, 24 | blueGrey: Color, 25 | brown: Color, 26 | common: Color, 27 | cyan: Color, 28 | deepOrange: Color, 29 | deepPurple: Color, 30 | green: Color, 31 | grey: Color, 32 | indigo: Color, 33 | lightBlue: Color, 34 | lightGreen: Color, 35 | lime: Color, 36 | orange: Color, 37 | pink: Color, 38 | purple: Color, 39 | red: Color, 40 | teal: Color, 41 | yellow: Color 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core" { 3 | 4 | declare export type PaletteType = "light" | "dark"; 5 | 6 | declare module.exports: { 7 | AppBar: $Exports<"@material-ui/core/AppBar">, 8 | Button: $Exports<"@material-ui/core/Button">, 9 | Card: $Exports<"@material-ui/core/Card">, 10 | CardContent: $Exports<"@material-ui/core/CardContent">, 11 | CardActions: $Exports<"@material-ui/core/CardActions">, 12 | Paper: $Exports<"@material-ui/core/Paper">, 13 | Tabs: $Exports<"@material-ui/core/Tabs">, 14 | Tab: $Exports<"@material-ui/core/Tab">, 15 | Typography: $Exports<"@material-ui/core/Typography">, 16 | TextField: $Exports<"@material-ui/core/TextField">, 17 | SvgIcon: $Exports<"@material-ui/core/SvgIcon">, 18 | Toolbar: $Exports<"@material-ui/core/Toolbar">, 19 | IconButton: $Exports<"@material-ui/core/IconButton"> 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /styles/MuiThemeProvider.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/MuiThemeProvider" { 3 | 4 | import type {StandardProps} from "@material-ui/core/styles/withStyles"; 5 | import type {Theme} from "@material-ui/core/styles/createMuiTheme"; 6 | 7 | /* 8 | declare type SheetManagerTheme = { 9 | refs: number, 10 | sheet: StyleSheet 11 | }; 12 | */ 13 | declare export type MuiThemeProviderProps = { 14 | theme: Theme | ((outer: Theme | null) => Theme), 15 | // sheetsManager?: Map>; 16 | disableStylesGeneration?: boolean, 17 | children: React$Node 18 | }; 19 | 20 | declare type MuiThemeProvider = React$ComponentType; 21 | 22 | declare module.exports: MuiThemeProvider; 23 | } 24 | -------------------------------------------------------------------------------- /styles/createBreakpoints.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/createBreakpoints" { 3 | 4 | declare type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl"; 5 | declare type BreakpointValues = { [key: Breakpoint]: number }; 6 | 7 | declare export type Breakpoints = { 8 | keys: Breakpoint[], 9 | values: BreakpointValues, 10 | up: (key: Breakpoint | number) => string, 11 | down: (key: Breakpoint | number) => string, 12 | between: (start: Breakpoint, end: Breakpoint) => string, 13 | only: (key: Breakpoint) => string, 14 | width: (key: Breakpoint) => number 15 | }; 16 | 17 | declare export type BreakpointsOptions = $Shape<{ unit: string, step: number } & Breakpoints>; 18 | 19 | declare module.exports: { 20 | keys: Array, 21 | default: (breakpoints: BreakpointsOptions) => Breakpoints 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /styles/createMixins.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/createMixins" { 3 | 4 | import type {Properties as CSSProperties} from "csstype"; 5 | import type {Breakpoints} from "@material-ui/core/styles/createBreakpoints"; 6 | import type {Spacing} from "@material-ui/core/styles/spacing"; 7 | 8 | declare export type Mixins = { 9 | gutters: (styles?: CSSProperties<*>) => CSSProperties<*>, 10 | toolbar: CSSProperties<*> 11 | }; 12 | 13 | declare export type MixinsOptions = $Shape; 14 | 15 | declare module.exports: ( 16 | breakpoints: Breakpoints, 17 | spacing: Spacing, 18 | mixins: MixinsOptions 19 | ) => Mixins; 20 | } 21 | -------------------------------------------------------------------------------- /styles/createMuiTheme.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/createMuiTheme" { 3 | 4 | import type { Breakpoints, BreakpointsOptions } from "@material-ui/core/styles/createBreakpoints"; 5 | import type { Mixins, MixinsOptions } from "@material-ui/core/styles/createMixins"; 6 | import type { Palette, PaletteOptions } from "@material-ui/core/styles/createPalette"; 7 | import type { Shadows } from "@material-ui/core/styles/shadows"; 8 | import type { Spacing, SpacingOptions } from "@material-ui/core/styles/spacing"; 9 | import type { Transitions, TransitionsOptions } from "@material-ui/core/styles/transitions"; 10 | import type { Typography, TypographyOptions } from "@material-ui/core/styles/createTypography"; 11 | import type { ZIndex, ZIndexOptions } from "@material-ui/core/styles/zIndex"; 12 | // import type { Overrides } from "./overrides"; 13 | 14 | declare type Direction = "ltr" | "rtl"; 15 | 16 | declare type ThemeOptions = { 17 | direction?: Direction, 18 | palette?: PaletteOptions, 19 | typography?: TypographyOptions | ((palette: Palette) => TypographyOptions), 20 | mixins?: MixinsOptions, 21 | breakpoints?: BreakpointsOptions, 22 | shadows?: Shadows, 23 | transitions?: TransitionsOptions, 24 | spacing?: SpacingOptions, 25 | zIndex?: ZIndexOptions, 26 | overrides?: Object 27 | }; 28 | 29 | declare type Theme = { 30 | direction: Direction, 31 | palette: Palette, 32 | typography: Typography, 33 | mixins: Mixins, 34 | shadows: Shadows, 35 | transitions: Transitions, 36 | spacing: Spacing, 37 | zIndex: ZIndex, 38 | overrides?: Object 39 | }; 40 | 41 | declare module.exports: (options: ThemeOptions) => Theme; 42 | } 43 | -------------------------------------------------------------------------------- /styles/createPalette.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/createPalette" { 3 | 4 | import type {CommonColors} from "@material-ui/core/colors/common"; 5 | 6 | declare type TypeText = { 7 | primary: string, 8 | secondary: string, 9 | disabled: string, 10 | hint: string 11 | }; 12 | 13 | declare type TypeAction = { 14 | active: string, 15 | hover: string, 16 | selected: string, 17 | disabled: string, 18 | disabledBackground: string 19 | }; 20 | 21 | declare type TypeBackground = { 22 | default: string, 23 | paper: string 24 | }; 25 | 26 | declare type PaletteType = "light" | "dark"; 27 | 28 | declare type Color = { 29 | "50": string, 30 | "100": string, 31 | "200": string, 32 | "300": string, 33 | "400": string, 34 | "500": string, 35 | "600": string, 36 | "700": string, 37 | "800": string, 38 | "900": string, 39 | "A100": string, 40 | "A200": string, 41 | "A400": string, 42 | "A700": string 43 | }; 44 | 45 | declare type PaletteColor = { 46 | light: string, 47 | main: string, 48 | dark: string, 49 | contrastText: string 50 | }; 51 | 52 | declare type TypeObject = { 53 | text: TypeText; 54 | action: TypeAction; 55 | background: TypeBackground; 56 | }; 57 | 58 | declare type SimplePaletteColorOptions = { 59 | light?: string, 60 | main: string, 61 | dark?: string, 62 | contrastText?: string 63 | }; 64 | 65 | declare type PaletteColorOptions = SimplePaletteColorOptions | $Shape; 66 | 67 | declare export type PaletteOptions = { 68 | common?: $Shape, 69 | type?: PaletteType, 70 | primary?: PaletteColorOptions, 71 | secondary?: PaletteColorOptions, 72 | error?: PaletteColorOptions, 73 | grey?: $Shape, 74 | text?: $Shape, 75 | divider?: string, 76 | action?: $Shape, 77 | background?: $Shape, 78 | getContrastText?: (background: string) => string 79 | }; 80 | 81 | declare export type Palette = { 82 | common: CommonColors, 83 | type: PaletteType, 84 | contrastThreshold: number, 85 | tonalOffset: number, 86 | primary: PaletteColor, 87 | secondary: PaletteColor, 88 | error: PaletteColor, 89 | grey: Color, 90 | text: TypeText, 91 | divider: string, 92 | action: TypeAction, 93 | background: TypeBackground, 94 | getContrastText: (background: string) => string, 95 | augmentColor: ( 96 | color: string, 97 | mainShade: number | string, 98 | lightShade: number | string, 99 | darkShade: number | string, 100 | ) => void 101 | }; 102 | 103 | declare export var light: TypeObject; 104 | declare export var dark: TypeObject; 105 | declare export default (palette: PaletteOptions) => Palette; 106 | } 107 | -------------------------------------------------------------------------------- /styles/createTypography.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/createTypography" { 3 | 4 | import type {Properties as CSSProperties} from "csstype"; 5 | import type {Palette} from "@material-ui/core/styles/createPalette"; 6 | 7 | declare type TextStyle = "display1" | "display2" | "display3" | "display4" | "headline" | "title" | "subheading" 8 | | "body1" | "body2" | "caption"; 9 | 10 | declare type Style = TextStyle | "button"; 11 | 12 | declare type FontStyle = { 13 | fontFamily: $PropertyType, "fontFamily">, 14 | fontSize: $PropertyType, "fontSize">, 15 | fontWeightLight: $PropertyType, "fontWeight">, 16 | fontWeightRegular: $PropertyType, "fontWeight">, 17 | fontWeightMedium: $PropertyType, "fontWeight">, 18 | htmlFontSize?: $PropertyType, "fontSize"> 19 | }; 20 | 21 | declare type TypographyStyle = { 22 | color?: string, 23 | fontFamily: $PropertyType, "fontFamily">, 24 | fontSize: $PropertyType, "fontSize">, 25 | fontWeight: $PropertyType, "fontWeight">, 26 | letterSpacing?: $PropertyType, "letterSpacing">, 27 | lineHeight?: $PropertyType, "lineHeight">, 28 | textTransform?: $PropertyType, "textTransform"> 29 | }; 30 | 31 | declare type TypographyUtils = { 32 | pxToRem: (px: number) => string 33 | }; 34 | 35 | declare export type Typography = { [style: Style]: $Shape } & FontStyle & TypographyUtils; 36 | declare export type TypographyOptions = $Shape<{ [style: Style]: $Shape } & FontStyle>; 37 | declare module.exports: ( 38 | palette: Palette, 39 | typography: TypographyOptions | ((palette: Palette) => TypographyOptions), 40 | ) => Typography; 41 | } 42 | -------------------------------------------------------------------------------- /styles/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles" { 3 | 4 | import type {Properties as CSSProperties} from "csstype"; 5 | import type {Theme} from "@material-ui/core/styles/createMuiTheme"; 6 | import type {WithStyles as ExportsWithStyles, StyleRulesCallback as ExportsStyleRulesCallback} from "@material-ui/core/styles/withStyles"; 7 | 8 | declare export type StylingProps = { 9 | className?: string, 10 | style?: $Shape> 11 | }; 12 | 13 | declare export type WithStyles = ExportsWithStyles; 14 | declare export type StyleRulesCallback = ExportsStyleRulesCallback; 15 | 16 | declare module.exports: { 17 | Theme: Theme, 18 | withStyles: $Exports<"@material-ui/core/styles/withStyles">, 19 | MuiThemeProvider: $Exports<"@material-ui/core/styles/MuiThemeProvider">, 20 | createMuiTheme: $Exports<"@material-ui/core/styles/createMuiTheme"> 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /styles/overrides.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | -------------------------------------------------------------------------------- /styles/shadows.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/shadows" { 3 | 4 | declare export type Shadows = string[]; 5 | 6 | declare module.exports: Shadows; 7 | } 8 | -------------------------------------------------------------------------------- /styles/spacing.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/spacing" { 3 | 4 | declare export type Spacing = { 5 | unit: number 6 | }; 7 | 8 | declare export type SpacingOptions = $Shape; 9 | 10 | declare module.exports: Spacing; 11 | } 12 | -------------------------------------------------------------------------------- /styles/transitions.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/transitions" { 3 | 4 | declare type Easing = { 5 | easeInOut: string, 6 | easeOut: string, 7 | easeIn: string, 8 | sharp: string 9 | }; 10 | 11 | declare type Duration = { 12 | shortest: number, 13 | shorter: number, 14 | short: number, 15 | standard: number, 16 | complex: number, 17 | enteringScreen: number, 18 | leavingScreen: number 19 | }; 20 | 21 | declare export type Transitions = { 22 | easing: Easing, 23 | duration: Duration, 24 | create( 25 | props: string | string[], 26 | options?: $Shape<{ duration: number | string; easing: string; delay: number | string }>, 27 | ): string, 28 | getAutoHeightDuration(height: number): number 29 | }; 30 | 31 | declare export type TransitionsOptions = { 32 | easing?: $Shape; 33 | duration?: $Shape; 34 | create?: ( 35 | props: string | string[], 36 | options?: $Shape<{ duration: number | string; easing: string; delay: number | string }>, 37 | ) => string; 38 | getAutoHeightDuration?: (height: number) => number; 39 | }; 40 | 41 | declare export var easing: Easing; 42 | declare export var duration: Duration; 43 | declare export var formatMs: (milliseconds: number) => string; 44 | declare export default Transitions; 45 | } 46 | -------------------------------------------------------------------------------- /styles/withStyles.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/withStyles" { 3 | 4 | import type {Properties as CSSProperties} from "csstype"; 5 | import type {WithTheme} from "@material-ui/core/styles/withTheme"; 6 | import type {Theme} from "@material-ui/core/styles/createMuiTheme"; 7 | 8 | declare type Record = { [K]: V }; 9 | declare type StyleRules = Record>; 10 | declare export type StyleRulesCallback = (theme: Theme) => StyleRules; 11 | 12 | declare type WithStylesOptions = { 13 | flip?: boolean, 14 | withTheme?: boolean, 15 | name?: string 16 | }; 17 | 18 | declare export type ClassNameMap = Record; 19 | 20 | declare export type WithStyles = $Shape & { 21 | classes: ClassNameMap 22 | }; 23 | 24 | declare export type StyledComponentProps = { 25 | classes?: $Shape>, 26 | innerRef?: React$Ref 27 | }; 28 | 29 | // & C 30 | declare export type StandardProps = StyledComponentProps & { 31 | className?: string, 32 | style?: $Shape> 33 | }; 34 | 35 | declare module.exports: >( 36 | style: StyleRules | StyleRulesCallback, 37 | options?: WithStylesOptions 38 | ) => (C: Comp) => Class, WithStyles>>>; 39 | } 40 | -------------------------------------------------------------------------------- /styles/withTheme.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/withTheme" { 3 | import type { Theme } from "@material-ui/core/styles/createMuiTheme"; 4 | 5 | declare export type WithTheme = { 6 | theme: Theme 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /styles/zIndex.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "@material-ui/core/styles/zIndex" { 3 | 4 | declare export type ZIndex = { 5 | mobileStepper: number, 6 | appBar: number, 7 | drawer: number, 8 | modal: number, 9 | snackbar: number, 10 | tooltip: number 11 | }; 12 | 13 | declare type ZIndexOptions = $Shape; 14 | 15 | declare module.exports: ZIndex; 16 | } 17 | --------------------------------------------------------------------------------