@digitaldefiance/express-suite-react-components 2.1.42 → 2.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/package.json +2 -2
- package/src/components/ApiAccess.js +1 -1
- package/src/components/BackupCodeLoginForm.js +1 -1
- package/src/components/DropdownMenu.d.ts +4 -10
- package/src/components/DropdownMenu.d.ts.map +1 -1
- package/src/components/DropdownMenu.js +19 -7
- package/src/components/Flag.d.ts +12 -2
- package/src/components/Flag.d.ts.map +1 -1
- package/src/components/Flag.js +17 -4
- package/src/components/ForgotPasswordForm.js +1 -1
- package/src/components/LoginForm.js +1 -1
- package/src/components/SideMenu.d.ts +2 -7
- package/src/components/SideMenu.d.ts.map +1 -1
- package/src/components/SideMenu.js +7 -2
- package/src/components/TopMenu.d.ts +3 -14
- package/src/components/TopMenu.d.ts.map +1 -1
- package/src/components/TopMenu.js +23 -2
- package/src/components/TranslatedTitle.d.ts +5 -5
- package/src/components/TranslatedTitle.d.ts.map +1 -1
- package/src/components/TranslatedTitle.js +7 -5
- package/src/components/UserLanguageSelector.d.ts +1 -12
- package/src/components/UserLanguageSelector.d.ts.map +1 -1
- package/src/components/UserLanguageSelector.js +7 -4
- package/src/components/UserMenu.d.ts +4 -0
- package/src/components/UserMenu.d.ts.map +1 -0
- package/src/components/UserMenu.js +12 -0
- package/src/components/index.d.ts +1 -0
- package/src/components/index.d.ts.map +1 -1
- package/src/components/index.js +1 -0
- package/src/contexts/AuthProvider.d.ts +146 -0
- package/src/contexts/AuthProvider.d.ts.map +1 -0
- package/src/contexts/AuthProvider.js +406 -0
- package/src/contexts/I18nProvider.d.ts +6 -6
- package/src/contexts/I18nProvider.d.ts.map +1 -1
- package/src/contexts/I18nProvider.js +4 -4
- package/src/contexts/MenuContext.d.ts +16 -0
- package/src/contexts/MenuContext.d.ts.map +1 -0
- package/src/contexts/MenuContext.js +215 -0
- package/src/contexts/index.d.ts +2 -0
- package/src/contexts/index.d.ts.map +1 -1
- package/src/contexts/index.js +2 -0
- package/src/interfaces/AppConfig.d.ts +0 -2
- package/src/interfaces/AppConfig.d.ts.map +1 -1
- package/src/services/__mocks__/authService.d.ts +21 -0
- package/src/services/__mocks__/authService.d.ts.map +1 -0
- package/src/services/__mocks__/authService.js +15 -0
- package/src/services/authService.d.ts +80 -0
- package/src/services/authService.d.ts.map +1 -0
- package/src/services/authService.js +339 -0
- package/src/services/index.d.ts +1 -0
- package/src/services/index.d.ts.map +1 -1
- package/src/services/index.js +1 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/express-suite-react-components",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.47",
|
|
4
4
|
"description": "React MUI components for Digital Defiance Express Suite",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@digitaldefiance/i18n-lib": "2.1.40",
|
|
30
|
-
"@digitaldefiance/suite-core-lib": "2.1.
|
|
30
|
+
"@digitaldefiance/suite-core-lib": "2.1.46",
|
|
31
31
|
"@emotion/react": "^11.14.0",
|
|
32
32
|
"@emotion/styled": "^11.14.0",
|
|
33
33
|
"@mui/icons-material": "^7.0.2",
|
|
@@ -30,7 +30,7 @@ const ApiAccessTitle = (0, material_1.styled)(material_1.Typography)(({ theme })
|
|
|
30
30
|
color: theme.palette.primary.main,
|
|
31
31
|
}));
|
|
32
32
|
const ApiAccess = ({ token, labels = {}, }) => {
|
|
33
|
-
const {
|
|
33
|
+
const { tComponent } = (0, contexts_1.useI18n)();
|
|
34
34
|
const [dialogOpen, setDialogOpen] = (0, react_1.useState)(false);
|
|
35
35
|
const [isError, setIsError] = (0, react_1.useState)(false);
|
|
36
36
|
const translatedLabels = {
|
|
@@ -10,7 +10,7 @@ const Yup = tslib_1.__importStar(require("yup"));
|
|
|
10
10
|
const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
|
|
11
11
|
const contexts_1 = require("../contexts");
|
|
12
12
|
const BackupCodeLoginForm = ({ onSubmit, onNavigate, isAuthenticated = false, emailValidation, usernameValidation, codeValidation, passwordValidation, confirmPasswordValidation, labels = {}, }) => {
|
|
13
|
-
const {
|
|
13
|
+
const { tComponent } = (0, contexts_1.useI18n)();
|
|
14
14
|
const [loginType, setLoginType] = (0, react_1.useState)('email');
|
|
15
15
|
const [loginError, setLoginError] = (0, react_1.useState)(null);
|
|
16
16
|
const [recoveredMnemonic, setRecoveredMnemonic] = (0, react_1.useState)(null);
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { FC, ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
icon?: ReactElement;
|
|
6
|
-
action?: () => void;
|
|
7
|
-
link?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface DropdownMenuProps {
|
|
2
|
+
import { IncludeOnMenu } from '../enumerations/IncludeOnMenu';
|
|
3
|
+
interface DropdownMenuProps {
|
|
4
|
+
menuType: IncludeOnMenu;
|
|
10
5
|
menuIcon: ReactElement;
|
|
11
|
-
options: MenuOption[];
|
|
12
|
-
onNavigate?: (link: string) => void;
|
|
13
6
|
}
|
|
14
7
|
export declare const DropdownMenu: FC<DropdownMenuProps>;
|
|
8
|
+
export {};
|
|
15
9
|
//# sourceMappingURL=DropdownMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9D,UAAU,iBAAiB;IACzB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA6E9C,CAAC"}
|
|
@@ -4,8 +4,12 @@ exports.DropdownMenu = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
const
|
|
7
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
8
|
+
const MenuContext_1 = require("../contexts/MenuContext");
|
|
9
|
+
const DropdownMenu = ({ menuType, menuIcon }) => {
|
|
10
|
+
const { getMenuOptions } = (0, MenuContext_1.useMenu)();
|
|
8
11
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
12
|
+
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
9
13
|
const handleClose = (0, react_1.useCallback)(() => {
|
|
10
14
|
setAnchorEl(null);
|
|
11
15
|
}, []);
|
|
@@ -14,15 +18,23 @@ const DropdownMenu = ({ menuIcon, options, onNavigate }) => {
|
|
|
14
18
|
if (option.action) {
|
|
15
19
|
option.action();
|
|
16
20
|
}
|
|
17
|
-
else if (option.link
|
|
18
|
-
|
|
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
|
+
}
|
|
19
30
|
}
|
|
20
|
-
handleClose();
|
|
21
|
-
}, [
|
|
31
|
+
handleClose(); // Call handleClose after handling the click
|
|
32
|
+
}, [navigate, handleClose]);
|
|
22
33
|
const handleClick = (0, react_1.useCallback)((event) => {
|
|
23
34
|
setAnchorEl(event.currentTarget);
|
|
24
35
|
}, []);
|
|
25
|
-
|
|
36
|
+
const menuItems = getMenuOptions(menuType, false);
|
|
37
|
+
if (menuItems.length === 0) {
|
|
26
38
|
return null;
|
|
27
39
|
}
|
|
28
40
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { color: "inherit", onClick: handleClick, children: menuIcon }), (0, jsx_runtime_1.jsx)(material_1.Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, TransitionComponent: material_1.Fade, sx: {
|
|
@@ -30,7 +42,7 @@ const DropdownMenu = ({ menuIcon, options, onNavigate }) => {
|
|
|
30
42
|
opacity: 0.5,
|
|
31
43
|
overflow: 'visible',
|
|
32
44
|
},
|
|
33
|
-
}, children:
|
|
45
|
+
}, children: menuItems.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { component: "li", onClick: handleMenuItemClick(option), sx: {
|
|
34
46
|
display: 'flex',
|
|
35
47
|
alignItems: 'center',
|
|
36
48
|
'& > svg': {
|
package/src/components/Flag.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material';
|
|
2
2
|
import { FC } from 'react';
|
|
3
3
|
export interface FlagProps {
|
|
4
|
-
|
|
5
|
-
countryCode: string;
|
|
4
|
+
language: string;
|
|
6
5
|
sx?: SxProps<Theme>;
|
|
7
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
|
+
*/
|
|
8
18
|
export declare const Flag: FC<FlagProps>;
|
|
9
19
|
//# sourceMappingURL=Flag.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flag.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/Flag.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Flag.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/Flag.tsx"],"names":[],"mappings":"AAEA,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"}
|
package/src/components/Flag.js
CHANGED
|
@@ -2,12 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Flag = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
|
|
5
6
|
const material_1 = require("@mui/material");
|
|
6
|
-
|
|
7
|
-
|
|
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) {
|
|
8
21
|
return null;
|
|
9
22
|
}
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", "aria-label": `Flag for ${
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", "aria-label": `Flag for ${language}`, sx: {
|
|
11
24
|
fontSize: '1.5rem',
|
|
12
25
|
lineHeight: 1,
|
|
13
26
|
verticalAlign: 'middle',
|
|
@@ -16,7 +29,7 @@ const Flag = ({ languageCode, countryCode, sx }) => {
|
|
|
16
29
|
display: 'inline-block',
|
|
17
30
|
width: '1em',
|
|
18
31
|
height: '1em',
|
|
19
|
-
backgroundImage: `url(https://flagcdn.com/${
|
|
32
|
+
backgroundImage: `url(https://flagcdn.com/${flagContent.toLowerCase()}.svg)`,
|
|
20
33
|
backgroundSize: 'contain',
|
|
21
34
|
backgroundRepeat: 'no-repeat',
|
|
22
35
|
backgroundPosition: 'center',
|
|
@@ -10,7 +10,7 @@ const Yup = tslib_1.__importStar(require("yup"));
|
|
|
10
10
|
const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
|
|
11
11
|
const contexts_1 = require("../contexts");
|
|
12
12
|
const ForgotPasswordForm = ({ onSubmit, emailValidation, labels = {}, }) => {
|
|
13
|
-
const {
|
|
13
|
+
const { tComponent } = (0, contexts_1.useI18n)();
|
|
14
14
|
const [success, setSuccess] = (0, react_1.useState)(false);
|
|
15
15
|
const [apiError, setApiError] = (0, react_1.useState)('');
|
|
16
16
|
const validation = {
|
|
@@ -11,7 +11,7 @@ const Yup = tslib_1.__importStar(require("yup"));
|
|
|
11
11
|
const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
|
|
12
12
|
const contexts_1 = require("../contexts");
|
|
13
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 {
|
|
14
|
+
const { tComponent } = (0, contexts_1.useI18n)();
|
|
15
15
|
const [loginType, setLoginType] = (0, react_1.useState)(initialLoginType);
|
|
16
16
|
const [authType, setAuthType] = (0, react_1.useState)(initialAuthType);
|
|
17
17
|
const [showSecret, setShowSecret] = (0, react_1.useState)(false);
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface SideMenuProps {
|
|
2
|
+
interface SideMenuProps {
|
|
4
3
|
isOpen: boolean;
|
|
5
4
|
onClose: () => void;
|
|
6
|
-
menuOptions: IMenuOption[];
|
|
7
|
-
onNavigate?: (link: string | {
|
|
8
|
-
pathname: string;
|
|
9
|
-
state?: any;
|
|
10
|
-
}) => void;
|
|
11
5
|
}
|
|
12
6
|
export declare const SideMenu: FC<SideMenuProps>;
|
|
7
|
+
export default SideMenu;
|
|
13
8
|
//# sourceMappingURL=SideMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAM3B,UAAU,aAAa;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CActC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -3,8 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SideMenu = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
+
const IncludeOnMenu_1 = require("../enumerations/IncludeOnMenu");
|
|
7
|
+
const MenuContext_1 = require("../contexts/MenuContext");
|
|
6
8
|
const SideMenuListItem_1 = require("./SideMenuListItem");
|
|
7
|
-
const SideMenu = ({ isOpen, onClose
|
|
8
|
-
|
|
9
|
+
const SideMenu = ({ isOpen, onClose }) => {
|
|
10
|
+
const { getMenuOptions } = (0, MenuContext_1.useMenu)();
|
|
11
|
+
const menuOptions = getMenuOptions(IncludeOnMenu_1.IncludeOnMenu.SideMenu, true);
|
|
12
|
+
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 }, item.id))) }) }));
|
|
9
13
|
};
|
|
10
14
|
exports.SideMenu = SideMenu;
|
|
15
|
+
exports.default = exports.SideMenu;
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
import { FC
|
|
2
|
-
import { IMenuOption } from '../interfaces';
|
|
1
|
+
import React, { FC } from 'react';
|
|
3
2
|
export interface TopMenuProps {
|
|
4
|
-
|
|
5
|
-
logo?: string;
|
|
6
|
-
logoAlt?: string;
|
|
7
|
-
isAuthenticated?: boolean;
|
|
8
|
-
menuOptions: IMenuOption[];
|
|
9
|
-
authenticatedButtons?: ReactNode;
|
|
10
|
-
unauthenticatedButtons?: ReactNode;
|
|
11
|
-
rightContent?: ReactNode;
|
|
12
|
-
onNavigate?: (link: string | {
|
|
13
|
-
pathname: string;
|
|
14
|
-
state?: any;
|
|
15
|
-
}) => void;
|
|
3
|
+
Logo: React.ReactNode;
|
|
16
4
|
}
|
|
17
5
|
export declare const TopMenu: FC<TopMenuProps>;
|
|
6
|
+
export default TopMenu;
|
|
18
7
|
//# sourceMappingURL=TopMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TopMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TopMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TopMenu.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAE,EAAwB,MAAM,OAAO,CAAC;AAUxD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAgEpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -6,9 +6,30 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const Menu_1 = tslib_1.__importDefault(require("@mui/icons-material/Menu"));
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
10
|
+
const AuthProvider_1 = require("../contexts/AuthProvider");
|
|
11
|
+
const I18nProvider_1 = require("../contexts/I18nProvider");
|
|
9
12
|
const SideMenu_1 = require("./SideMenu");
|
|
10
|
-
const
|
|
13
|
+
const UserLanguageSelector_1 = require("./UserLanguageSelector");
|
|
14
|
+
const UserMenu_1 = require("./UserMenu");
|
|
15
|
+
const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
|
|
16
|
+
const TopMenu = ({ Logo }) => {
|
|
17
|
+
const { isAuthenticated } = (0, react_1.useContext)(AuthProvider_1.AuthContext);
|
|
11
18
|
const [isSideMenuOpen, setIsSideMenuOpen] = (0, react_1.useState)(false);
|
|
12
|
-
|
|
19
|
+
const handleOpenSideMenu = () => setIsSideMenuOpen(true);
|
|
20
|
+
const handleCloseSideMenu = () => setIsSideMenuOpen(false);
|
|
21
|
+
const { t, tComponent } = (0, I18nProvider_1.useI18n)();
|
|
22
|
+
const appConfig = 'APP_CONFIG' in window
|
|
23
|
+
? window.APP_CONFIG
|
|
24
|
+
: undefined;
|
|
25
|
+
const siteTitle = t(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_SiteTemplate));
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.AppBar, { position: "fixed", sx: { top: 10 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Toolbar, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "large", edge: "start", color: "inherit", "aria-label": "menu", sx: { mr: 2 }, onClick: handleOpenSideMenu, children: (0, jsx_runtime_1.jsx)(Menu_1.default, {}) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
27
|
+
height: 40,
|
|
28
|
+
width: 40,
|
|
29
|
+
marginRight: 2,
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
}, children: Logo }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", component: "div", sx: { flexGrow: 1 }, children: siteTitle }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, children: [isAuthenticated ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_dom_1.Link, to: "/dashboard", children: t(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Dashboard)) }), (0, jsx_runtime_1.jsx)(UserMenu_1.UserMenu, {})] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_dom_1.Link, to: "/login", children: t(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_LoginButton)) }), (0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_dom_1.Link, to: "/register", children: t(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.RegisterButton)) })] })), (0, jsx_runtime_1.jsx)(UserLanguageSelector_1.UserLanguageSelector, {})] })] }), (0, jsx_runtime_1.jsx)(SideMenu_1.SideMenu, { isOpen: isSideMenuOpen, onClose: handleCloseSideMenu })] }));
|
|
13
33
|
};
|
|
14
34
|
exports.TopMenu = TopMenu;
|
|
35
|
+
exports.default = exports.TopMenu;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
language?: string;
|
|
1
|
+
interface FCParams<TEnum extends string> {
|
|
2
|
+
componentId: string;
|
|
3
|
+
stringKey: TEnum;
|
|
5
4
|
}
|
|
6
|
-
|
|
5
|
+
declare const TranslatedTitle: <TEnum extends string>({ componentId, stringKey }: FCParams<TEnum>) => null;
|
|
6
|
+
export default TranslatedTitle;
|
|
7
7
|
//# sourceMappingURL=TranslatedTitle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslatedTitle.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TranslatedTitle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TranslatedTitle.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TranslatedTitle.tsx"],"names":[],"mappings":"AAMA,UAAU,QAAQ,CAAC,KAAK,SAAS,MAAM;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;CAClB;AAED,QAAA,MAAM,eAAe,GAAI,KAAK,SAAS,MAAM,EAAE,4BAA4B,QAAQ,CAAC,KAAK,CAAC,KAAG,IAQ5F,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// src/app/components/TranslatedTitle.tsx
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TranslatedTitle = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
5
|
+
const contexts_1 = require("../contexts");
|
|
6
|
+
const TranslatedTitle = ({ componentId, stringKey }) => {
|
|
7
|
+
const { tComponent, currentLanguage } = (0, contexts_1.useI18n)();
|
|
6
8
|
(0, react_1.useEffect)(() => {
|
|
7
|
-
document.title =
|
|
8
|
-
}, [
|
|
9
|
+
document.title = tComponent(componentId, stringKey, undefined, currentLanguage);
|
|
10
|
+
}, [tComponent, componentId, stringKey, currentLanguage]);
|
|
9
11
|
return null;
|
|
10
12
|
};
|
|
11
|
-
exports.
|
|
13
|
+
exports.default = TranslatedTitle;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
export
|
|
3
|
-
code: string;
|
|
4
|
-
name: string;
|
|
5
|
-
countryCode: string;
|
|
6
|
-
}
|
|
7
|
-
export interface UserLanguageSelectorProps {
|
|
8
|
-
currentLanguage: string;
|
|
9
|
-
currentCountryCode: string;
|
|
10
|
-
languages: LanguageOption[];
|
|
11
|
-
onLanguageChange: (languageCode: string) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const UserLanguageSelector: FC<UserLanguageSelectorProps>;
|
|
2
|
+
export declare const UserLanguageSelector: FC;
|
|
14
3
|
//# sourceMappingURL=UserLanguageSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserLanguageSelector.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/UserLanguageSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserLanguageSelector.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/UserLanguageSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAwB,MAAM,OAAO,CAAC;AAIjD,eAAO,MAAM,oBAAoB,EAAE,EA+BlC,CAAC"}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserLanguageSelector = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const i18n_lib_1 = require("@digitaldefiance/i18n-lib");
|
|
5
6
|
const material_1 = require("@mui/material");
|
|
6
7
|
const react_1 = require("react");
|
|
8
|
+
const AuthProvider_1 = require("../contexts/AuthProvider");
|
|
7
9
|
const Flag_1 = require("./Flag");
|
|
8
|
-
const UserLanguageSelector = (
|
|
10
|
+
const UserLanguageSelector = () => {
|
|
11
|
+
const { language, setLanguage } = (0, AuthProvider_1.useAuth)();
|
|
9
12
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
10
13
|
const handleClick = (event) => {
|
|
11
14
|
setAnchorEl(event.currentTarget);
|
|
@@ -13,10 +16,10 @@ const UserLanguageSelector = ({ currentLanguage, currentCountryCode, languages,
|
|
|
13
16
|
const handleClose = () => {
|
|
14
17
|
setAnchorEl(null);
|
|
15
18
|
};
|
|
16
|
-
const handleLanguageChange = (
|
|
17
|
-
|
|
19
|
+
const handleLanguageChange = (newLanguage) => {
|
|
20
|
+
setLanguage(newLanguage);
|
|
18
21
|
handleClose();
|
|
19
22
|
};
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleClick, children: (0, jsx_runtime_1.jsx)(Flag_1.Flag, {
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleClick, children: (0, jsx_runtime_1.jsx)(Flag_1.Flag, { language: language }) }), (0, jsx_runtime_1.jsx)(material_1.Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: Object.values(i18n_lib_1.LanguageRegistry.getAllLanguages()).map((lang) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: () => handleLanguageChange(lang.code), children: [(0, jsx_runtime_1.jsx)(Flag_1.Flag, { language: lang.code, sx: { mr: 1 } }), " ", lang.name] }, lang.code))) })] }));
|
|
21
24
|
};
|
|
22
25
|
exports.UserLanguageSelector = UserLanguageSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/UserMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK3B,eAAO,MAAM,QAAQ,EAAE,EAOtB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserMenu = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
6
|
+
const IncludeOnMenu_1 = require("../enumerations/IncludeOnMenu");
|
|
7
|
+
const DropdownMenu_1 = require("./DropdownMenu");
|
|
8
|
+
const UserMenu = () => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu, { menuType: IncludeOnMenu_1.IncludeOnMenu.UserMenu, menuIcon: (0, jsx_runtime_1.jsx)(icons_material_1.AccountCircle, {}) }));
|
|
10
|
+
};
|
|
11
|
+
exports.UserMenu = UserMenu;
|
|
12
|
+
exports.default = exports.UserMenu;
|
|
@@ -18,6 +18,7 @@ export * from './SideMenu';
|
|
|
18
18
|
export * from './SideMenuListItem';
|
|
19
19
|
export * from './TopMenu';
|
|
20
20
|
export * from './TranslatedTitle';
|
|
21
|
+
export * from './UserMenu';
|
|
21
22
|
export * from './UserLanguageSelector';
|
|
22
23
|
export * from './VerifyEmailPage';
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
package/src/components/index.js
CHANGED
|
@@ -22,5 +22,6 @@ tslib_1.__exportStar(require("./SideMenu"), exports);
|
|
|
22
22
|
tslib_1.__exportStar(require("./SideMenuListItem"), exports);
|
|
23
23
|
tslib_1.__exportStar(require("./TopMenu"), exports);
|
|
24
24
|
tslib_1.__exportStar(require("./TranslatedTitle"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./UserMenu"), exports);
|
|
25
26
|
tslib_1.__exportStar(require("./UserLanguageSelector"), exports);
|
|
26
27
|
tslib_1.__exportStar(require("./VerifyEmailPage"), exports);
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Member as FrontendMember, EmailString, IECIESConfig, SecureString } from '@digitaldefiance/ecies-lib';
|
|
2
|
+
import { CurrencyCode } from '@digitaldefiance/i18n-lib';
|
|
3
|
+
import { Wallet } from '@ethereumjs/wallet';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { ISuccessMessage, IRequestUserDTO, IConstants } from '@digitaldefiance/suite-core-lib';
|
|
6
|
+
export interface AuthContextData {
|
|
7
|
+
/**
|
|
8
|
+
* True if the user has a global admin role
|
|
9
|
+
*/
|
|
10
|
+
admin: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Counter that increments on login/logout to trigger effects in dependent components
|
|
13
|
+
*/
|
|
14
|
+
authState: number;
|
|
15
|
+
/**
|
|
16
|
+
* Performs a server side backup-code login
|
|
17
|
+
* @param identifier
|
|
18
|
+
* @param code
|
|
19
|
+
* @param isEmail
|
|
20
|
+
* @param recoverMnemonic
|
|
21
|
+
* @param newPassword
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
backupCodeLogin: (identifier: string, code: string, isEmail: boolean, recoverMnemonic: boolean, newPassword?: string) => Promise<{
|
|
25
|
+
token: string;
|
|
26
|
+
codeCount: number;
|
|
27
|
+
mnemonic?: string;
|
|
28
|
+
message?: string;
|
|
29
|
+
} | {
|
|
30
|
+
error: string;
|
|
31
|
+
status?: number;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Verifies the stored token (if any) and updates auth state
|
|
35
|
+
* @returns void
|
|
36
|
+
*/
|
|
37
|
+
checkAuth: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Changes the stored browser password login mnemonic
|
|
40
|
+
* @param currentPassword
|
|
41
|
+
* @param newPassword
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
changePassword: (currentPassword: string, newPassword: string) => Promise<ISuccessMessage | {
|
|
45
|
+
error: string;
|
|
46
|
+
errorType?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
clearMnemonic: () => void;
|
|
49
|
+
clearWallet: () => void;
|
|
50
|
+
currencyCode: CurrencyCode;
|
|
51
|
+
directLogin: (mnemonic: SecureString, username?: string, email?: EmailString, expireMnemonicSeconds?: number, expireWalletSeconds?: number) => Promise<{
|
|
52
|
+
token: string;
|
|
53
|
+
user: IRequestUserDTO;
|
|
54
|
+
wallet: Wallet;
|
|
55
|
+
} | {
|
|
56
|
+
error: string;
|
|
57
|
+
errorType?: string;
|
|
58
|
+
}>;
|
|
59
|
+
emailChallengeLogin: (mnemonic: SecureString, token: string, username?: string, email?: EmailString, expireMnemonicSeconds?: number, expireWalletSeconds?: number) => Promise<{
|
|
60
|
+
token: string;
|
|
61
|
+
user: IRequestUserDTO;
|
|
62
|
+
wallet: Wallet;
|
|
63
|
+
message: string;
|
|
64
|
+
} | {
|
|
65
|
+
error: string;
|
|
66
|
+
errorType?: string;
|
|
67
|
+
}>;
|
|
68
|
+
isAuthenticated: boolean;
|
|
69
|
+
isCheckingAuth: boolean;
|
|
70
|
+
isPasswordLoginAvailable?: () => boolean;
|
|
71
|
+
language: string;
|
|
72
|
+
loading: boolean;
|
|
73
|
+
logout: () => void;
|
|
74
|
+
mnemonic?: SecureString;
|
|
75
|
+
mnemonicExpirationSeconds: number;
|
|
76
|
+
passwordLogin: (password: SecureString, username?: string, email?: EmailString) => Promise<{
|
|
77
|
+
token: string;
|
|
78
|
+
user: IRequestUserDTO;
|
|
79
|
+
wallet: Wallet;
|
|
80
|
+
} | {
|
|
81
|
+
error: string;
|
|
82
|
+
errorType?: string;
|
|
83
|
+
}>;
|
|
84
|
+
requestEmailLogin: (username?: string, email?: EmailString) => Promise<string | {
|
|
85
|
+
error: string;
|
|
86
|
+
errorType?: string;
|
|
87
|
+
}>;
|
|
88
|
+
refreshToken: () => Promise<{
|
|
89
|
+
token: string;
|
|
90
|
+
user: IRequestUserDTO;
|
|
91
|
+
}>;
|
|
92
|
+
register: (username: string, email: string, timezone: string, password?: string) => Promise<{
|
|
93
|
+
success: boolean;
|
|
94
|
+
message: string;
|
|
95
|
+
mnemonic: string;
|
|
96
|
+
} | {
|
|
97
|
+
error: string;
|
|
98
|
+
errorType?: string;
|
|
99
|
+
field?: string;
|
|
100
|
+
errors?: Array<{
|
|
101
|
+
path: string;
|
|
102
|
+
msg: string;
|
|
103
|
+
}>;
|
|
104
|
+
}>;
|
|
105
|
+
serverPublicKey: string | null;
|
|
106
|
+
setCurrencyCode: (code: CurrencyCode) => Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Gets the remaining time in seconds for the mnemonic expiration
|
|
109
|
+
* @returns Number of seconds remaining, or 0 if no mnemonic is set
|
|
110
|
+
*/
|
|
111
|
+
getMnemonicRemainingTime: () => number;
|
|
112
|
+
/**
|
|
113
|
+
* Gets the remaining time in seconds for the wallet expiration
|
|
114
|
+
* @returns Number of seconds remaining, or 0 if no wallet is set
|
|
115
|
+
*/
|
|
116
|
+
getWalletRemainingTime: () => number;
|
|
117
|
+
setLanguage: (lang: string) => Promise<void>;
|
|
118
|
+
setMnemonic: (mnemonic: SecureString, durationSeconds?: number) => void;
|
|
119
|
+
setMnemonicExpirationSeconds: (seconds: number) => void;
|
|
120
|
+
setWalletExpirationSeconds: (seconds: number) => void;
|
|
121
|
+
setUpPasswordLogin: (mnemonic: SecureString, password: SecureString, username?: string, email?: EmailString) => Promise<{
|
|
122
|
+
success: boolean;
|
|
123
|
+
message: string;
|
|
124
|
+
} | {
|
|
125
|
+
error: string;
|
|
126
|
+
errorType?: string;
|
|
127
|
+
}>;
|
|
128
|
+
setUser: (user: IRequestUserDTO | null) => Promise<void>;
|
|
129
|
+
setWallet: (wallet: Wallet, durationSeconds?: number) => void;
|
|
130
|
+
user: FrontendMember | null;
|
|
131
|
+
userData: IRequestUserDTO | null;
|
|
132
|
+
token: string | null;
|
|
133
|
+
wallet?: Wallet;
|
|
134
|
+
walletExpirationSeconds: number;
|
|
135
|
+
verifyToken: (token: string) => Promise<boolean>;
|
|
136
|
+
}
|
|
137
|
+
export type AuthProviderProps = {
|
|
138
|
+
children: ReactNode;
|
|
139
|
+
baseUrl: string;
|
|
140
|
+
constants: IConstants;
|
|
141
|
+
eciesConfig: IECIESConfig;
|
|
142
|
+
};
|
|
143
|
+
export declare const AuthContext: import("react").Context<AuthContextData>;
|
|
144
|
+
export declare const AuthProvider: ({ children, baseUrl, constants, eciesConfig }: AuthProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
145
|
+
export declare const useAuth: () => AuthContextData;
|
|
146
|
+
//# sourceMappingURL=AuthProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthProvider.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/contexts/AuthProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAE/B,WAAW,EACX,YAAY,EACZ,YAAY,EAIb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,YAAY,EAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAEL,SAAS,EAMV,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,eAAe,EAAE,eAAe,EAA4C,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAEzI,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;OAQG;IACH,eAAe,EAAE,CACf,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,OAAO,EACxB,WAAW,CAAC,EAAE,MAAM,KACjB,OAAO,CACR;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GACzE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CACrC,CAAC;IACF;;;OAGG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;;;;OAKG;IACH,cAAc,EAAE,CACd,eAAe,EAAE,MAAM,EACv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