@digitaldefiance/express-suite-react-components 2.9.1 → 2.9.3

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 (257) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +11 -7
  3. package/src/auth/Private.tsx +17 -0
  4. package/src/auth/PrivateRoute.tsx +28 -0
  5. package/src/auth/UnAuth.tsx +16 -0
  6. package/src/auth/UnAuthRoute.tsx +30 -0
  7. package/src/auth/{index.d.ts → index.ts} +1 -2
  8. package/src/components/ApiAccess.tsx +134 -0
  9. package/src/components/BackupCodeLoginForm.tsx +314 -0
  10. package/src/components/BackupCodesForm.tsx +198 -0
  11. package/src/components/ChangePasswordForm.tsx +182 -0
  12. package/src/components/ConfirmationDialog.tsx +48 -0
  13. package/src/components/CurrencyCodeSelector.tsx +60 -0
  14. package/src/components/CurrencyInput.tsx +80 -0
  15. package/src/components/DashboardPage.tsx +24 -0
  16. package/src/components/DropdownMenu.tsx +92 -0
  17. package/src/components/ExpirationSecondsSelector.tsx +65 -0
  18. package/src/components/Flag.tsx +53 -0
  19. package/src/components/ForgotPasswordForm.tsx +120 -0
  20. package/src/components/LoginForm.tsx +307 -0
  21. package/src/components/LogoutPage.tsx +21 -0
  22. package/src/components/RegisterForm.tsx +354 -0
  23. package/src/components/ResetPasswordForm.tsx +164 -0
  24. package/src/components/SideMenu.tsx +46 -0
  25. package/src/components/SideMenuListItem.tsx +74 -0
  26. package/src/components/TopMenu.tsx +134 -0
  27. package/src/components/TranslatedTitle.tsx +22 -0
  28. package/src/components/UserLanguageSelector.tsx +45 -0
  29. package/src/components/UserMenu.tsx +15 -0
  30. package/src/components/UserSettingsForm.tsx +328 -0
  31. package/src/components/VerifyEmailPage.tsx +133 -0
  32. package/src/components/{index.d.ts → index.ts} +1 -1
  33. package/src/contexts/AuthProvider.spec.tsx +1060 -0
  34. package/src/contexts/AuthProvider.tsx +741 -0
  35. package/src/contexts/I18nProvider.tsx +85 -0
  36. package/src/contexts/MenuContext.tsx +310 -0
  37. package/src/contexts/SuiteConfigProvider.tsx +93 -0
  38. package/src/contexts/ThemeProvider.tsx +67 -0
  39. package/src/contexts/{index.d.ts → index.ts} +0 -1
  40. package/src/hooks/{index.d.ts → index.ts} +0 -1
  41. package/src/hooks/useBackupCodes.ts +85 -0
  42. package/src/hooks/useEmailVerification.ts +39 -0
  43. package/src/hooks/useExpiringValue.ts +78 -0
  44. package/src/hooks/useLocalStorage.ts +18 -0
  45. package/src/hooks/useUserSettings.ts +216 -0
  46. package/src/{index.d.ts → index.ts} +1 -1
  47. package/src/interfaces/IAppConfig.ts +5 -0
  48. package/src/interfaces/IMenuConfig.ts +11 -0
  49. package/src/interfaces/IMenuOption.ts +55 -0
  50. package/src/interfaces/index.ts +3 -0
  51. package/src/services/__mocks__/authService.ts +14 -0
  52. package/src/services/api.ts +13 -0
  53. package/src/services/authService.ts +422 -0
  54. package/src/services/authenticatedApi.ts +17 -0
  55. package/src/services/index.ts +3 -0
  56. package/src/types/MenuType.ts +15 -0
  57. package/src/types/expirationSeconds.ts +18 -0
  58. package/src/types/index.ts +1 -0
  59. package/src/types/translation.ts +20 -0
  60. package/src/wrappers/BackupCodeLoginWrapper.tsx +35 -0
  61. package/src/wrappers/BackupCodesWrapper.tsx +28 -0
  62. package/src/wrappers/ChangePasswordFormWrapper.tsx +31 -0
  63. package/src/wrappers/LoginFormWrapper.tsx +59 -0
  64. package/src/wrappers/LogoutPageWrapper.tsx +30 -0
  65. package/src/wrappers/RegisterFormWrapper.tsx +48 -0
  66. package/src/wrappers/UserSettingsFormWrapper.tsx +39 -0
  67. package/src/wrappers/VerifyEmailPageWrapper.tsx +27 -0
  68. package/src/wrappers/{index.d.ts → index.tsx} +8 -1
  69. package/src/auth/Private.d.ts +0 -6
  70. package/src/auth/Private.d.ts.map +0 -1
  71. package/src/auth/Private.js +0 -14
  72. package/src/auth/PrivateRoute.d.ts +0 -8
  73. package/src/auth/PrivateRoute.d.ts.map +0 -1
  74. package/src/auth/PrivateRoute.js +0 -23
  75. package/src/auth/UnAuth.d.ts +0 -6
  76. package/src/auth/UnAuth.d.ts.map +0 -1
  77. package/src/auth/UnAuth.js +0 -14
  78. package/src/auth/UnAuthRoute.d.ts +0 -8
  79. package/src/auth/UnAuthRoute.d.ts.map +0 -1
  80. package/src/auth/UnAuthRoute.js +0 -22
  81. package/src/auth/index.d.ts.map +0 -1
  82. package/src/auth/index.js +0 -10
  83. package/src/components/ApiAccess.d.ts +0 -16
  84. package/src/components/ApiAccess.d.ts.map +0 -1
  85. package/src/components/ApiAccess.js +0 -70
  86. package/src/components/BackupCodeLoginForm.d.ts +0 -43
  87. package/src/components/BackupCodeLoginForm.d.ts.map +0 -1
  88. package/src/components/BackupCodeLoginForm.js +0 -106
  89. package/src/components/BackupCodesForm.d.ts +0 -26
  90. package/src/components/BackupCodesForm.d.ts.map +0 -1
  91. package/src/components/BackupCodesForm.js +0 -108
  92. package/src/components/ChangePasswordForm.d.ts +0 -26
  93. package/src/components/ChangePasswordForm.d.ts.map +0 -1
  94. package/src/components/ChangePasswordForm.js +0 -66
  95. package/src/components/ConfirmationDialog.d.ts +0 -13
  96. package/src/components/ConfirmationDialog.d.ts.map +0 -1
  97. package/src/components/ConfirmationDialog.js +0 -10
  98. package/src/components/CurrencyCodeSelector.d.ts +0 -9
  99. package/src/components/CurrencyCodeSelector.d.ts.map +0 -1
  100. package/src/components/CurrencyCodeSelector.js +0 -31
  101. package/src/components/CurrencyInput.d.ts +0 -13
  102. package/src/components/CurrencyInput.d.ts.map +0 -1
  103. package/src/components/CurrencyInput.js +0 -22
  104. package/src/components/DashboardPage.d.ts +0 -8
  105. package/src/components/DashboardPage.d.ts.map +0 -1
  106. package/src/components/DashboardPage.js +0 -10
  107. package/src/components/DropdownMenu.d.ts +0 -9
  108. package/src/components/DropdownMenu.d.ts.map +0 -1
  109. package/src/components/DropdownMenu.js +0 -56
  110. package/src/components/ExpirationSecondsSelector.d.ts +0 -13
  111. package/src/components/ExpirationSecondsSelector.d.ts.map +0 -1
  112. package/src/components/ExpirationSecondsSelector.js +0 -32
  113. package/src/components/Flag.d.ts +0 -20
  114. package/src/components/Flag.d.ts.map +0 -1
  115. package/src/components/Flag.js +0 -43
  116. package/src/components/ForgotPasswordForm.d.ts +0 -18
  117. package/src/components/ForgotPasswordForm.d.ts.map +0 -1
  118. package/src/components/ForgotPasswordForm.js +0 -54
  119. package/src/components/LoginForm.d.ts +0 -44
  120. package/src/components/LoginForm.d.ts.map +0 -1
  121. package/src/components/LoginForm.js +0 -99
  122. package/src/components/LogoutPage.d.ts +0 -8
  123. package/src/components/LogoutPage.d.ts.map +0 -1
  124. package/src/components/LogoutPage.js +0 -16
  125. package/src/components/RegisterForm.d.ts +0 -54
  126. package/src/components/RegisterForm.d.ts.map +0 -1
  127. package/src/components/RegisterForm.js +0 -105
  128. package/src/components/ResetPasswordForm.d.ts +0 -23
  129. package/src/components/ResetPasswordForm.d.ts.map +0 -1
  130. package/src/components/ResetPasswordForm.js +0 -68
  131. package/src/components/SideMenu.d.ts +0 -8
  132. package/src/components/SideMenu.d.ts.map +0 -1
  133. package/src/components/SideMenu.js +0 -25
  134. package/src/components/SideMenuListItem.d.ts +0 -13
  135. package/src/components/SideMenuListItem.d.ts.map +0 -1
  136. package/src/components/SideMenuListItem.js +0 -44
  137. package/src/components/TopMenu.d.ts +0 -24
  138. package/src/components/TopMenu.d.ts.map +0 -1
  139. package/src/components/TopMenu.js +0 -36
  140. package/src/components/TranslatedTitle.d.ts +0 -7
  141. package/src/components/TranslatedTitle.d.ts.map +0 -1
  142. package/src/components/TranslatedTitle.js +0 -15
  143. package/src/components/UserLanguageSelector.d.ts +0 -4
  144. package/src/components/UserLanguageSelector.d.ts.map +0 -1
  145. package/src/components/UserLanguageSelector.js +0 -31
  146. package/src/components/UserMenu.d.ts +0 -4
  147. package/src/components/UserMenu.d.ts.map +0 -1
  148. package/src/components/UserMenu.js +0 -12
  149. package/src/components/UserSettingsForm.d.ts +0 -56
  150. package/src/components/UserSettingsForm.d.ts.map +0 -1
  151. package/src/components/UserSettingsForm.js +0 -93
  152. package/src/components/VerifyEmailPage.d.ts +0 -23
  153. package/src/components/VerifyEmailPage.d.ts.map +0 -1
  154. package/src/components/VerifyEmailPage.js +0 -61
  155. package/src/components/index.d.ts.map +0 -1
  156. package/src/components/index.js +0 -28
  157. package/src/contexts/AuthProvider.d.ts +0 -152
  158. package/src/contexts/AuthProvider.d.ts.map +0 -1
  159. package/src/contexts/AuthProvider.js +0 -446
  160. package/src/contexts/I18nProvider.d.ts +0 -16
  161. package/src/contexts/I18nProvider.d.ts.map +0 -1
  162. package/src/contexts/I18nProvider.js +0 -46
  163. package/src/contexts/MenuContext.d.ts +0 -20
  164. package/src/contexts/MenuContext.d.ts.map +0 -1
  165. package/src/contexts/MenuContext.js +0 -244
  166. package/src/contexts/SuiteConfigProvider.d.ts +0 -44
  167. package/src/contexts/SuiteConfigProvider.d.ts.map +0 -1
  168. package/src/contexts/SuiteConfigProvider.js +0 -43
  169. package/src/contexts/ThemeProvider.d.ts +0 -15
  170. package/src/contexts/ThemeProvider.d.ts.map +0 -1
  171. package/src/contexts/ThemeProvider.js +0 -36
  172. package/src/contexts/index.d.ts.map +0 -1
  173. package/src/contexts/index.js +0 -8
  174. package/src/hooks/index.d.ts.map +0 -1
  175. package/src/hooks/index.js +0 -8
  176. package/src/hooks/useBackupCodes.d.ts +0 -15
  177. package/src/hooks/useBackupCodes.d.ts.map +0 -1
  178. package/src/hooks/useBackupCodes.js +0 -70
  179. package/src/hooks/useEmailVerification.d.ts +0 -10
  180. package/src/hooks/useEmailVerification.d.ts.map +0 -1
  181. package/src/hooks/useEmailVerification.js +0 -36
  182. package/src/hooks/useExpiringValue.d.ts +0 -14
  183. package/src/hooks/useExpiringValue.d.ts.map +0 -1
  184. package/src/hooks/useExpiringValue.js +0 -53
  185. package/src/hooks/useLocalStorage.d.ts +0 -2
  186. package/src/hooks/useLocalStorage.d.ts.map +0 -1
  187. package/src/hooks/useLocalStorage.js +0 -15
  188. package/src/hooks/useUserSettings.d.ts +0 -46
  189. package/src/hooks/useUserSettings.d.ts.map +0 -1
  190. package/src/hooks/useUserSettings.js +0 -152
  191. package/src/index.d.ts.map +0 -1
  192. package/src/index.js +0 -12
  193. package/src/interfaces/IAppConfig.d.ts +0 -6
  194. package/src/interfaces/IAppConfig.d.ts.map +0 -1
  195. package/src/interfaces/IAppConfig.js +0 -2
  196. package/src/interfaces/IMenuConfig.d.ts +0 -11
  197. package/src/interfaces/IMenuConfig.d.ts.map +0 -1
  198. package/src/interfaces/IMenuConfig.js +0 -2
  199. package/src/interfaces/IMenuOption.d.ts +0 -58
  200. package/src/interfaces/IMenuOption.d.ts.map +0 -1
  201. package/src/interfaces/IMenuOption.js +0 -2
  202. package/src/interfaces/index.d.ts +0 -4
  203. package/src/interfaces/index.d.ts.map +0 -1
  204. package/src/interfaces/index.js +0 -6
  205. package/src/services/__mocks__/authService.d.ts +0 -21
  206. package/src/services/__mocks__/authService.d.ts.map +0 -1
  207. package/src/services/__mocks__/authService.js +0 -15
  208. package/src/services/api.d.ts +0 -3
  209. package/src/services/api.d.ts.map +0 -1
  210. package/src/services/api.js +0 -14
  211. package/src/services/authService.d.ts +0 -72
  212. package/src/services/authService.d.ts.map +0 -1
  213. package/src/services/authService.js +0 -347
  214. package/src/services/authenticatedApi.d.ts +0 -3
  215. package/src/services/authenticatedApi.d.ts.map +0 -1
  216. package/src/services/authenticatedApi.js +0 -18
  217. package/src/services/index.d.ts +0 -4
  218. package/src/services/index.d.ts.map +0 -1
  219. package/src/services/index.js +0 -6
  220. package/src/types/MenuType.d.ts +0 -11
  221. package/src/types/MenuType.d.ts.map +0 -1
  222. package/src/types/MenuType.js +0 -12
  223. package/src/types/expirationSeconds.d.ts +0 -3
  224. package/src/types/expirationSeconds.d.ts.map +0 -1
  225. package/src/types/expirationSeconds.js +0 -17
  226. package/src/types/index.d.ts +0 -2
  227. package/src/types/index.d.ts.map +0 -1
  228. package/src/types/index.js +0 -4
  229. package/src/types/translation.d.ts +0 -10
  230. package/src/types/translation.d.ts.map +0 -1
  231. package/src/types/translation.js +0 -9
  232. package/src/wrappers/BackupCodeLoginWrapper.d.ts +0 -8
  233. package/src/wrappers/BackupCodeLoginWrapper.d.ts.map +0 -1
  234. package/src/wrappers/BackupCodeLoginWrapper.js +0 -21
  235. package/src/wrappers/BackupCodesWrapper.d.ts +0 -7
  236. package/src/wrappers/BackupCodesWrapper.d.ts.map +0 -1
  237. package/src/wrappers/BackupCodesWrapper.js +0 -17
  238. package/src/wrappers/ChangePasswordFormWrapper.d.ts +0 -8
  239. package/src/wrappers/ChangePasswordFormWrapper.d.ts.map +0 -1
  240. package/src/wrappers/ChangePasswordFormWrapper.js +0 -21
  241. package/src/wrappers/LoginFormWrapper.d.ts +0 -9
  242. package/src/wrappers/LoginFormWrapper.d.ts.map +0 -1
  243. package/src/wrappers/LoginFormWrapper.js +0 -43
  244. package/src/wrappers/LogoutPageWrapper.d.ts +0 -9
  245. package/src/wrappers/LogoutPageWrapper.d.ts.map +0 -1
  246. package/src/wrappers/LogoutPageWrapper.js +0 -21
  247. package/src/wrappers/RegisterFormWrapper.d.ts +0 -9
  248. package/src/wrappers/RegisterFormWrapper.d.ts.map +0 -1
  249. package/src/wrappers/RegisterFormWrapper.js +0 -26
  250. package/src/wrappers/UserSettingsFormWrapper.d.ts +0 -8
  251. package/src/wrappers/UserSettingsFormWrapper.d.ts.map +0 -1
  252. package/src/wrappers/UserSettingsFormWrapper.js +0 -24
  253. package/src/wrappers/VerifyEmailPageWrapper.d.ts +0 -8
  254. package/src/wrappers/VerifyEmailPageWrapper.d.ts.map +0 -1
  255. package/src/wrappers/VerifyEmailPageWrapper.js +0 -20
  256. package/src/wrappers/index.d.ts.map +0 -1
  257. package/src/wrappers/index.js +0 -20
