@crystaldesign/diva-core 25.4.0-beta.5 → 25.4.0-beta.50

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 (65) hide show
  1. package/build/esm/{ModalsWrapper-ff80d1d5.js → ModalsWrapper-b3779fb1.js} +5 -16
  2. package/build/esm/{index-b32ec50b.js → index-07cb65cf.js} +160 -119
  3. package/build/esm/{index-8f3a286e.js → index-42e7fbf5.js} +385 -321
  4. package/build/esm/index.js +2 -1
  5. package/build/types/core/src/elements/Auth/Header/index.d.ts +9 -0
  6. package/build/types/core/src/elements/Auth/Header/index.d.ts.map +1 -0
  7. package/build/types/core/src/elements/Auth/Input/index.d.ts +3 -1
  8. package/build/types/core/src/elements/Auth/Input/index.d.ts.map +1 -1
  9. package/build/types/core/src/elements/Auth/Login/index.d.ts.map +1 -1
  10. package/build/types/core/src/elements/Auth/Register/index.d.ts.map +1 -1
  11. package/build/types/core/src/elements/Auth/RequestNewPassword/index.d.ts.map +1 -1
  12. package/build/types/core/src/elements/Auth/WelcomeScreen/index.d.ts.map +1 -1
  13. package/build/types/core/src/elements/Auth/index.d.ts.map +1 -1
  14. package/build/types/core/src/elements/Modal/index.d.ts.map +1 -1
  15. package/build/types/core/src/externalTypes.d.ts +4 -2
  16. package/build/types/core/src/externalTypes.d.ts.map +1 -1
  17. package/build/types/core/src/handler/InternalApiHandler.d.ts +1 -2
  18. package/build/types/core/src/handler/InternalApiHandler.d.ts.map +1 -1
  19. package/build/types/core/src/handler/MediaHandler/index.d.ts +3 -2
  20. package/build/types/core/src/handler/MediaHandler/index.d.ts.map +1 -1
  21. package/build/types/core/src/handler/OrganizationHandler/index.d.ts +1 -1
  22. package/build/types/core/src/handler/OrganizationHandler/index.d.ts.map +1 -1
  23. package/build/types/core/src/store/ConfigurationStore.d.ts.map +1 -1
  24. package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
  25. package/build/types/core/src/store/DataStore.d.ts +1 -1
  26. package/build/umd/{109.diva-core.umd.min.js → 135.diva-core.umd.min.js} +2 -2
  27. package/build/umd/135.diva-core.umd.min.js.LICENSE.txt +1 -0
  28. package/build/umd/210.diva-core.umd.min.js +2 -0
  29. package/build/umd/210.diva-core.umd.min.js.LICENSE.txt +1 -0
  30. package/build/umd/215.diva-core.umd.min.js +2 -0
  31. package/build/umd/215.diva-core.umd.min.js.LICENSE.txt +1 -0
  32. package/build/umd/{962.diva-core.umd.min.js → 263.diva-core.umd.min.js} +2 -2
  33. package/build/umd/263.diva-core.umd.min.js.LICENSE.txt +1 -0
  34. package/build/umd/429.diva-core.umd.min.js +2 -0
  35. package/build/umd/429.diva-core.umd.min.js.LICENSE.txt +1 -0
  36. package/build/umd/43.diva-core.umd.min.js +2 -0
  37. package/build/umd/43.diva-core.umd.min.js.LICENSE.txt +1 -0
  38. package/build/umd/{535.diva-core.umd.min.js → 700.diva-core.umd.min.js} +2 -2
  39. package/build/umd/700.diva-core.umd.min.js.LICENSE.txt +1 -0
  40. package/build/umd/731.diva-core.umd.min.js +2 -0
  41. package/build/umd/731.diva-core.umd.min.js.LICENSE.txt +1 -0
  42. package/build/umd/{304.diva-core.umd.min.js → 800.diva-core.umd.min.js} +2 -2
  43. package/build/umd/800.diva-core.umd.min.js.LICENSE.txt +1 -0
  44. package/build/umd/83.diva-core.umd.min.js +2 -0
  45. package/build/umd/83.diva-core.umd.min.js.LICENSE.txt +1 -0
  46. package/build/umd/diva-core.umd.min.js +29 -2
  47. package/build/umd/diva-core.umd.min.js.LICENSE.txt +11 -1
  48. package/build/umd/report.html +1 -1
  49. package/package.json +10 -10
  50. package/build/umd/109.diva-core.umd.min.js.LICENSE.txt +0 -1
  51. package/build/umd/304.diva-core.umd.min.js.LICENSE.txt +0 -1
  52. package/build/umd/41.diva-core.umd.min.js +0 -2
  53. package/build/umd/41.diva-core.umd.min.js.LICENSE.txt +0 -1
  54. package/build/umd/53.diva-core.umd.min.js +0 -2
  55. package/build/umd/53.diva-core.umd.min.js.LICENSE.txt +0 -1
  56. package/build/umd/535.diva-core.umd.min.js.LICENSE.txt +0 -1
  57. package/build/umd/671.diva-core.umd.min.js +0 -2
  58. package/build/umd/671.diva-core.umd.min.js.LICENSE.txt +0 -1
  59. package/build/umd/704.diva-core.umd.min.js +0 -2
  60. package/build/umd/704.diva-core.umd.min.js.LICENSE.txt +0 -1
  61. package/build/umd/806.diva-core.umd.min.js +0 -2
  62. package/build/umd/806.diva-core.umd.min.js.LICENSE.txt +0 -1
  63. package/build/umd/902.diva-core.umd.min.js +0 -2
  64. package/build/umd/902.diva-core.umd.min.js.LICENSE.txt +0 -1
  65. package/build/umd/962.diva-core.umd.min.js.LICENSE.txt +0 -1
