@sikka/hawa 0.0.27 → 0.0.28

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.
@@ -7,8 +7,7 @@ import PasswordIcon from "@mui/icons-material/HttpsOutlined";
7
7
  import Container from "@mui/material/Container";
8
8
  import Typography from "@mui/material/Typography";
9
9
  import Button from "@mui/material/Button";
10
- import Alert from "@mui/material/Alert";
11
- import AlertTitle from "@mui/material/AlertTitle";
10
+ import PropTypes from "prop-types";
12
11
  import Divider from "@mui/material/Divider";
13
12
 
14
13
  export const SignInForm = (props) => {
@@ -143,3 +142,14 @@ export const SignInForm = (props) => {
143
142
  </Container>
144
143
  );
145
144
  };
145
+ SignInForm.propTypes = {
146
+ texts: PropTypes.object,
147
+ viaGoogle: PropTypes.bool,
148
+ viaGithub: PropTypes.bool,
149
+ viaTwitter: PropTypes.bool,
150
+ handleSignIn: PropTypes.func,
151
+ handleRouteToSignUp: PropTypes.func,
152
+ handleGoogleSignIn: PropTypes.func,
153
+ handleGithubSignIn: PropTypes.func,
154
+ handleTwitterSignIn: PropTypes.func
155
+ };
@@ -33,9 +33,7 @@ export const SignUpForm = (props) => {
33
33
  {props.errorText}
34
34
  </Alert>
35
35
  )}
36
- {/* {props.error && (
37
- <HawaAlert text="This is a sign in alert" severity="error" />
38
- )} */}
36
+
39
37
  <FormProvider {...methods}>
40
38
  <form onSubmit={handleSubmit(props.handleSignUp)}>
41
39
  <Controller
@@ -166,9 +164,13 @@ export const SignUpForm = (props) => {
166
164
  };
167
165
 
168
166
  SignUpForm.propTypes = {
169
- theme: PropTypes.oneOf(["secondary", "primary"])
170
- // buttonLabel: PropTypes.string,
171
- // danger: PropTypes.bool,
172
- // disabled: PropTypes.bool,
173
- // showText: PropTypes.bool
167
+ texts: PropTypes.object,
168
+ viaGoogle: PropTypes.bool,
169
+ viaGithub: PropTypes.bool,
170
+ viaTwitter: PropTypes.bool,
171
+ handleSignUp: PropTypes.func,
172
+ handleRouteToSignIn: PropTypes.func,
173
+ handleGoogleSignUp: PropTypes.func,
174
+ handleGithubSignUp: PropTypes.func,
175
+ handleTwitterSignUp: PropTypes.func
174
176
  };
@@ -4,6 +4,7 @@ import { Controller, FormProvider, useForm } from "react-hook-form";
4
4
  import Container from "@mui/material/Container";
5
5
  import Button from "@mui/material/Button";
6
6
  import Typography from "@mui/material/Typography";
7
+ import PropTypes from "prop-types";
7
8
 
