@sikka/hawa 0.0.27 → 0.0.30

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 (40) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +5 -4
  4. package/src/blocks/Account/UserProfileForm.js +7 -4
  5. package/src/blocks/AuthForms/NewPasswordForm.js +22 -4
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +15 -0
  7. package/src/blocks/AuthForms/SignInForm.js +30 -2
  8. package/src/blocks/AuthForms/SignUpForm.js +53 -8
  9. package/src/blocks/Payment/ChargeWalletForm.js +12 -7
  10. package/src/blocks/Payment/CheckoutForm.js +27 -1
  11. package/src/blocks/Payment/Confirmation.js +41 -23
  12. package/src/blocks/Payment/{PaymentMethod.js → Form/PaymentMethod.js} +7 -12
  13. package/src/blocks/Payment/SelectPayment.js +18 -7
  14. package/src/blocks/Pricing/PricingPlans.js +20 -0
  15. package/src/elements/ActionButton.js +0 -33
  16. package/src/elements/AdaptiveButton.js +1 -0
  17. package/src/elements/HawaAccordian.js +28 -0
  18. package/src/elements/HawaAlert.js +16 -0
  19. package/src/elements/HawaColorPicker.js +61 -0
  20. package/src/elements/HawaItemCard.js +5 -1
  21. package/src/elements/HawaLogoButton.js +30 -1
  22. package/src/elements/HawaPopMenu.js +12 -0
  23. package/src/elements/HawaPricingCard.js +14 -0
  24. package/src/elements/HawaRadio.js +13 -0
  25. package/src/elements/HawaSearchBar.js +17 -0
  26. package/src/elements/HawaSettingsRow.js +13 -5
  27. package/src/elements/{OfflineBanner.js → HawaSnackbar.js} +3 -8
  28. package/src/elements/HawaTable.js +7 -0
  29. package/src/elements/index.js +4 -1
  30. package/src/layout/HawaAppLayout.js +15 -59
  31. package/storybook-static/iframe.html +1 -1
  32. package/storybook-static/index.html +1 -1
  33. package/storybook-static/{main.ac6e4b72b033097dad76.manager.bundle.js → main.9d5968bcf15d21f5487c.manager.bundle.js} +0 -0
  34. package/storybook-static/main.cbf6de78.iframe.bundle.js +1 -0
  35. package/storybook-static/vendors~main.8ffaa38a.iframe.bundle.js +76 -0
  36. package/storybook-static/{vendors~main.b026595c.iframe.bundle.js.LICENSE.txt → vendors~main.8ffaa38a.iframe.bundle.js.LICENSE.txt} +0 -0
  37. package/storybook-static/vendors~main.8ffaa38a.iframe.bundle.js.map +1 -0
  38. package/storybook-static/main.bc81d4bb.iframe.bundle.js +0 -1
  39. package/storybook-static/vendors~main.b026595c.iframe.bundle.js +0 -76
  40. package/storybook-static/vendors~main.b026595c.iframe.bundle.js.map +0 -1
@@ -4,8 +4,10 @@ import GitHubIcon from "@mui/icons-material/GitHub";
4
4
  import TwitterIcon from "@mui/icons-material/Twitter";
5
5
  import WalletIcon from "@mui/icons-material/AccountBalanceWallet";
6
6
  import Typography from "@mui/material/Typography";
7
+ import PropTypes from "prop-types";
7
8
 