@@ -1,4 +1,4 @@
1
- import { i as styleInject, u as useDivaCoreContext } from './index-8f3a286e.js';
1
+ import { i as styleInject, u as useDivaCoreContext } from './index-42e7fbf5.js';
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import Button from '@mui/material/Button';
@@ -36,6 +36,7 @@ import '@mui/material/locale';
36
36
  import '@elastic/apm-rum-react';
37
37
  import '@mui/material/Typography';
38
38
  import 'classnames';
39
+ import '@mui/icons-material';
39
40
  import '@crystaldesign/basket-model';
40
41
  import 'lodash/debounce';
41
42
  import 'axios';
@@ -89,7 +90,7 @@ var Progress = function Progress(_ref) {
89
90
  var Progress$1 = observer(Progress);
90
91
 
91
92
  function Modal() {
92
- var _pureModal$actions;
93
+ var _pureModal$actions, _pureModal$actions2;
93
94
  var _useDivaCoreContext = useDivaCoreContext(),
94
95
  contentStore = _useDivaCoreContext.contentStore;
95
96
  var _useTranslation = useTranslation(),
@@ -114,18 +115,6 @@ function Modal() {
114
115
  }
115
116
  modal === null || modal === void 0 || (_modal$callback3 = modal.callback) === null || _modal$callback3 === void 0 || _modal$callback3.call(modal, id);
116
117
  };
117
- var escFunction = useCallback(function (event) {
118
- if (!contentStore.modal) return;
119
- if (event.key === 'Escape') {
120
- onReject();
121
- }
122
- }, []);
123
- useEffect(function () {
124
- document.addEventListener('keydown', escFunction, false);
125
- return function () {
126
- document.removeEventListener('keydown', escFunction, false);
127
- };
128
- }, []);
129
118
  function tryDecodeURIComponent(val) {
130
119
  try {
131
120
  return decodeURIComponent(val);
@@ -181,7 +170,7 @@ function Modal() {
181
170
  id: "diva-dialog-submitbtn",
182
171
  children: typeof pureModal.accept == 'string' ? t(pureModal.accept) : t('modal.accept')
183
172
  })]
184
- }), /*#__PURE__*/jsxs("div", {
173
+ }), !!(pureModal.image || pureModal.progress !== undefined || (_pureModal$actions = pureModal.actions) !== null && _pureModal$actions !== void 0 && _pureModal$actions.length) && /*#__PURE__*/jsxs("div", {
185
174
  style: {
186
175
  margin: 10
187
176
  },
@@ -192,7 +181,7 @@ function Modal() {
192
181
  }
193
182
  }), pureModal.progress !== undefined && /*#__PURE__*/jsx(Progress$1, {
194
183
  progress: pureModal.progress
195
- }), (_pureModal$actions = pureModal.actions) === null || _pureModal$actions === void 0 ? void 0 : _pureModal$actions.map(function (a) {
184
+ }), (_pureModal$actions2 = pureModal.actions) === null || _pureModal$actions2 === void 0 ? void 0 : _pureModal$actions2.map(function (a) {
196
185
  var _a$variant;
197
186
  return /*#__PURE__*/jsx(Button, {
198
187
  fullWidth: true,
@@ -1,4 +1,4 @@
1
- import { u as useDivaCoreContext, B as Button, s as socialButton, g as google, m as microsoft, a as getLogger, e as error, b as separator, I as Input, r as resetInput, l as link, c as success, d as auth, f as loginBox, h as logoContainer } from './index-8f3a286e.js';
1
+ import { u as useDivaCoreContext, B as Button, s as socialButton, g as google, m as microsoft, e as error, a as getLogger, b as separator, I as Input, l as link, c as success, d as auth, f as loginBox, h as logoContainer } from './index-42e7fbf5.js';
2
2
  import { useState, useRef, useEffect, useMemo } from 'react';
3
3
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -9,8 +9,11 @@ import { flowResult, toJS } from 'mobx';
9
9
  import { useTranslation } from 'react-i18next';
10
10
  import classnames from 'classnames';
11
11
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
12
+ import CircularProgress from '@mui/material/CircularProgress';
13
+ import Alert from '@mui/material/Alert';
14
+ import { useTranslation as useTranslation$1 } from '@crystaldesign/diva-core';
12
15
  import { ContentBoxComponent } from '@crystaldesign/content-box';
13
- import { Typography } from '@mui/material';
16
+ import { Alert as Alert$1, CircularProgress as CircularProgress$1 } from '@mui/material';
14
17
  import Checkbox from '@mui/material/Checkbox';
15
18
  import Snowfall from 'react-snowfall';
16
19
  import '@babel/runtime/helpers/classCallCheck';
@@ -32,12 +35,12 @@ import '@mui/material/styles';
32
35
  import '@mui/material/locale';
33
36
  import '@elastic/apm-rum-react';
34
37
  import '@mui/material/Typography';
38
+ import '@mui/icons-material';
35
39
  import '@crystaldesign/basket-model';
36
40
  import 'lodash/debounce';
37
41
  import 'axios';
38
42
  import '@crystaldesign/product-handler';
39
43
  import 'react-swipeable';
40
- import '@crystaldesign/diva-core';
41
44
  import 'react-qr-code';
42
45
  import '@mui/icons-material/Close';
43
46
  import '@mui/material/IconButton';
@@ -87,6 +90,30 @@ function OpenId () {
87
90
  });
88
91
  }
89
92
 
93
+ function Header (_ref) {
94
+ var title = _ref.title,
95
+ text = _ref.text,
96
+ errorText = _ref.errorText;
97
+ var _useTranslation = useTranslation$1(),
98
+ t = _useTranslation.t;
99
+ return /*#__PURE__*/jsxs(Fragment, {
100
+ children: [/*#__PURE__*/jsx("div", {
101
+ style: {
102
+ textAlign: 'center'
103
+ },
104
+ children: /*#__PURE__*/jsx("h2", {
105
+ children: title
106
+ })
107
+ }), /*#__PURE__*/jsx("p", {
108
+ children: text
109
+ }), errorText && /*#__PURE__*/jsx(Alert, {
110
+ severity: "error",
111
+ className: error,
112
+ children: t(errorText)
113
+ })]
114
+ });
115
+ }
116
+
90
117
  var LOG$3 = getLogger('Framework', 'Login');
91
118
  function Login() {
92
119
  var _email, _authorizationStore$s, _authorizationStore$s2, _authorizationStore$s3;
@@ -97,30 +124,34 @@ function Login() {
97
124
  _useState2 = _slicedToArray(_useState, 2),
98
125
  step = _useState2[0],
99
126
  setStep = _useState2[1];
100
- var _useState3 = useState((_email = (_authorizationStore$s = authorizationStore.state) === null || _authorizationStore$s === void 0 ? void 0 : _authorizationStore$s.email) !== null && _email !== void 0 ? _email : ''),
127
+ var _useState3 = useState(false),
101
128
  _useState4 = _slicedToArray(_useState3, 2),
102
- email = _useState4[0],
103
- setEmail = _useState4[1];
104
- var _useState5 = useState(''),
129
+ loading = _useState4[0],
130
+ setLoading = _useState4[1];
131
+ var _useState5 = useState((_email = (_authorizationStore$s = authorizationStore.state) === null || _authorizationStore$s === void 0 ? void 0 : _authorizationStore$s.email) !== null && _email !== void 0 ? _email : ''),
105
132
  _useState6 = _slicedToArray(_useState5, 2),
106
- password = _useState6[0],
107
- setPassword = _useState6[1];
133
+ email = _useState6[0],
134
+ setEmail = _useState6[1];
108
135
  var _useState7 = useState(''),
109
136
  _useState8 = _slicedToArray(_useState7, 2),
110
- otp = _useState8[0],
111
- setOtp = _useState8[1];
112
- var _useState9 = useState(false),
137
+ password = _useState8[0],
138
+ setPassword = _useState8[1];
139
+ var _useState9 = useState(''),
113
140
  _useState10 = _slicedToArray(_useState9, 2),
114
- useOtp = _useState10[0],
115
- setUseOtp = _useState10[1];
116
- var _useState11 = useState(authorizationStore.state.invitationId),
141
+ otp = _useState10[0],
142
+ setOtp = _useState10[1];
143
+ var _useState11 = useState(false),
117
144
  _useState12 = _slicedToArray(_useState11, 2),
118
- invitationFound = _useState12[0],
119
- setInvitationFound = _useState12[1];
120
- var _useState13 = useState(((_authorizationStore$s2 = authorizationStore.state) === null || _authorizationStore$s2 === void 0 ? void 0 : _authorizationStore$s2.type) == 'LOGIN' ? authorizationStore.state.error : undefined),
145
+ useOtp = _useState12[0],
146
+ setUseOtp = _useState12[1];
147
+ var _useState13 = useState(authorizationStore.state.invitationId),
121
148
  _useState14 = _slicedToArray(_useState13, 2),
122
- errorText = _useState14[0],
123
- setError = _useState14[1];
149
+ invitationFound = _useState14[0],
150
+ setInvitationFound = _useState14[1];
151
+ var _useState15 = useState(((_authorizationStore$s2 = authorizationStore.state) === null || _authorizationStore$s2 === void 0 ? void 0 : _authorizationStore$s2.type) == 'LOGIN' ? authorizationStore.state.error : undefined),
152
+ _useState16 = _slicedToArray(_useState15, 2),
153
+ errorText = _useState16[0],
154
+ setError = _useState16[1];
124
155
  var _useTranslation = useTranslation(),
125
156
  t = _useTranslation.t;
126
157
  var onContinue = /*#__PURE__*/function () {
@@ -129,14 +160,18 @@ function Login() {
129
160
  return _regeneratorRuntime.wrap(function _callee$(_context) {
130
161
  while (1) switch (_context.prev = _context.next) {
131
162
  case 0:
132
- _context.prev = 0;
163
+ setLoading(true);
164
+ if (errorText) {
165
+ setError(undefined);
166
+ }
167
+ _context.prev = 2;
133
168
  if (invitationFound) {
134
- _context.next = 6;
169
+ _context.next = 8;
135
170
  break;
136
171
  }
137
- _context.next = 4;
172
+ _context.next = 6;
138
173
  return authorizationHandler.getInvitationValue('id', email);
139
- case 4:
174
+ case 6:
140
175
  checkInvitation = _context.sent;
141
176
  if (checkInvitation) {
142
177
  if (checkInvitation.isNewUser) {
@@ -146,32 +181,36 @@ function Login() {
146
181
  setInvitationFound(true);
147
182
  if (checkInvitation.useotp) setUseOtp(true);
148
183
  }
149
- case 6:
150
- _context.next = 8;
184
+ case 8:
185
+ _context.next = 10;
151
186
  return authorizationHandler.fetchLoginProvider({
152
187
  email: email
153
188
  });
154
- case 8:
189
+ case 10:
155
190
  response = _context.sent;
156
191
  if (response.provider == 'standard') {
157
192
  setStep('login');
158
193
  } else {
159
194
  authorizationStore.openOAuthLogin(response.provider, authorizationStore.state.organizationId, authorizationStore.state.invitationId);
160
195
  }
161
- _context.next = 16;
196
+ _context.next = 18;
162
197
  break;
163
- case 12:
164
- _context.prev = 12;
165
- _context.t0 = _context["catch"](0);
198
+ case 14:
199
+ _context.prev = 14;
200
+ _context.t0 = _context["catch"](2);
166
201
  LOG$3.error(new DivaError('Error while fetching login provider', {
167
202
  cause: _context.t0
168
203
  }));
169
204
  setError('auth.error.password');
170
- case 16:
205
+ case 18:
206
+ _context.prev = 18;
207
+ setLoading(false);
208
+ return _context.finish(18);
209
+ case 21:
171
210
  case "end":
172
211
  return _context.stop();
173
212
  }
174
- }, _callee, null, [[0, 12]]);
213
+ }, _callee, null, [[2, 14, 18, 21]]);
175
214
  }));
176
215
  return function onContinue() {
177
216
  return _ref.apply(this, arguments);
@@ -182,27 +221,35 @@ function Login() {
182
221
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
183
222
  while (1) switch (_context2.prev = _context2.next) {
184
223
  case 0:
185
- _context2.prev = 0;
186
- _context2.next = 3;
224
+ setLoading(true);
225
+ if (errorText) {
226
+ setError(undefined);
227
+ }
228
+ _context2.prev = 2;
229
+ _context2.next = 5;
187
230
  return flowResult(authorizationStore.login(email, password, false, authorizationStore.state.organizationId, authorizationStore.state.invitationId, otp));
188
- case 3:
231
+ case 5:
189
232
  setEmail('');
190
233
  setPassword('');
191
234
  setError(undefined);
192
- _context2.next = 12;
235
+ _context2.next = 14;
193
236
  break;
194
- case 8:
195
- _context2.prev = 8;
196
- _context2.t0 = _context2["catch"](0);
237
+ case 10:
238
+ _context2.prev = 10;
239
+ _context2.t0 = _context2["catch"](2);
197
240
  LOG$3.error(new DivaError('Error while logging in', {
198
241
  cause: _context2.t0
199
242
  }));
200
243
  setError(invitationFound ? 'auth.error.passwordotp' : 'auth.error.password');
201
- case 12:
244
+ case 14:
245
+ _context2.prev = 14;
246
+ setLoading(false);
247
+ return _context2.finish(14);
248
+ case 17:
202
249
  case "end":
203
250
  return _context2.stop();
204
251
  }
205
- }, _callee2, null, [[0, 8]]);
252
+ }, _callee2, null, [[2, 10, 14, 17]]);
206
253
  }));