8
9
  export const ChargeWalletForm = (props) => {
9
10
  const [walletAmount, setWalletAmount] = useState(0);
@@ -33,21 +34,18 @@ export const ChargeWalletForm = (props) => {
33
34
  render={({ field }) => (
34
35
  <HawaTextField
35
36
  fullWidth
36
- placeholder="Enter amount"
37
+ placeholder={props.texts.amountLabel}
37
38
  type="number"
38
39
  value={field.value ?? ""}
39
- // helperText={errors.amount?.message}
40
40
  {...field}
41
41
  inputProps={{
42
42
  inputMode: "numeric",
43
- min: "0",
43
+ min: "1",
44
44
  max: "9999999",
45
45
  step: "0.01"
46
46
  }}
47
47
  onChange={(e) => {
48
- // e.preventDefault();
49
48
  field.onChange(parseFloat(e.target.value));
50
- console.log("e", e.target.value);
51
49
  setWalletAmount(e.target.value);
52
50
  }}
53
51
  />
@@ -60,11 +58,15 @@ export const ChargeWalletForm = (props) => {
60
58
  variant="last"
61
59
  onClick={props.handleSignIn}
62
60
  >
63
- {/* {props.texts.signInText} */}
64
- {"Charge Wallet"}
61
+ {props.texts.chargeWallet}
65
62
  </Button>
66
63
  </form>
67
64
  </FormProvider>
68
65
  </Container>
69
66
  );
70
67
  };
68
+
69
+ ChargeWalletForm.propTypes = {
70
+ texts: PropTypes.object,
71
+ handleChargeWallet: PropTypes.func
72
+ };
@@ -1,10 +1,11 @@
1
- import React, { useState } from "react";
1
+ import React from "react";
2
2
  import { HawaTextField, HawaTable, HawaSelect } from "../../elements";
3
3
  import { Controller, FormProvider, useForm } from "react-hook-form";
4
4
  import Button from "@mui/material/Button";
5
5
  import Container from "@mui/material/Container";
6
6
  import Typography from "@mui/material/Typography";
7
7
  import Divider from "@mui/material/Divider";
8
+ import PropTypes from "prop-types";
8
9
 
9
10
  export const CheckoutForm = (props) => {
10
11
  let isArabic = props.lang === "ar";
@@ -243,3 +244,12 @@ export const CheckoutForm = (props) => {
243
244
  </Container>
244
245
  );
245
246
  };
247
+
248
+ CheckoutForm.propTypes = {
249
+ texts: PropTypes.object,
250
+ lang: PropTypes.string,
251
+ countriesList: PropTypes.array,
252
+ products: PropTypes.array,
253
+ total: PropTypes.string,
254
+ handlePayNow: PropTypes.func
255
+ };
@@ -1,34 +1,14 @@
1
- import React, { useState } from "react";
2
- import { HawaTextField, HawaTable, HawaSelect } from "../../elements";
3
- import { Controller, FormProvider, useForm } from "react-hook-form";
1
+ import React from "react";
2
+ import { HawaTable } from "../../elements";
4
3
  import Button from "@mui/material/Button";
5
4
  import Container from "@mui/material/Container";
6
5
  import Typography from "@mui/material/Typography";
7
6
  import Divider from "@mui/material/Divider";
7
+ import PropTypes from "prop-types";
8
8
 
9
9
  export const ConfirmationPage = (props) => {
10
10
  let isArabic = props.lang === "ar";
11
- const methods = useForm();
12
- const {
13
- formState: { errors },
14
- handleSubmit,
15
- register,
16
- control
17
- } = methods;
18
11
 
19
- let containerStyle = {
20
- display: "flex",
21
- padding: 0,
22
- paddingRight: "0px !important",
23
- paddingLeft: "0px !important",
24
- flexDirection: {
25
- xs: "column",
26
- sm: "row",
27
- md: "row",
28
- lg: "row",
29
- xl: "row"
30
- }
31
- };
32
12
  return (
33
13
  <div
34
14
  style={{
@@ -118,3 +98,18 @@ export const ConfirmationPage = (props) => {
118
98
  </div>
119
99
  );
120
100
  };
101
+
102
+ ConfirmationPage.propTypes = {
103
+ texts: PropTypes.object,
104
+ products: PropTypes.array,
105
+ countriesList: PropTypes.array,
106
+ lang: PropTypes.string,
107
+ total: PropTypes.string,
108
+ userEmail: PropTypes.string,
109
+ orderNumber: PropTypes.string,
110
+ confirmationTitle: PropTypes.string,
111
+ handleHome: PropTypes.func,
112
+ handlePrint: PropTypes.func,
113
+ handleHistory: PropTypes.func,
114
+ handleRefundPolicyLink: PropTypes.func
115
+ };
@@ -1,8 +1,9 @@
1
1
  import useTranslation from "next-translate/useTranslation";
2
2
  import Button from "@mui/material/Button";
3
3
  import Chip from "@mui/material/Chip";
4
+ import PropTypes from "prop-types";
4
5
 
5
- const PaymentMethod = (props) => {
6
+ export const PaymentMethod = (props) => {
6
7
  const { t } = useTranslation("common");
7
8
  const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
8
9
  return (
@@ -77,7 +78,7 @@ const PaymentMethodButton = (props) => {
77
78
  opacity: props.chip ? 0.7 : 1,
78
79
  padding: 20,
79
80
  width: "90%",
80
- margin: 10,
81
+ margin: 10
81
82
  }}
82
83
  onClick={(e) => props.handlePaymentMethod(e, props.methodCode)}
83
84
  >
@@ -128,4 +129,8 @@ const PaymentMethodButton = (props) => {
128
129
  );
129
130
  };
130
131
 
131
- export default PaymentMethod;
132
+ PaymentMethod.propTypes = {
133
+ texts: PropTypes.object,
134
+ wallet: PropTypes.bool,
135
+ handlePaymentMethod: PropTypes.func
136
+ };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
- import { HawaTextField, HawaTypography, HawaLogoButton } from "../../elements";
3
+ import { HawaTypography, HawaLogoButton } from "../../elements";
4
4
  import Container from "@mui/material/Container";
5
5
 
6
6
  export const SelectPayment = (props) => {
@@ -60,12 +60,23 @@ export const SelectPayment = (props) => {
60
60
  );
61
61
  };
62
62
 
63
- HawaTextField.propTypes = {
64
- theme: PropTypes.oneOf(["secondary", "primary"]),
65
- viaApplePay: PropTypes.bool,
66
- viaGooglePay: PropTypes.bool,
63
+ SelectPayment.propTypes = {
64
+ viaMada: PropTypes.bool,
65
+ viaWallet: PropTypes.bool,
67
66
  viaSTCPay: PropTypes.bool,
68
- viaCreditCard: PropTypes.bool,
69
67
  viaPayPal: PropTypes.bool,
70
- handleApplePay: PropTypes.func
68
+ viaApplePay: PropTypes.bool,
69
+ viaCreditCard: PropTypes.bool,
70
+ madaLabel: PropTypes.string,
71
+ stcPayLabel: PropTypes.string,
72
+ paypalLabel: PropTypes.string,
73
+ walletLabel: PropTypes.string,
74
+ applePayLabel: PropTypes.string,
75
+ visaMasterLabel: PropTypes.string,
76
+ handleMada: PropTypes.func,
77
+ handleWallet: PropTypes.func,
78
+ handleSTCPay: PropTypes.func,
79
+ handlePayPal: PropTypes.func,
80
+ handleApplePay: PropTypes.func,
81
+ handleCreditCard: PropTypes.func
71
82
  };
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import Container from "@mui/material/Container";
3
3
  import { HawaPricingCard, HawaRadio } from "../../elements";
4
+ import PropTypes from "prop-types";
4
5
 
5
6
  export const PricingPlans = (props) => {
6
7
  const [currentCurrency, setCurrentCurrency] = useState("sar");
@@ -55,3 +56,8 @@ export const PricingPlans = (props) => {
55
56
  </Container>
56
57
  );
57
58
  };
59
+
60
+ PricingPlans.propTypes = {
61
+ plans: PropTypes.array,
62
+ lang: PropTypes.string
63
+ };
@@ -1,38 +1,5 @@
1
1
  import Button from "@mui/material/Button";
2
- // import { styled, darken } from "@mui/material/styles";
3
2
 
4
3
  export const ActionButton = (props) => {
5
- // const currentTheme = Object.keys(hawaTheme.actionButton).find(
6
- // (tName) => tName.toLowerCase() === themeName?.toLowerCase()
7
- // );
8
- // let actionButtonStyle = {};
9
-
10
- // if (currentTheme) {
11
- // actionButtonStyle = {
12
- // ...hawaTheme.actionButton[currentTheme],
13
- // margin: props.last ? 0 : hawaTheme.actionButton[currentTheme].margin,
14
- // marginTop: props.last
15
- // ? hawaTheme.actionButton[currentTheme].margin * 2
16
- // : 0,
17
- // "&:hover": {
18
- // backgroundColor: darken(
19
- // hawaTheme.actionButton[currentTheme]?.backgroundColor,
20
- // 0.1
21
- // )
22
- // }
23
- // };
24
- // } else {
25
- // actionButtonStyle = {
26
- // backgroundColor: "black",
27
- // color: "white",
28
- // padding: 10,
29
- // marginTop: props.last ? 10 * 2 : 0,
30
- // borderRadius: 0
31
- // };
32
- // }
33
-
34
- // const StyledButton = styled(Button)(({ theme }) => {
35
- // return { ...actionButtonStyle };
36
- // });
37
4
  return <Button {...props}>{props.text}</Button>;
38
5
  };
@@ -26,5 +26,6 @@ export const AdaptiveButton = (props) => {
26
26
 
27
27
  AdaptiveButton.propTypes = {
28
28
  buttonText: PropTypes.string,
29
+ onClick: PropTypes.func,
29
30
  showText: PropTypes.bool
30
31
  };
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import Alert from "@mui/material/Alert";
3
3
  import AlertTitle from "@mui/material/AlertTitle";
4
+ import PropTypes from "prop-types";
4
5
 
5
6
  export const HawaAlert = (props) => {
6
7
  return (
@@ -10,3 +11,9 @@ export const HawaAlert = (props) => {
10
11
  </Alert>
11
12
  );
12
13
  };
14
+ HawaAlert.propTypes = {
15
+ severity: PropTypes.string,
16
+ title: PropTypes.string,
17
+ text: PropTypes.string,
18
+ hideIcon: PropTypes.bool
19
+ };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import Container from "@mui/material/Container";
3
- import Button from "@mui/material/Button";
3
+ import PropTypes from "prop-types";
4
4
 
5
5
  export const HawaItemCard = (props) => {
6
6
  let isArabic = props.lang === "ar";
@@ -54,3 +54,7 @@ export const HawaItemCard = (props) => {
54
54
  </Container>
55
55
  );
56
56
  };
57
+ HawaItemCard.propTypes = {
58
+ lang: PropTypes.string,
59
+ onCardClick: PropTypes.func,
60
+ };
@@ -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,9 @@ export const HawaLogoButton = (props) => {
97
103
  </Button>
98
104
  );
99
105
  };
106
+
107
+ HawaLogoButton.propTypes = {
108
+ lang: PropTypes.string,
109
+ logo: PropTypes.string,
110
+ buttonText: PropTypes.string
111
+ };
@@ -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,8 @@ export const HawaPopMenu = (props) => {
37
38
  </Menu>
38
39
  );
39
40
  };
41
+
42
+ HawaPopMenu.propTypes = {
43
+ handleClose: PropTypes.func,
44
+ menuItems: PropTypes.array
45
+ };
@@ -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,9 @@ export const HawaRadio = (props) => {
28
29
  </Container>
29
30
  );
30
31
  };
32
+ HawaRadio.propTypes = {
33
+ lang: PropTypes.string,
34
+ options: PropTypes.array,
35
+ defaultValue: PropTypes.string,
36
+ location: PropTypes.string
37
+ };
@@ -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.b026595c.iframe.bundle.js"></script><script src="main.9dd59e4f.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>