@@ -1,44 +0,0 @@
1
- import { useFormik } from 'formik';
2
- import { FC } from 'react';
3
- import * as Yup from 'yup';
4
- export interface LoginFormValues {
5
- email?: string;
6
- username?: string;
7
- password?: string;
8
- mnemonic?: string;
9
- [key: string]: any;
10
- }
11
- export interface LoginFormProps {
12
- onSubmit: (values: LoginFormValues) => Promise<void>;
13
- loginType?: 'email' | 'username';
14
- authType?: 'password' | 'mnemonic';
15
- allowLoginTypeToggle?: boolean;
16
- allowAuthTypeToggle?: boolean;
17
- showForgotPassword?: boolean;
18
- showSignUp?: boolean;
19
- forgotPasswordLink?: string;
20
- signUpLink?: string;
21
- emailLabel?: string;
22
- usernameLabel?: string;
23
- passwordLabel?: string;
24
- mnemonicLabel?: string;
25
- signInButtonText?: string;
26
- forgotPasswordText?: string;
27
- signUpText?: string;
28
- useUsernameText?: string;
29
- useEmailText?: string;
30
- useMnemonicText?: string;
31
- usePasswordText?: string;
32
- toggleVisibilityLabel?: string;
33
- titleText?: string;
34
- emailValidation?: Yup.StringSchema;
35
- usernameValidation?: Yup.StringSchema;
36
- passwordValidation?: Yup.StringSchema;
37
- mnemonicValidation?: Yup.StringSchema;
38
- additionalFields?: (formik: ReturnType<typeof useFormik<LoginFormValues>>) => React.ReactNode;
39
- additionalInitialValues?: Record<string, any>;
40
- additionalValidation?: Record<string, Yup.Schema>;
41
- }
42
- export declare const LoginForm: FC<LoginFormProps>;
43
- export default LoginForm;
44
- //# sourceMappingURL=LoginForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoginForm.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/LoginForm.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAI3B,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACjC,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACnC,kBAAkB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACtC,kBAAkB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACtC,kBAAkB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACtC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,eAAe,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC9F,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAsPxC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,99 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoginForm = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const icons_material_1 = require("@mui/icons-material");
7
- const material_1 = require("@mui/material");
8
- const formik_1 = require("formik");
9
- const react_1 = require("react");
10
- const Yup = tslib_1.__importStar(require("yup"));
11
- const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
12
- const contexts_1 = require("../contexts");
13
- const LoginForm = ({ onSubmit, loginType: initialLoginType = 'email', authType: initialAuthType = 'password', allowLoginTypeToggle = true, allowAuthTypeToggle = true, showForgotPassword = true, showSignUp = true, forgotPasswordLink = '/forgot-password', signUpLink = '/register', emailLabel, usernameLabel, passwordLabel, mnemonicLabel, signInButtonText, forgotPasswordText, signUpText, useUsernameText, useEmailText, useMnemonicText, usePasswordText, toggleVisibilityLabel, titleText, emailValidation, usernameValidation, passwordValidation, mnemonicValidation, additionalFields, additionalInitialValues = {}, additionalValidation = {}, }) => {
14
- const { tComponent } = (0, contexts_1.useI18n)();
15
- const [loginType, setLoginType] = (0, react_1.useState)(initialLoginType);
16
- const [authType, setAuthType] = (0, react_1.useState)(initialAuthType);
17
- const [showSecret, setShowSecret] = (0, react_1.useState)(false);
18
- // Use translations with fallbacks
19
- const labels = {
20
- title: titleText || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_Title),
21
- email: emailLabel || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Email),
22
- username: usernameLabel || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Username),
23
- password: passwordLabel || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Password),
24
- mnemonic: mnemonicLabel || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Mnemonic),
25
- signIn: signInButtonText || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.SignInButton),
26
- forgotPassword: forgotPasswordText || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_ForgotPassword),
27
- signUp: signUpText || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_SignUp),
28
- useUsername: useUsernameText || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_UseUsername),
29
- useEmail: useEmailText || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_UseEmailAddress),
30
- useMnemonic: useMnemonicText || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_UseMnemonic),
31
- usePassword: usePasswordText || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_UsePassword),
32
- toggleVisibility: toggleVisibilityLabel || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.TogglePasswordVisibility),
33
- };
34
- const validation = {
35
- email: emailValidation || Yup.string()
36
- .email(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_InvalidEmail))
37
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
38
- username: usernameValidation || Yup.string()
39
- .matches(suite_core_lib_1.Constants.UsernameRegex, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_UsernameRegexErrorTemplate))
40
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
41
- password: passwordValidation || Yup.string()
42
- .min(1, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required))
43
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
44
- mnemonic: mnemonicValidation || Yup.string()
45
- .matches(suite_core_lib_1.Constants.MnemonicRegex, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_InvalidMnemonic))
46
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
47
- };
48
- const formik = (0, formik_1.useFormik)({
49
- initialValues: {
50
- email: '',
51
- username: '',
52
- mnemonic: '',
53
- password: '',
54
- ...additionalInitialValues,
55
- },
56
- validationSchema: Yup.object({
57
- [loginType]: loginType === 'email' ? validation.email : validation.username,
58
- ...(authType === 'mnemonic'
59
- ? { mnemonic: validation.mnemonic }
60
- : { password: validation.password }),
61
- ...additionalValidation,
62
- }),
63
- enableReinitialize: true,
64
- onSubmit: async (values, { setStatus }) => {
65
- try {
66
- setStatus(null);
67
- await onSubmit(values);
68
- }
69
- catch (error) {
70
- setStatus(error.message || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_UnexpectedError));
71
- throw error;
72
- }
73
- },
74
- });
75
- return ((0, jsx_runtime_1.jsx)(material_1.Container, { component: "main", maxWidth: "xs", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
76
- marginTop: 8,
77
- display: 'flex',
78
- flexDirection: 'column',
79
- alignItems: 'center',
80
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h1", variant: "h5", children: labels.title }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "form", onSubmit: formik.handleSubmit, sx: { mt: 1, width: '100%' }, children: [formik.status && ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { mb: 2 }, children: formik.status })), (0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", fullWidth: true, id: loginType, label: loginType === 'email' ? labels.email : labels.username, name: loginType, autoComplete: loginType === 'email' ? 'email' : 'username', autoFocus: true, value: loginType === 'email' ? formik.values.email : formik.values.username, onChange: formik.handleChange, error: formik.touched[loginType] && Boolean(formik.errors[loginType]), helperText: formik.touched[loginType] && formik.errors[loginType] }), authType === 'password' ? ((0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, name: "password", label: labels.password, id: "password", type: showSecret ? 'text' : 'password', value: formik.values.password, onChange: formik.handleChange, error: formik.touched.password && Boolean(formik.errors.password), helperText: formik.touched.password && formik.errors.password, slotProps: {
81
- input: {
82
- endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": labels.toggleVisibility, onClick: () => setShowSecret(!showSecret), edge: "end", children: showSecret ? (0, jsx_runtime_1.jsx)(icons_material_1.VisibilityOff, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.Visibility, {}) }) })),
83
- },
84
- } })) : ((0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, name: "mnemonic", label: labels.mnemonic, id: "mnemonic", multiline: true, rows: 3, value: formik.values.mnemonic, onChange: formik.handleChange, error: formik.touched.mnemonic && Boolean(formik.errors.mnemonic), helperText: formik.touched.mnemonic && formik.errors.mnemonic, type: showSecret ? 'text' : 'password', slotProps: {
85
- input: {
86
- endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": labels.toggleVisibility, onClick: () => setShowSecret(!showSecret), edge: "end", children: showSecret ? (0, jsx_runtime_1.jsx)(icons_material_1.VisibilityOff, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.Visibility, {}) }) })),
87
- },
88
- } })), additionalFields && additionalFields(formik), (0, jsx_runtime_1.jsx)(material_1.Button, { type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2 }, disabled: formik.isSubmitting, children: labels.signIn }), (showForgotPassword || showSignUp) && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', justifyContent: 'space-between' }, children: [showForgotPassword && ((0, jsx_runtime_1.jsx)(material_1.Link, { href: forgotPasswordLink, variant: "body2", children: labels.forgotPassword })), showSignUp && ((0, jsx_runtime_1.jsx)(material_1.Link, { href: signUpLink, variant: "body2", children: labels.signUp }))] })), (allowLoginTypeToggle || allowAuthTypeToggle) && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', gap: 1, mt: 2 }, children: [allowLoginTypeToggle && ((0, jsx_runtime_1.jsx)(material_1.Button, { fullWidth: true, variant: "text", onClick: () => {
89
- const newType = loginType === 'email' ? 'username' : 'email';
90
- formik.setFieldValue(loginType, '');
91
- setLoginType(newType);
92
- }, children: loginType === 'email' ? labels.useUsername : labels.useEmail })), allowAuthTypeToggle && ((0, jsx_runtime_1.jsx)(material_1.Button, { fullWidth: true, variant: "text", onClick: () => {
93
- const newType = authType === 'password' ? 'mnemonic' : 'password';
94
- formik.setFieldValue(authType, '');
95
- setAuthType(newType);
96
- }, children: authType === 'password' ? labels.useMnemonic : labels.usePassword }))] }))] })] }) }));
97
- };
98
- exports.LoginForm = LoginForm;
99
- exports.default = exports.LoginForm;
@@ -1,8 +0,0 @@
1
- export interface LogoutPageProps {
2
- onLogout: () => Promise<void> | void;
3
- onNavigate?: (path: string) => void;
4
- redirectTo?: string;
5
- }
6
- export declare const LogoutPage: ({ onLogout, onNavigate, redirectTo }: LogoutPageProps) => null;
7
- export default LogoutPage;
8
- //# sourceMappingURL=LogoutPage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogoutPage.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/LogoutPage.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,GAAI,sCAAiD,eAAe,SAU1F,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogoutPage = void 0;
4
- const react_1 = require("react");
5
- const LogoutPage = ({ onLogout, onNavigate, redirectTo = '/login' }) => {
6
- (0, react_1.useEffect)(() => {
7
- const performLogout = async () => {
8
- await onLogout();
9
- onNavigate?.(redirectTo);
10
- };
11
- performLogout();
12
- }, [onLogout, onNavigate, redirectTo]);
13
- return null;
14
- };
15
- exports.LogoutPage = LogoutPage;
16
- exports.default = exports.LogoutPage;
@@ -1,54 +0,0 @@
1
- import { FC } from 'react';
2
- import * as Yup from 'yup';
3
- export interface RegisterFormValues {
4
- username: string;
5
- email: string;
6
- timezone: string;
7
- password?: string;
8
- confirmPassword?: string;
9
- [key: string]: any;
10
- }
11
- export interface RegisterFormProps {
12
- onSubmit: (values: RegisterFormValues, usePassword: boolean) => Promise<{
13
- success: boolean;
14
- message: string;
15
- mnemonic?: string;
16
- } | {
17
- error: string;
18
- errorType?: string;
19
- field?: string;
20
- errors?: Array<{
21
- path: string;
22
- msg: string;
23
- }>;
24
- }>;
25
- timezones: string[];
26
- getInitialTimezone: () => string;
27
- usernameValidation?: Yup.StringSchema;
28
- emailValidation?: Yup.StringSchema;
29
- timezoneValidation?: Yup.StringSchema;
30
- passwordValidation?: Yup.StringSchema;
31
- confirmPasswordValidation?: Yup.StringSchema;
32
- additionalFields?: (formik: any, usePassword: boolean) => React.ReactNode;
33
- additionalInitialValues?: Record<string, any>;
34
- additionalValidation?: Record<string, Yup.Schema>;
35
- labels?: {
36
- title?: string;
37
- username?: string;
38
- email?: string;
39
- timezone?: string;
40
- password?: string;
41
- confirmPassword?: string;
42
- useMnemonic?: string;
43
- usePassword?: string;
44
- registering?: string;
45
- register?: string;
46
- successTitle?: string;
47
- mnemonicSuccess?: string;
48
- proceedToLogin?: string;
49
- loginLink?: string;
50
- };
51
- }
52
- export declare const RegisterForm: FC<RegisterFormProps>;
53
- export default RegisterForm;
54
- //# sourceMappingURL=RegisterForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RegisterForm.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/RegisterForm.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAI3B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,WAAW,EAAE,OAAO,KAAK,OAAO,CACnE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GACxD;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CACvG,CAAC;IACF,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kBAAkB,EAAE,MAAM,MAAM,CAAC;IACjC,kBAAkB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACtC,eAAe,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACnC,kBAAkB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACtC,kBAAkB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACtC,yBAAyB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IAC7C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1E,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA8R9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,105 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RegisterForm = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const material_1 = require("@mui/material");
7
- const formik_1 = require("formik");
8
- const react_1 = require("react");
9
- const Yup = tslib_1.__importStar(require("yup"));
10
- const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
11
- const contexts_1 = require("../contexts");
12
- const RegisterForm = ({ onSubmit, timezones, getInitialTimezone, usernameValidation, emailValidation, timezoneValidation, passwordValidation, confirmPasswordValidation, additionalFields, additionalInitialValues = {}, additionalValidation = {}, labels = {}, }) => {
13
- const { t, tComponent } = (0, contexts_1.useI18n)();
14
- const [apiErrors, setApiErrors] = (0, react_1.useState)({});
15
- const [mnemonic, setMnemonic] = (0, react_1.useState)(null);
16
- const [usePassword, setUsePassword] = (0, react_1.useState)(true);
17
- const [registrationSuccess, setRegistrationSuccess] = (0, react_1.useState)(false);
18
- const [registering, setRegistering] = (0, react_1.useState)(false);
19
- const validation = {
20
- username: usernameValidation || Yup.string()
21
- .min(suite_core_lib_1.Constants.UsernameMinLength, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_UsernameMinLengthTemplate))
22
- .max(suite_core_lib_1.Constants.UsernameMaxLength, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_UsernameMaxLengthTemplate))
23
- .matches(suite_core_lib_1.Constants.UsernameRegex, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_UsernameRegexErrorTemplate))
24
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
25
- email: emailValidation || Yup.string()
26
- .email(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_InvalidEmail))
27
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
28
- timezone: timezoneValidation || Yup.string()
29
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_TimezoneRequired))
30
- .oneOf(timezones, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_TimezoneInvalid)),
31
- password: passwordValidation || Yup.string()
32
- .matches(suite_core_lib_1.Constants.PasswordRegex, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordRegexErrorTemplate))
33
- .min(8, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordMinLengthTemplate))
34
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
35
- confirmPassword: confirmPasswordValidation || Yup.string()
36
- .oneOf([Yup.ref('password')], tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordMatch))
37
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
38
- };
39
- const formik = (0, formik_1.useFormik)({
40
- initialValues: {
41
- username: '',
42
- email: '',
43
- timezone: getInitialTimezone(),
44
- password: '',
45
- confirmPassword: '',
46
- directChallenge: false,
47
- ...additionalInitialValues,
48
- },
49
- enableReinitialize: true,
50
- validationSchema: Yup.object({
51
- username: validation.username,
52
- email: validation.email,
53
- timezone: validation.timezone,
54
- ...(usePassword
55
- ? {
56
- password: validation.password,
57
- confirmPassword: validation.confirmPassword,
58
- }
59
- : {}),
60
- ...additionalValidation,
61
- }),
62
- onSubmit: async (values, { setSubmitting, setFieldError, setTouched }) => {
63
- setRegistering(true);
64
- const registerResult = await onSubmit(values, usePassword);
65
- if ('success' in registerResult && registerResult.success) {
66
- setRegistrationSuccess(true);
67
- if (!usePassword && registerResult?.mnemonic) {
68
- setMnemonic(registerResult.mnemonic);
69
- }
70
- }
71
- else {
72
- setRegistrationSuccess(false);
73
- const newApiErrors = {};
74
- const fieldsToTouch = {};
75
- if ('field' in registerResult && registerResult.field) {
76
- setFieldError(registerResult.field, registerResult.error);
77
- fieldsToTouch[registerResult.field] = true;
78
- }
79
- if ('errors' in registerResult && registerResult.errors) {
80
- registerResult.errors.forEach((err) => {
81
- if (err.path && err.msg) {
82
- setFieldError(err.path, err.msg);
83
- fieldsToTouch[err.path] = true;
84
- }
85
- });
86
- }
87
- if ('error' in registerResult && registerResult.error && !Object.keys(newApiErrors).length) {
88
- newApiErrors.general = registerResult.error;
89
- }
90
- setApiErrors(newApiErrors);
91
- setTouched(fieldsToTouch, false);
92
- }
93
- setSubmitting(false);
94
- setRegistering(false);
95
- setApiErrors({});
96
- },
97
- });
98
- return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "sm", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { mt: 8, display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: labels.title || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Registration) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "form", onSubmit: formik.handleSubmit, sx: { mt: 1, width: '100%' }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "username", name: "username", label: labels.username || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Username), value: formik.values.username, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.username && (formik.errors.username || apiErrors.username)), helperText: formik.touched.username && (formik.errors.username || apiErrors.username), margin: "normal" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "email", name: "email", label: labels.email || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Email), value: formik.values.email, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.email && (formik.errors.email || apiErrors.email)), helperText: formik.touched.email && (formik.errors.email || apiErrors.email), margin: "normal" }), (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, margin: "normal", children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { id: "timezone-label", children: labels.timezone || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Timezone) }), (0, jsx_runtime_1.jsx)(material_1.Select, { labelId: "timezone-label", id: "timezone", name: "timezone", value: formik.values.timezone, onChange: formik.handleChange, onBlur: formik.handleBlur, error: formik.touched.timezone && Boolean(formik.errors.timezone), label: labels.timezone || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Timezone), children: timezones.map((tz) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: tz, children: tz }, tz))) }), formik.touched.timezone && (formik.errors.timezone || apiErrors.timezone) && ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: "error", variant: "caption", children: formik.errors.timezone || apiErrors.timezone }))] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: 'flex', alignItems: 'center', mt: 2 }, children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "text", onClick: () => setUsePassword(!usePassword), children: usePassword
99
- ? labels.useMnemonic || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_UseMnemonic)
100
- : labels.usePassword || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_UsePassword) }) }), usePassword && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "password", name: "password", label: labels.password || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Password), type: "password", value: formik.values.password, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.password && formik.errors.password), helperText: formik.touched.password && formik.errors.password, margin: "normal" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "confirmPassword", name: "confirmPassword", label: labels.confirmPassword || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ConfirmNewPassword), type: "password", value: formik.values.confirmPassword, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword), helperText: formik.touched.confirmPassword && formik.errors.confirmPassword, margin: "normal" })] })), (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, margin: "normal", children: [(0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { id: "directChallenge", name: "directChallenge", checked: formik.values.directChallenge || false, onChange: formik.handleChange }), label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_DirectChallengeLabel) }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_DirectChallengeHelper) })] }), additionalFields && additionalFields(formik, usePassword), apiErrors.general && ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { mt: 2, mb: 2 }, children: apiErrors.general })), (0, jsx_runtime_1.jsx)(material_1.Button, { type: "submit", fullWidth: true, variant: "contained", color: "primary", sx: { mt: 3, mb: 2 }, disabled: formik.isSubmitting, children: registering
101
- ? labels.registering || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_Registering)
102
- : labels.register || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_RegisterButton) }), registering && ((0, jsx_runtime_1.jsxs)(material_1.Alert, { severity: "success", sx: { mt: 2, mb: 2, whiteSpace: 'pre-wrap' }, children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: labels.registering || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_Registering) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", component: "div", children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_RegisteringMessage) })] })), mnemonic && ((0, jsx_runtime_1.jsxs)(material_1.Alert, { severity: "success", sx: { mt: 2, mb: 2, whiteSpace: 'pre-wrap' }, children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: labels.successTitle || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_SuccessTitle) }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body2", component: "div", children: [labels.mnemonicSuccess || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_MnemonicSuccess), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", component: "div", sx: { mt: 1, fontFamily: 'monospace' }, children: mnemonic }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { textAlign: 'center' }, children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "/login", children: labels.proceedToLogin || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.ProceedToLogin) }) })] })] })), registrationSuccess && ((0, jsx_runtime_1.jsxs)(material_1.Alert, { severity: "success", sx: { mt: 2, mb: 2 }, children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: labels.successTitle || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_SuccessTitle) }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body2", component: "div", children: [tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_Success), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { textAlign: 'center' }, children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "/login", children: labels.proceedToLogin || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.ProceedToLogin) }) })] })] })), !mnemonic && !registrationSuccess && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { textAlign: 'center' }, children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "/login", variant: "body2", children: labels.loginLink || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Registration_LoginLink) }) }))] })] }) }));
103
- };
104
- exports.RegisterForm = RegisterForm;
105
- exports.default = exports.RegisterForm;
@@ -1,23 +0,0 @@
1
- import { FC } from 'react';
2
- import * as Yup from 'yup';
3
- export interface ResetPasswordFormValues {
4
- password: string;
5
- confirmPassword: string;
6
- }
7
- export interface ResetPasswordFormProps {
8
- token: string | null;
9
- onSubmit: (token: string, password: string) => Promise<void>;
10
- passwordValidation?: Yup.StringSchema;
11
- confirmPasswordValidation?: Yup.StringSchema;
12
- labels?: {
13
- title?: string;
14
- password?: string;
15
- confirmPassword?: string;
16
- resetButton?: string;
17
- successMessage?: string;
18
- invalidToken?: string;
19
- };
20
- }
21
- export declare const ResetPasswordForm: FC<ResetPasswordFormProps>;
22
- export default ResetPasswordForm;
23
- //# sourceMappingURL=ResetPasswordForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResetPasswordForm.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/ResetPasswordForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAI3B,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,kBAAkB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACtC,yBAAyB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IAC7C,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAsIxD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResetPasswordForm = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const material_1 = require("@mui/material");
7
- const formik_1 = require("formik");
8
- const react_1 = require("react");
9
- const Yup = tslib_1.__importStar(require("yup"));
10
- const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
11
- const contexts_1 = require("../contexts");
12
- const ResetPasswordForm = ({ token, onSubmit, passwordValidation, confirmPasswordValidation, labels = {}, }) => {
13
- const { t, tComponent } = (0, contexts_1.useI18n)();
14
- const [success, setSuccess] = (0, react_1.useState)(false);
15
- const [apiError, setApiError] = (0, react_1.useState)('');
16
- const validation = {
17
- password: passwordValidation || Yup.string()
18
- .min(suite_core_lib_1.Constants.PasswordMinLength, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordMinLengthTemplate))
19
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
20
- confirmPassword: confirmPasswordValidation || Yup.string()
21
- .oneOf([Yup.ref('password')], tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordMatch))
22
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
23
- };
24
- const translatedLabels = {
25
- title: labels.title || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.PasswordReset_Title),
26
- password: labels.password || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_NewPassword),
27
- confirmPassword: labels.confirmPassword || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ConfirmNewPassword),
28
- resetButton: labels.resetButton || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.PasswordReset_Button),
29
- successMessage: labels.successMessage || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.PasswordReset_Success),
30
- invalidToken: labels.invalidToken || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.ForgotPassword_InvalidToken),
31
- };
32
- const formik = (0, formik_1.useFormik)({
33
- initialValues: {
34
- password: '',
35
- confirmPassword: '',
36
- },
37
- validationSchema: Yup.object({
38
- password: validation.password,
39
- confirmPassword: validation.confirmPassword,
40
- }),
41
- onSubmit: async (values) => {
42
- if (!token) {
43
- setApiError(translatedLabels.invalidToken);
44
- return;
45
- }
46
- try {
47
- await onSubmit(token, values.password);
48
- setSuccess(true);
49
- setApiError('');
50
- }
51
- catch (error) {
52
- setApiError(error.response?.data?.message || tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Error_PasswordChange));
53
- setSuccess(false);
54
- }
55
- },
56
- });
57
- if (!token) {
58
- return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "sm", children: (0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { mt: 4 }, children: translatedLabels.invalidToken }) }));
59
- }
60
- return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "sm", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
61
- mt: 8,
62
- display: 'flex',
63
- flexDirection: 'column',
64
- alignItems: 'center',
65
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: translatedLabels.title }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "form", onSubmit: formik.handleSubmit, sx: { mt: 1, width: '100%' }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "password", name: "password", label: translatedLabels.password, type: "password", value: formik.values.password, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.password && formik.errors.password), helperText: formik.touched.password && formik.errors.password, margin: "normal" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "confirmPassword", name: "confirmPassword", label: translatedLabels.confirmPassword, type: "password", value: formik.values.confirmPassword, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword), helperText: formik.touched.confirmPassword && formik.errors.confirmPassword, margin: "normal" }), apiError && ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { mt: 2, mb: 2 }, children: apiError })), success && ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "success", sx: { mt: 2, mb: 2 }, children: translatedLabels.successMessage })), (0, jsx_runtime_1.jsx)(material_1.Button, { type: "submit", fullWidth: true, variant: "contained", color: "primary", sx: { mt: 3, mb: 2 }, disabled: formik.isSubmitting, children: translatedLabels.resetButton })] })] }) }));
66
- };
67
- exports.ResetPasswordForm = ResetPasswordForm;
68
- exports.default = exports.ResetPasswordForm;
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- interface SideMenuProps {
3
- isOpen: boolean;
4
- onClose: () => void;
5
- }
6
- export declare const SideMenu: FC<SideMenuProps>;
7
- export default SideMenu;
8
- //# sourceMappingURL=SideMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SideMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/SideMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAO3B,UAAU,aAAa;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA8BtC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SideMenu = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
6
- const react_router_dom_1 = require("react-router-dom");
7
- const MenuContext_1 = require("../contexts/MenuContext");
8
- const MenuType_1 = require("../types/MenuType");
9
- const SideMenuListItem_1 = require("./SideMenuListItem");
10
- const SideMenu = ({ isOpen, onClose }) => {
11
- const { getMenuOptions } = (0, MenuContext_1.useMenu)();
12
- const navigate = (0, react_router_dom_1.useNavigate)();
13
- const menuOptions = getMenuOptions(MenuType_1.MenuTypes.SideMenu, true);
14
- const handleNavigate = (link) => {
15
- if (typeof link === 'string') {
16
- navigate(link);
17
- }
18
- else if (link.pathname) {
19
- navigate(link.pathname, { state: link.state });
20
- }
21
- };
22
- return ((0, jsx_runtime_1.jsx)(material_1.Drawer, { anchor: "left", open: isOpen, onClose: onClose, children: (0, jsx_runtime_1.jsx)(material_1.List, { children: menuOptions.map((item) => ((0, jsx_runtime_1.jsx)(SideMenuListItem_1.SideMenuListItem, { menuItem: item, onClose: onClose, onNavigate: handleNavigate }, item.id))) }) }));
23
- };
24
- exports.SideMenu = SideMenu;
25
- exports.default = exports.SideMenu;
@@ -1,13 +0,0 @@
1
- import { FC } from 'react';
2
- import { IMenuOption } from '../interfaces';
3
- export interface SideMenuListItemProps {
4
- menuItem: IMenuOption;
5
- onClose: () => void;
6
- onNavigate?: (link: string | Partial<{
7
- pathname: string;
8
- state?: unknown;
9
- }>) => void;
10
- }
11
- export declare const SideMenuListItem: FC<SideMenuListItemProps>;
12
- export default SideMenuListItem;
13
- //# sourceMappingURL=SideMenuListItem.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SideMenuListItem.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/SideMenuListItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAe,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,KAC1D,IAAI,CAAC;CACX;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAsDtD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SideMenuListItem = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
6
- const react_1 = require("react");
7
- const SideMenuListItem = ({ menuItem, onClose, onNavigate, }) => {
8
- const handleMenuItemClick = (0, react_1.useCallback)((option) => (event) => {
9
- event.stopPropagation();
10
- if (option.action) {
11
- option.action();
12
- }
13
- else if (option.link !== undefined && onNavigate) {
14
- if (typeof option.link === 'string') {
15
- onNavigate(option.link);
16
- }
17
- else if (typeof option.link === 'object' &&
18
- 'pathname' in option.link &&
19
- option.link.pathname) {
20
- onNavigate({
21
- pathname: option.link.pathname,
22
- state: 'state' in option.link ? option.link.state : undefined,
23
- });
24
- }
25
- }
26
- onClose();
27
- }, [onNavigate, onClose]);
28
- if (menuItem.divider) {
29
- return (0, jsx_runtime_1.jsx)(material_1.Divider, {}, menuItem.label);
30
- }
31
- else if (menuItem.link) {
32
- return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { onClick: handleMenuItemClick(menuItem), children: [menuItem.icon && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: menuItem.icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: menuItem.label })] }, menuItem.id));
33
- }
34
- else if (menuItem.action) {
35
- const action = menuItem.action;
36
- return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { onClick: async () => {
37
- await action();
38
- onClose();
39
- }, children: [menuItem.icon && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: menuItem.icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: menuItem.label })] }, menuItem.id));
40
- }
41
- return null;
42
- };
43
- exports.SideMenuListItem = SideMenuListItem;
44
- exports.default = exports.SideMenuListItem;
@@ -1,24 +0,0 @@
1
- import React, { FC, ReactElement } from 'react';
2
- import { MenuType } from '../types/MenuType';
3
- declare global {
4
- interface Window {
5
- APP_CONFIG?: {
6
- hostname: string;
7
- siteTitle: string;
8
- server: string;
9
- [key: string]: unknown;
10
- };
11
- }
12
- }
13
- export interface AdditionalDropdownMenu {
14
- menuType: MenuType;
15
- menuIcon: ReactElement;
16
- priority?: number;
17
- }
18
- export interface TopMenuProps {
19
- Logo: React.ReactNode;
20
- additionalMenus?: Array<AdditionalDropdownMenu>;
21
- }
22
- export declare const TopMenu: FC<TopMenuProps>;
23
- export default TopMenu;
24
- //# sourceMappingURL=TopMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TopMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TopMenu.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAwB,MAAM,OAAO,CAAC;AAKtE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;YAClB,MAAM,EAAE,MAAM,CAAC;YACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,eAAe,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAoFpC,CAAC;AAEF,eAAe,OAAO,CAAC"}