@sikka/hawa 0.0.19 → 0.0.22

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 (36) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +1 -1
  4. package/src/blocks/Account/UserSettingsForm.js +2 -2
  5. package/src/blocks/AuthForms/SignInForm.js +2 -0
  6. package/src/blocks/AuthForms/SignUpForm.js +2 -0
  7. package/src/blocks/Payment/ChargeWalletForm.js +6 -1
  8. package/src/blocks/Payment/CheckoutForm.js +213 -66
  9. package/src/blocks/Payment/Confirmation.js +120 -0
  10. package/src/blocks/Payment/CreditCardForm.js +3 -3
  11. package/src/blocks/Payment/PayWithWallet.js +3 -3
  12. package/src/blocks/Payment/SelectPayment.js +1 -1
  13. package/src/blocks/Payment/index.js +1 -0
  14. package/src/elements/AdaptiveButton.js +0 -2
  15. package/src/elements/HawaLogoButton.js +1 -2
  16. package/src/elements/HawaPopMenu.js +10 -0
  17. package/src/elements/HawaPricingCard.js +2 -1
  18. package/src/elements/HawaSelect.js +26 -0
  19. package/src/elements/HawaSwitch.js +1 -1
  20. package/src/elements/HawaTable.js +20 -5
  21. package/src/elements/HawaTextField.js +10 -4
  22. package/src/elements/HawaTypography.js +0 -1
  23. package/src/elements/index.js +1 -2
  24. package/src/{elements → layout}/HawaAppBar.js +19 -6
  25. package/src/layout/HawaAppLayout.js +44 -43
  26. package/src/layout/HawaDialog.js +5 -7
  27. package/src/layout/index.js +1 -0
  28. package/storybook-static/iframe.html +1 -1
  29. package/storybook-static/main.f236f782.iframe.bundle.js +1 -0
  30. package/storybook-static/vendors~main.7097848f.iframe.bundle.js +76 -0
  31. package/storybook-static/{vendors~main.ae39b38c.iframe.bundle.js.LICENSE.txt → vendors~main.7097848f.iframe.bundle.js.LICENSE.txt} +0 -0
  32. package/storybook-static/vendors~main.7097848f.iframe.bundle.js.map +1 -0
  33. package/src/elements/HawaListItem.js +0 -21
  34. package/storybook-static/main.894e2873.iframe.bundle.js +0 -1
  35. package/storybook-static/vendors~main.ae39b38c.iframe.bundle.js +0 -76
  36. package/storybook-static/vendors~main.ae39b38c.iframe.bundle.js.map +0 -1
@@ -11,11 +11,13 @@ import Avatar from "@mui/material/Avatar";
11
11
  import Button from "@mui/material/Button";
12
12
  import Tooltip from "@mui/material/Tooltip";
13
13
  import MenuItem from "@mui/material/MenuItem";
14
+ import { useTheme } from "@mui/material";
14
15
 
15
16
  const pages = ["Products", "Pricing", "Blog"];
16
17
  const settings = ["Profile", "Account", "Dashboard", "Logout"];
17
18
 
18
19
  export const HawaAppBar = (props) => {
20
+ const theme = useTheme();
19
21
  const [anchorElNav, setAnchorElNav] = React.useState(null);
20
22
  const [anchorElUser, setAnchorElUser] = React.useState(null);
21
23
 
@@ -33,9 +35,9 @@ export const HawaAppBar = (props) => {
33
35
  const handleCloseUserMenu = () => {
34
36
  setAnchorElUser(null);
35
37
  };
36
-
38
+ console.log("theme is ", theme);
37
39
  return (
38
- <AppBar position="static">
40
+ <AppBar position="static" variant="appbar">
39
41
  <Container maxWidth="xl" variant="appbar">
40
42
  <Toolbar disableGutters>
41
43
  <Typography
@@ -96,7 +98,7 @@ export const HawaAppBar = (props) => {
96
98
  <Button
97
99
  key={page}
98
100
  onClick={handleCloseNavMenu}
99
- sx={{ my: 2, color: "white", display: "block" }}
101
+ sx={{ my: 2, display: "block" }}
100
102
  >
101
103
  {page}
102
104
  </Button>
@@ -124,10 +126,21 @@ export const HawaAppBar = (props) => {
124
126
  }}
125
127
  open={Boolean(anchorElUser)}
126
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
+ }}
127
139
  >
128
- {settings.map((setting) => (
129
- <MenuItem key={setting} onClick={handleCloseUserMenu}>
130
- <Typography textAlign="center">{setting}</Typography>
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>
131
144
  </MenuItem>
132
145
  ))}
133
146
  </Menu>
@@ -5,7 +5,6 @@ import MuiDrawer from "@mui/material/Drawer";
5
5
  import MuiAppBar from "@mui/material/AppBar";
6
6
  import Toolbar from "@mui/material/Toolbar";
7
7
  import List from "@mui/material/List";
8
- // import CssBaseline from "@mui/material/CssBaseline";
9
8
  import Typography from "@mui/material/Typography";
10
9
  import Divider from "@mui/material/Divider";
11
10
  import IconButton from "@mui/material/IconButton";
@@ -13,15 +12,9 @@ import MenuIcon from "@mui/icons-material/Menu";
13
12
  import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
14
13
  import ChevronRightIcon from "@mui/icons-material/ChevronRight";
15
14
  import ListItemButton from "@mui/material/ListItemButton";
16
- import ListItemIcon from "@mui/material/ListItemIcon";
17
15
  import ListItemText from "@mui/material/ListItemText";
18
- import InboxIcon from "@mui/icons-material/MoveToInbox";
19
- import MailIcon from "@mui/icons-material/Mail";
20
- import { HawaListItem } from "../elements";
21
16
  import Menu from "@mui/material/Menu";
22
- import Container from "@mui/material/Container";
23
17
  import Avatar from "@mui/material/Avatar";
24
- import Button from "@mui/material/Button";
25
18
  import Tooltip from "@mui/material/Tooltip";
26
19
  import MenuItem from "@mui/material/MenuItem";
27
20
 
@@ -152,7 +145,7 @@ export function HawaAppLayout(props) {
152
145
  }}