207
254
  return function onLogin() {
208
255
  return _ref2.apply(this, arguments);
@@ -234,16 +281,10 @@ function Login() {
234
281
  if (useOtp && !loginDisabled) loginDisabled = otp.length == 0;
235
282
  var loginMethods = (_authorizationStore$s3 = authorizationStore.state) === null || _authorizationStore$s3 === void 0 ? void 0 : _authorizationStore$s3.loginMethods;
236
283
  return /*#__PURE__*/jsxs(Fragment, {
237
- children: [/*#__PURE__*/jsx("h1", {
238
- children: t('auth.title.login')
239
- }), /*#__PURE__*/jsx("p", {
240
- children: t('auth.text.login', '')
241
- }), !!errorText && /*#__PURE__*/jsxs("div", {
242
- className: error,
243
- children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
244
- id: "loginerrortext",
245
- children: t(errorText)
246
- })]
284
+ children: [/*#__PURE__*/jsx(Header, {
285
+ title: t('auth.title.login'),
286
+ text: t('auth.text.login', ''),
287
+ errorText: errorText !== null && errorText !== void 0 ? errorText : ''
247
288
  }), /*#__PURE__*/jsx(OpenId, {}), ((loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.generic) || (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.google) || (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.microsoft)) && loginMethods.standard && /*#__PURE__*/jsx("div", {
248
289
  className: separator,
249
290
  children: "or"
@@ -254,6 +295,7 @@ function Login() {
254
295
  value: email,
255
296
  autoComplete: "username",
256
297
  autoFocus: true,
298
+ type: "email",
257
299
  placeholder: t('auth.input.email'),
258
300
  onChange: function onChange(e) {
259
301
  return setEmail(e.target.value);
@@ -285,14 +327,12 @@ function Login() {
285
327
  onChange: function onChange(e) {
286
328
  return setOtp(e.target.value);
287
329
  }
288
- }), /*#__PURE__*/jsx("label", {
289
- className: resetInput,
290
- onClick: reset,
291
- children: /*#__PURE__*/jsx(Input, {
292
- value: email,
293
- readOnly: true,
294
- placeholder: t('auth.input.email')
295
- })
330
+ }), /*#__PURE__*/jsx(Input, {
331
+ value: email,
332
+ type: "email",
333
+ readOnly: true,
334
+ placeholder: t('auth.input.email'),
335
+ resetInput: reset
296
336
  }), /*#__PURE__*/jsx(Input, {
297
337
  value: password,
298
338
  type: "password",
@@ -305,20 +345,25 @@ function Login() {
305
345
  onKeyPress: function onKeyPress(e) {
306
346
  return e.key == 'Enter' ? onLogin() : false;
307
347
  }
308
- }), /*#__PURE__*/jsx("div", {
309
- className: link,
310
- style: {
311
- textAlign: 'right'
312
- },
313
- onClick: resetPassword,
314
- children: t('auth.button.forgotpassword')
315
348
  })]
316
- }), /*#__PURE__*/jsx(Button, {
349
+ }), /*#__PURE__*/jsxs(Button, {
317
350
  id: "submit",
318
- disabled: loginDisabled,
351
+ disabled: loginDisabled || loading,
319
352
  onClick: step == 'enter' ? onContinue : onLogin,
320
- children: step == 'enter' ? t('auth.button.continue') : t('auth.button.login')
321
- })]
353
+ children: [loading ? /*#__PURE__*/jsx(CircularProgress, {
354
+ size: 24,
355
+ color: "inherit"
356
+ }) : undefined, loading ? undefined : step == 'enter' ? t('auth.button.continue') : t('auth.button.login')]
357
+ }), step == 'login' && /*#__PURE__*/jsx("div", {
358
+ style: {
359
+ textAlign: 'center'
360
+ },
361
+ children: /*#__PURE__*/jsx("div", {
362
+ className: link,
363
+ onClick: resetPassword,
364
+ children: t('auth.button.forgotpassword')
365
+ })
366
+ }), ' ']
322
367
  })]