8
9
  export const HawaLogoButton = (props) => {
10
+ let isArabic = props.lang === "ar";
9
11
  let logoElement = "";
10
12
  switch (props.logo?.toLowerCase()) {
11
13
  case "google":
@@ -79,7 +81,11 @@ export const HawaLogoButton = (props) => {
79
81
  break;
80
82
  }
81
83
  return (
82
- <Button {...props} variant="withLogo">
84
+ <Button
85
+ style={{ direction: isArabic ? "rtl" : "ltr" }}
86
+ {...props}
87
+ variant="withLogo"
88
+ >
83
89
  {logoElement}
84
90
  <div style={{ width: 10 }} />
85
91
  <Typography
@@ -97,3 +103,26 @@ export const HawaLogoButton = (props) => {
97
103
  </Button>
98
104
  );
99
105
  };
106
+
107
+ HawaLogoButton.propTypes = {
108
+ lang: PropTypes.string,
109
+ /**
110
+ * The logo/icon of the button
111
+ */
112
+ logo: PropTypes.oneOf([
113
+ "google",
114
+ "github",
115
+ "twitter",
116
+ "wallet",
117
+ "googlepay",
118
+ "applepay",
119
+ "stcpay",
120
+ "visa/master",
121
+ "paypal",
122
+ "mada"
123
+ ]),
124
+ /**
125
+ * The text next to the logo in the button
126
+ */
127
+ buttonText: PropTypes.string
128
+ };
@@ -1,4 +1,5 @@
1
1
  import { MenuItem, Menu, Typography, useTheme } from "@mui/material";
2
+ import PropTypes from "prop-types";
2
3
 
3
4
  export const HawaPopMenu = (props) => {
4
5
  const theme = useTheme();
@@ -37,3 +38,14 @@ export const HawaPopMenu = (props) => {
37
38
  </Menu>
38
39
  );
39
40
  };
41
+
42
+ HawaPopMenu.propTypes = {
43
+ handleClose: PropTypes.func,
44
+ menuItems: PropTypes.arrayOf(
45
+ PropTypes.shape({
46
+ icon: PropTypes.element,
47
+ label: PropTypes.string,
48
+ action: PropTypes.func
49
+ })
50
+ )
51
+ };
@@ -3,6 +3,8 @@ import Container from "@mui/material/Container";
3
3
  import Button from "@mui/material/Button";
4
4
  import Typography from "@mui/material/Typography";
5
5
  import CheckIcon from "@mui/icons-material/CheckCircleOutlined";
6
+ import PropTypes from "prop-types";
7
+
6
8
  export const HawaPricingCard = (props) => {
7
9
  let isArabic = props.lang === "ar";
8
10
  let cycleTextsArabic = {
@@ -132,3 +134,15 @@ export const HawaPricingCard = (props) => {
132
134
  </Container>
133
135
  );
134
136
  };
137
+
138
+ HawaPricingCard.propTypes = {
139
+ lang: PropTypes.string,
140
+ buttonText: PropTypes.string,
141
+ selectedPlan: PropTypes.string,
142
+ title: PropTypes.string,
143
+ title_ar: PropTypes.string,
144
+ subtitle: PropTypes.string,
145
+ subtitle_ar: PropTypes.string,
146
+ features: PropTypes.array,
147
+ features_ar: PropTypes.array
148
+ };
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import Button from "@mui/material/Button";
3
3
  import Container from "@mui/material/Container";
4
+ import PropTypes from "prop-types";
4
5
 
5
6
  export const HawaRadio = (props) => {
6
7
  const [value, setValue] = useState(props.defaultValue);
@@ -28,3 +29,15 @@ export const HawaRadio = (props) => {
28
29
  </Container>
29
30
  );
30
31
  };
32
+ HawaRadio.propTypes = {
33
+ lang: PropTypes.string,
34
+ options: PropTypes.arrayOf(
35
+ PropTypes.shape({
36
+ label: PropTypes.string,
37
+ value: PropTypes.string
38
+ })
39
+ ),
40
+ defaultValue: PropTypes.string,
41
+ handleChange: PropTypes.func,
42
+ location: PropTypes.string
43
+ };
@@ -0,0 +1,17 @@
1
+ import { Search } from "@mui/icons-material";
2
+ import { InputAdornment } from "@mui/material";
3
+ import React from "react";
4
+ import { HawaTextField } from "./HawaTextField";
5
+
6
+ export const HawaSearchBar = (props) => {
7
+ return (
8
+ <HawaTextField
9
+ endAdornment={
10
+ <InputAdornment position="start">
11
+ <Search />
12
+ </InputAdornment>
13
+ }
14
+ {...props}
15
+ />
16
+ );
17
+ };
@@ -1,27 +1,35 @@
1
1
  import React from "react";
2
-
3
2
  import PropTypes from "prop-types";
4
3
  import Checkbox from "@mui/material/Checkbox";
5
- import { HawaTypography } from "./HawaTypography";
6
4
  import Container from "@mui/material/Container";
5
+ import { HawaTypography } from "./HawaTypography";
7
6
  import { HawaTextField } from "./HawaTextField";
8
7
  import { HawaRadio } from "./HawaRadio";
9
8
  import { HawaSwitch } from "./HawaSwitch";
9
+ import { HawaColorPicker } from "./HawaColorPicker";
10
+
10
11
  export const HawaSettingsRow = (props) => {
11
12
  return (
12
13
  <Container variant="settingsRow">
13
14
  <HawaTypography>{props.settingsLabel}</HawaTypography>
14
15
  {props.settingsType === "checkbox" && <Checkbox {...props} />}
15
16
  {props.settingsType === "text" && <HawaTextField {...props} />}
17
+ {props.settingsType === "boolean" && <HawaSwitch {...props} />}
18
+ {props.settingsType === "color" && <HawaColorPicker {...props} />}
16
19
  {props.settingsType === "radio" && (
17
20
  <HawaRadio location="inSettings" {...props} />
18
21
  )}
19
- {props.settingsType === "boolean" && <HawaSwitch {...props} />}
20
22
  </Container>
21
23
  );
22
24
  };
23
25
 
24
26
  HawaSettingsRow.propTypes = {
25
- type: PropTypes.oneOf(["text", "number", "password"]),
26
- helperText: PropTypes.string
27
+ settingsLabel: PropTypes.string,
28
+ settingsType: PropTypes.oneOf([
29
+ "checkbox",
30
+ "text",
31
+ "radio",
32
+ "boolean",
33
+ "color"
34
+ ])
27
35
  };
@@ -3,15 +3,10 @@ import Snackbar from "@mui/material/Snackbar";
3
3
  import AlertTitle from "@mui/material/AlertTitle";
4
4
  import Alert from "@mui/material/Alert";
5
5
 
6
- export const OfflineBanner = (props) => {
6
+ export const HawaSnackbar = (props) => {
7
7
  return (
8
- <Snackbar
9
- variant="danger"
10
- // style={{ outline: "1px solid red" }}
11
- open={props.open}
12
- onClose={props.handleClose}
13
- >
14
- <Alert icon={false} severity={"error"} variant="offline">
8
+ <Snackbar open={props.open} onClose={props.handleClose}>
9
+ <Alert icon={false} severity={props.severity}>
15
10
  {props.title && <AlertTitle>{props.title}</AlertTitle>}
16
11
  {props.text}
17
12
  </Alert>
@@ -5,6 +5,7 @@ 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";
8
9
 
9
10
  export const HawaTable = (props) => {
10
11
  let isArabic = props.lang === "ar";
@@ -73,3 +74,9 @@ export const HawaTable = (props) => {
73
74
  </TableContainer>
74
75
  );
75
76
  };
77
+ HawaTable.propTypes = {
78
+ lang: PropTypes.string,
79
+ columns: PropTypes.array,
80
+ rows: PropTypes.array,
81
+ end: PropTypes.array
82
+ };
@@ -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";
@@ -15,3 +15,6 @@ export * from "./HawaInputLabel";
15
15
  export * from "./HawaTypography";
16
16
  export * from "./HawaAlert";
17
17
  export * from "./HawaTable";
18
+ export * from "./HawaColorPicker";
19
+ export * from "./HawaSearchBar";
20
+ export * from "./HawaAccordian";
@@ -13,10 +13,11 @@ 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';
20
21
 
21
22
  const drawerWidth = 240;
22
23
 
@@ -92,32 +93,15 @@ export function HawaAppLayout(props) {
92
93
  const [anchorElNav, setAnchorElNav] = React.useState(null);
93
94
  const [anchorElUser, setAnchorElUser] = React.useState(null);
94
95
 
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
- };
96
+ const handleOpenNavMenu = (event) => setAnchorElNav(event.currentTarget);
97
+ const handleOpenUserMenu = (event) => setAnchorElUser(event.currentTarget);
98
+ const handleCloseNavMenu = () => setAnchorElNav(null);
99
+ const handleCloseUserMenu = () => setAnchorElUser(null);
100
+ const handleDrawerOpen = () => setOpen(true);
101
+ const handleDrawerClose = () => setOpen(false);
117
102
 
118
103
  return (
119
104
  <Box sx={{ display: "flex" }}>
120
- {/* <CssBaseline /> */}
121
105
  <AppBar variant="appbar" position="fixed" open={open}>
122
106
  <Toolbar variant="appbar">
123
107
  <IconButton
@@ -151,42 +135,14 @@ export function HawaAppLayout(props) {
151
135
  <Box>
152
136
  <Tooltip title="Open settings">
153
137
  <IconButton onClick={handleOpenUserMenu} sx={{ p: 0 }}>
154
- <Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" />
138
+ <Avatar />
155
139
  </IconButton>
156
140
  </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>
141
+ <HawaPopMenu
142
+ menuItems={props.accountMenu}
143
+ anchor={anchorElUser}
144
+ handleClose={handleCloseUserMenu}
145
+ />
190
146
  </Box>
191
147
  </div>
192
148
  </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.bc81d4bb.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.8ffaa38a.iframe.bundle.js"></script><script src="main.cbf6de78.iframe.bundle.js"></script></body></html>
@@ -56,4 +56,4 @@
56
56
 
57
57
 
58
58
 
59
- window['DOCS_MODE'] = false;</script><script src="runtime~main.c8dac23bc753439736f0.manager.bundle.js"></script><script src="vendors~main.a697e07137d366f95f76.manager.bundle.js"></script><script src="main.ac6e4b72b033097dad76.manager.bundle.js"></script></body></html>
59
+ window['DOCS_MODE'] = false;</script><script src="runtime~main.c8dac23bc753439736f0.manager.bundle.js"></script><script src="vendors~main.a697e07137d366f95f76.manager.bundle.js"></script><script src="main.9d5968bcf15d21f5487c.manager.bundle.js"></script></body></html>