@sikka/hawa 0.0.22 → 0.0.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -1,10 +1,39 @@
1
- import { MenuItem, Typography } from "@mui/material";
1
+ import { MenuItem, Menu, Typography, useTheme } from "@mui/material";
2
2
 
3
- export const HawaPopMenu = () => {
3
+ export const HawaPopMenu = (props) => {
4
+ const theme = useTheme();
4
5
  return (
5
- <MenuItem key={setting.label} onClick={setting.action}>
6
- {setting.icon && <setting.icon />}
7
- <Typography textAlign="center">{setting.label}</Typography>
8
- </MenuItem>
6
+ <Menu
7
+ sx={{ mt: "45px" }}
8
+ id="menu-appbar"
9
+ anchorEl={props.anchor}
10
+ anchorOrigin={{
11
+ vertical: "top",
12
+ horizontal: "right"
13
+ }}
14
+ keepMounted
15
+ transformOrigin={{
16
+ vertical: "top",
17
+ horizontal: "right"
18
+ }}
19
+ open={Boolean(props.anchor)}
20
+ onClose={props.handleClose}
21
+ variant="themed"
22
+ PaperProps={{
23
+ style: {
24
+ boxShadow: "none",
25
+ borderRadius: theme.allBorderRadius,
26
+ border: `1px solid ${theme.primaryActionColor}`
27
+ }
28
+ }}
29
+ >
30
+ {props.menuItems.map((item) => (
31
+ <MenuItem key={item.label} onClick={item.action}>
32
+ {item.icon && <item.icon />}
33
+ <div style={{ width: 10 }} />
34
+ <Typography textAlign="center">{item.label}</Typography>
35
+ </MenuItem>
36
+ ))}
37
+ </Menu>
9
38
  );
10
39
  };
@@ -12,6 +12,7 @@ import Button from "@mui/material/Button";
12
12
  import Tooltip from "@mui/material/Tooltip";
13
13
  import MenuItem from "@mui/material/MenuItem";
14
14
  import { useTheme } from "@mui/material";
15
+ import { HawaPopMenu } from "../elements/HawaPopMenu";
15
16
 
16
17
  const pages = ["Products", "Pricing", "Blog"];
17
18
  const settings = ["Profile", "Account", "Dashboard", "Logout"];
@@ -111,39 +112,11 @@ export const HawaAppBar = (props) => {
111
112
  <Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" />
112
113
  </IconButton>
113
114
  </Tooltip>
114
- <Menu
115
- sx={{ mt: "45px" }}
116
- id="menu-appbar"
117
- anchorEl={anchorElUser}
118
- anchorOrigin={{
119
- vertical: "top",
120
- horizontal: "right"
121
- }}
122
- keepMounted
123
- transformOrigin={{
124
- vertical: "top",
125
- horizontal: "right"
126
- }}
127
- open={Boolean(anchorElUser)}
128
- onClose={handleCloseUserMenu}
129
- variant="themed"
130
- PaperProps={{
131
- style: {
132
- boxShadow: "none",
133
- borderRadius: theme.allBorderRadius,
134
- // borderColor: theme.primaryActionColor,
135
- // borderWidth: 2,
136
- border: `1px solid ${theme.primaryActionColor}`
137
- }
138
- }}
139
- >
140
- {props.accountMenu.map((setting) => (
141
- <MenuItem key={setting.label} onClick={setting.action}>
142
- {setting.icon && <setting.icon />}
143
- <Typography textAlign="center">{setting.label}</Typography>
144
- </MenuItem>
145
- ))}
146
- </Menu>
115
+ <HawaPopMenu
116
+ anchor={anchorElUser}
117
+ handleClose={(e) => setAnchorElUser(null)}
118
+ menuItems={props.accountMenu}
119
+ />
147
120
  </Box>
148
121
  </Toolbar>
149
122
  </Container>
@@ -345,4 +345,4 @@
345
345
 
346
346
 
347
347
 
348
- window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.708d7ac1.iframe.bundle.js"></script><script src="vendors~main.7097848f.iframe.bundle.js"></script><script src="main.f236f782.iframe.bundle.js"></script></body></html>
348
+ window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.708d7ac1.iframe.bundle.js"></script><script src="vendors~main.62e56b46.iframe.bundle.js"></script><script src="main.9157fa74.iframe.bundle.js"></script></body></html>