@digitaldefiance/express-suite-react-components 5.0.1 → 5.0.2

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 (311) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +3 -4
  3. package/src/auth/AdminRoute.tsx +54 -0
  4. package/src/auth/Private.tsx +17 -0
  5. package/src/auth/PrivateRoute.tsx +28 -0
  6. package/src/auth/UnAuth.tsx +16 -0
  7. package/src/auth/UnAuthRoute.tsx +30 -0
  8. package/src/auth/{index.d.ts → index.ts} +2 -3
  9. package/src/components/ApiAccess.tsx +175 -0
  10. package/src/components/BackupCodeLoginForm.tsx +489 -0
  11. package/src/components/BackupCodesForm.tsx +287 -0
  12. package/src/components/CategoryMenu.tsx +155 -0
  13. package/src/components/ChangePasswordForm.tsx +273 -0
  14. package/src/components/ConfirmationDialog.tsx +48 -0
  15. package/src/components/CurrencyCodeSelector.tsx +60 -0
  16. package/src/components/CurrencyInput.tsx +80 -0
  17. package/src/components/DashboardPage.tsx +24 -0
  18. package/src/components/DropdownMenu.tsx +105 -0
  19. package/src/components/ExpirationSecondsSelector.tsx +60 -0
  20. package/src/components/FakeEmailAdminPanel.tsx +374 -0
  21. package/src/components/Flag.tsx +52 -0
  22. package/src/components/ForgotPasswordForm.tsx +174 -0
  23. package/src/components/LoginForm.tsx +468 -0
  24. package/src/components/LogoutPage.tsx +21 -0
  25. package/src/components/RegisterForm.tsx +1169 -0
  26. package/src/components/ResetPasswordForm.tsx +247 -0
  27. package/src/components/SideMenu.tsx +46 -0
  28. package/src/components/SideMenuListItem.tsx +75 -0
  29. package/src/components/T.tsx +24 -0
  30. package/src/components/TDiv.tsx +26 -0
  31. package/src/components/TImgAlt.tsx +28 -0
  32. package/src/components/TopMenu.tsx +252 -0
  33. package/src/components/TotpSetupForm.tsx +188 -0
  34. package/src/components/TotpVerificationForm.tsx +148 -0
  35. package/src/components/TranslatedTitle.tsx +31 -0
  36. package/src/components/UserLanguageSelector.tsx +45 -0
  37. package/src/components/UserMenu.tsx +15 -0
  38. package/src/components/UserSettingsForm.tsx +904 -0
  39. package/src/components/VerifyEmailPage.tsx +222 -0
  40. package/src/components/__tests__/RegisterForm.totp.spec.tsx +377 -0
  41. package/src/components/__tests__/TotpSetupForm.spec.tsx +258 -0
  42. package/src/components/__tests__/TotpVerificationForm.spec.tsx +259 -0
  43. package/src/components/__tests__/UserSettingsForm.totp.spec.tsx +396 -0
  44. package/src/components/{index.d.ts → index.ts} +1 -1
  45. package/src/contexts/AuthProvider.spec.tsx +1284 -0
  46. package/src/contexts/AuthProvider.tsx +977 -0
  47. package/src/contexts/I18nProvider.tsx +164 -0
  48. package/src/contexts/MenuContext.tsx +426 -0
  49. package/src/contexts/SuiteConfigProvider.tsx +93 -0
  50. package/src/contexts/ThemeProvider.tsx +67 -0
  51. package/src/contexts/{index.d.ts → index.ts} +0 -1
  52. package/src/hooks/{index.d.ts → index.ts} +0 -1
  53. package/src/hooks/useAuthenticatedApi.tsx +67 -0
  54. package/src/hooks/useBackupCodes.ts +105 -0
  55. package/src/hooks/useEmailVerification.ts +54 -0
  56. package/src/hooks/useExpiringValue.ts +78 -0
  57. package/src/hooks/useLocalStorage.ts +18 -0
  58. package/src/hooks/useUserSettings.ts +271 -0
  59. package/src/{index.d.ts → index.ts} +1 -1
  60. package/src/interfaces/IAppConfig.ts +7 -0
  61. package/src/interfaces/ICategoryConfig.ts +41 -0
  62. package/src/interfaces/IMenuConfig.ts +28 -0
  63. package/src/interfaces/IMenuOption.ts +79 -0
  64. package/src/interfaces/{index.d.ts → index.ts} +0 -1
  65. package/src/services/__mocks__/authService.ts +14 -0
  66. package/src/services/__tests__/authService.totp.property.spec.ts +360 -0
  67. package/src/services/__tests__/authService.totp.spec.ts +439 -0
  68. package/src/services/api.ts +13 -0
  69. package/src/services/authService.ts +692 -0
  70. package/src/services/authenticatedApi.ts +17 -0
  71. package/src/services/index.ts +3 -0
  72. package/src/types/MenuType.ts +15 -0
  73. package/src/types/expirationSeconds.ts +18 -0
  74. package/src/types/index.ts +1 -0
  75. package/src/types/translation.ts +20 -0
  76. package/src/wrappers/BackupCodeLoginWrapper.tsx +34 -0
  77. package/src/wrappers/BackupCodesWrapper.tsx +28 -0
  78. package/src/wrappers/ChangePasswordFormWrapper.tsx +34 -0
  79. package/src/wrappers/ForgotPasswordFormWrapper.tsx +45 -0
  80. package/src/wrappers/LoginFormWrapper.tsx +108 -0
  81. package/src/wrappers/LogoutPageWrapper.tsx +30 -0
  82. package/src/wrappers/RegisterFormWrapper.tsx +109 -0
  83. package/src/wrappers/ResetPasswordFormWrapper.tsx +57 -0
  84. package/src/wrappers/UserSettingsFormWrapper.tsx +140 -0
  85. package/src/wrappers/VerifyEmailPageWrapper.tsx +27 -0
  86. package/src/wrappers/__tests__/LoginFormWrapper.totp.spec.tsx +339 -0
  87. package/src/wrappers/{index.d.ts → index.tsx} +10 -1
  88. package/src/auth/AdminRoute.d.ts +0 -8
  89. package/src/auth/AdminRoute.d.ts.map +0 -1
  90. package/src/auth/AdminRoute.js +0 -28
  91. package/src/auth/Private.d.ts +0 -6
  92. package/src/auth/Private.d.ts.map +0 -1
  93. package/src/auth/Private.js +0 -14
  94. package/src/auth/PrivateRoute.d.ts +0 -8
  95. package/src/auth/PrivateRoute.d.ts.map +0 -1
  96. package/src/auth/PrivateRoute.js +0 -23
  97. package/src/auth/UnAuth.d.ts +0 -6
  98. package/src/auth/UnAuth.d.ts.map +0 -1
  99. package/src/auth/UnAuth.js +0 -14
  100. package/src/auth/UnAuthRoute.d.ts +0 -8
  101. package/src/auth/UnAuthRoute.d.ts.map +0 -1
  102. package/src/auth/UnAuthRoute.js +0 -22
  103. package/src/auth/index.d.ts.map +0 -1
  104. package/src/auth/index.js +0 -12
  105. package/src/components/ApiAccess.d.ts +0 -16
  106. package/src/components/ApiAccess.d.ts.map +0 -1
  107. package/src/components/ApiAccess.js +0 -77
  108. package/src/components/BackupCodeLoginForm.d.ts +0 -43
  109. package/src/components/BackupCodeLoginForm.d.ts.map +0 -1
  110. package/src/components/BackupCodeLoginForm.js +0 -139
  111. package/src/components/BackupCodesForm.d.ts +0 -26
  112. package/src/components/BackupCodesForm.d.ts.map +0 -1
  113. package/src/components/BackupCodesForm.js +0 -120
  114. package/src/components/CategoryMenu.d.ts +0 -17
  115. package/src/components/CategoryMenu.d.ts.map +0 -1
  116. package/src/components/CategoryMenu.js +0 -65
  117. package/src/components/ChangePasswordForm.d.ts +0 -26
  118. package/src/components/ChangePasswordForm.d.ts.map +0 -1
  119. package/src/components/ChangePasswordForm.js +0 -78
  120. package/src/components/ConfirmationDialog.d.ts +0 -13
  121. package/src/components/ConfirmationDialog.d.ts.map +0 -1
  122. package/src/components/ConfirmationDialog.js +0 -10
  123. package/src/components/CurrencyCodeSelector.d.ts +0 -9
  124. package/src/components/CurrencyCodeSelector.d.ts.map +0 -1
  125. package/src/components/CurrencyCodeSelector.js +0 -31
  126. package/src/components/CurrencyInput.d.ts +0 -13
  127. package/src/components/CurrencyInput.d.ts.map +0 -1
  128. package/src/components/CurrencyInput.js +0 -22
  129. package/src/components/DashboardPage.d.ts +0 -8
  130. package/src/components/DashboardPage.d.ts.map +0 -1
  131. package/src/components/DashboardPage.js +0 -10
  132. package/src/components/DropdownMenu.d.ts +0 -13
  133. package/src/components/DropdownMenu.d.ts.map +0 -1
  134. package/src/components/DropdownMenu.js +0 -63
  135. package/src/components/ExpirationSecondsSelector.d.ts +0 -13
  136. package/src/components/ExpirationSecondsSelector.d.ts.map +0 -1
  137. package/src/components/ExpirationSecondsSelector.js +0 -32
  138. package/src/components/FakeEmailAdminPanel.d.ts +0 -23
  139. package/src/components/FakeEmailAdminPanel.d.ts.map +0 -1
  140. package/src/components/FakeEmailAdminPanel.js +0 -147
  141. package/src/components/Flag.d.ts +0 -20
  142. package/src/components/Flag.d.ts.map +0 -1
  143. package/src/components/Flag.js +0 -43
  144. package/src/components/ForgotPasswordForm.d.ts +0 -18
  145. package/src/components/ForgotPasswordForm.d.ts.map +0 -1
  146. package/src/components/ForgotPasswordForm.js +0 -61
  147. package/src/components/LoginForm.d.ts +0 -44
  148. package/src/components/LoginForm.d.ts.map +0 -1
  149. package/src/components/LoginForm.js +0 -123
  150. package/src/components/LogoutPage.d.ts +0 -8
  151. package/src/components/LogoutPage.d.ts.map +0 -1
  152. package/src/components/LogoutPage.js +0 -16
  153. package/src/components/RegisterForm.d.ts +0 -100
  154. package/src/components/RegisterForm.d.ts.map +0 -1
  155. package/src/components/RegisterForm.js +0 -306
  156. package/src/components/ResetPasswordForm.d.ts +0 -23
  157. package/src/components/ResetPasswordForm.d.ts.map +0 -1
  158. package/src/components/ResetPasswordForm.js +0 -78
  159. package/src/components/SideMenu.d.ts +0 -8
  160. package/src/components/SideMenu.d.ts.map +0 -1
  161. package/src/components/SideMenu.js +0 -25
  162. package/src/components/SideMenuListItem.d.ts +0 -13
  163. package/src/components/SideMenuListItem.d.ts.map +0 -1
  164. package/src/components/SideMenuListItem.js +0 -44
  165. package/src/components/T.d.ts +0 -7
  166. package/src/components/T.d.ts.map +0 -1
  167. package/src/components/T.js +0 -13
  168. package/src/components/TDiv.d.ts +0 -9
  169. package/src/components/TDiv.d.ts.map +0 -1
  170. package/src/components/TDiv.js +0 -14
  171. package/src/components/TImgAlt.d.ts +0 -10
  172. package/src/components/TImgAlt.d.ts.map +0 -1
  173. package/src/components/TImgAlt.js +0 -14
  174. package/src/components/TopMenu.d.ts +0 -50
  175. package/src/components/TopMenu.d.ts.map +0 -1
  176. package/src/components/TopMenu.js +0 -79
  177. package/src/components/TotpSetupForm.d.ts +0 -24
  178. package/src/components/TotpSetupForm.d.ts.map +0 -1
  179. package/src/components/TotpSetupForm.js +0 -82
  180. package/src/components/TotpVerificationForm.d.ts +0 -23
  181. package/src/components/TotpVerificationForm.d.ts.map +0 -1
  182. package/src/components/TotpVerificationForm.js +0 -66
  183. package/src/components/TranslatedTitle.d.ts +0 -8
  184. package/src/components/TranslatedTitle.d.ts.map +0 -1
  185. package/src/components/TranslatedTitle.js +0 -15
  186. package/src/components/UserLanguageSelector.d.ts +0 -4
  187. package/src/components/UserLanguageSelector.d.ts.map +0 -1
  188. package/src/components/UserLanguageSelector.js +0 -31
  189. package/src/components/UserMenu.d.ts +0 -4
  190. package/src/components/UserMenu.d.ts.map +0 -1
  191. package/src/components/UserMenu.js +0 -12
  192. package/src/components/UserSettingsForm.d.ts +0 -113
  193. package/src/components/UserSettingsForm.d.ts.map +0 -1
  194. package/src/components/UserSettingsForm.js +0 -269
  195. package/src/components/VerifyEmailPage.d.ts +0 -24
  196. package/src/components/VerifyEmailPage.d.ts.map +0 -1
  197. package/src/components/VerifyEmailPage.js +0 -81
  198. package/src/components/index.d.ts.map +0 -1
  199. package/src/components/index.js +0 -35
  200. package/src/contexts/AuthProvider.d.ts +0 -186
  201. package/src/contexts/AuthProvider.d.ts.map +0 -1
  202. package/src/contexts/AuthProvider.js +0 -515
  203. package/src/contexts/I18nProvider.d.ts +0 -27
  204. package/src/contexts/I18nProvider.d.ts.map +0 -1
  205. package/src/contexts/I18nProvider.js +0 -60
  206. package/src/contexts/MenuContext.d.ts +0 -20
  207. package/src/contexts/MenuContext.d.ts.map +0 -1
  208. package/src/contexts/MenuContext.js +0 -275
  209. package/src/contexts/SuiteConfigProvider.d.ts +0 -44
  210. package/src/contexts/SuiteConfigProvider.d.ts.map +0 -1
  211. package/src/contexts/SuiteConfigProvider.js +0 -43
  212. package/src/contexts/ThemeProvider.d.ts +0 -15
  213. package/src/contexts/ThemeProvider.d.ts.map +0 -1
  214. package/src/contexts/ThemeProvider.js +0 -36
  215. package/src/contexts/index.d.ts.map +0 -1
  216. package/src/contexts/index.js +0 -8
  217. package/src/hooks/index.d.ts.map +0 -1
  218. package/src/hooks/index.js +0 -9
  219. package/src/hooks/useAuthenticatedApi.d.ts +0 -34
  220. package/src/hooks/useAuthenticatedApi.d.ts.map +0 -1
  221. package/src/hooks/useAuthenticatedApi.js +0 -46
  222. package/src/hooks/useBackupCodes.d.ts +0 -15
  223. package/src/hooks/useBackupCodes.d.ts.map +0 -1
  224. package/src/hooks/useBackupCodes.js +0 -74
  225. package/src/hooks/useEmailVerification.d.ts +0 -10
  226. package/src/hooks/useEmailVerification.d.ts.map +0 -1
  227. package/src/hooks/useEmailVerification.js +0 -40
  228. package/src/hooks/useExpiringValue.d.ts +0 -14
  229. package/src/hooks/useExpiringValue.d.ts.map +0 -1
  230. package/src/hooks/useExpiringValue.js +0 -53
  231. package/src/hooks/useLocalStorage.d.ts +0 -2
  232. package/src/hooks/useLocalStorage.d.ts.map +0 -1
  233. package/src/hooks/useLocalStorage.js +0 -15
  234. package/src/hooks/useUserSettings.d.ts +0 -48
  235. package/src/hooks/useUserSettings.d.ts.map +0 -1
  236. package/src/hooks/useUserSettings.js +0 -171
  237. package/src/index.d.ts.map +0 -1
  238. package/src/index.js +0 -12
  239. package/src/interfaces/IAppConfig.d.ts +0 -8
  240. package/src/interfaces/IAppConfig.d.ts.map +0 -1
  241. package/src/interfaces/IAppConfig.js +0 -2
  242. package/src/interfaces/ICategoryConfig.d.ts +0 -41
  243. package/src/interfaces/ICategoryConfig.d.ts.map +0 -1
  244. package/src/interfaces/ICategoryConfig.js +0 -2
  245. package/src/interfaces/IMenuConfig.d.ts +0 -28
  246. package/src/interfaces/IMenuConfig.d.ts.map +0 -1
  247. package/src/interfaces/IMenuConfig.js +0 -2
  248. package/src/interfaces/IMenuOption.d.ts +0 -82
  249. package/src/interfaces/IMenuOption.d.ts.map +0 -1
  250. package/src/interfaces/IMenuOption.js +0 -2
  251. package/src/interfaces/index.d.ts.map +0 -1
  252. package/src/interfaces/index.js +0 -7
  253. package/src/services/__mocks__/authService.d.ts +0 -21
  254. package/src/services/__mocks__/authService.d.ts.map +0 -1
  255. package/src/services/__mocks__/authService.js +0 -15
  256. package/src/services/api.d.ts +0 -3
  257. package/src/services/api.d.ts.map +0 -1
  258. package/src/services/api.js +0 -14
  259. package/src/services/authService.d.ts +0 -126
  260. package/src/services/authService.d.ts.map +0 -1
  261. package/src/services/authService.js +0 -471
  262. package/src/services/authenticatedApi.d.ts +0 -3
  263. package/src/services/authenticatedApi.d.ts.map +0 -1
  264. package/src/services/authenticatedApi.js +0 -18
  265. package/src/services/index.d.ts +0 -4
  266. package/src/services/index.d.ts.map +0 -1
  267. package/src/services/index.js +0 -6
  268. package/src/types/MenuType.d.ts +0 -11
  269. package/src/types/MenuType.d.ts.map +0 -1
  270. package/src/types/MenuType.js +0 -12
  271. package/src/types/expirationSeconds.d.ts +0 -3
  272. package/src/types/expirationSeconds.d.ts.map +0 -1
  273. package/src/types/expirationSeconds.js +0 -17
  274. package/src/types/index.d.ts +0 -2
  275. package/src/types/index.d.ts.map +0 -1
  276. package/src/types/index.js +0 -4
  277. package/src/types/translation.d.ts +0 -10
  278. package/src/types/translation.d.ts.map +0 -1
  279. package/src/types/translation.js +0 -9
  280. package/src/wrappers/BackupCodeLoginWrapper.d.ts +0 -8
  281. package/src/wrappers/BackupCodeLoginWrapper.d.ts.map +0 -1
  282. package/src/wrappers/BackupCodeLoginWrapper.js +0 -20
  283. package/src/wrappers/BackupCodesWrapper.d.ts +0 -7
  284. package/src/wrappers/BackupCodesWrapper.d.ts.map +0 -1
  285. package/src/wrappers/BackupCodesWrapper.js +0 -17
  286. package/src/wrappers/ChangePasswordFormWrapper.d.ts +0 -8
  287. package/src/wrappers/ChangePasswordFormWrapper.d.ts.map +0 -1
  288. package/src/wrappers/ChangePasswordFormWrapper.js +0 -21
  289. package/src/wrappers/ForgotPasswordFormWrapper.d.ts +0 -8
  290. package/src/wrappers/ForgotPasswordFormWrapper.d.ts.map +0 -1
  291. package/src/wrappers/ForgotPasswordFormWrapper.js +0 -29
  292. package/src/wrappers/LoginFormWrapper.d.ts +0 -21
  293. package/src/wrappers/LoginFormWrapper.d.ts.map +0 -1
  294. package/src/wrappers/LoginFormWrapper.js +0 -72
  295. package/src/wrappers/LogoutPageWrapper.d.ts +0 -9
  296. package/src/wrappers/LogoutPageWrapper.d.ts.map +0 -1
  297. package/src/wrappers/LogoutPageWrapper.js +0 -21
  298. package/src/wrappers/RegisterFormWrapper.d.ts +0 -20
  299. package/src/wrappers/RegisterFormWrapper.d.ts.map +0 -1
  300. package/src/wrappers/RegisterFormWrapper.js +0 -51
  301. package/src/wrappers/ResetPasswordFormWrapper.d.ts +0 -9
  302. package/src/wrappers/ResetPasswordFormWrapper.d.ts.map +0 -1
  303. package/src/wrappers/ResetPasswordFormWrapper.js +0 -34
  304. package/src/wrappers/UserSettingsFormWrapper.d.ts +0 -29
  305. package/src/wrappers/UserSettingsFormWrapper.d.ts.map +0 -1
  306. package/src/wrappers/UserSettingsFormWrapper.js +0 -95
  307. package/src/wrappers/VerifyEmailPageWrapper.d.ts +0 -8
  308. package/src/wrappers/VerifyEmailPageWrapper.d.ts.map +0 -1
  309. package/src/wrappers/VerifyEmailPageWrapper.js +0 -21
  310. package/src/wrappers/index.d.ts.map +0 -1
  311. package/src/wrappers/index.js +0 -24