323
368
  });
324
369
  }
@@ -392,15 +437,10 @@ function RequestNewPassword (_ref) {
392
437
  authorizationStore.showLogin();
393
438
  };
394
439
  return /*#__PURE__*/jsxs(Fragment, {
395
- children: [/*#__PURE__*/jsx("h1", {
396
- children: t('auth.title.resetpassword')
397
- }), /*#__PURE__*/jsx("p", {
398
- children: t('auth.info.resetdescription')
399
- }), !!errorText && /*#__PURE__*/jsxs("div", {
400
- className: error,
401
- children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
402
- children: t(errorText)
403
- })]
440
+ children: [/*#__PURE__*/jsx(Header, {
441
+ title: t('auth.title.resetpassword'),
442
+ text: t('auth.info.resetdescription', ''),
443
+ errorText: errorText !== null && errorText !== void 0 ? errorText : ''
404
444
  }), requested && /*#__PURE__*/jsxs("div", {
405
445
  className: success,
406
446
  children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
@@ -703,15 +743,10 @@ function WelcomeScreen (_ref) {
703
743
  return _checkInvitation.apply(this, arguments);
704
744
  }
705
745
  return /*#__PURE__*/jsxs(Fragment, {
706
- children: [/*#__PURE__*/jsx("h1", {
707
- children: t('auth.title.welcome')
708
- }), /*#__PURE__*/jsx("p", {
709
- children: t('auth.info.welcomedescription')
710
- }), invitationError && /*#__PURE__*/jsxs("div", {
711
- className: error,
712
- children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
713
- children: t(invitationError)
714
- })]
746
+ children: [/*#__PURE__*/jsx(Header, {
747
+ title: t('auth.title.welcome'),
748
+ text: t('auth.info.welcomedescription', ''),
749
+ errorText: invitationError !== null && invitationError !== void 0 ? invitationError : ''
715
750
  }), isNewUser && !invitationError && /*#__PURE__*/jsx(Button, {
716
751
  onClick: toRegister,
717
752
  children: t('auth.title.register')
@@ -760,8 +795,12 @@ function Register() {
760
795
  setOtp = _useState14[1];
761
796
  var _useState15 = useState(false),
762
797
  _useState16 = _slicedToArray(_useState15, 2),
763
- agbAccepted = _useState16[0],
764
- setAgbAccepted = _useState16[1];
798
+ loading = _useState16[0],
799
+ setLoading = _useState16[1];
800
+ var _useState17 = useState(false),
801
+ _useState18 = _slicedToArray(_useState17, 2),
802
+ agbAccepted = _useState18[0],
803
+ setAgbAccepted = _useState18[1];
765
804
  var onRegister = /*#__PURE__*/function () {
766
805
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
767
806
  var _authorizationStore$s2;
@@ -769,28 +808,33 @@ function Register() {
769
808
  while (1) switch (_context.prev = _context.next) {
770
809
  case 0:
771
810
  _context.prev = 0;
772
- _context.next = 3;
811
+ setLoading(true);
812
+ _context.next = 4;
773
813
  return flowResult(authorizationStore.register(email, password, firstname, familyname, (_authorizationStore$s2 = authorizationStore.state) === null || _authorizationStore$s2 === void 0 ? void 0 : _authorizationStore$s2.invitationId, useOtp ? otp : undefined));
774
- case 3:
814
+ case 4:
775
815
  setEmail('');
776
816
  setPassword('');
777
817
  setRepeatPassword('');
778
818
  setFirstname('');
779
819
  setFamilyname('');
780
- _context.next = 14;
820
+ _context.next = 15;
781
821
  break;
782
- case 10:
783
- _context.prev = 10;
822
+ case 11:
823
+ _context.prev = 11;
784
824
  _context.t0 = _context["catch"](0);
785
825
  setErrorText('auth.error.invitationotp');
786
826
  LOG.error(new DivaError('Error while registering', {
787
827
  cause: _context.t0
788
828
  }));
789
- case 14:
829
+ case 15:
830
+ _context.prev = 15;
831
+ setLoading(false);
832
+ return _context.finish(15);
833
+ case 18:
790
834
  case "end":
791
835
  return _context.stop();
792
836
  }
793
- }, _callee, null, [[0, 10]]);
837
+ }, _callee, null, [[0, 11, 15, 18]]);
794
838
  }));
795
839
  return function onRegister() {
796
840
  return _ref.apply(this, arguments);
@@ -803,15 +847,10 @@ function Register() {
803
847
  };
804
848
  var loginMethods = (_authorizationStore$s4 = authorizationStore.state) === null || _authorizationStore$s4 === void 0 ? void 0 : _authorizationStore$s4.loginMethods;
805
849
  return /*#__PURE__*/jsxs(Fragment, {
806
- children: [/*#__PURE__*/jsx("h1", {
807
- children: t('auth.title.register')
808
- }), /*#__PURE__*/jsx("p", {
809
- children: t('auth.text.register', '')
810
- }), !!errorText && /*#__PURE__*/jsxs("div", {
811
- className: error,
812
- children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
813
- children: t(errorText)
814
- })]
850
+ children: [/*#__PURE__*/jsx(Header, {
851
+ title: t('auth.title.register'),
852
+ text: t('auth.text.register', ''),
853
+ errorText: errorText !== null && errorText !== void 0 ? errorText : ''
815
854
  }), /*#__PURE__*/jsx(OpenId, {}), ((loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.generic) || (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.google) || (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.microsoft)) && loginMethods.standard && /*#__PURE__*/jsx("div", {
816
855
  className: separator,
817
856
  children: "or"
@@ -892,19 +931,20 @@ function Register() {
892
931
  })]
893
932
  })]
894
933
  })]
895
- }), /*#__PURE__*/jsx(Typography, {
896
- style: {
897
- color: '#FF8C00',
898
- marginTop: 10,
899
- fontSize: 14
934
+ }), /*#__PURE__*/jsx(Alert$1, {
935
+ severity: "warning",
936
+ sx: {
937
+ display: validPassword() ? 'none' : 'flex'
900
938
  },
901
- hidden: validPassword(),
902
939
  children: t('auth.input.passwordsnotmatch')
903
940
  })]
904
- }), /*#__PURE__*/jsx(Button, {
905
- disabled: !validPassword(),
941
+ }), /*#__PURE__*/jsxs(Button, {
942
+ disabled: !validPassword() || loading,
906
943
  onClick: validPassword() ? onRegister : undefined,
907
- children: t('auth.input.login')
944
+ children: [loading ? /*#__PURE__*/jsx(CircularProgress$1, {
945
+ size: 24,
946
+ color: "inherit"
947
+ }) : undefined, loading ? undefined : t('auth.input.login')]
908
948
  })]
