@panneau/form-auth 1.0.0-alpha.247 → 1.0.0-alpha.253

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.
Files changed (3) hide show
  1. package/es/index.js +128 -128
  2. package/lib/index.js +128 -128
  3. package/package.json +4 -4
package/es/index.js CHANGED
@@ -7,15 +7,95 @@ import { FormattedMessage } from 'react-intl';
7
7
  import { Link } from 'react-router-dom';
8
8
  import { postJSON, getCSRFHeaders } from '@folklore/fetch';
9
9
 
10
- var _excluded$8 = ["action", "fields", "size", "passwordLabel", "submitButtonLabel"];
10
+ var _excluded$8 = ["action", "fields", "size", "currentPasswordLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
11
11
  var propTypes$8 = {
12
12
  action: PropTypes.string,
13
13
  fields: PropTypes$1.fields,
14
14
  size: PropTypes.string,
15
+ currentPasswordLabel: PropTypes$1.label,
15
16
  passwordLabel: PropTypes$1.label,
17
+ passwordConfirmationLabel: PropTypes$1.label,
16
18
  submitButtonLabel: PropTypes$1.label
17
19
  };
18
20
  var defaultProps$8 = {
21
+ action: '/user/password',
22
+ fields: null,
23
+ size: 'lg',
24
+ currentPasswordLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
25
+ id: "8LSb8C",
26
+ defaultMessage: [{
27
+ "type": 0,
28
+ "value": "Current password"
29
+ }]
30
+ }),
31
+ passwordLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
32
+ id: "XJ1dc3",
33
+ defaultMessage: [{
34
+ "type": 0,
35
+ "value": "New password"
36
+ }]
37
+ }),
38
+ passwordConfirmationLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
39
+ id: "DUbv+u",
40
+ defaultMessage: [{
41
+ "type": 0,
42
+ "value": "Confirm your new password"
43
+ }]
44
+ }),
45
+ submitButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
46
+ id: "XW9IKQ",
47
+ defaultMessage: [{
48
+ "type": 0,
49
+ "value": "Update password"
50
+ }]
51
+ })
52
+ };
53
+
54
+ var ChangePassword = function ChangePassword(_ref) {
55
+ var action = _ref.action,
56
+ fields = _ref.fields,
57
+ size = _ref.size,
58
+ currentPasswordLabel = _ref.currentPasswordLabel,
59
+ passwordLabel = _ref.passwordLabel,
60
+ passwordConfirmationLabel = _ref.passwordConfirmationLabel,
61
+ submitButtonLabel = _ref.submitButtonLabel,
62
+ props = _objectWithoutProperties(_ref, _excluded$8);
63
+
64
+ return /*#__PURE__*/React.createElement(Form, Object.assign({
65
+ action: action,
66
+ method: "PUT",
67
+ fields: fields || [{
68
+ name: 'current_password',
69
+ type: 'password',
70
+ size: size,
71
+ label: currentPasswordLabel
72
+ }, {
73
+ name: 'password',
74
+ type: 'password',
75
+ size: size,
76
+ label: passwordLabel
77
+ }, {
78
+ name: 'password_confirmation',
79
+ type: 'password',
80
+ size: size,
81
+ label: passwordConfirmationLabel
82
+ }],
83
+ submitButtonLabel: submitButtonLabel
84
+ }, props));
85
+ };
86
+
87
+ ChangePassword.propTypes = propTypes$8;
88
+ ChangePassword.defaultProps = defaultProps$8;
89
+
90
+ var _excluded$7 = ["action", "fields", "size", "passwordLabel", "submitButtonLabel"];
91
+ var propTypes$7 = {
92
+ action: PropTypes.string,
93
+ fields: PropTypes$1.fields,
94
+ size: PropTypes.string,
95
+ passwordLabel: PropTypes$1.label,
96
+ submitButtonLabel: PropTypes$1.label
97
+ };
98
+ var defaultProps$7 = {
19
99
  action: '/user/confirm-password',
20
100
  fields: null,
21
101
  size: 'lg',
@@ -41,7 +121,7 @@ var ConfirmPassword = function ConfirmPassword(_ref) {
41
121
  size = _ref.size,
42
122
  passwordLabel = _ref.passwordLabel,
43
123
  submitButtonLabel = _ref.submitButtonLabel,
44
- props = _objectWithoutProperties(_ref, _excluded$8);
124
+ props = _objectWithoutProperties(_ref, _excluded$7);
45
125
 
46
126
  return /*#__PURE__*/React.createElement(Form, Object.assign({
47
127
  action: action,
@@ -55,11 +135,11 @@ var ConfirmPassword = function ConfirmPassword(_ref) {
55
135
  }, props));
56
136
  };
57
137
 
58
- ConfirmPassword.propTypes = propTypes$8;
59
- ConfirmPassword.defaultProps = defaultProps$8;
138
+ ConfirmPassword.propTypes = propTypes$7;
139
+ ConfirmPassword.defaultProps = defaultProps$7;
60
140
 
61
- var _excluded$7 = ["action", "fields", "emailLabel", "submitButtonLabel", "size", "withLoginLink", "loginLink", "loginLabel"];
62
- var propTypes$7 = {
141
+ var _excluded$6 = ["action", "fields", "emailLabel", "submitButtonLabel", "size", "withLoginLink", "loginLink", "loginLabel"];
142
+ var propTypes$6 = {
63
143
  action: PropTypes.string,
64
144
  fields: PropTypes$1.fields,
65
145
  size: PropTypes.string,
@@ -69,7 +149,7 @@ var propTypes$7 = {
69
149
  loginLink: PropTypes.string,
70
150
  loginLabel: PropTypes$1.label
71
151
  };
72
- var defaultProps$7 = {
152
+ var defaultProps$6 = {
73
153
  action: '/forgot-password',
74
154
  fields: null,
75
155
  size: 'lg',
@@ -107,7 +187,7 @@ var ForgotPassword = function ForgotPassword(_ref) {
107
187
  withLoginLink = _ref.withLoginLink,
108
188
  loginLink = _ref.loginLink,
109
189
  loginLabel = _ref.loginLabel,
110
- props = _objectWithoutProperties(_ref, _excluded$7);
190
+ props = _objectWithoutProperties(_ref, _excluded$6);
111
191
 
112
192
  return /*#__PURE__*/React.createElement(Form, Object.assign({
113
193
  action: action,
@@ -125,11 +205,11 @@ var ForgotPassword = function ForgotPassword(_ref) {
125
205
  }, props));
126
206
  };
127
207
 
128
- ForgotPassword.propTypes = propTypes$7;
129
- ForgotPassword.defaultProps = defaultProps$7;
208
+ ForgotPassword.propTypes = propTypes$6;
209
+ ForgotPassword.defaultProps = defaultProps$6;
130
210
 
131
- var _excluded$6 = ["action", "fields", "size", "emailLabel", "passwordLabel", "submitButtonLabel", "withForgotPassword", "forgotPasswordLink", "forgotPasswordLabel"];
132
- var propTypes$6 = {
211
+ var _excluded$5 = ["action", "fields", "size", "emailLabel", "passwordLabel", "submitButtonLabel", "withForgotPassword", "forgotPasswordLink", "forgotPasswordLabel"];
212
+ var propTypes$5 = {
133
213
  action: PropTypes.string,
134
214
  fields: PropTypes$1.fields,
135
215
  size: PropTypes.string,
@@ -140,7 +220,7 @@ var propTypes$6 = {
140
220
  forgotPasswordLink: PropTypes.string,
141
221
  forgotPasswordLabel: PropTypes$1.label
142
222
  };
143
- var defaultProps$6 = {
223
+ var defaultProps$5 = {
144
224
  action: '/login',
145
225
  fields: null,
146
226
  size: 'lg',
@@ -186,7 +266,7 @@ var Login = function Login(_ref) {
186
266
  withForgotPassword = _ref.withForgotPassword,
187
267
  forgotPasswordLink = _ref.forgotPasswordLink,
188
268
  forgotPasswordLabel = _ref.forgotPasswordLabel,
189
- props = _objectWithoutProperties(_ref, _excluded$6);
269
+ props = _objectWithoutProperties(_ref, _excluded$5);
190
270
 
191
271
  return /*#__PURE__*/React.createElement(Form, Object.assign({
192
272
  action: action,
@@ -209,11 +289,11 @@ var Login = function Login(_ref) {
209
289
  }, props));
210
290
  };
211
291
 
212
- Login.propTypes = propTypes$6;
213
- Login.defaultProps = defaultProps$6;
292
+ Login.propTypes = propTypes$5;
293
+ Login.defaultProps = defaultProps$5;
214
294
 
215
- var _excluded$5 = ["action", "fields", "size", "nameLabel", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel", "withLoginLink", "loginLink", "loginLabel"];
216
- var propTypes$5 = {
295
+ var _excluded$4 = ["action", "fields", "size", "nameLabel", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel", "withLoginLink", "loginLink", "loginLabel"];
296
+ var propTypes$4 = {
217
297
  action: PropTypes.string,
218
298
  fields: PropTypes$1.fields,
219
299
  size: PropTypes.string,
@@ -226,7 +306,7 @@ var propTypes$5 = {
226
306
  loginLink: PropTypes.string,
227
307
  loginLabel: PropTypes$1.label
228
308
  };
229
- var defaultProps$5 = {
309
+ var defaultProps$4 = {
230
310
  action: '/register',
231
311
  fields: null,
232
312
  size: 'lg',
@@ -288,7 +368,7 @@ var Register = function Register(_ref) {
288
368
  withLoginLink = _ref.withLoginLink,
289
369
  loginLink = _ref.loginLink,
290
370
  loginLabel = _ref.loginLabel,
291
- props = _objectWithoutProperties(_ref, _excluded$5);
371
+ props = _objectWithoutProperties(_ref, _excluded$4);
292
372
 
293
373
  return /*#__PURE__*/React.createElement(Form, Object.assign({
294
374
  action: action,
@@ -321,11 +401,11 @@ var Register = function Register(_ref) {
321
401
  }, props));
322
402
  };
323
403
 
324
- Register.propTypes = propTypes$5;
325
- Register.defaultProps = defaultProps$5;
404
+ Register.propTypes = propTypes$4;
405
+ Register.defaultProps = defaultProps$4;
326
406
 
327
- var _excluded$4 = ["action", "fields", "size", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
328
- var propTypes$4 = {
407
+ var _excluded$3 = ["action", "fields", "size", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
408
+ var propTypes$3 = {
329
409
  action: PropTypes.string,
330
410
  fields: PropTypes$1.fields,
331
411
  size: PropTypes.string,
@@ -334,7 +414,7 @@ var propTypes$4 = {
334
414
  passwordConfirmationLabel: PropTypes$1.label,
335
415
  submitButtonLabel: PropTypes$1.label
336
416
  };
337
- var defaultProps$4 = {
417
+ var defaultProps$3 = {
338
418
  action: '/reset-password',
339
419
  fields: null,
340
420
  size: 'lg',
@@ -376,7 +456,7 @@ var ResetPassword = function ResetPassword(_ref) {
376
456
  passwordLabel = _ref.passwordLabel,
377
457
  passwordConfirmationLabel = _ref.passwordConfirmationLabel,
378
458
  submitButtonLabel = _ref.submitButtonLabel,
379
- props = _objectWithoutProperties(_ref, _excluded$4);
459
+ props = _objectWithoutProperties(_ref, _excluded$3);
380
460
 
381
461
  return /*#__PURE__*/React.createElement(Form, Object.assign({
382
462
  action: action,
@@ -392,7 +472,7 @@ var ResetPassword = function ResetPassword(_ref) {
392
472
  size: size,
393
473
  label: passwordLabel
394
474
  }, {
395
- name: 'password_confrmation',
475
+ name: 'password_confirmation',
396
476
  type: 'password',
397
477
  size: size,
398
478
  label: passwordConfirmationLabel
@@ -401,18 +481,18 @@ var ResetPassword = function ResetPassword(_ref) {
401
481
  }, props));
402
482
  };
403
483
 
404
- ResetPassword.propTypes = propTypes$4;
405
- ResetPassword.defaultProps = defaultProps$4;
484
+ ResetPassword.propTypes = propTypes$3;
485
+ ResetPassword.defaultProps = defaultProps$3;
406
486
 
407
- var _excluded$3 = ["action", "fields", "size", "codeLabel", "submitButtonLabel"];
408
- var propTypes$3 = {
487
+ var _excluded$2 = ["action", "fields", "size", "codeLabel", "submitButtonLabel"];
488
+ var propTypes$2 = {
409
489
  action: PropTypes.string,
410
490
  fields: PropTypes$1.fields,
411
491
  size: PropTypes.string,
412
492
  codeLabel: PropTypes$1.label,
413
493
  submitButtonLabel: PropTypes$1.label
414
494
  };
415
- var defaultProps$3 = {
495
+ var defaultProps$2 = {
416
496
  action: '/two-factor-challenge',
417
497
  fields: null,
418
498
  size: 'lg',
@@ -438,7 +518,7 @@ var TwoFactorChallenge = function TwoFactorChallenge(_ref) {
438
518
  size = _ref.size,
439
519
  codeLabel = _ref.codeLabel,
440
520
  submitButtonLabel = _ref.submitButtonLabel,
441
- props = _objectWithoutProperties(_ref, _excluded$3);
521
+ props = _objectWithoutProperties(_ref, _excluded$2);
442
522
 
443
523
  return /*#__PURE__*/React.createElement(Form, Object.assign({
444
524
  action: action,
@@ -452,11 +532,11 @@ var TwoFactorChallenge = function TwoFactorChallenge(_ref) {
452
532
  }, props));
453
533
  };
454
534
 
455
- TwoFactorChallenge.propTypes = propTypes$3;
456
- TwoFactorChallenge.defaultProps = defaultProps$3;
535
+ TwoFactorChallenge.propTypes = propTypes$2;
536
+ TwoFactorChallenge.defaultProps = defaultProps$2;
457
537
 
458
- var _excluded$2 = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withCancelLink", "cancelLink", "cancelLabel"];
459
- var propTypes$2 = {
538
+ var _excluded$1 = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withCancelLink", "cancelLink", "cancelLabel"];
539
+ var propTypes$1 = {
460
540
  action: PropTypes.string,
461
541
  fields: PropTypes$1.fields,
462
542
  size: PropTypes.string,
@@ -466,7 +546,7 @@ var propTypes$2 = {
466
546
  cancelLink: PropTypes.string,
467
547
  cancelLabel: PropTypes$1.label
468
548
  };
469
- var defaultProps$2 = {
549
+ var defaultProps$1 = {
470
550
  action: '/user/two-factor-authentication',
471
551
  fields: null,
472
552
  size: 'lg',
@@ -504,7 +584,7 @@ var TwoFactorDisable = function TwoFactorDisable(_ref) {
504
584
  var withCancelLink = _ref.withCancelLink,
505
585
  cancelLink = _ref.cancelLink,
506
586
  cancelLabel = _ref.cancelLabel,
507
- props = _objectWithoutProperties(_ref, _excluded$2);
587
+ props = _objectWithoutProperties(_ref, _excluded$1);
508
588
 
509
589
  var defaultPostForm = useCallback(function (act, data) {
510
590
  return postJSON(act, data, {
@@ -524,11 +604,11 @@ var TwoFactorDisable = function TwoFactorDisable(_ref) {
524
604
  }, props), /*#__PURE__*/React.createElement("p", null, explainationLabel));
525
605
  };
526
606
 
527
- TwoFactorDisable.propTypes = propTypes$2;
528
- TwoFactorDisable.defaultProps = defaultProps$2;
607
+ TwoFactorDisable.propTypes = propTypes$1;
608
+ TwoFactorDisable.defaultProps = defaultProps$1;
529
609
 
530
- var _excluded$1 = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withSkipLink", "skipLink", "skipLabel"];
531
- var propTypes$1 = {
610
+ var _excluded = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withSkipLink", "skipLink", "skipLabel"];
611
+ var propTypes = {
532
612
  action: PropTypes.string,
533
613
  fields: PropTypes$1.fields,
534
614
  size: PropTypes.string,
@@ -538,7 +618,7 @@ var propTypes$1 = {
538
618
  skipLink: PropTypes.string,
539
619
  skipLabel: PropTypes$1.label
540
620
  };
541
- var defaultProps$1 = {
621
+ var defaultProps = {
542
622
  action: '/user/two-factor-authentication',
543
623
  fields: null,
544
624
  size: 'lg',
@@ -576,7 +656,7 @@ var TwoFactorEnable = function TwoFactorEnable(_ref) {
576
656
  var withSkipLink = _ref.withSkipLink,
577
657
  skipLink = _ref.skipLink,
578
658
  skipLabel = _ref.skipLabel,
579
- props = _objectWithoutProperties(_ref, _excluded$1);
659
+ props = _objectWithoutProperties(_ref, _excluded);
580
660
 
581
661
  return /*#__PURE__*/React.createElement(Form, Object.assign({
582
662
  action: action,
@@ -588,87 +668,7 @@ var TwoFactorEnable = function TwoFactorEnable(_ref) {
588
668
  }, props), /*#__PURE__*/React.createElement("p", null, explainationLabel));
589
669
  };
590
670
 
591
- TwoFactorEnable.propTypes = propTypes$1;
592
- TwoFactorEnable.defaultProps = defaultProps$1;
593
-
594
- var _excluded = ["action", "fields", "size", "currentPasswordLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
595
- var propTypes = {
596
- action: PropTypes.string,
597
- fields: PropTypes$1.fields,
598
- size: PropTypes.string,
599
- currentPasswordLabel: PropTypes$1.label,
600
- passwordLabel: PropTypes$1.label,
601
- passwordConfirmationLabel: PropTypes$1.label,
602
- submitButtonLabel: PropTypes$1.label
603
- };
604
- var defaultProps = {
605
- action: '/user/password',
606
- fields: null,
607
- size: 'lg',
608
- currentPasswordLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
609
- id: "8LSb8C",
610
- defaultMessage: [{
611
- "type": 0,
612
- "value": "Current password"
613
- }]
614
- }),
615
- passwordLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
616
- id: "4yfet+",
617
- defaultMessage: [{
618
- "type": 0,
619
- "value": "Password"
620
- }]
621
- }),
622
- passwordConfirmationLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
623
- id: "VhJUeW",
624
- defaultMessage: [{
625
- "type": 0,
626
- "value": "Confirm your password"
627
- }]
628
- }),
629
- submitButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
630
- id: "XW9IKQ",
631
- defaultMessage: [{
632
- "type": 0,
633
- "value": "Update password"
634
- }]
635
- })
636
- };
637
-
638
- var UpdatePassword = function UpdatePassword(_ref) {
639
- var action = _ref.action,
640
- fields = _ref.fields,
641
- size = _ref.size,
642
- currentPasswordLabel = _ref.currentPasswordLabel,
643
- passwordLabel = _ref.passwordLabel,
644
- passwordConfirmationLabel = _ref.passwordConfirmationLabel,
645
- submitButtonLabel = _ref.submitButtonLabel,
646
- props = _objectWithoutProperties(_ref, _excluded);
647
-
648
- return /*#__PURE__*/React.createElement(Form, Object.assign({
649
- action: action,
650
- method: "PUT",
651
- fields: fields || [{
652
- name: 'current_password',
653
- type: 'password',
654
- size: size,
655
- label: currentPasswordLabel
656
- }, {
657
- name: 'password',
658
- type: 'password',
659
- size: size,
660
- label: passwordLabel
661
- }, {
662
- name: 'password_confrmation',
663
- type: 'password',
664
- size: size,
665
- label: passwordConfirmationLabel
666
- }],
667
- submitButtonLabel: submitButtonLabel
668
- }, props));
669
- };
670
-
671
- UpdatePassword.propTypes = propTypes;
672
- UpdatePassword.defaultProps = defaultProps;
671
+ TwoFactorEnable.propTypes = propTypes;
672
+ TwoFactorEnable.defaultProps = defaultProps;
673
673
 
674
- export { ConfirmPassword, ForgotPassword, Login, Register, ResetPassword, TwoFactorChallenge, TwoFactorDisable, TwoFactorEnable, UpdatePassword };
674
+ export { ChangePassword, ConfirmPassword, ForgotPassword, Login, Register, ResetPassword, TwoFactorChallenge, TwoFactorDisable, TwoFactorEnable };
package/lib/index.js CHANGED
@@ -18,15 +18,95 @@ var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
18
18
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
19
19
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
20
20
 
21
- var _excluded$8 = ["action", "fields", "size", "passwordLabel", "submitButtonLabel"];
21
+ var _excluded$8 = ["action", "fields", "size", "currentPasswordLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
22
22
  var propTypes$8 = {
23
23
  action: PropTypes__default["default"].string,
24
24
  fields: core.PropTypes.fields,
25
25
  size: PropTypes__default["default"].string,
26
+ currentPasswordLabel: core.PropTypes.label,
26
27
  passwordLabel: core.PropTypes.label,
28
+ passwordConfirmationLabel: core.PropTypes.label,
27
29
  submitButtonLabel: core.PropTypes.label
28
30
  };
29
31
  var defaultProps$8 = {
32
+ action: '/user/password',
33
+ fields: null,
34
+ size: 'lg',
35
+ currentPasswordLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
36
+ id: "8LSb8C",
37
+ defaultMessage: [{
38
+ "type": 0,
39
+ "value": "Current password"
40
+ }]
41
+ }),
42
+ passwordLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
43
+ id: "XJ1dc3",
44
+ defaultMessage: [{
45
+ "type": 0,
46
+ "value": "New password"
47
+ }]
48
+ }),
49
+ passwordConfirmationLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
50
+ id: "DUbv+u",
51
+ defaultMessage: [{
52
+ "type": 0,
53
+ "value": "Confirm your new password"
54
+ }]
55
+ }),
56
+ submitButtonLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
57
+ id: "XW9IKQ",
58
+ defaultMessage: [{
59
+ "type": 0,
60
+ "value": "Update password"
61
+ }]
62
+ })
63
+ };
64
+
65
+ var ChangePassword = function ChangePassword(_ref) {
66
+ var action = _ref.action,
67
+ fields = _ref.fields,
68
+ size = _ref.size,
69
+ currentPasswordLabel = _ref.currentPasswordLabel,
70
+ passwordLabel = _ref.passwordLabel,
71
+ passwordConfirmationLabel = _ref.passwordConfirmationLabel,
72
+ submitButtonLabel = _ref.submitButtonLabel,
73
+ props = _objectWithoutProperties__default["default"](_ref, _excluded$8);
74
+
75
+ return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
76
+ action: action,
77
+ method: "PUT",
78
+ fields: fields || [{
79
+ name: 'current_password',
80
+ type: 'password',
81
+ size: size,
82
+ label: currentPasswordLabel
83
+ }, {
84
+ name: 'password',
85
+ type: 'password',
86
+ size: size,
87
+ label: passwordLabel
88
+ }, {
89
+ name: 'password_confirmation',
90
+ type: 'password',
91
+ size: size,
92
+ label: passwordConfirmationLabel
93
+ }],
94
+ submitButtonLabel: submitButtonLabel
95
+ }, props));
96
+ };
97
+
98
+ ChangePassword.propTypes = propTypes$8;
99
+ ChangePassword.defaultProps = defaultProps$8;
100
+
101
+ var _excluded$7 = ["action", "fields", "size", "passwordLabel", "submitButtonLabel"];
102
+ var propTypes$7 = {
103
+ action: PropTypes__default["default"].string,
104
+ fields: core.PropTypes.fields,
105
+ size: PropTypes__default["default"].string,
106
+ passwordLabel: core.PropTypes.label,
107
+ submitButtonLabel: core.PropTypes.label
108
+ };
109
+ var defaultProps$7 = {
30
110
  action: '/user/confirm-password',
31
111
  fields: null,
32
112
  size: 'lg',
@@ -52,7 +132,7 @@ var ConfirmPassword = function ConfirmPassword(_ref) {
52
132
  size = _ref.size,
53
133
  passwordLabel = _ref.passwordLabel,
54
134
  submitButtonLabel = _ref.submitButtonLabel,
55
- props = _objectWithoutProperties__default["default"](_ref, _excluded$8);
135
+ props = _objectWithoutProperties__default["default"](_ref, _excluded$7);
56
136
 
57
137
  return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
58
138
  action: action,
@@ -66,11 +146,11 @@ var ConfirmPassword = function ConfirmPassword(_ref) {
66
146
  }, props));
67
147
  };
68
148
 
69
- ConfirmPassword.propTypes = propTypes$8;
70
- ConfirmPassword.defaultProps = defaultProps$8;
149
+ ConfirmPassword.propTypes = propTypes$7;
150
+ ConfirmPassword.defaultProps = defaultProps$7;
71
151
 
72
- var _excluded$7 = ["action", "fields", "emailLabel", "submitButtonLabel", "size", "withLoginLink", "loginLink", "loginLabel"];
73
- var propTypes$7 = {
152
+ var _excluded$6 = ["action", "fields", "emailLabel", "submitButtonLabel", "size", "withLoginLink", "loginLink", "loginLabel"];
153
+ var propTypes$6 = {
74
154
  action: PropTypes__default["default"].string,
75
155
  fields: core.PropTypes.fields,
76
156
  size: PropTypes__default["default"].string,
@@ -80,7 +160,7 @@ var propTypes$7 = {
80
160
  loginLink: PropTypes__default["default"].string,
81
161
  loginLabel: core.PropTypes.label
82
162
  };
83
- var defaultProps$7 = {
163
+ var defaultProps$6 = {
84
164
  action: '/forgot-password',
85
165
  fields: null,
86
166
  size: 'lg',
@@ -118,7 +198,7 @@ var ForgotPassword = function ForgotPassword(_ref) {
118
198
  withLoginLink = _ref.withLoginLink,
119
199
  loginLink = _ref.loginLink,
120
200
  loginLabel = _ref.loginLabel,
121
- props = _objectWithoutProperties__default["default"](_ref, _excluded$7);
201
+ props = _objectWithoutProperties__default["default"](_ref, _excluded$6);
122
202
 
123
203
  return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
124
204
  action: action,
@@ -136,11 +216,11 @@ var ForgotPassword = function ForgotPassword(_ref) {
136
216
  }, props));
137
217
  };
138
218
 
139
- ForgotPassword.propTypes = propTypes$7;
140
- ForgotPassword.defaultProps = defaultProps$7;
219
+ ForgotPassword.propTypes = propTypes$6;
220
+ ForgotPassword.defaultProps = defaultProps$6;
141
221
 
142
- var _excluded$6 = ["action", "fields", "size", "emailLabel", "passwordLabel", "submitButtonLabel", "withForgotPassword", "forgotPasswordLink", "forgotPasswordLabel"];
143
- var propTypes$6 = {
222
+ var _excluded$5 = ["action", "fields", "size", "emailLabel", "passwordLabel", "submitButtonLabel", "withForgotPassword", "forgotPasswordLink", "forgotPasswordLabel"];
223
+ var propTypes$5 = {
144
224
  action: PropTypes__default["default"].string,
145
225
  fields: core.PropTypes.fields,
146
226
  size: PropTypes__default["default"].string,
@@ -151,7 +231,7 @@ var propTypes$6 = {
151
231
  forgotPasswordLink: PropTypes__default["default"].string,
152
232
  forgotPasswordLabel: core.PropTypes.label
153
233
  };
154
- var defaultProps$6 = {
234
+ var defaultProps$5 = {
155
235
  action: '/login',
156
236
  fields: null,
157
237
  size: 'lg',
@@ -197,7 +277,7 @@ var Login = function Login(_ref) {
197
277
  withForgotPassword = _ref.withForgotPassword,
198
278
  forgotPasswordLink = _ref.forgotPasswordLink,
199
279
  forgotPasswordLabel = _ref.forgotPasswordLabel,
200
- props = _objectWithoutProperties__default["default"](_ref, _excluded$6);
280
+ props = _objectWithoutProperties__default["default"](_ref, _excluded$5);
201
281
 
202
282
  return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
203
283
  action: action,
@@ -220,11 +300,11 @@ var Login = function Login(_ref) {
220
300
  }, props));
221
301
  };
222
302
 
223
- Login.propTypes = propTypes$6;
224
- Login.defaultProps = defaultProps$6;
303
+ Login.propTypes = propTypes$5;
304
+ Login.defaultProps = defaultProps$5;
225
305
 
226
- var _excluded$5 = ["action", "fields", "size", "nameLabel", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel", "withLoginLink", "loginLink", "loginLabel"];
227
- var propTypes$5 = {
306
+ var _excluded$4 = ["action", "fields", "size", "nameLabel", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel", "withLoginLink", "loginLink", "loginLabel"];
307
+ var propTypes$4 = {
228
308
  action: PropTypes__default["default"].string,
229
309
  fields: core.PropTypes.fields,
230
310
  size: PropTypes__default["default"].string,
@@ -237,7 +317,7 @@ var propTypes$5 = {
237
317
  loginLink: PropTypes__default["default"].string,
238
318
  loginLabel: core.PropTypes.label
239
319
  };
240
- var defaultProps$5 = {
320
+ var defaultProps$4 = {
241
321
  action: '/register',
242
322
  fields: null,
243
323
  size: 'lg',
@@ -299,7 +379,7 @@ var Register = function Register(_ref) {
299
379
  withLoginLink = _ref.withLoginLink,
300
380
  loginLink = _ref.loginLink,
301
381
  loginLabel = _ref.loginLabel,
302
- props = _objectWithoutProperties__default["default"](_ref, _excluded$5);
382
+ props = _objectWithoutProperties__default["default"](_ref, _excluded$4);
303
383
 
304
384
  return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
305
385
  action: action,
@@ -332,11 +412,11 @@ var Register = function Register(_ref) {
332
412
  }, props));
333
413
  };
334
414
 
335
- Register.propTypes = propTypes$5;
336
- Register.defaultProps = defaultProps$5;
415
+ Register.propTypes = propTypes$4;
416
+ Register.defaultProps = defaultProps$4;
337
417
 
338
- var _excluded$4 = ["action", "fields", "size", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
339
- var propTypes$4 = {
418
+ var _excluded$3 = ["action", "fields", "size", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
419
+ var propTypes$3 = {
340
420
  action: PropTypes__default["default"].string,
341
421
  fields: core.PropTypes.fields,
342
422
  size: PropTypes__default["default"].string,
@@ -345,7 +425,7 @@ var propTypes$4 = {
345
425
  passwordConfirmationLabel: core.PropTypes.label,
346
426
  submitButtonLabel: core.PropTypes.label
347
427
  };
348
- var defaultProps$4 = {
428
+ var defaultProps$3 = {
349
429
  action: '/reset-password',
350
430
  fields: null,
351
431
  size: 'lg',
@@ -387,7 +467,7 @@ var ResetPassword = function ResetPassword(_ref) {
387
467
  passwordLabel = _ref.passwordLabel,
388
468
  passwordConfirmationLabel = _ref.passwordConfirmationLabel,
389
469
  submitButtonLabel = _ref.submitButtonLabel,
390
- props = _objectWithoutProperties__default["default"](_ref, _excluded$4);
470
+ props = _objectWithoutProperties__default["default"](_ref, _excluded$3);
391
471
 
392
472
  return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
393
473
  action: action,
@@ -403,7 +483,7 @@ var ResetPassword = function ResetPassword(_ref) {
403
483
  size: size,
404
484
  label: passwordLabel
405
485
  }, {
406
- name: 'password_confrmation',
486
+ name: 'password_confirmation',
407
487
  type: 'password',
408
488
  size: size,
409
489
  label: passwordConfirmationLabel
@@ -412,18 +492,18 @@ var ResetPassword = function ResetPassword(_ref) {
412
492
  }, props));
413
493
  };
414
494
 
415
- ResetPassword.propTypes = propTypes$4;
416
- ResetPassword.defaultProps = defaultProps$4;
495
+ ResetPassword.propTypes = propTypes$3;
496
+ ResetPassword.defaultProps = defaultProps$3;
417
497
 
418
- var _excluded$3 = ["action", "fields", "size", "codeLabel", "submitButtonLabel"];
419
- var propTypes$3 = {
498
+ var _excluded$2 = ["action", "fields", "size", "codeLabel", "submitButtonLabel"];
499
+ var propTypes$2 = {
420
500
  action: PropTypes__default["default"].string,
421
501
  fields: core.PropTypes.fields,
422
502
  size: PropTypes__default["default"].string,
423
503
  codeLabel: core.PropTypes.label,
424
504
  submitButtonLabel: core.PropTypes.label
425
505
  };
426
- var defaultProps$3 = {
506
+ var defaultProps$2 = {
427
507
  action: '/two-factor-challenge',
428
508
  fields: null,
429
509
  size: 'lg',
@@ -449,7 +529,7 @@ var TwoFactorChallenge = function TwoFactorChallenge(_ref) {
449
529
  size = _ref.size,
450
530
  codeLabel = _ref.codeLabel,
451
531
  submitButtonLabel = _ref.submitButtonLabel,
452
- props = _objectWithoutProperties__default["default"](_ref, _excluded$3);
532
+ props = _objectWithoutProperties__default["default"](_ref, _excluded$2);
453
533
 
454
534
  return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
455
535
  action: action,
@@ -463,11 +543,11 @@ var TwoFactorChallenge = function TwoFactorChallenge(_ref) {
463
543
  }, props));
464
544
  };
465
545
 
466
- TwoFactorChallenge.propTypes = propTypes$3;
467
- TwoFactorChallenge.defaultProps = defaultProps$3;
546
+ TwoFactorChallenge.propTypes = propTypes$2;
547
+ TwoFactorChallenge.defaultProps = defaultProps$2;
468
548
 
469
- var _excluded$2 = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withCancelLink", "cancelLink", "cancelLabel"];
470
- var propTypes$2 = {
549
+ var _excluded$1 = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withCancelLink", "cancelLink", "cancelLabel"];
550
+ var propTypes$1 = {
471
551
  action: PropTypes__default["default"].string,
472
552
  fields: core.PropTypes.fields,
473
553
  size: PropTypes__default["default"].string,
@@ -477,7 +557,7 @@ var propTypes$2 = {
477
557
  cancelLink: PropTypes__default["default"].string,
478
558
  cancelLabel: core.PropTypes.label
479
559
  };
480
- var defaultProps$2 = {
560
+ var defaultProps$1 = {
481
561
  action: '/user/two-factor-authentication',
482
562
  fields: null,
483
563
  size: 'lg',
@@ -515,7 +595,7 @@ var TwoFactorDisable = function TwoFactorDisable(_ref) {
515
595
  var withCancelLink = _ref.withCancelLink,
516
596
  cancelLink = _ref.cancelLink,
517
597
  cancelLabel = _ref.cancelLabel,
518
- props = _objectWithoutProperties__default["default"](_ref, _excluded$2);
598
+ props = _objectWithoutProperties__default["default"](_ref, _excluded$1);
519
599
 
520
600
  var defaultPostForm = React.useCallback(function (act, data) {
521
601
  return fetch.postJSON(act, data, {
@@ -535,11 +615,11 @@ var TwoFactorDisable = function TwoFactorDisable(_ref) {
535
615
  }, props), /*#__PURE__*/React__default["default"].createElement("p", null, explainationLabel));
536
616
  };
537
617
 
538
- TwoFactorDisable.propTypes = propTypes$2;
539
- TwoFactorDisable.defaultProps = defaultProps$2;
618
+ TwoFactorDisable.propTypes = propTypes$1;
619
+ TwoFactorDisable.defaultProps = defaultProps$1;
540
620
 
541
- var _excluded$1 = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withSkipLink", "skipLink", "skipLabel"];
542
- var propTypes$1 = {
621
+ var _excluded = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withSkipLink", "skipLink", "skipLabel"];
622
+ var propTypes = {
543
623
  action: PropTypes__default["default"].string,
544
624
  fields: core.PropTypes.fields,
545
625
  size: PropTypes__default["default"].string,
@@ -549,7 +629,7 @@ var propTypes$1 = {
549
629
  skipLink: PropTypes__default["default"].string,
550
630
  skipLabel: core.PropTypes.label
551
631
  };
552
- var defaultProps$1 = {
632
+ var defaultProps = {
553
633
  action: '/user/two-factor-authentication',
554
634
  fields: null,
555
635
  size: 'lg',
@@ -587,7 +667,7 @@ var TwoFactorEnable = function TwoFactorEnable(_ref) {
587
667
  var withSkipLink = _ref.withSkipLink,
588
668
  skipLink = _ref.skipLink,
589
669
  skipLabel = _ref.skipLabel,
590
- props = _objectWithoutProperties__default["default"](_ref, _excluded$1);
670
+ props = _objectWithoutProperties__default["default"](_ref, _excluded);
591
671
 
592
672
  return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
593
673
  action: action,
@@ -599,89 +679,10 @@ var TwoFactorEnable = function TwoFactorEnable(_ref) {
599
679
  }, props), /*#__PURE__*/React__default["default"].createElement("p", null, explainationLabel));
600
680
  };
601
681
 
602
- TwoFactorEnable.propTypes = propTypes$1;
603
- TwoFactorEnable.defaultProps = defaultProps$1;
604
-
605
- var _excluded = ["action", "fields", "size", "currentPasswordLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
606
- var propTypes = {
607
- action: PropTypes__default["default"].string,
608
- fields: core.PropTypes.fields,
609
- size: PropTypes__default["default"].string,
610
- currentPasswordLabel: core.PropTypes.label,
611
- passwordLabel: core.PropTypes.label,
612
- passwordConfirmationLabel: core.PropTypes.label,
613
- submitButtonLabel: core.PropTypes.label
614
- };
615
- var defaultProps = {
616
- action: '/user/password',
617
- fields: null,
618
- size: 'lg',
619
- currentPasswordLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
620
- id: "8LSb8C",
621
- defaultMessage: [{
622
- "type": 0,
623
- "value": "Current password"
624
- }]
625
- }),
626
- passwordLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
627
- id: "4yfet+",
628
- defaultMessage: [{
629
- "type": 0,
630
- "value": "Password"
631
- }]
632
- }),
633
- passwordConfirmationLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
634
- id: "VhJUeW",
635
- defaultMessage: [{
636
- "type": 0,
637
- "value": "Confirm your password"
638
- }]
639
- }),
640
- submitButtonLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
641
- id: "XW9IKQ",
642
- defaultMessage: [{
643
- "type": 0,
644
- "value": "Update password"
645
- }]
646
- })
647
- };
648
-
649
- var UpdatePassword = function UpdatePassword(_ref) {
650
- var action = _ref.action,
651
- fields = _ref.fields,
652
- size = _ref.size,
653
- currentPasswordLabel = _ref.currentPasswordLabel,
654
- passwordLabel = _ref.passwordLabel,
655
- passwordConfirmationLabel = _ref.passwordConfirmationLabel,
656
- submitButtonLabel = _ref.submitButtonLabel,
657
- props = _objectWithoutProperties__default["default"](_ref, _excluded);
658
-
659
- return /*#__PURE__*/React__default["default"].createElement(Form__default["default"], Object.assign({
660
- action: action,
661
- method: "PUT",
662
- fields: fields || [{
663
- name: 'current_password',
664
- type: 'password',
665
- size: size,
666
- label: currentPasswordLabel
667
- }, {
668
- name: 'password',
669
- type: 'password',
670
- size: size,
671
- label: passwordLabel
672
- }, {
673
- name: 'password_confrmation',
674
- type: 'password',
675
- size: size,
676
- label: passwordConfirmationLabel
677
- }],
678
- submitButtonLabel: submitButtonLabel
679
- }, props));
680
- };
681
-
682
- UpdatePassword.propTypes = propTypes;
683
- UpdatePassword.defaultProps = defaultProps;
682
+ TwoFactorEnable.propTypes = propTypes;
683
+ TwoFactorEnable.defaultProps = defaultProps;
684
684
 
685
+ exports.ChangePassword = ChangePassword;
685
686
  exports.ConfirmPassword = ConfirmPassword;
686
687
  exports.ForgotPassword = ForgotPassword;
687
688
  exports.Login = Login;
@@ -690,4 +691,3 @@ exports.ResetPassword = ResetPassword;
690
691
  exports.TwoFactorChallenge = TwoFactorChallenge;
691
692
  exports.TwoFactorDisable = TwoFactorDisable;
692
693
  exports.TwoFactorEnable = TwoFactorEnable;
693
- exports.UpdatePassword = UpdatePassword;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/form-auth",
3
- "version": "1.0.0-alpha.247",
3
+ "version": "1.0.0-alpha.253",
4
4
  "description": "Basic forgot password form",
5
5
  "keywords": [
6
6
  "javascript"
@@ -47,8 +47,8 @@
47
47
  "dependencies": {
48
48
  "@babel/runtime": "^7.12.5",
49
49
  "@folklore/fetch": "^0.1.15",
50
- "@panneau/core": "^1.0.0-alpha.242",
51
- "@panneau/form": "^1.0.0-alpha.244",
50
+ "@panneau/core": "^1.0.0-alpha.253",
51
+ "@panneau/form": "^1.0.0-alpha.253",
52
52
  "classnames": "^2.2.6",
53
53
  "lodash": "^4.17.21",
54
54
  "prop-types": "^15.7.2",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "cd40162975fef5731ec4879cddd205d02a0ec9ef"
61
+ "gitHead": "de016fc362f1a53f78f6278539afd4c933981990"
62
62
  }