@sikka/hawa 0.0.29 → 0.0.32

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 (37) 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/UserProfileForm.js +5 -0
  5. package/src/blocks/AuthForms/NewPasswordForm.js +22 -1
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +16 -3
  7. package/src/blocks/AuthForms/SignInForm.js +19 -1
  8. package/src/blocks/AuthForms/SignUpForm.js +31 -9
  9. package/src/blocks/Payment/ChargeWalletForm.js +21 -8
  10. package/src/blocks/Payment/CheckoutForm.js +17 -1
  11. package/src/blocks/Payment/Confirmation.js +27 -1
  12. package/src/blocks/Payment/CreditCardForm.js +0 -23
  13. package/src/blocks/Payment/{PaymentMethod.js → Form/PaymentMethod.js} +0 -10
  14. package/src/blocks/Pricing/PricingPlans.js +18 -1
  15. package/src/elements/HawaAccordian.js +28 -0
  16. package/src/elements/HawaAlert.js +10 -1
  17. package/src/elements/HawaColorPicker.js +1 -0
  18. package/src/elements/HawaLogoButton.js +18 -1
  19. package/src/elements/HawaPopMenu.js +7 -1
  20. package/src/elements/HawaPricingCard.js +18 -1
  21. package/src/elements/HawaRadio.js +6 -1
  22. package/src/elements/HawaRange.js +31 -0
  23. package/src/elements/HawaSearchBar.js +17 -0
  24. package/src/elements/HawaSettingsRow.js +12 -4
  25. package/src/elements/{OfflineBanner.js → HawaSnackbar.js} +3 -8
  26. package/src/elements/HawaTable.js +65 -20
  27. package/src/elements/HawaTextField.js +6 -2
  28. package/src/elements/index.js +4 -1
  29. package/src/layout/HawaAppLayout.js +33 -61
  30. package/storybook-static/iframe.html +1 -1
  31. package/storybook-static/main.c86d0451.iframe.bundle.js +1 -0
  32. package/storybook-static/vendors~main.924b4d3c.iframe.bundle.js +76 -0
  33. package/storybook-static/{vendors~main.b026595c.iframe.bundle.js.LICENSE.txt → vendors~main.924b4d3c.iframe.bundle.js.LICENSE.txt} +0 -0
  34. package/storybook-static/vendors~main.924b4d3c.iframe.bundle.js.map +1 -0
  35. package/storybook-static/main.c6115a9b.iframe.bundle.js +0 -1
  36. package/storybook-static/vendors~main.b026595c.iframe.bundle.js +0 -76
  37. package/storybook-static/vendors~main.b026595c.iframe.bundle.js.map +0 -1
@@ -5,6 +5,8 @@ import TableCell from "@mui/material/TableCell";
5
5
  import TableContainer from "@mui/material/TableContainer";
6
6
  import TableHead from "@mui/material/TableHead";
7
7
  import TableRow from "@mui/material/TableRow";
8
+ import PropTypes from "prop-types";
9
+ import { Button } from "@mui/material";
8
10
 
9
11
  export const HawaTable = (props) => {
10
12
  let isArabic = props.lang === "ar";
@@ -25,31 +27,66 @@ export const HawaTable = (props) => {
25
27
  {col}
26
28
  </TableCell>
27
29
  ))}
30
+ {props.actions && (
31
+ <TableCell
32
+ align={isArabic ? "right" : "left"}
33
+ style={{ fontWeight: 700 }}
34
+ variant={isArabic ? "borderedRight" : "borderedLeft"}
35
+ >
36
+ Actions
37
+ </TableCell>
38
+ )}
28
39
  </TableRow>
29
40
  </TableHead>
30
41
 
31
42
  <TableBody>