@@ -1,13 +0,0 @@
1
- export interface CurrencyInputProps {
2
- value: number;
3
- onChange: (value: number) => void;
4
- currencyCode?: string;
5
- locale?: string;
6
- label: string;
7
- error?: boolean;
8
- helperText?: string;
9
- name: string;
10
- }
11
- export declare const CurrencyInput: React.FC<CurrencyInputProps>;
12
- export default CurrencyInput;
13
- //# sourceMappingURL=CurrencyInput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CurrencyInput.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/CurrencyInput.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8DtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CurrencyInput = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
6
- const react_number_format_1 = require("react-number-format");
7
- const i18n_lib_1 = require("@digitaldefiance/i18n-lib");
8
- const CurrencyInput = ({ value, onChange, currencyCode = 'USD', locale = 'en-US', label, error, helperText, name, }) => {
9
- const format = (0, i18n_lib_1.getCurrencyFormat)(locale, currencyCode);
10
- if (format.position === 'infix') {
11
- const [whole, decimal] = value.toString().split('.');
12
- const displayValue = `${whole}${format.symbol}${format.decimalSeparator}${decimal || '00'}`;
13
- return ((0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, { customInput: material_1.TextField, fullWidth: true, margin: "normal", label: label, value: displayValue, thousandSeparator: format.groupSeparator, decimalSeparator: format.decimalSeparator, decimalScale: 2, fixedDecimalScale: true, valueIsNumericString: true, onValueChange: (values) => {
14
- onChange(values.floatValue || 0);
15
- }, error: error, helperText: helperText, name: name }));
16
- }
17
- return ((0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, { customInput: material_1.TextField, fullWidth: true, margin: "normal", label: label, value: value, thousandSeparator: format.groupSeparator, decimalSeparator: format.decimalSeparator, decimalScale: 2, fixedDecimalScale: true, prefix: format.position === 'prefix' ? format.symbol + ' ' : undefined, suffix: format.position === 'postfix' ? ' ' + format.symbol : undefined, valueIsNumericString: true, onValueChange: (values) => {
18
- onChange(values.floatValue || 0);
19
- }, error: error, helperText: helperText, name: name }));
20
- };
21
- exports.CurrencyInput = CurrencyInput;
22
- exports.default = exports.CurrencyInput;
@@ -1,8 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- export interface DashboardPageProps {
3
- title?: string;
4
- children?: ReactNode;
5
- }
6
- export declare const DashboardPage: FC<DashboardPageProps>;
7
- export default DashboardPage;
8
- //# sourceMappingURL=DashboardPage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/DashboardPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAahD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DashboardPage = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
6
- const DashboardPage = ({ title = 'Dashboard', children }) => {
7
- return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "md", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { my: 4, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h4", component: "h1", gutterBottom: true, align: "center", children: title }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", justifyContent: "center", mt: 3, children: children })] }) }));
8
- };
9
- exports.DashboardPage = DashboardPage;
10
- exports.default = exports.DashboardPage;
@@ -1,13 +0,0 @@
1
- import { FC, ReactElement } from 'react';
2
- import { MenuType } from '../types/MenuType';
3
- interface DropdownMenuProps {
4
- menuType: MenuType;
5
- menuIcon: ReactElement;
6
- /** When true, the entire icon button is hidden if there are no menu options. Defaults to false. */
7
- hideWhenEmpty?: boolean;
8
- /** Optional callback invoked when the icon button is clicked. When provided alongside menu options, the action fires first and the dropdown still opens. When there are no menu options, only the action fires. */
9
- action?: () => void;
10
- }
11
- export declare const DropdownMenu: FC<DropdownMenuProps>;
12
- export default DropdownMenu;
13
- //# sourceMappingURL=DropdownMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/DropdownMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAc,YAAY,EAAyB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,UAAU,iBAAiB;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,mGAAmG;IACnG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mNAAmN;IACnN,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAsF9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DropdownMenu = 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 react_router_1 = require("react-router");
8
- const MenuContext_1 = require("../contexts/MenuContext");
9
- const DropdownMenu = ({ menuType, menuIcon, hideWhenEmpty = false, action }) => {
10
- const { getMenuOptions } = (0, MenuContext_1.useMenu)();
11
- const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
12
- const navigate = (0, react_router_1.useNavigate)();
13
- const handleClose = (0, react_1.useCallback)(() => {
14
- setAnchorEl(null);
15
- }, []);
16
- const handleMenuItemClick = (0, react_1.useCallback)((option) => (event) => {
17
- event.stopPropagation();
18
- if (option.action) {
19
- option.action();
20
- }
21
- else if (option.link !== undefined) {
22
- if (typeof option.link === 'object' &&
23
- 'pathname' in option.link &&
24
- 'state' in option.link) {
25
- navigate(option.link.pathname, { state: option.link.state });
26
- }
27
- else {
28
- navigate(option.link);
29
- }
30
- }
31
- handleClose(); // Call handleClose after handling the click
32
- }, [navigate, handleClose]);
33
- const menuItems = getMenuOptions(menuType, false);
34
- const hasItems = menuItems.length > 0;
35
- const handleClick = (0, react_1.useCallback)((event) => {
36
- if (action) {
37
- action();
38
- }
39
- if (hasItems) {
40
- setAnchorEl(event.currentTarget);
41
- }
42
- }, [action, hasItems]);
43
- if (!hasItems && hideWhenEmpty) {
44
- return null;
45
- }
46
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { color: "inherit", onClick: (hasItems || action) ? handleClick : undefined, children: menuIcon }), hasItems && ((0, jsx_runtime_1.jsx)(material_1.Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, TransitionComponent: material_1.Fade, sx: {
47
- '& .MuiPopover-paper': {
48
- opacity: 0.5,
49
- overflow: 'visible',
50
- },
51
- }, children: menuItems.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { component: "li", onClick: handleMenuItemClick(option), sx: {
52
- display: 'flex',
53
- alignItems: 'center',
54
- '& > svg': {
55
- marginRight: 2,
56
- width: 24,
57
- height: 24,
58
- },
59
- ...option.additionalSx
60
- }, children: [option.icon, option.label] }, option.id))) }))] }));
61
- };
62
- exports.DropdownMenu = DropdownMenu;
63
- exports.default = exports.DropdownMenu;
@@ -1,13 +0,0 @@
1
- import { FormikProps } from 'formik';
2
- import { FC } from 'react';
3
- export interface ExpirationSecondsSelectorProps<T = Record<string, unknown>> {
4
- name: string;
5
- label: string;
6
- formik: FormikProps<T>;
7
- optionValues: number[];
8
- optionNames: string[];
9
- onChange?: (value: number) => void;
10
- }
11
- export declare const ExpirationSecondsSelector: FC<ExpirationSecondsSelectorProps<Record<string, unknown>>>;
12
- export default ExpirationSecondsSelector;
13
- //# sourceMappingURL=ExpirationSecondsSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpirationSecondsSelector.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/ExpirationSecondsSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAe,EAAE,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,8BAA8B,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,yBAAyB,EAAE,EAAE,CACxC,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2CxD,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExpirationSecondsSelector = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
6
- const ExpirationSecondsSelector = ({ name, label, formik, optionValues, optionNames, onChange }) => {
7
- return ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, fullWidth: true, label: label, name: name, value: formik.values[name] ?? '', onChange: (event) => {
8
- const selectedValue = event.target.value;
9
- formik.setFieldValue(name, selectedValue);
10
- if (onChange) {
11
- onChange(parseInt(selectedValue));
12
- }
13
- }, error: formik.touched[name] && Boolean(formik.errors[name]), helperText: formik.touched[name] && formik.errors[name], sx: {
14
- mt: 1,
15
- '& .MuiSelect-select': {
16
- paddingRight: '32px',
17
- },
18
- '& .MuiOutlinedInput-root': {
19
- '& fieldset': {
20
- borderColor: 'rgba(0, 0, 0, 0.23)',
21
- },
22
- '&:hover fieldset': {
23
- borderColor: 'rgba(0, 0, 0, 0.87)',
24
- },
25
- '&.Mui-focused fieldset': {
26
- borderColor: 'primary.main',
27
- },
28
- },
29
- }, children: optionNames.map((name, index) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: optionValues[index], children: name }, name))) }));
30
- };
31
- exports.ExpirationSecondsSelector = ExpirationSecondsSelector;
32
- exports.default = exports.ExpirationSecondsSelector;
@@ -1,23 +0,0 @@
1
- import { FC } from 'react';
2
- /** Shape of a single captured email as returned by AdminEmailRouter */
3
- export interface CapturedEmailInfo {
4
- to: string;
5
- subject: string;
6
- text: string;
7
- html: string;
8
- timestamp: string;
9
- }
10
- /** Shape of a recipient summary as returned by GET /api/admin/emails */
11
- export interface RecipientSummary {
12
- address: string;
13
- count: number;
14
- }
15
- export declare const FakeEmailAdminPanel: FC;
16
- export default FakeEmailAdminPanel;
17
- export interface FakeEmailAdminButtonsProps {
18
- onRefresh: () => void;
19
- onClear: () => void;
20
- disabled?: boolean;
21
- }
22
- export declare const FakeEmailAdminButtons: FC<FakeEmailAdminButtonsProps>;
23
- //# sourceMappingURL=FakeEmailAdminPanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FakeEmailAdminPanel.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/FakeEmailAdminPanel.tsx"],"names":[],"mappings":"AAkCA,OAAO,EAAE,EAAE,EAA4C,MAAM,OAAO,CAAC;AAQrE,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAiRD,eAAO,MAAM,mBAAmB,EAAE,EAIjC,CAAC;AAEF,eAAe,mBAAmB,CAAC;AAGnC,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CA8BhE,CAAC"}
@@ -1,147 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FakeEmailAdminButtons = exports.FakeEmailAdminPanel = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- /**
7
- * FakeEmailAdminPanel — dev-only panel for inspecting captured emails.
8
- *
9
- * Renders only in development/test environments where FakeEmailService is
10
- * active. Calls the AdminEmailRouter endpoints mounted at `baseUrl/api/admin/emails`.
11
- *
12
- * Self-contained: wraps itself with AuthenticatedApiProvider internally.
13
- * Usage (inside SuiteConfigProvider):
14
- * <FakeEmailAdminPanel />
15
- */
16
- const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
17
- const Delete_1 = tslib_1.__importDefault(require("@mui/icons-material/Delete"));
18
- const ExpandLess_1 = tslib_1.__importDefault(require("@mui/icons-material/ExpandLess"));
19
- const ExpandMore_1 = tslib_1.__importDefault(require("@mui/icons-material/ExpandMore"));
20
- const Refresh_1 = tslib_1.__importDefault(require("@mui/icons-material/Refresh"));
21
- const material_1 = require("@mui/material");
22
- const react_1 = require("react");
23
- const contexts_1 = require("../contexts");
24
- const ConfirmationDialog_1 = require("./ConfirmationDialog");
25
- const useAuthenticatedApi_1 = require("../hooks/useAuthenticatedApi");
26
- /**
27
- * Renders email HTML content in a sandboxed iframe so that links are
28
- * clickable and open in a new tab. Falls back to plain text when no
29
- * HTML body is available.
30
- */
31
- const EmailBodyIframe = ({ html, text, }) => {
32
- const iframeRef = (0, react_1.useRef)(null);
33
- (0, react_1.useEffect)(() => {
34
- const iframe = iframeRef.current;
35
- if (!iframe)
36
- return;
37
- const doc = iframe.contentDocument ?? iframe.contentWindow?.document;
38
- if (!doc)
39
- return;
40
- if (html) {
41
- // Inject a <base target="_blank"> so every link opens in a new tab,
42
- // then write the original HTML body.
43
- doc.open();
44
- doc.write(`<!DOCTYPE html><html><head><base target="_blank"><style>body{font-family:sans-serif;font-size:14px;margin:8px;}</style></head><body>${html}</body></html>`);
45
- doc.close();
46
- }
47
- else {
48
- doc.open();
49
- doc.write(`<!DOCTYPE html><html><head><style>body{font-family:sans-serif;font-size:14px;margin:8px;white-space:pre-wrap;}</style></head><body>${text.replace(/</g, '&lt;').replace(/>/g, '&gt;')}</body></html>`);
50
- doc.close();
51
- }
52
- // Auto-resize iframe height to fit content
53
- const resize = () => {
54
- if (doc.body) {
55
- iframe.style.height = `${doc.body.scrollHeight + 16}px`;
56
- }
57
- };
58
- // Resize after content loads (images, etc.)
59
- iframe.addEventListener('load', resize);
60
- resize();
61
- // Small delay to catch late-rendering content
62
- const timer = setTimeout(resize, 200);
63
- return () => {
64
- iframe.removeEventListener('load', resize);
65
- clearTimeout(timer);
66
- };
67
- }, [html, text]);
68
- return ((0, jsx_runtime_1.jsx)("iframe", { ref: iframeRef, sandbox: "allow-popups allow-popups-to-escape-sandbox allow-same-origin", style: {
69
- width: '100%',
70
- minHeight: 80,
71
- border: '1px solid #e0e0e0',
72
- borderRadius: 4,
73
- background: '#fff',
74
- }, title: "Email body" }));
75
- };
76
- const FakeEmailAdminPanelContent = () => {
77
- const api = (0, useAuthenticatedApi_1.useAuthenticatedApi)();
78
- const { tComponent } = (0, contexts_1.useI18n)();
79
- const t = (key) => tComponent(suite_core_lib_1.SuiteCoreComponentId, key);
80
- const [recipients, setRecipients] = (0, react_1.useState)([]);
81
- const [expanded, setExpanded] = (0, react_1.useState)(null);
82
- /** Tracks which individual email is expanded to show its body (address:idx) */
83
- const [expandedEmail, setExpandedEmail] = (0, react_1.useState)(null);
84
- const [emailsByAddress, setEmailsByAddress] = (0, react_1.useState)({});
85
- const [loading, setLoading] = (0, react_1.useState)(false);
86
- const [error, setError] = (0, react_1.useState)(null);
87
- const [clearDialogOpen, setClearDialogOpen] = (0, react_1.useState)(false);
88
- const loadRecipients = (0, react_1.useCallback)(async () => {
89
- setLoading(true);
90
- setError(null);
91
- try {
92
- const res = await api.get('/admin/emails');
93
- setRecipients(res.data.recipients);
94
- }
95
- catch (err) {
96
- setError(err instanceof Error ? err.message : String(err));
97
- }
98
- finally {
99
- setLoading(false);
100
- }
101
- }, [api]);
102
- (0, react_1.useEffect)(() => {
103
- void loadRecipients();
104
- }, [loadRecipients]);
105
- const toggleExpand = (0, react_1.useCallback)(async (address) => {
106
- if (expanded === address) {
107
- setExpanded(null);
108
- return;
109
- }
110
- setExpanded(address);
111
- if (!emailsByAddress[address]) {
112
- try {
113
- const res = await api.get(`/admin/emails/${encodeURIComponent(address)}`);
114
- setEmailsByAddress((prev) => ({ ...prev, [address]: res.data }));
115
- }
116
- catch (err) {
117
- setError(err instanceof Error ? err.message : String(err));
118
- }
119
- }
120
- }, [api, expanded, emailsByAddress]);
121
- const handleClearAll = (0, react_1.useCallback)(async () => {
122
- setClearDialogOpen(false);
123
- try {
124
- await api.delete('/admin/emails');
125
- setRecipients([]);
126
- setEmailsByAddress({});
127
- setExpanded(null);
128
- }
129
- catch (err) {
130
- setError(err instanceof Error ? err.message : String(err));
131
- }
132
- }, [api]);
133
- return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { variant: "outlined", sx: { p: 2 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 1 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "subtitle1", fontWeight: "bold", sx: { flexGrow: 1 }, children: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_Title) }), (0, jsx_runtime_1.jsx)(material_1.Chip, { label: "DEV", size: "small", color: "warning" }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "small", onClick: () => void loadRecipients(), title: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_Refresh), children: (0, jsx_runtime_1.jsx)(Refresh_1.default, { fontSize: "small" }) }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "small", color: "error", onClick: () => setClearDialogOpen(true), title: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_ClearAll), disabled: recipients.length === 0, children: (0, jsx_runtime_1.jsx)(Delete_1.default, { fontSize: "small" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { mb: 1 } }), error && ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { mb: 1 }, onClose: () => setError(null), children: error })), loading && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: 'flex', justifyContent: 'center', py: 2 }, children: (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 24 }) })), !loading && recipients.length === 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: "text.secondary", children: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_NoRecipients) })), !loading && recipients.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.List, { dense: true, disablePadding: true, children: recipients.map((r) => ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { onClick: () => void toggleExpand(r.address), sx: { px: 0, py: 0.5 }, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: r.address, secondary: `${r.count} ${t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_Recipients)}` }), expanded === r.address ? ((0, jsx_runtime_1.jsx)(ExpandLess_1.default, { fontSize: "small" })) : ((0, jsx_runtime_1.jsx)(ExpandMore_1.default, { fontSize: "small" }))] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { in: expanded === r.address, unmountOnExit: true, children: emailsByAddress[r.address]?.length === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: "text.secondary", sx: { pl: 2, py: 0.5 }, children: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_NoEmails) })) : ((0, jsx_runtime_1.jsx)(material_1.List, { dense: true, disablePadding: true, sx: { pl: 2 }, children: (emailsByAddress[r.address] ?? []).map((email, idx) => {
134
- const emailKey = `${r.address}:${idx}`;
135
- const isEmailExpanded = expandedEmail === emailKey;
136
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { py: 0.25 }, children: [(0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { disableGutters: true, onClick: () => setExpandedEmail(isEmailExpanded ? null : emailKey), sx: { py: 0.25, px: 0.5, borderRadius: 1 }, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: email.subject || '(no subject)', secondary: `${t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_Timestamp)}: ${new Date(email.timestamp).toLocaleString()}`, primaryTypographyProps: { variant: 'body2' }, secondaryTypographyProps: { variant: 'caption' } }), isEmailExpanded ? ((0, jsx_runtime_1.jsx)(ExpandLess_1.default, { fontSize: "small" })) : ((0, jsx_runtime_1.jsx)(ExpandMore_1.default, { fontSize: "small" }))] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { in: isEmailExpanded, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { pl: 1, pr: 1, pb: 1 }, children: (0, jsx_runtime_1.jsx)(EmailBodyIframe, { html: email.html, text: email.text }) }) })] }, idx));
137
- }) })) }), (0, jsx_runtime_1.jsx)(material_1.Divider, {})] }, r.address))) })), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.ConfirmationDialog, { open: clearDialogOpen, title: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_ClearAll), message: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_ClearConfirm), onConfirm: () => void handleClearAll(), onCancel: () => setClearDialogOpen(false) })] }));
138
- };
139
- const FakeEmailAdminPanel = () => ((0, jsx_runtime_1.jsx)(useAuthenticatedApi_1.AuthenticatedApiProvider, { children: (0, jsx_runtime_1.jsx)(FakeEmailAdminPanelContent, {}) }));
140
- exports.FakeEmailAdminPanel = FakeEmailAdminPanel;
141
- exports.default = exports.FakeEmailAdminPanel;
142
- const FakeEmailAdminButtons = ({ onRefresh, onClear, disabled = false, }) => {
143
- const { tComponent } = (0, contexts_1.useI18n)();
144
- const t = (key) => tComponent(suite_core_lib_1.SuiteCoreComponentId, key);
145
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', gap: 1 }, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", startIcon: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}), onClick: onRefresh, disabled: disabled, children: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_Refresh) }), (0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", color: "error", startIcon: (0, jsx_runtime_1.jsx)(Delete_1.default, {}), onClick: onClear, disabled: disabled, children: t(suite_core_lib_1.SuiteCoreStringKey.FakeEmail_Admin_ClearAll) })] }));
146
- };
147
- exports.FakeEmailAdminButtons = FakeEmailAdminButtons;
@@ -1,20 +0,0 @@
1
- import { SxProps, Theme } from '@mui/material';
2
- import { FC } from 'react';
3
- export interface FlagProps {
4
- language: string;
5
- sx?: SxProps<Theme>;
6
- }
7
- /**
8
- * A simple component to display a flag icon for a given language.
9
- *
10
- * Props:
11
- * language: The language to display a flag for, as a StringLanguages enum value.
12
- * sx: Optional styles to apply to the component.
13
- *
14
- * Returns a Box component with an SVG flag icon from flagcdn.com as a ::before pseudo-element.
15
- * The flag is sized to 1.5rem by default, but can be overridden by passing a custom sx prop.
16
- * The component also includes an aria-label for accessibility, set to `Flag for <language>`.
17
- */
18
- export declare const Flag: FC<FlagProps>;
19
- export default Flag;
20
- //# sourceMappingURL=Flag.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Flag.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/Flag.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA6B9B,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Flag = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
6
- const material_1 = require("@mui/material");
7
- /**
8
- * A simple component to display a flag icon for a given language.
9
- *
10
- * Props:
11
- * language: The language to display a flag for, as a StringLanguages enum value.
12
- * sx: Optional styles to apply to the component.
13
- *
14
- * Returns a Box component with an SVG flag icon from flagcdn.com as a ::before pseudo-element.
15
- * The flag is sized to 1.5rem by default, but can be overridden by passing a custom sx prop.
16
- * The component also includes an aria-label for accessibility, set to `Flag for <language>`.
17
- */
18
- const Flag = ({ language, sx }) => {
19
- const flagContent = (0, suite_core_lib_1.getFlagCode)(language);
20
- if (!flagContent) {
21
- return null;
22
- }
23
- return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", "aria-label": `Flag for ${language}`, sx: {
24
- fontSize: '1.5rem',
25
- lineHeight: 1,
26
- verticalAlign: 'middle',
27
- '&::before': {
28
- content: `" "`,
29
- display: 'inline-block',
30
- width: '1em',
31
- height: '1em',
32
- backgroundImage: `url(https://flagcdn.com/${flagContent.toLowerCase()}.svg)`,
33
- backgroundSize: 'contain',
34
- backgroundRepeat: 'no-repeat',
35
- backgroundPosition: 'center',
36
- border: '1px solid rgba(0, 0, 0, 0.1)',
37
- borderRadius: '2px',
38
- },
39
- ...sx,
40
- } }));
41
- };
42
- exports.Flag = Flag;
43
- exports.default = exports.Flag;
@@ -1,18 +0,0 @@
1
- import { FC } from 'react';
2
- import * as Yup from 'yup';
3
- export interface ForgotPasswordFormValues {
4
- email: string;
5
- }
6
- export interface ForgotPasswordFormProps {
7
- onSubmit: (values: ForgotPasswordFormValues) => Promise<void>;
8
- emailValidation?: Yup.StringSchema;
9
- labels?: {
10
- title?: string;
11
- email?: string;
12
- sendResetLink?: string;
13
- successMessage?: string;
14
- };
15
- }
16
- export declare const ForgotPasswordForm: FC<ForgotPasswordFormProps>;
17
- export default ForgotPasswordForm;
18
- //# sourceMappingURL=ForgotPasswordForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForgotPasswordForm.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/ForgotPasswordForm.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,eAAe,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACnC,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA0I1D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ForgotPasswordForm = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
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 contexts_1 = require("../contexts");
12
- const ForgotPasswordForm = ({ onSubmit, emailValidation, labels = {}, }) => {
13
- const { 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
- email: emailValidation ||
18
- Yup.string()
19
- .email(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_InvalidEmail))
20
- .required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
21
- };
22
- const translatedLabels = {
23
- title: labels.title ||
24
- tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.ForgotPassword_Title),
25
- email: labels.email ||
26
- tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Email),
27
- sendResetLink: labels.sendResetLink ||
28
- tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.ForgotPassword_SendResetLink),
29
- successMessage: labels.successMessage ||
30
- tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.PasswordReset_Success),
31
- };
32
- const formik = (0, formik_1.useFormik)({
33
- initialValues: {
34
- email: '',
35
- },
36
- validationSchema: Yup.object({
37
- email: validation.email,
38
- }),
39
- onSubmit: async (values) => {
40
- try {
41
- await onSubmit(values);
42
- setSuccess(true);
43
- setApiError('');
44
- }
45
- catch (error) {
46
- const err = error;
47
- setApiError(err.response?.data?.message ||
48
- tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.ForgotPassword_Error));
49
- setSuccess(false);
50
- }
51
- },
52
- });
53
- return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "sm", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
54
- mt: 8,
55
- display: 'flex',
56
- flexDirection: 'column',
57
- alignItems: 'center',
58
- }, 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: "email", name: "email", label: translatedLabels.email, value: formik.values.email, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.email && formik.errors.email), helperText: formik.touched.email && formik.errors.email, 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.sendResetLink })] })] }) }));
59
- };
60
- exports.ForgotPasswordForm = ForgotPasswordForm;
61
- exports.default = exports.ForgotPasswordForm;
@@ -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]: string | boolean | undefined;
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, string | boolean>;
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":"AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,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,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAC7C;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,CACjB,MAAM,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,eAAe,CAAC,CAAC,KAClD,KAAK,CAAC,SAAS,CAAC;IACrB,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IAC3D,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAgZxC,CAAC;AAEF,eAAe,SAAS,CAAC"}