├── .gitignore ├── .versions ├── LICENSE ├── README.md ├── accounts-material.png ├── main.jsx ├── package.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.versions: -------------------------------------------------------------------------------- 1 | accounts-base@1.2.7 2 | allow-deny@1.0.4 3 | babel-compiler@6.6.4 4 | babel-runtime@0.1.8 5 | base64@1.0.8 6 | binary-heap@1.0.8 7 | blaze@2.1.7 8 | blaze-tools@1.0.8 9 | boilerplate-generator@1.0.8 10 | caching-compiler@1.0.4 11 | callback-hook@1.0.8 12 | check@1.2.1 13 | coffeescript@1.0.17 14 | ddp@1.2.5 15 | ddp-client@1.2.7 16 | ddp-common@1.2.5 17 | ddp-rate-limiter@1.0.4 18 | ddp-server@1.2.6 19 | deps@1.0.12 20 | diff-sequence@1.0.5 21 | ecmascript@0.4.3 22 | ecmascript-runtime@0.2.10 23 | ejson@1.0.11 24 | email@1.0.12 25 | geojson-utils@1.0.8 26 | html-tools@1.0.9 27 | htmljs@1.0.9 28 | id-map@1.0.7 29 | jquery@1.11.8 30 | localstorage@1.0.9 31 | logging@1.0.12 32 | meteor@1.1.14 33 | minimongo@1.0.16 34 | modules@0.6.1 35 | modules-runtime@0.6.3 36 | mongo@1.1.7 37 | mongo-id@1.0.4 38 | npm-mongo@1.4.43 39 | observe-sequence@1.0.11 40 | ordered-dict@1.0.7 41 | promise@0.6.7 42 | random@1.0.9 43 | rate-limit@1.0.4 44 | reactive-dict@1.1.7 45 | reactive-var@1.0.9 46 | retry@1.0.7 47 | routepolicy@1.0.10 48 | service-configuration@1.0.9 49 | session@1.1.5 50 | softwarerero:accounts-t9n@1.3.3 51 | spacebars@1.0.11 52 | spacebars-compiler@1.0.11 53 | std:accounts-material@1.1.0 54 | std:accounts-ui@1.2.1 55 | tmeasday:check-npm-versions@0.3.1 56 | tracker@1.0.13 57 | ui@1.0.11 58 | underscore@1.0.8 59 | webapp@1.2.8 60 | webapp-hashing@1.0.9 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Studio Interact Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > This package is not maintained anymore, use [zetoff:accounts-material-ui](https://atmospherejs.com/zetoff/accounts-material-ui) instead. // T 2 | 3 | # React Accounts UI for Meteor 1.3 - Material UI 4 | 5 | Current version 1.1.0 6 | 7 | ![Accounts UI for Meteor 1.3 - Material UI](https://raw.githubusercontent.com/studiointeract/accounts-material/master/accounts-material.png) 8 | 9 | ## Features 10 | 11 | 1. **[Easy to use](https://github.com/studiointeract/react-accounts-ui#using-react-accounts-ui)**, mixing the ideas of useraccounts configuration and accounts-ui that everyone already knows and loves. 12 | 3. **[Components](https://github.com/studiointeract/react-accounts-ui#components-available)** are everywhere, and extensible by replacing them on Accounts.ui. 13 | 4. **[Basic routing](https://github.com/studiointeract/react-accounts-ui#configuration)** included, redirections when the user clicks a link in an email or when signing in or out. 14 | 5. **[Unstyled](https://github.com/studiointeract/react-accounts-ui#styling)** is the default, no CSS included. 15 | 6. **[No password](https://github.com/studiointeract/react-accounts-ui#no-password-required)** sign up and sign in are included. 16 | 7. **[Extra fields](https://github.com/studiointeract/react-accounts-ui#extra-fields)** is now supported. 17 | 8. **[Server Side Rendering](https://github.com/studiointeract/react-accounts-ui#server-side-rendering)** are supported, trough FlowRouter (SSR). 18 | 9. **[Extending](https://github.com/studiointeract/react-accounts-ui#create-your-own-styled-version)** to make your own custom form, for your app, or as a package, all components can be extended and customized. 19 | 20 | ### Based on and extends std:accounts-ui 21 | 22 | [https://github.com/studiointeract/accounts-ui](https://github.com/studiointeract/accounts-ui) 23 | 24 | ## Installation 25 | 26 | `meteor add std:accounts-material` 27 | 28 | ## Configuration 29 | 30 | We support the standard [configuration in the account-ui package](http://docs.meteor.com/#/full/accounts_ui_config). But have extended with some new options. 31 | 32 | ### [Accounts.ui.config(options)](https://github.com/studiointeract/react-accounts-ui#configuration) 33 | 34 | ### Example setup (Meteor 1.3) 35 | 36 | `meteor add accounts-password` 37 | `meteor add materialize:materialize` 38 | `meteor add std:accounts-material` 39 | 40 | ```javascript 41 | 42 | import React from 'react'; 43 | import { Accounts } from 'meteor/std:accounts-material'; 44 | 45 | Accounts.ui.config({ 46 | passwordSignupFields: 'NO_PASSWORD', 47 | loginPath: '/', 48 | }); 49 | 50 | if (Meteor.isClient) { 51 | ReactDOM.render(, document.body) 52 | } 53 | 54 | ``` 55 | 56 | ## Example setup using FlowRouter (Meteor 1.3) 57 | 58 | `meteor add accounts-password` 59 | `meteor add materialize:materialize` 60 | `meteor add std:accounts-material` 61 | `meteor add kadira:flow-router-ssr` 62 | 63 | ```javascript 64 | import { FlowRouter } from 'meteor/kadira:flow-router-ssr'; 65 | import { Accounts } from 'meteor/std:accounts-material'; 66 | import React from 'react'; 67 | 68 | Accounts.ui.config({ 69 | passwordSignupFields: 'NO_PASSWORD', 70 | loginPath: '/login', 71 | onSignedInHook: () => FlowRouter.go('/'), 72 | onSignedOutHook: () => FlowRouter.go('/') 73 | }); 74 | 75 | FlowRouter.route("/login", { 76 | action(params) { 77 | mount(MainLayout, { 78 | content: 79 | }); 80 | } 81 | }); 82 | ``` 83 | 84 | ## Credits 85 | 86 | Made by the [creative folks at Studio Interact](http://studiointeract.com) 87 | -------------------------------------------------------------------------------- /accounts-material.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiointeract/accounts-material/c77cd1616ff4d98aa913109e36fa0f0d4fdf1b31/accounts-material.png -------------------------------------------------------------------------------- /main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Accounts, STATES } from 'meteor/std:accounts-ui'; 3 | 4 | /** 5 | * Form.propTypes = { 6 | * fields: React.PropTypes.object.isRequired, 7 | * buttons: React.PropTypes.object.isRequired, 8 | * error: React.PropTypes.string, 9 | * ready: React.PropTypes.bool 10 | * }; 11 | */ 12 | class Form extends Accounts.ui.Form { 13 | render() { 14 | const { fields, buttons, error, message, ready } = this.props; 15 | return ( 16 |
evt.preventDefault() }> 20 | {Object.keys(fields).length > 0 ? ( 21 | 22 | ): null } 23 | { buttons['switchToPasswordReset'] ? ( 24 |
25 | 26 |
27 | ): null } 28 | {_.values(_.omit(buttons, 'switchToPasswordReset', 'switchToSignIn', 29 | 'switchToSignUp', 'switchToChangePassword', 'switchToSignOut', 'signOut')).map((button, i) => 30 | 70 | ); 71 | } 72 | } 73 | class Fields extends Accounts.ui.Fields { 74 | render () { 75 | let { fields = {}, className = "field row" } = this.props; 76 | return ( 77 |
78 | {Object.keys(fields).map((id, i) => 79 | 80 | )} 81 |
82 | ); 83 | } 84 | } 85 | class Field extends Accounts.ui.Field { 86 | render() { 87 | const { 88 | id, 89 | hint, 90 | label, 91 | type = 'text', 92 | onChange, 93 | required = false, 94 | className, 95 | defaultValue = "" 96 | } = this.props; 97 | const { mount = true } = this.state; 98 | return mount ? ( 99 |
100 | this.input = ref } 104 | autoCapitalize={ type == 'email' ? 'none' : false } 105 | autoCorrect="off" 106 | onChange={ onChange } 107 | className="validate" 108 | placeholder={ hint } defaultValue={ defaultValue } /> 109 | 110 |
111 | ) : null; 112 | } 113 | } 114 | class FormMessage extends Accounts.ui.FormMessage {} 115 | // Notice! Accounts.ui.LoginForm manages all state logic at the moment, so avoid 116 | // overwriting this one, but have a look at it and learn how it works. And pull 117 | // requests altering how that works are welcome. 118 | 119 | // Alter provided default unstyled UI. 120 | Accounts.ui.Form = Form; 121 | Accounts.ui.Buttons = Buttons; 122 | Accounts.ui.Button = Button; 123 | Accounts.ui.Fields = Fields; 124 | Accounts.ui.Field = Field; 125 | Accounts.ui.FormMessage = FormMessage; 126 | 127 | // Export the themed version. 128 | export { Accounts, STATES }; 129 | export default Accounts; 130 | -------------------------------------------------------------------------------- /package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'std:accounts-material', 3 | version: '1.1.0', 4 | summary: 'Material UI – Accounts UI for React in Meteor 1.3', 5 | git: 'https://github.com/std/react-accounts-ui-material-ui', 6 | documentation: 'README.md' 7 | }); 8 | 9 | Package.onUse(function(api) { 10 | api.versionsFrom('1.3'); 11 | api.use('ecmascript'); 12 | api.use('underscore'); 13 | api.use('std:accounts-ui@1.2.1'); 14 | 15 | api.mainModule('main.jsx'); 16 | }); 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-accounts-ui-material-ui", 3 | "description": "Material UI – Accounts UI for React in Meteor 1.3", 4 | "repository": { 5 | "type": "git", 6 | "url": "https://github.com/studiointeract/react-accounts-ui-material-ui.git" 7 | }, 8 | "keywords": [ 9 | "react", 10 | "meteor", 11 | "accounts", 12 | "tracker", 13 | "material-ui" 14 | ], 15 | "author": "timbrandin", 16 | "license": "MIT", 17 | "bugs": { 18 | "url": "https://github.com/studiointeract/react-accounts-ui-material-ui/issues" 19 | }, 20 | "homepage": "https://github.com/studiointeract/react-accounts-ui-material-ui", 21 | "dependencies": { 22 | "react": ">=0.14.7 || ^15.0.0-rc.2", 23 | "react-dom": ">=0.14.7 || ^15.0.0-rc.2", 24 | "tracker-component": ">=1.3.13" 25 | } 26 | } 27 | --------------------------------------------------------------------------------