32
- {props.rows.map((singleRow, j) => (
33
- <TableRow key={j}>
34
- {singleRow.map((r, i) => (
35
- <TableCell
36
- align={isArabic ? "right" : "left"}
37
- key={i}
38
- component="th"
39
- scope="row"
40
- variant={
41
- i > 0
42
- ? isArabic
43
- ? "borderedRight"
44
- : "borderedLeft"
45
- : "body"
46
- }
47
- >
48
- {r}
49
- </TableCell>
50
- ))}
43
+ {props.rows ? (
44
+ props.rows.map((singleRow, j) => (
45
+ <TableRow key={j}>
46
+ {singleRow.map((r, i) => (
47
+ <TableCell
48
+ align={isArabic ? "right" : "left"}
49
+ key={i}
50
+ component="th"
51
+ scope="row"
52
+ variant={
53
+ i > 0
54
+ ? isArabic
55
+ ? "borderedRight"
56
+ : "borderedLeft"
57
+ : "body"
58
+ }
59
+ >
60
+ {r}
61
+ </TableCell>
62
+ ))}
63
+ {props.actions && (
64
+ <TableCell
65
+ align={isArabic ? "right" : "left"}
66
+ style={{ fontWeight: 700 }}
67
+ variant={isArabic ? "borderedRight" : "borderedLeft"}
68
+ >
69
+ {props.actions.map((act) => (
70
+ <Button
71
+ style={{ margin: 2 }}
72
+ variant="outlined"
73
+ size="small"
74
+ onClick={() => props.handleActionClick(singleRow)}
75
+ >
76
+ {act}
77
+ </Button>
78
+ ))}
79
+ </TableCell>
80
+ )}
81
+ </TableRow>
82
+ ))
83
+ ) : (
84
+ <TableRow align="center">
85
+ <TableCell align={"center"} component="th" colSpan={6}>
86
+ {props.noDataText}
87
+ </TableCell>
51
88
  </TableRow>
52
- ))}
89
+ )}
53
90
  </TableBody>
54
91
  {props.end && (
55
92
  <TableRow>
@@ -73,3 +110,11 @@ export const HawaTable = (props) => {
73
110
  </TableContainer>
74
111
  );
75
112
  };
113
+ HawaTable.propTypes = {
114
+ handleActionClick: PropTypes.func,
115
+ noDataText: PropTypes.string,
116
+ lang: PropTypes.string,
117
+ columns: PropTypes.array,
118
+ rows: PropTypes.array,
119
+ end: PropTypes.array
120
+ };
@@ -16,9 +16,13 @@ export const HawaTextField = (props) => {
16
16
  }}
17
17
  >
18
18
  {props.label && <InputLabel>{props.label}</InputLabel>}
19
-
20
19
  {props.helperText && (
21
- <Typography variant="validation">{props.helperText}</Typography>
20
+ <Typography
21
+ style={{ marginBottom: !props.label && 10 }}
22
+ variant="validation"
23
+ >
24
+ {props.helperText}
25
+ </Typography>
22
26
  )}
23
27
  </div>
24
28
  <Input disableUnderline {...props} />
@@ -1,6 +1,6 @@
1
1
  export * from "./AdaptiveButton";
2
2
  export * from "./ActionButton";
3
- export * from "./OfflineBanner";
3
+ export * from "./HawaSnackbar";
4
4
  export * from "./HawaCheckbox";
5
5
  export * from "./HawaRadio";
6
6
  export * from "./HawaItemCard";
@@ -9,6 +9,7 @@ export * from "./HawaSettingsRow";
9
9
  export * from "./HawaLogoButton";
10
10
  export * from "./HawaButton";
11
11
  export * from "./HawaSelect";
12
+ export * from "./HawaRange";
12
13
  export * from "./HawaTextField";
13
14
  export * from "./HawaTextArea";
14
15
  export * from "./HawaInputLabel";
@@ -16,3 +17,5 @@ export * from "./HawaTypography";
16
17
  export * from "./HawaAlert";
17
18
  export * from "./HawaTable";
18
19
  export * from "./HawaColorPicker";
20
+ export * from "./HawaSearchBar";
21
+ export * from "./HawaAccordian";
@@ -13,10 +13,13 @@ import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
13
13
  import ChevronRightIcon from "@mui/icons-material/ChevronRight";
14
14
  import ListItemButton from "@mui/material/ListItemButton";
15
15
  import ListItemText from "@mui/material/ListItemText";
16
- import Menu from "@mui/material/Menu";
17
16
  import Avatar from "@mui/material/Avatar";
18
17
  import Tooltip from "@mui/material/Tooltip";
19
- import MenuItem from "@mui/material/MenuItem";
18
+ import { HawaPopMenu } from "../elements/HawaPopMenu";
19
+ // use this to detect size and change things accordingly
20
+ import useMediaQuery from "@mui/material/useMediaQuery";
21
+ import { BottomNavigation, BottomNavigationAction } from "@mui/material";
22
+ import { RestoreOutlined } from "@mui/icons-material";
20
23
 
