@panneau/form-auth 1.0.0-alpha.236
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +177 -0
- package/lib/index.js +190 -0
- package/package.json +59 -0
package/es/index.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import { PropTypes as PropTypes$1 } from '@panneau/core';
|
|
3
|
+
import Form from '@panneau/form';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
var _excluded$2 = ["action", "fields", "emailLabel", "size"];
|
|
9
|
+
var propTypes$2 = {
|
|
10
|
+
action: PropTypes.string.isRequired,
|
|
11
|
+
fields: PropTypes$1.fields,
|
|
12
|
+
size: PropTypes.string,
|
|
13
|
+
emailLabel: PropTypes$1.message
|
|
14
|
+
};
|
|
15
|
+
var defaultProps$2 = {
|
|
16
|
+
fields: null,
|
|
17
|
+
size: 'lg',
|
|
18
|
+
emailLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
19
|
+
id: "LI0Gz4",
|
|
20
|
+
defaultMessage: [{
|
|
21
|
+
"type": 0,
|
|
22
|
+
"value": "Email"
|
|
23
|
+
}]
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var ForgotPassword = function ForgotPassword(_ref) {
|
|
28
|
+
var action = _ref.action,
|
|
29
|
+
fields = _ref.fields,
|
|
30
|
+
emailLabel = _ref.emailLabel,
|
|
31
|
+
size = _ref.size,
|
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
33
|
+
|
|
34
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
35
|
+
action: action,
|
|
36
|
+
fields: fields || [{
|
|
37
|
+
name: 'email',
|
|
38
|
+
type: 'email',
|
|
39
|
+
size: size,
|
|
40
|
+
label: emailLabel
|
|
41
|
+
}],
|
|
42
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
43
|
+
id: "12Px0g",
|
|
44
|
+
defaultMessage: [{
|
|
45
|
+
"type": 0,
|
|
46
|
+
"value": "Send reset link"
|
|
47
|
+
}]
|
|
48
|
+
})
|
|
49
|
+
}, props));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
ForgotPassword.propTypes = propTypes$2;
|
|
53
|
+
ForgotPassword.defaultProps = defaultProps$2;
|
|
54
|
+
|
|
55
|
+
var _excluded$1 = ["action", "fields", "size", "emailLabel", "passwordLabel"];
|
|
56
|
+
var propTypes$1 = {
|
|
57
|
+
action: PropTypes.string.isRequired,
|
|
58
|
+
fields: PropTypes$1.fields,
|
|
59
|
+
size: PropTypes.string,
|
|
60
|
+
emailLabel: PropTypes$1.message,
|
|
61
|
+
passwordLabel: PropTypes$1.message
|
|
62
|
+
};
|
|
63
|
+
var defaultProps$1 = {
|
|
64
|
+
fields: null,
|
|
65
|
+
size: 'lg',
|
|
66
|
+
emailLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
67
|
+
id: "LI0Gz4",
|
|
68
|
+
defaultMessage: [{
|
|
69
|
+
"type": 0,
|
|
70
|
+
"value": "Email"
|
|
71
|
+
}]
|
|
72
|
+
}),
|
|
73
|
+
passwordLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
74
|
+
id: "4yfet+",
|
|
75
|
+
defaultMessage: [{
|
|
76
|
+
"type": 0,
|
|
77
|
+
"value": "Password"
|
|
78
|
+
}]
|
|
79
|
+
})
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var LoginForm = function LoginForm(_ref) {
|
|
83
|
+
var action = _ref.action,
|
|
84
|
+
fields = _ref.fields,
|
|
85
|
+
size = _ref.size,
|
|
86
|
+
emailLabel = _ref.emailLabel,
|
|
87
|
+
passwordLabel = _ref.passwordLabel,
|
|
88
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
89
|
+
|
|
90
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
91
|
+
action: action,
|
|
92
|
+
fields: fields || [{
|
|
93
|
+
name: 'email',
|
|
94
|
+
type: 'email',
|
|
95
|
+
size: size,
|
|
96
|
+
label: emailLabel
|
|
97
|
+
}, {
|
|
98
|
+
name: 'password',
|
|
99
|
+
type: 'password',
|
|
100
|
+
size: size,
|
|
101
|
+
label: passwordLabel
|
|
102
|
+
}],
|
|
103
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
104
|
+
id: "g6qbbX",
|
|
105
|
+
defaultMessage: [{
|
|
106
|
+
"type": 0,
|
|
107
|
+
"value": "Log in"
|
|
108
|
+
}]
|
|
109
|
+
})
|
|
110
|
+
}, props));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
LoginForm.propTypes = propTypes$1;
|
|
114
|
+
LoginForm.defaultProps = defaultProps$1;
|
|
115
|
+
|
|
116
|
+
var _excluded = ["action", "fields", "size", "passwordLabel", "passwordConfirmationLabel"];
|
|
117
|
+
var propTypes = {
|
|
118
|
+
action: PropTypes.string.isRequired,
|
|
119
|
+
fields: PropTypes$1.fields,
|
|
120
|
+
size: PropTypes.string,
|
|
121
|
+
passwordLabel: PropTypes$1.message,
|
|
122
|
+
passwordConfirmationLabel: PropTypes$1.message
|
|
123
|
+
};
|
|
124
|
+
var defaultProps = {
|
|
125
|
+
fields: null,
|
|
126
|
+
size: 'lg',
|
|
127
|
+
passwordLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
128
|
+
id: "4yfet+",
|
|
129
|
+
defaultMessage: [{
|
|
130
|
+
"type": 0,
|
|
131
|
+
"value": "Password"
|
|
132
|
+
}]
|
|
133
|
+
}),
|
|
134
|
+
passwordConfirmationLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
135
|
+
id: "SdtI90",
|
|
136
|
+
defaultMessage: [{
|
|
137
|
+
"type": 0,
|
|
138
|
+
"value": "Password confirmation"
|
|
139
|
+
}]
|
|
140
|
+
})
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
var ResetPassword = function ResetPassword(_ref) {
|
|
144
|
+
var action = _ref.action,
|
|
145
|
+
fields = _ref.fields,
|
|
146
|
+
size = _ref.size,
|
|
147
|
+
passwordLabel = _ref.passwordLabel,
|
|
148
|
+
passwordConfirmationLabel = _ref.passwordConfirmationLabel,
|
|
149
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
150
|
+
|
|
151
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
152
|
+
action: action,
|
|
153
|
+
fields: fields || [{
|
|
154
|
+
name: 'password',
|
|
155
|
+
type: 'password',
|
|
156
|
+
size: size,
|
|
157
|
+
label: passwordLabel
|
|
158
|
+
}, {
|
|
159
|
+
name: 'password_confrmation',
|
|
160
|
+
type: 'password',
|
|
161
|
+
size: size,
|
|
162
|
+
label: passwordConfirmationLabel
|
|
163
|
+
}],
|
|
164
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
165
|
+
id: "zwks3g",
|
|
166
|
+
defaultMessage: [{
|
|
167
|
+
"type": 0,
|
|
168
|
+
"value": "Save new password"
|
|
169
|
+
}]
|
|
170
|
+
})
|
|
171
|
+
}, props));
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
ResetPassword.propTypes = propTypes;
|
|
175
|
+
ResetPassword.defaultProps = defaultProps;
|
|
176
|
+
|
|
177
|
+
export { ForgotPassword, LoginForm as Login, ResetPassword };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
+
var core = require('@panneau/core');
|
|
7
|
+
var Form = require('@panneau/form');
|
|
8
|
+
var PropTypes = require('prop-types');
|
|
9
|
+
var React = require('react');
|
|
10
|
+
var reactIntl = require('react-intl');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
15
|
+
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
16
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
+
|
|
19
|
+
var _excluded$2 = ["action", "fields", "emailLabel", "size"];
|
|
20
|
+
var propTypes$2 = {
|
|
21
|
+
action: PropTypes__default["default"].string.isRequired,
|
|
22
|
+
fields: core.PropTypes.fields,
|
|
23
|
+
size: PropTypes__default["default"].string,
|
|
24
|
+
emailLabel: core.PropTypes.message
|
|
25
|
+
};
|
|
26
|
+
var defaultProps$2 = {
|
|
27
|
+
fields: null,
|
|
28
|
+
size: 'lg',
|
|
29
|
+
emailLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
30
|
+
id: "LI0Gz4",
|
|
31
|
+
defaultMessage: [{
|
|
32
|
+
"type": 0,
|
|
33
|
+
"value": "Email"
|
|
34
|
+
}]
|
|
35
|
+
})
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var ForgotPassword = function ForgotPassword(_ref) {
|
|
39
|
+
var action = _ref.action,
|
|
40
|
+
fields = _ref.fields,
|
|
41
|
+
emailLabel = _ref.emailLabel,
|
|
42
|
+
size = _ref.size,
|
|
43
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded$2);
|
|
44
|
+
|
|
45
|
+
return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
|
|
46
|
+
action: action,
|
|
47
|
+
fields: fields || [{
|
|
48
|
+
name: 'email',
|
|
49
|
+
type: 'email',
|
|
50
|
+
size: size,
|
|
51
|
+
label: emailLabel
|
|
52
|
+
}],
|
|
53
|
+
submitButtonLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
54
|
+
id: "12Px0g",
|
|
55
|
+
defaultMessage: [{
|
|
56
|
+
"type": 0,
|
|
57
|
+
"value": "Send reset link"
|
|
58
|
+
}]
|
|
59
|
+
})
|
|
60
|
+
}, props));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
ForgotPassword.propTypes = propTypes$2;
|
|
64
|
+
ForgotPassword.defaultProps = defaultProps$2;
|
|
65
|
+
|
|
66
|
+
var _excluded$1 = ["action", "fields", "size", "emailLabel", "passwordLabel"];
|
|
67
|
+
var propTypes$1 = {
|
|
68
|
+
action: PropTypes__default["default"].string.isRequired,
|
|
69
|
+
fields: core.PropTypes.fields,
|
|
70
|
+
size: PropTypes__default["default"].string,
|
|
71
|
+
emailLabel: core.PropTypes.message,
|
|
72
|
+
passwordLabel: core.PropTypes.message
|
|
73
|
+
};
|
|
74
|
+
var defaultProps$1 = {
|
|
75
|
+
fields: null,
|
|
76
|
+
size: 'lg',
|
|
77
|
+
emailLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
78
|
+
id: "LI0Gz4",
|
|
79
|
+
defaultMessage: [{
|
|
80
|
+
"type": 0,
|
|
81
|
+
"value": "Email"
|
|
82
|
+
}]
|
|
83
|
+
}),
|
|
84
|
+
passwordLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
85
|
+
id: "4yfet+",
|
|
86
|
+
defaultMessage: [{
|
|
87
|
+
"type": 0,
|
|
88
|
+
"value": "Password"
|
|
89
|
+
}]
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var LoginForm = function LoginForm(_ref) {
|
|
94
|
+
var action = _ref.action,
|
|
95
|
+
fields = _ref.fields,
|
|
96
|
+
size = _ref.size,
|
|
97
|
+
emailLabel = _ref.emailLabel,
|
|
98
|
+
passwordLabel = _ref.passwordLabel,
|
|
99
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded$1);
|
|
100
|
+
|
|
101
|
+
return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
|
|
102
|
+
action: action,
|
|
103
|
+
fields: fields || [{
|
|
104
|
+
name: 'email',
|
|
105
|
+
type: 'email',
|
|
106
|
+
size: size,
|
|
107
|
+
label: emailLabel
|
|
108
|
+
}, {
|
|
109
|
+
name: 'password',
|
|
110
|
+
type: 'password',
|
|
111
|
+
size: size,
|
|
112
|
+
label: passwordLabel
|
|
113
|
+
}],
|
|
114
|
+
submitButtonLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
115
|
+
id: "g6qbbX",
|
|
116
|
+
defaultMessage: [{
|
|
117
|
+
"type": 0,
|
|
118
|
+
"value": "Log in"
|
|
119
|
+
}]
|
|
120
|
+
})
|
|
121
|
+
}, props));
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
LoginForm.propTypes = propTypes$1;
|
|
125
|
+
LoginForm.defaultProps = defaultProps$1;
|
|
126
|
+
|
|
127
|
+
var _excluded = ["action", "fields", "size", "passwordLabel", "passwordConfirmationLabel"];
|
|
128
|
+
var propTypes = {
|
|
129
|
+
action: PropTypes__default["default"].string.isRequired,
|
|
130
|
+
fields: core.PropTypes.fields,
|
|
131
|
+
size: PropTypes__default["default"].string,
|
|
132
|
+
passwordLabel: core.PropTypes.message,
|
|
133
|
+
passwordConfirmationLabel: core.PropTypes.message
|
|
134
|
+
};
|
|
135
|
+
var defaultProps = {
|
|
136
|
+
fields: null,
|
|
137
|
+
size: 'lg',
|
|
138
|
+
passwordLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
139
|
+
id: "4yfet+",
|
|
140
|
+
defaultMessage: [{
|
|
141
|
+
"type": 0,
|
|
142
|
+
"value": "Password"
|
|
143
|
+
}]
|
|
144
|
+
}),
|
|
145
|
+
passwordConfirmationLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
146
|
+
id: "SdtI90",
|
|
147
|
+
defaultMessage: [{
|
|
148
|
+
"type": 0,
|
|
149
|
+
"value": "Password confirmation"
|
|
150
|
+
}]
|
|
151
|
+
})
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
var ResetPassword = function ResetPassword(_ref) {
|
|
155
|
+
var action = _ref.action,
|
|
156
|
+
fields = _ref.fields,
|
|
157
|
+
size = _ref.size,
|
|
158
|
+
passwordLabel = _ref.passwordLabel,
|
|
159
|
+
passwordConfirmationLabel = _ref.passwordConfirmationLabel,
|
|
160
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
161
|
+
|
|
162
|
+
return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
|
|
163
|
+
action: action,
|
|
164
|
+
fields: fields || [{
|
|
165
|
+
name: 'password',
|
|
166
|
+
type: 'password',
|
|
167
|
+
size: size,
|
|
168
|
+
label: passwordLabel
|
|
169
|
+
}, {
|
|
170
|
+
name: 'password_confrmation',
|
|
171
|
+
type: 'password',
|
|
172
|
+
size: size,
|
|
173
|
+
label: passwordConfirmationLabel
|
|
174
|
+
}],
|
|
175
|
+
submitButtonLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
176
|
+
id: "zwks3g",
|
|
177
|
+
defaultMessage: [{
|
|
178
|
+
"type": 0,
|
|
179
|
+
"value": "Save new password"
|
|
180
|
+
}]
|
|
181
|
+
})
|
|
182
|
+
}, props));
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
ResetPassword.propTypes = propTypes;
|
|
186
|
+
ResetPassword.defaultProps = defaultProps;
|
|
187
|
+
|
|
188
|
+
exports.ForgotPassword = ForgotPassword;
|
|
189
|
+
exports.Login = LoginForm;
|
|
190
|
+
exports.ResetPassword = ResetPassword;
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@panneau/form-auth",
|
|
3
|
+
"version": "1.0.0-alpha.236",
|
|
4
|
+
"description": "Basic forgot password form",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"javascript"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/folkloreinc/panneau-js",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/folkloreinc/panneau-js.git"
|
|
12
|
+
},
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Folklore",
|
|
15
|
+
"email": "info@folklore.email"
|
|
16
|
+
},
|
|
17
|
+
"contributors": [
|
|
18
|
+
{
|
|
19
|
+
"name": "David Mongeau-Petitpas",
|
|
20
|
+
"email": "dmp@folklore.email"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Nicolas Roy-Bourdages",
|
|
24
|
+
"email": "nrb@folklore.email"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"main": "lib/index.js",
|
|
29
|
+
"module": "es/index.js",
|
|
30
|
+
"files": [
|
|
31
|
+
"lib",
|
|
32
|
+
"es",
|
|
33
|
+
"assets"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"prepare": "../../scripts/prepare-package.sh"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
40
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
44
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@babel/runtime": "^7.12.5",
|
|
48
|
+
"@panneau/core": "^1.0.0-alpha.236",
|
|
49
|
+
"@panneau/form": "^1.0.0-alpha.236",
|
|
50
|
+
"classnames": "^2.2.6",
|
|
51
|
+
"lodash": "^4.17.21",
|
|
52
|
+
"prop-types": "^15.7.2",
|
|
53
|
+
"react-intl": "^5.15.8"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"gitHead": "ac8add5d37f0c2439d9b3726d052f2698ee1ea3b"
|
|
59
|
+
}
|