153
146
  >
154
147
  <Typography variant="h6" noWrap component="div">
155
- Page name here
148
+ {props.pageTitle}
156
149
  </Typography>
157
150
 
158
151
  <Box>
@@ -176,10 +169,21 @@ export function HawaAppLayout(props) {
176
169
  }}
177
170
  open={Boolean(anchorElUser)}
178
171
  onClose={handleCloseUserMenu}
172
+ variant="themed"
173
+ PaperProps={{
174
+ style: {
175
+ boxShadow: "none",
176
+ borderRadius: theme.allBorderRadius,
177
+ // borderColor: theme.primaryActionColor,
178
+ // borderWidth: 2,
179
+ border: `1px solid ${theme.primaryActionColor}`
180
+ }
181
+ }}
179
182
  >
180
- {[2, 3, 4].map((setting) => (
181
- <MenuItem key={setting} onClick={handleCloseUserMenu}>
182
- <Typography textAlign="center">{setting}</Typography>
183
+ {props.accountMenu.map((setting) => (
184
+ <MenuItem key={setting.label} onClick={setting.action}>
185
+ {setting.icon && <setting.icon />}
186
+ <Typography textAlign="center">{setting.label}</Typography>
183
187
  </MenuItem>
184
188
  ))}
185
189
  </Menu>
@@ -200,42 +204,39 @@ export function HawaAppLayout(props) {
200
204
  </DrawerHeader>
201
205
  <Divider />
202
206
  <List>
203
- {props.pages.map((t) => {
207
+ {props.pages.map((p, jk) => {
204
208
  return (
205
- <HawaListItem
206
- open={open}
207
- text={t.text}
208
- selected={props.pageName.toLowerCase() === t.text}
209
- // icon={<ChevronLeftIcon />}
210
- icon={t.icon}
211
- />
209
+ <Tooltip
210
+ title={p.text}
211
+ key={jk}
212
+ placement={"right"}
213
+ arrow={true}
214
+ PopperProps={{ style: { opacity: open ? 0 : 1 } }}
215
+ >
216
+ <ListItemButton
217
+ variant={
218
+ props.pageName?.toLowerCase() === p.slug?.toLowerCase() &&
219
+ "clicked"
220
+ }
221
+ onClick={p.action}
222
+ key={p.text}
223
+ sx={{
224
+ minHeight: 48,
225
+ justifyContent: open ? "initial" : "center",
226
+ px: 2.5
227
+ }}
228
+ >
229
+ <p.icon />
230
+ <div style={{ width: 20 }} />
231
+ <ListItemText
232
+ primary={p.text}
233
+ sx={{ opacity: open ? 1 : 0 }}
234
+ />
235
+ </ListItemButton>
236
+ </Tooltip>
212
237
  );
213
238
  })}
214
239
  </List>
215
- <Divider />
216
- <List>
217
- {["All mail", "Trash", "Spam"].map((text, index) => (
218
- <ListItemButton
219
- key={text}
220
- sx={{
221
- minHeight: 48,
222
- justifyContent: open ? "initial" : "center",
223
- px: 2.5
224
- }}
225
- >
226
- <ListItemIcon
227
- sx={{
228
- minWidth: 0,
229
- mr: open ? 3 : "auto",
230
- justifyContent: "center"
231
- }}
232
- >
233
- {index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
234
- </ListItemIcon>
235
- <ListItemText primary={text} sx={{ opacity: open ? 1 : 0 }} />
236
- </ListItemButton>
237
- ))}
238
- </List>
239
240
  </Drawer>
240
241
  <Box sx={{ flexGrow: 1, p: 3 }}>
241
242
  <DrawerHeader />
@@ -1,11 +1,9 @@
1
1
  import CloseIcon from "@mui/icons-material/Close";
2
- import {
3
- Dialog,
4
- DialogActions,
5
- DialogContent,
6
- DialogTitle,
7
- IconButton
8
- } from "@mui/material";
2
+ import Dialog from "@mui/material/Dialog";
3
+ import DialogActions from "@mui/material/DialogActions";
4
+ import DialogContent from "@mui/material/DialogContent";
5
+ import DialogTitle from "@mui/material/DialogTitle";
6
+ import IconButton from "@mui/material/IconButton";
9
7
  import React, { useState } from "react";
10
8
 
11
9
  const BootstrapDialogTitle = (props) => {
@@ -1,3 +1,4 @@
1
1
  export * from "./Box";
2
2
  export * from "./HawaAppLayout";
3
3
  export * from "./HawaDialog";
4
+ export * from "./HawaAppBar";
@@ -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.ae39b38c.iframe.bundle.js"></script><script src="main.894e2873.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.7097848f.iframe.bundle.js"></script><script src="main.f236f782.iframe.bundle.js"></script></body></html>