grep-components 1.15.0-grepf-1694.1 → 1.15.0-grepf-1792.1

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.
@@ -1,14 +1,3 @@
1
1
  import * as React from 'react';
2
- export declare const useToolbarStyles: (params: void, styleOverrides?: {
3
- props: {
4
- classes?: Record<string, string> | undefined;
5
- } & Record<string, unknown>;
6
- ownerState?: Record<string, unknown> | undefined;
7
- } | undefined) => {
8
- classes: Record<"toolbar", string>;
9
- theme: import("@mui/material").Theme;
10
- css: import("tss-react").Css;
11
- cx: import("tss-react").Cx;
12
- };
13
2
  declare const _default: React.ComponentType<{}>;
14
3
  export default _default;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { IAuthorizedPage, UserMenuItem, v0colors } from './types';
3
+ declare type AppBarProps = {
4
+ isProd: boolean;
5
+ username: string;
6
+ currentPath: string;
7
+ appTitle: string;
8
+ userMenuItems: UserMenuItem[];
9
+ menuItems: IAuthorizedPage[];
10
+ userRole?: string;
11
+ colors: v0colors;
12
+ };
13
+ declare const AppBar: React.FunctionComponent<AppBarProps>;
14
+ export default AppBar;
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ import { Theme, MUIStyledCommonProps } from '@mui/system';
3
+ import { v0colors } from './types';
4
+ export declare const dimensions: {
5
+ breadcrumbsFontSize: number;
6
+ contentWidth: number;
7
+ footerHeight: number;
8
+ inputBoxHeight: number;
9
+ toolbarHeight: number;
10
+ toolbarHeightMobile: number;
11
+ toolbarWidth: number;
12
+ toolbarMenuWidth: number;
13
+ toolbarMenuHeight: number;
14
+ };
15
+ export declare const ToolbarTitle: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps<unknown> & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
16
+ export declare const EnvironmentTitle: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
+ export declare const Toolbar: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme> & {
18
+ colors: v0colors;
19
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
+ export declare const ToolbarFixer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme> & {
21
+ colors: v0colors;
22
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
+ export declare const ToolbarInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
+ export declare const ToolbarLeft: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
25
+ export declare const ToolbarRight: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const UserContainer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
27
+ export declare const AccountName: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
28
+ export declare const ToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme> & {
29
+ colors: v0colors;
30
+ } & MUIStyledCommonProps<Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
31
+ export declare const MobileToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme> & {
32
+ colors: v0colors;
33
+ } & MUIStyledCommonProps<Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
34
+ export declare const ToolbarMenuInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
35
+ export declare const ToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps<unknown> & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material").Theme> & {
36
+ colors: v0colors;
37
+ }, {}, {}>;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { IAuthorizedPage, UserMenuItem, v0colors } from './types';
3
+ declare type Props = {
4
+ userMenuItems: UserMenuItem[];
5
+ menuItems: IAuthorizedPage[];
6
+ colors: v0colors;
7
+ };
8
+ declare const MobileAppBar: React.FunctionComponent<Props>;
9
+ export default MobileAppBar;
@@ -0,0 +1,15 @@
1
+ export declare const v0colors: {
2
+ primary: string;
3
+ secondary: string;
4
+ body: string;
5
+ headerBackgroundColor: string;
6
+ borderColor: string;
7
+ primaryFade: string;
8
+ greyText: string;
9
+ placeholderText: string;
10
+ textColor: string;
11
+ textColorFade: string;
12
+ textColorMoreFade: string;
13
+ white: string;
14
+ lightGrey: string;
15
+ };
@@ -0,0 +1,30 @@
1
+ export declare type UserMenuItem = {
2
+ id: string;
3
+ label: string;
4
+ action: () => void;
5
+ };
6
+ export interface IAuthorizedPage {
7
+ name: string;
8
+ translatedTextRef?: string;
9
+ accessTextRef?: string;
10
+ redirectUrl?: string;
11
+ path: string;
12
+ exact?: boolean;
13
+ link?: boolean;
14
+ accessLink?: boolean;
15
+ }
16
+ export declare type v0colors = {
17
+ body: string;
18
+ headerBackgroundColor: string;
19
+ borderColor: string;
20
+ primaryFade: string;
21
+ greyText: string;
22
+ placeholderText: string;
23
+ textColor: string;
24
+ textColorFade: string;
25
+ textColorMoreFade: string;
26
+ white: string;
27
+ lightGrey: string;
28
+ primary: string;
29
+ secondary: string;
30
+ };
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export { default as Sidebar } from './components/Sidebar';
28
28
  export { default as ServiceMessage } from './components/ServiceMessage';
29
29
  export { default as SortableTable } from './components/SortableTable';
30
30
  export { default as GrepEditor } from './components/GrepEditor';
31
+ export { default as NewAppBar } from './components/AppBarNew/AppBar';
31
32
  export { ParseableDate } from './utils/dateHelper';
32
33
  export { Utils };
33
34
  export * from './components';
package/dist/index.js CHANGED
@@ -5,15 +5,15 @@ import isBetweenPlugin from 'dayjs/plugin/isBetween';
5
5
  import { red, pink, purple, deepPurple, indigo, blue, lightBlue, cyan, teal, green, lightGreen, lime, yellow, amber, orange, deepOrange, brown, grey, blueGrey } from '@mui/material/colors';
6
6
  import * as React from 'react';
7
7
  import React__default, { useContext, forwardRef, createElement, createContext, Fragment, useRef, useLayoutEffect, useState, useCallback as useCallback$1, useEffect, useMemo as useMemo$1 } from 'react';
8
- import { Toolbar, useScrollTrigger, Slide, Button, Box, Typography, IconButton, Menu, MenuItem, Tabs, Tab, Collapse, MenuList, Tooltip, Container, List, ListItem, ListItemText, ListItemIcon, Divider, styled, TableCell, TableRow, TableSortLabel, TableHead, TablePagination, TableContainer, Table, TableBody, TableFooter, CircularProgress, Link, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, Grid, ToggleButtonGroup, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from '@mui/material';
9
- import AppBar$1 from '@mui/material/AppBar';
8
+ import { Toolbar as Toolbar$1, useScrollTrigger, Slide, Button, Box, Typography, IconButton, Menu, MenuItem, Tabs, Tab, Collapse, MenuList, Tooltip, Container, List, ListItem, ListItemText, ListItemIcon, Divider, styled, TableCell, TableRow, TableSortLabel, TableHead, TablePagination, TableContainer, Table, TableBody, TableFooter, CircularProgress, Link, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, Grid, ToggleButtonGroup, AppBar as AppBar$3, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from '@mui/material';
9
+ import AppBar$2 from '@mui/material/AppBar';
10
10
  import { useTheme as useTheme$1 } from '@mui/material/styles';
11
11
  import AccountCircle from '@mui/icons-material/AccountCircle';
12
12
  import ArrowDropdown from '@mui/icons-material/ArrowDropDown';
13
- import { useHistory, Prompt } from 'react-router-dom';
13
+ import { useHistory, NavLink, Prompt } from 'react-router-dom';
14
14
  import MenuIcon from '@mui/icons-material/Menu';
15
15
  import IconExpand from '@mui/icons-material/ExpandMore';
16
- import { ArrowForward, Info, ExpandMore, ExpandLess } from '@mui/icons-material';
16
+ import { ArrowForward, Info, ExpandMore, ExpandLess, Menu as Menu$1 } from '@mui/icons-material';
17
17
  import ListItemIcon$1 from '@mui/material/ListItemIcon';
18
18
  import MoreVert from '@mui/icons-material/MoreVert';
19
19
  import { useDispatch, connect, Provider as Provider$1, useSelector } from 'react-redux';
@@ -40,6 +40,9 @@ export { ContentState } from 'draft-js';
40
40
  import ToggleButton from '@mui/material/ToggleButton';
41
41
  import FormatBold from '@mui/icons-material/FormatBold';
42
42
  import FormatItalic from '@mui/icons-material/FormatItalic';
43
+ import Menu$2 from '@mui/material/Menu';
44
+ import MenuItem$1 from '@mui/material/MenuItem';
45
+ import Button$1 from '@mui/material/Button';
43
46
  import Link$1 from '@mui/material/Link';
44
47
 
45
48
  dayjs.extend(isBetweenPlugin);
@@ -4058,7 +4061,7 @@ var makeStyles = (_a = tssReact.createMakeAndWithStyles({
4058
4061
  //"useTheme": useTheme as (()=> MyTheme)
4059
4062
  }), _a.makeStyles), withStyles = _a.withStyles;
4060
4063
 
4061
- var StyledAppBar = withStyles(AppBar$1, {
4064
+ var StyledAppBar = withStyles(AppBar$2, {
4062
4065
  root: {
4063
4066
  backgroundColor: 'transparant',
4064
4067
  },
@@ -4068,21 +4071,6 @@ var StyledAppBar = withStyles(AppBar$1, {
4068
4071
  },
4069
4072
  });
4070
4073
 
4071
- var useToolbarStyles = makeStyles()(function (_a) {
4072
- var _b;
4073
- var breakpoints = _a.breakpoints;
4074
- return ({
4075
- toolbar: (_b = {},
4076
- _b[breakpoints.down('lg')] = {
4077
- height: '40px',
4078
- minHeight: '40px',
4079
- },
4080
- _b[breakpoints.up('lg')] = {
4081
- height: '80px',
4082
- },
4083
- _b),
4084
- });
4085
- });
4086
4074
  var HideOnScroll = function (_a) {
4087
4075
  var children = _a.children;
4088
4076
  // Note that you normally won't need to set the window ref as useScrollTrigger
@@ -4092,13 +4080,11 @@ var HideOnScroll = function (_a) {
4092
4080
  var trigger = useScrollTrigger();
4093
4081
  return (React.createElement(Slide, { appear: false, direction: "down", in: !trigger }, children));
4094
4082
  };
4095
- var AppBar = function (props) {
4096
- var classes = useToolbarStyles().classes;
4097
- return (React.createElement(React.Fragment, null,
4098
- React.createElement(HideOnScroll, __assign({}, props),
4099
- React.createElement(StyledAppBar, { color: "inherit", elevation: 0 },
4100
- React.createElement(Toolbar, { className: classes.toolbar }, props.children)))));
4101
- };
4083
+ var AppBar$1 = function (props) { return (React.createElement(React.Fragment, null,
4084
+ React.createElement(HideOnScroll, __assign({}, props),
4085
+ React.createElement(StyledAppBar, { color: "inherit", elevation: 0 },
4086
+ React.createElement(Toolbar$1, null, props.children))),
4087
+ React.createElement(Toolbar$1, null))); };
4102
4088
 
4103
4089
  var useStyles$i = makeStyles()(function (_a) {
4104
4090
  var palette = _a.palette;
@@ -21749,6 +21735,317 @@ var GrepEditor = function (_a) {
21749
21735
  React__default.createElement(EditorComponent, __assign({}, props))));
21750
21736
  };
21751
21737
 
21738
+ var dimensions = {
21739
+ breadcrumbsFontSize: 16,
21740
+ contentWidth: 1028,
21741
+ footerHeight: 50,
21742
+ inputBoxHeight: 61,
21743
+ toolbarHeight: 80,
21744
+ toolbarHeightMobile: 40,
21745
+ toolbarWidth: 1260,
21746
+ toolbarMenuWidth: 1028,
21747
+ toolbarMenuHeight: 50,
21748
+ };
21749
+ var ToolbarTitle = styled(NavLink)(function () { return ({
21750
+ display: 'flex',
21751
+ fontSize: '24px',
21752
+ color: '#303030',
21753
+ fontFamily: 'Montserrat medium',
21754
+ textDecoration: 'none',
21755
+ ':hover': {
21756
+ textDecoration: 'none',
21757
+ },
21758
+ }); });
21759
+ var EnvironmentTitle = styled('div')(function () { return ({
21760
+ color: 'rgba(0, 0, 0, 0.33)',
21761
+ marginLeft: '17px',
21762
+ }); });
21763
+ var Toolbar = styled('div')(function (_a) {
21764
+ var colors = _a.colors;
21765
+ return ({
21766
+ display: 'flex',
21767
+ flexDirection: 'column',
21768
+ backgroundColor: "".concat(colors.headerBackgroundColor),
21769
+ height: "".concat(dimensions.toolbarMenuHeight + dimensions.toolbarHeight, "px"),
21770
+ minHeight: "".concat(dimensions.toolbarMenuHeight + dimensions.toolbarHeight, "px"),
21771
+ maxHeight: "".concat(dimensions.toolbarMenuHeight + dimensions.toolbarHeight, "px"),
21772
+ });
21773
+ });
21774
+ var ToolbarFixer = styled('div')(function (_a) {
21775
+ var colors = _a.colors;
21776
+ return ({
21777
+ display: 'flex',
21778
+ flexDirection: 'column',
21779
+ backgroundColor: "".concat(colors.headerBackgroundColor),
21780
+ height: "".concat(dimensions.toolbarMenuHeight + dimensions.toolbarHeight, "px"),
21781
+ minHeight: "".concat(dimensions.toolbarMenuHeight + dimensions.toolbarHeight, "px"),
21782
+ maxHeight: "".concat(dimensions.toolbarMenuHeight + dimensions.toolbarHeight, "px"),
21783
+ position: 'fixed',
21784
+ top: 0,
21785
+ left: 0,
21786
+ right: 0,
21787
+ zIndex: 101,
21788
+ });
21789
+ });
21790
+ var ToolbarInner = styled('div')(function (_a) {
21791
+ var _b;
21792
+ var theme = _a.theme;
21793
+ return (_b = {
21794
+ alignItems: 'center',
21795
+ display: 'flex',
21796
+ margin: '0 auto',
21797
+ width: '100%',
21798
+ padding: 0
21799
+ },
21800
+ _b[theme.breakpoints.down('sm')] = {
21801
+ height: "".concat(dimensions.toolbarHeightMobile, "px"),
21802
+ minHeight: "".concat(dimensions.toolbarHeightMobile, "px"),
21803
+ },
21804
+ _b[theme.breakpoints.up('sm')] = {
21805
+ padding: 0,
21806
+ height: "".concat(dimensions.toolbarHeight, "px"),
21807
+ minHeight: "".concat(dimensions.toolbarHeight, "px"),
21808
+ },
21809
+ _b);
21810
+ });
21811
+ var ToolbarLeft = styled('div')(function () { return ({
21812
+ alignItems: 'center',
21813
+ display: 'flex',
21814
+ marginLeft: '40px',
21815
+ }); });
21816
+ var ToolbarRight = styled('div')(function (_a) {
21817
+ var _b;
21818
+ var theme = _a.theme;
21819
+ return (_b = {
21820
+ alignItems: 'center',
21821
+ display: 'flex',
21822
+ marginLeft: 'auto',
21823
+ marginRight: '40px'
21824
+ },
21825
+ _b[theme.breakpoints.down('sm')] = {
21826
+ display: 'none',
21827
+ },
21828
+ _b[theme.breakpoints.up('sm')] = {
21829
+ display: 'flex',
21830
+ },
21831
+ _b);
21832
+ });
21833
+ var UserContainer = styled('div')(function () { return ({
21834
+ display: 'flex',
21835
+ flexDirection: 'column',
21836
+ margin: '0 17px',
21837
+ textAlign: 'left',
21838
+ textTransform: 'none',
21839
+ fontWeight: '400',
21840
+ color: 'rgba(0, 0, 0, 0.87)',
21841
+ }); });
21842
+ var AccountName = styled('span')(function () { return ({
21843
+ fontSize: '18px',
21844
+ lineHeight: '25px',
21845
+ }); });
21846
+ var ToolbarMenu = styled('div')(function (_a) {
21847
+ var _b;
21848
+ var theme = _a.theme, colors = _a.colors;
21849
+ if (!theme) {
21850
+ return {};
21851
+ }
21852
+ return _b = {
21853
+ backgroundColor: "".concat(colors.primary),
21854
+ height: "".concat(dimensions.toolbarMenuHeight, "px"),
21855
+ maxHeight: "".concat(dimensions.toolbarMenuHeight, "px"),
21856
+ minHeight: "".concat(dimensions.toolbarMenuHeight, "px"),
21857
+ width: '100%',
21858
+ display: 'flex',
21859
+ alignItems: 'center',
21860
+ fontFamily: 'MontSerrat, Helvetica Neue, Helvetica, Arial, sans-serif',
21861
+ boxShadow: '0 3px 5px 0 rgba(0, 0, 0, 0.3)'
21862
+ },
21863
+ _b[theme.breakpoints.down('sm')] = {
21864
+ display: 'none',
21865
+ },
21866
+ _b[theme.breakpoints.up('sm')] = {
21867
+ display: 'flex',
21868
+ },
21869
+ _b;
21870
+ });
21871
+ var MobileToolbarMenu = styled('div')(function (_a) {
21872
+ var _b;
21873
+ var theme = _a.theme, colors = _a.colors;
21874
+ if (!theme) {
21875
+ return {};
21876
+ }
21877
+ return _b = {
21878
+ backgroundColor: "".concat(colors.primary),
21879
+ height: "".concat(dimensions.toolbarMenuHeight, "px"),
21880
+ maxHeight: "".concat(dimensions.toolbarMenuHeight, "px"),
21881
+ minHeight: "".concat(dimensions.toolbarMenuHeight, "px"),
21882
+ width: '100%',
21883
+ flexGrow: 1,
21884
+ alignItems: 'center',
21885
+ fontFamily: 'MontSerrat, Helvetica Neue, Helvetica, Arial, sans-serif',
21886
+ boxShadow: '0 3px 5px 0 rgba(0, 0, 0, 0.3)'
21887
+ },
21888
+ _b[theme.breakpoints.down('sm')] = {
21889
+ display: 'flex',
21890
+ },
21891
+ _b[theme.breakpoints.up('sm')] = {
21892
+ display: 'none',
21893
+ },
21894
+ _b;
21895
+ });
21896
+ var ToolbarMenuInner = styled('div')(function (_a) {
21897
+ var _b;
21898
+ var theme = _a.theme;
21899
+ return (_b = {
21900
+ display: 'flex',
21901
+ height: 'fit-content',
21902
+ maxWidth: "".concat(dimensions.toolbarMenuWidth, "px"),
21903
+ margin: '0 auto',
21904
+ width: '100%'
21905
+ },
21906
+ _b[theme.breakpoints.down('md')] = {
21907
+ padding: '0 24px',
21908
+ },
21909
+ _b[theme.breakpoints.up('md')] = {
21910
+ padding: 0,
21911
+ },
21912
+ _b);
21913
+ });
21914
+ var menuItemHoverGreen = '#B9E1CC';
21915
+ var ToolbarMenuItem = styled(NavLink)(function (_a) {
21916
+ var colors = _a.colors;
21917
+ return ({
21918
+ alignItems: 'center',
21919
+ borderRight: '1px solid #696868',
21920
+ color: colors.white,
21921
+ cursor: 'pointer',
21922
+ display: 'flex',
21923
+ fontSize: '1.1rem',
21924
+ padding: '0 17px',
21925
+ height: '100%',
21926
+ textTransform: 'capitalize',
21927
+ userSelect: 'none',
21928
+ position: 'relative',
21929
+ textDecoration: 'none',
21930
+ ':first-child': {
21931
+ paddingLeft: 0,
21932
+ ':after': {
21933
+ marginLeft: '-24px',
21934
+ },
21935
+ },
21936
+ ':last-child': {
21937
+ borderRight: 'none',
21938
+ },
21939
+ ':after': {
21940
+ position: 'absolute',
21941
+ bottom: 0,
21942
+ left: '50%',
21943
+ width: '32px',
21944
+ marginLeft: '-16px',
21945
+ borderBottom: "2px solid ".concat(colors.secondary),
21946
+ opacity: 0,
21947
+ content: '""',
21948
+ transition: 'all 0.3s ease',
21949
+ pointerEvents: 'none',
21950
+ },
21951
+ ':focus': {
21952
+ outline: 'none',
21953
+ },
21954
+ ':hover': {
21955
+ textDecoration: 'none',
21956
+ color: menuItemHoverGreen,
21957
+ },
21958
+ '.active:after, :hover:after, focus:after': {
21959
+ bottom: '-4px',
21960
+ opacity: '1',
21961
+ },
21962
+ });
21963
+ });
21964
+
21965
+ var MobileAppBar = function (_a) {
21966
+ var userMenuItems = _a.userMenuItems, menuItems = _a.menuItems, colors = _a.colors;
21967
+ var _b = __read(React.useState(null), 2), anchorElNav = _b[0], setAnchorElNav = _b[1];
21968
+ var openNav = Boolean(anchorElNav);
21969
+ var handleClickNav = function (event) {
21970
+ setAnchorElNav(event.currentTarget);
21971
+ };
21972
+ var handleCloseNav = function () {
21973
+ setAnchorElNav(null);
21974
+ };
21975
+ var _c = __read(React.useState(null), 2), anchorElMenu = _c[0], setAnchorElMenu = _c[1];
21976
+ var openMenu = Boolean(anchorElMenu);
21977
+ var handleClickMenu = function (event) {
21978
+ setAnchorElMenu(event.currentTarget);
21979
+ };
21980
+ var handleCloseMenu = function () {
21981
+ setAnchorElMenu(null);
21982
+ };
21983
+ return (React.createElement(MobileToolbarMenu, { colors: colors, style: { flexGrow: 1 } },
21984
+ React.createElement(AppBar$3, { position: "static" },
21985
+ React.createElement(Toolbar$1, { style: { minHeight: '50px' } },
21986
+ React.createElement(IconButton, { size: "medium", edge: "start", color: "inherit", "aria-label": "menu", style: { marginRight: 2 }, onClick: handleClickNav },
21987
+ React.createElement(Menu$1, { sx: { color: 'white' } })),
21988
+ React.createElement(Menu, { id: "basic-menu", anchorEl: anchorElNav, open: openNav, onClose: handleCloseNav, MenuListProps: {
21989
+ 'aria-labelledby': 'basic-button',
21990
+ } }, menuItems.map(function (page) { return (React.createElement(NavLink, { key: page.name, to: page.redirectUrl || '' },
21991
+ React.createElement(MenuItem, { key: page.name }, page.translatedTextRef))); })),
21992
+ React.createElement(IconButton, { size: "medium", edge: "end", color: "inherit", "aria-label": "menu", style: { marginLeft: 'auto' }, onClick: handleClickMenu },
21993
+ React.createElement(MoreVert, { sx: { color: 'white' } })),
21994
+ React.createElement(Menu, { id: "basic-menu", anchorEl: anchorElMenu, open: openMenu, onClose: handleCloseMenu, MenuListProps: {
21995
+ 'aria-labelledby': 'basic-button',
21996
+ } }, userMenuItems.map(function (i) { return (React.createElement(MenuItem, { key: i.id, onClick: function () {
21997
+ handleCloseMenu();
21998
+ i.action();
21999
+ } }, i.label)); }))))));
22000
+ };
22001
+
22002
+ var AppBar = function (_a) {
22003
+ var username = _a.username, currentPath = _a.currentPath, isProd = _a.isProd, appTitle = _a.appTitle, userMenuItems = _a.userMenuItems, menuItems = _a.menuItems, userRole = _a.userRole, colors = _a.colors;
22004
+ var _b = __read(React.useState(null), 2), userMenuAnchor = _b[0], setUserMenuAnchor = _b[1];
22005
+ var _handleIconButtonClick = function (event) {
22006
+ event.preventDefault();
22007
+ setUserMenuAnchor(event.currentTarget);
22008
+ };
22009
+ var _handleCloseUserMenu = function () {
22010
+ setUserMenuAnchor(null);
22011
+ };
22012
+ var _renderToolbarMenuItem = function (page) {
22013
+ var isActive = (page === null || page === void 0 ? void 0 : page.exact)
22014
+ ? currentPath === page.redirectUrl
22015
+ : currentPath.includes(page.redirectUrl || '');
22016
+ return (React.createElement(ToolbarMenuItem, { className: isActive ? 'active' : '', to: page.redirectUrl || '', key: page.name, tabIndex: 0, colors: colors }, page === null || page === void 0 ? void 0 : page.translatedTextRef));
22017
+ };
22018
+ return (React.createElement(Toolbar, { colors: colors },
22019
+ React.createElement(ToolbarFixer, { colors: colors },
22020
+ React.createElement(ToolbarInner, null,
22021
+ React.createElement(ToolbarLeft, null,
22022
+ React.createElement(ToolbarTitle, { to: '/' },
22023
+ appTitle,
22024
+ !isProd && (React.createElement(EnvironmentTitle, null, process.env.REACT_APP_HOST)))),
22025
+ React.createElement(ToolbarRight, null,
22026
+ React.createElement(Button$1, { onClick: _handleIconButtonClick },
22027
+ React.createElement(AccountCircle, { color: "primary", fontSize: "large" }),
22028
+ React.createElement(UserContainer, null,
22029
+ React.createElement(AccountName, null, username),
22030
+ userRole && (React.createElement(Box, { sx: { fontSize: '14px', lineHeight: '20px' } }, userRole))),
22031
+ React.createElement(ArrowDropdown, { color: "primary" })),
22032
+ React.createElement(Menu$2, { open: Boolean(userMenuAnchor), anchorEl: userMenuAnchor, onClose: _handleCloseUserMenu, anchorOrigin: {
22033
+ vertical: 'bottom',
22034
+ horizontal: 'center',
22035
+ }, transformOrigin: {
22036
+ vertical: 'top',
22037
+ horizontal: 'center',
22038
+ } }, userMenuItems.map(function (i) {
22039
+ return (React.createElement(MenuItem$1, { key: i.id, onClick: function () {
22040
+ setUserMenuAnchor(null);
22041
+ i.action();
22042
+ } }, i.label));
22043
+ })))),
22044
+ React.createElement(ToolbarMenu, { colors: colors },
22045
+ React.createElement(ToolbarMenuInner, null, menuItems.map(function (page) { return _renderToolbarMenuItem(page); }))),
22046
+ React.createElement(MobileAppBar, { menuItems: menuItems, userMenuItems: userMenuItems, colors: colors }))));
22047
+ };
22048
+
21752
22049
  var NavGuard = function (_a) {
21753
22050
  var when = _a.when, title = _a.title, txt = _a.txt, txtSave = _a.txtSave, txtCancel = _a.txtCancel, txtDiscard = _a.txtDiscard, onSave = _a.onSave, onCancel = _a.onCancel, onDiscard = _a.onDiscard;
21754
22051
  var _b = __read(React.useState(false), 2), open = _b[0], setOpen = _b[1];
@@ -22644,5 +22941,5 @@ var GrepTableOfContent = function (_a) {
22644
22941
  };
22645
22942
  GrepTableOfContent.displayName = 'Grep.ToC';
22646
22943
 
22647
- export { AppBar, AppBarNavList, AppBarProfile, BodyLayout, CircularLoading, Colors, ConfirmationServiceProvider, ContainedLinkList, DatePicker, DropdownMenu, EditorContext, Footer, GDPR, GrepCrumbs, DatePicker as GrepDatePicker, GrepDateRange, GrepDialogServiceProvider, GrepEditor, GrepInput, GrepSelect, GrepTable, GrepTableCard, GrepTableOfContent, GrepTableRow, GreyCover, InfoContainer, LinkList, LoadingOverlay, MainLayout, NavGuard, OverflowTooltip, ProfileInfo, SearchBar, ServiceMessage, Sidebar, SortableTable, UpdateStyle, index as Utils, convert2html, convert2txt, convertToRgba, createState, filterElements as filterContentElements, hex2rgb, hex2rgba, makeStyles, parseContent, parseContentState, useConfirmation, useContentElements, useDate, useDebounce, useGrepDialog, useStyles$d as useStyles, useToolbarStyles, withStyles };
22944
+ export { AppBar$1 as AppBar, AppBarNavList, AppBarProfile, BodyLayout, CircularLoading, Colors, ConfirmationServiceProvider, ContainedLinkList, DatePicker, DropdownMenu, EditorContext, Footer, GDPR, GrepCrumbs, DatePicker as GrepDatePicker, GrepDateRange, GrepDialogServiceProvider, GrepEditor, GrepInput, GrepSelect, GrepTable, GrepTableCard, GrepTableOfContent, GrepTableRow, GreyCover, InfoContainer, LinkList, LoadingOverlay, MainLayout, NavGuard, AppBar as NewAppBar, OverflowTooltip, ProfileInfo, SearchBar, ServiceMessage, Sidebar, SortableTable, UpdateStyle, index as Utils, convert2html, convert2txt, convertToRgba, createState, filterElements as filterContentElements, hex2rgb, hex2rgba, makeStyles, parseContent, parseContentState, useConfirmation, useContentElements, useDate, useDebounce, useGrepDialog, useStyles$d as useStyles, withStyles };
22648
22945
  //# sourceMappingURL=index.js.map