21
24
  const drawerWidth = 240;
22
25
 
@@ -35,7 +38,7 @@ const closedMixin = (theme) => ({
35
38
  duration: theme.transitions.duration.leavingScreen
36
39
  }),
37
40
  overflowX: "hidden",
38
- width: `calc(${theme.spacing(7)} + 1px)`,
41
+ width: `calc(${theme.spacing(8)} + 1px)`,
39
42
  [theme.breakpoints.up("sm")]: {
40
43
  width: `calc(${theme.spacing(8)} + 1px)`
41
44
  }
@@ -88,36 +91,33 @@ const Drawer = styled(MuiDrawer, {
88
91
  export function HawaAppLayout(props) {
89
92
  const theme = useTheme();
90
93
  const [open, setOpen] = React.useState(true);
94
+ const matches = useMediaQuery("(max-width:600px)");
91
95
 
92
96
  const [anchorElNav, setAnchorElNav] = React.useState(null);
93
97
  const [anchorElUser, setAnchorElUser] = React.useState(null);
94
-
95
- const handleOpenNavMenu = (event) => {
96
- setAnchorElNav(event.currentTarget);
97
- };
98
- const handleOpenUserMenu = (event) => {
99
- setAnchorElUser(event.currentTarget);
100
- };
101
-
102
- const handleCloseNavMenu = () => {
103
- setAnchorElNav(null);
104
- };
105
-
106
- const handleCloseUserMenu = () => {
107
- setAnchorElUser(null);
108
- };
109
-
110
- const handleDrawerOpen = () => {
111
- setOpen(true);
112
- };
113
-
114
- const handleDrawerClose = () => {
115
- setOpen(false);
116
- };
98
+ console.log("match is ", matches);
99
+ const handleOpenNavMenu = (event) => setAnchorElNav(event.currentTarget);
100
+ const handleOpenUserMenu = (event) => setAnchorElUser(event.currentTarget);
101
+ const handleCloseNavMenu = () => setAnchorElNav(null);
102
+ const handleCloseUserMenu = () => setAnchorElUser(null);
103
+ const handleDrawerOpen = () => setOpen(true);
104
+ const handleDrawerClose = () => setOpen(false);
117
105
 
118
106
  return (
119
107
  <Box sx={{ display: "flex" }}>
120
- {/* <CssBaseline /> */}
108
+ {matches && (
109
+ <BottomNavigation
110
+ showLabels
111
+ // value={value}
112
+ // onChange={(event, newValue) => {
113
+ // setValue(newValue);
114
+ // }}
115
+ >
116
+ <BottomNavigationAction label="Recents" icon={<RestoreOutlined />} />
117
+ <BottomNavigationAction label="Favorites" icon={<RestoreOutlined />} />
118
+ <BottomNavigationAction label="Nearby" icon={<RestoreOutlined />} />
119
+ </BottomNavigation>
120
+ )}{" "}
121
121
  <AppBar variant="appbar" position="fixed" open={open}>
122
122
  <Toolbar variant="appbar">
123
123
  <IconButton
@@ -151,42 +151,14 @@ export function HawaAppLayout(props) {
151
151
  <Box>
152
152
  <Tooltip title="Open settings">
153
153
  <IconButton onClick={handleOpenUserMenu} sx={{ p: 0 }}>
154
- <Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" />
154
+ <Avatar />
155
155
  </IconButton>
156
156
  </Tooltip>
157
- <Menu
158
- sx={{ mt: "45px" }}
159
- id="menu-appbar"
160
- anchorEl={anchorElUser}
161
- anchorOrigin={{
162
- vertical: "top",
163
- horizontal: "right"
164
- }}
165
- keepMounted
166
- transformOrigin={{
167
- vertical: "top",
168
- horizontal: "right"
169
- }}
170
- open={Boolean(anchorElUser)}
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
- }}
182
- >
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>
187
- </MenuItem>
188
- ))}
189
- </Menu>
157
+ <HawaPopMenu
158
+ menuItems={props.accountMenu}
159
+ anchor={anchorElUser}
160
+ handleClose={handleCloseUserMenu}
161
+ />
190
162
  </Box>
191
163
  </div>
192
164
  </Toolbar>
@@ -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.b026595c.iframe.bundle.js"></script><script src="main.c6115a9b.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.924b4d3c.iframe.bundle.js"></script><script src="main.c86d0451.iframe.bundle.js"></script></body></html>