909
949
  })]
910
950
  });
@@ -916,7 +956,8 @@ function Auth() {
916
956
  var _useDivaCoreContext = useDivaCoreContext(),
917
957
  authorizationStore = _useDivaCoreContext.authorizationStore,
918
958
  configurationStore = _useDivaCoreContext.configurationStore,
919
- dataStore = _useDivaCoreContext.dataStore;
959
+ dataStore = _useDivaCoreContext.dataStore,
960
+ contentStore = _useDivaCoreContext.contentStore;
920
961
  var logo = useMemo(function () {
921
962
  var _dataStore$organizati, _configurationStore$n;
922
963
  var logo = divaLogo;
@@ -945,14 +986,14 @@ function Auth() {
945
986
  }
946
987
  }), /*#__PURE__*/jsxs("div", {
947
988
  className: loginBox,
948
- children: [/*#__PURE__*/jsx("div", {
989
+ children: [(!contentStore.containerDimensions.isMobile || contentStore.containerDimensions.isPortrait) && /*#__PURE__*/jsx("div", {
949
990
  className: logoContainer,
950
991
  style: {
951
992
  height: (_configurationStore$c = configurationStore.configuration.loginLogoHeight) !== null && _configurationStore$c !== void 0 ? _configurationStore$c : 50,
952
993
  backgroundImage: "url(".concat(logo, ")")
953
994
  }
954
995
  }), /*#__PURE__*/jsx(AuthElements, {})]
955
- }), configurationStore.authentication.contentBox && /*#__PURE__*/jsx("div", {
996
+ }), configurationStore.authentication.contentBox && !contentStore.containerDimensions.isMobile && /*#__PURE__*/jsx("div", {
956
997
  style: {
957
998
  width: 'calc(100% - 400px)',
958
999
  height: '100%',