@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
@@ -5,10 +5,9 @@ import InputAdornment from "@mui/material/InputAdornment";
5
5
  import PasswordIcon from "@mui/icons-material/HttpsOutlined";
6
6
  import Container from "@mui/material/Container";
7
7
  import Button from "@mui/material/Button";
8
+ import PropTypes from "prop-types";
8
9
 
9
10
  export const NewPasswordForm = (props) => {
10
- const [newPassword, setNewPassword] = useState("");
11
- const [confirmPassword, setConfirmPassword] = useState("");
12
11
  const [matchError, setMatchError] = useState(false);
13
12
  const methods = useForm();
14
13
  const {
@@ -48,7 +47,6 @@ export const NewPasswordForm = (props) => {
48
47
  value={field.value ?? ""}
49
48
  label={props.texts.passwordLabel}
50
49
  placeholder={props.texts.passwordPlaceholder}
51
- // onChange={(e) => setNewPassword(e.target.value)}
52
50
  helperText={errors.password?.message}
53
51
  startAdornment={
54
52
  <InputAdornment position="start">
@@ -72,7 +70,6 @@ export const NewPasswordForm = (props) => {
72
70
  value={field.value ?? ""}
73
71
  label={props.texts.confirmPasswordLabel}
74
72
  placeholder={props.texts.confirmPasswordPlaceholder}
75
- // onChange={(e) => setConfirmPassword(e.target.value)}
76
73
  helperText={errors.confirmPassword?.message}
77
74
  startAdornment={
78
75
  <InputAdornment position="start">
@@ -96,3 +93,24 @@ export const NewPasswordForm = (props) => {
96
93
  </Container>
97
94
  );
98
95
  };
96
+ NewPasswordForm.propTypes = {
97
+ /**
98
+ * An object of all the texts in the blocks
99
+ */
100
+ texts: PropTypes.shape({
101
+ emailLabel: PropTypes.string,
102
+ emailPlaceholder: PropTypes.string,
103
+ emailRequiredText: PropTypes.string,
104
+ passwordPlaceholder: PropTypes.string,
105
+ updatePassword: PropTypes.string,
106
+ passwordRequiredText: PropTypes.string,
107
+ passwordLabel: PropTypes.string,
108
+ confirmPasswordPlaceholder: PropTypes.string,
109
+ confirmPasswordLabel: PropTypes.string,
110
+ confirmPasswordRequiredText: PropTypes.string,
111
+ passwordMatchError: PropTypes.string,
112
+ forgotPasswordText: PropTypes.string,
113
+ passwordChanged: PropTypes.string
114
+ }),
115
+ handleNewPassword: PropTypes.func
116
+ };
@@ -5,6 +5,7 @@ import InputAdornment from "@mui/material/InputAdornment";
5
5
  import EmailIcon from "@mui/icons-material/MailOutline";
6
6
  import Container from "@mui/material/Container";
7
7
  import Button from "@mui/material/Button";
8
+ import PropTypes from "prop-types";
8
9
 
9
10
  export const ResetPasswordForm = (props) => {
10
11
  const methods = useForm();
@@ -58,3 +59,17 @@ export const ResetPasswordForm = (props) => {
58
59
  </Container>
59
60
  );
60
61
  };
62
+ ResetPasswordForm.propTypes = {
63
+ /**
64
+ * An object of all the texts in the blocks
65
+ */
66
+ texts: PropTypes.shape({
67
+ emailLabel: PropTypes.string,
68
+ emailPlaceholder: PropTypes.string,
69
+ emailRequiredText: PropTypes.string,
70
+ emailInvalidText: PropTypes.string,
71
+ resetPassword: PropTypes.string
72
+ }),
73
+ emailSentText: PropTypes.string,
74
+ handleResetPassword: PropTypes.func
75
+ };
@@ -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,32 @@ export const SignInForm = (props) => {
143
142
  </Container>
144
143
  );
145
144
  };
145
+ SignInForm.propTypes = {
146
+ /**
147
+ * An object of all the texts in the blocks
148
+ */
149
+ texts: PropTypes.shape({
150
+ emailLabel: PropTypes.string,
151
+ emailPlaceholder: PropTypes.string,
152
+ emailRequiredText: PropTypes.string,
153
+ emailInvalidText: PropTypes.string,
154
+ passwordLabel: PropTypes.string,
155
+ passwordPlaceholder: PropTypes.string,
156
+ passwordRequiredText: PropTypes.string,
157
+ forgotPasswordText: PropTypes.string,
158
+ newUserText: PropTypes.string,
159
+ signUpText: PropTypes.string,
160
+ signInText: PropTypes.string,
161
+ googleButtonLabel: PropTypes.string,
162
+ githubButtonLabel: PropTypes.string,
163
+ twitterButtonLabel: PropTypes.string
164
+ }),
165
+ viaGoogle: PropTypes.bool,
166
+ viaGithub: PropTypes.bool,
167
+ viaTwitter: PropTypes.bool,
168
+ handleSignIn: PropTypes.func,
169
+ handleRouteToSignUp: PropTypes.func,
170
+ handleGoogleSignIn: PropTypes.func,
171
+ handleGithubSignIn: PropTypes.func,
172
+ handleTwitterSignIn: PropTypes.func
173
+ };
@@ -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
@@ -165,10 +163,57 @@ export const SignUpForm = (props) => {
165
163
  );
166
164
  };
167
165
 
166
+ // fullNameLabel: "Full Name",
167
+ // fullNamePlaceholder: "Fulan AlFulani",
168
+ // fullNameRequiredText: "Full Name is required",
169
+ // emailLabel: "Email",
170
+ // emailPlaceholder: "Enter your email",
171
+ // emailRequiredText: "Email is required",
172
+ // emailInvalidText: "Invalid email address",
173
+ // passwordLabel: "Password",
174
+ // passwordPlaceholder: "Minimum 8 characters",
175
+ // passwordRequiredText: "Password is required",
176
+ // passwordTooShortText: "Password too short",
177
+ // forgotPasswordText: "Forgot password?",
178
+ // newUserText: "New user?",
179
+ // signUpText: "Sign up",
180
+ // signInText: "Sign in",
181
+ // existingUserText: "Existing User?",
182
+ // googleButtonLabel: "Sign in with Google",
183
+ // githubButtonLabel: "Sign in with Github",
184
+ // twitterButtonLabel: "Sign in with Twitter"
185
+
168
186
  SignUpForm.propTypes = {
169
- theme: PropTypes.oneOf(["secondary", "primary"])
170
- // buttonLabel: PropTypes.string,
171
- // danger: PropTypes.bool,
172
- // disabled: PropTypes.bool,
173
- // showText: PropTypes.bool
187
+ /**
188
+ * An object of all the texts in the blocks
189
+ */
190
+ texts: PropTypes.shape({
191
+ fullNameLabel: PropTypes.string,
192
+ fullNamePlaceholder: PropTypes.string,
193
+ fullNameRequiredText: PropTypes.string,
194
+ emailLabel: PropTypes.string,
195
+ emailPlaceholder: PropTypes.string,
196
+ emailRequiredText: PropTypes.string,
197
+ emailInvalidText: PropTypes.string,
198
+ passwordLabel: PropTypes.string,
199
+ passwordPlaceholder: PropTypes.string,
200
+ passwordRequiredText: PropTypes.string,
201
+ passwordTooShortText: PropTypes.string,
202
+ forgotPasswordText: PropTypes.string,
203
+ newUserText: PropTypes.string,
204
+ signUpText: PropTypes.string,
205
+ signInText: PropTypes.string,
206
+ existingUserText: PropTypes.string,
207
+ googleButtonLabel: PropTypes.string,
208
+ githubButtonLabel: PropTypes.string,
209
+ twitterButtonLabel: PropTypes.string
210
+ }),
211
+ viaGoogle: PropTypes.bool,
212
+ viaGithub: PropTypes.bool,
213
+ viaTwitter: PropTypes.bool,
214
+ handleSignUp: PropTypes.func,
215
+ handleRouteToSignIn: PropTypes.func,
216
+ handleGoogleSignUp: PropTypes.func,
217
+ handleGithubSignUp: PropTypes.func,
218
+ handleTwitterSignUp: PropTypes.func
174
219
  };
@@ -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,18 @@ 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.shape({
71
+ amountLabel: PropTypes.string,
72
+ chargeWallet: PropTypes.string
73
+ }),
74
+ handleChargeWallet: PropTypes.func
75
+ };
@@ -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,28 @@ export const CheckoutForm = (props) => {
243
244
  </Container>
244
245
  );
245
246
  };
247
+
248
+ CheckoutForm.propTypes = {
249
+ texts: PropTypes.shape({
250
+ orderDetails: PropTypes.string,
251
+ billingAddress: PropTypes.string,
252
+ payNow: PropTypes.string,
253
+ emailLabel: PropTypes.string,
254
+ emailRequiredText: PropTypes.string,
255
+ emailInvalidText: PropTypes.string,
256
+ firstNameLabel: PropTypes.string,
257
+ required: PropTypes.string,
258
+ lastNameLabel: PropTypes.string,
259
+ streetAddressLabel: PropTypes.string,
260
+ buildingNumberLabel: PropTypes.string,
261
+ cityLabel: PropTypes.string,
262
+ stateLabel: PropTypes.string,
263
+ countryLabel: PropTypes.string,
264
+ zipCodeLabel: PropTypes.string
265
+ }),
266
+ lang: PropTypes.string,
267
+ countriesList: PropTypes.array,
268
+ products: PropTypes.array,
269
+ total: PropTypes.string,
270
+ handlePayNow: PropTypes.func
271
+ };
@@ -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,41 @@ export const ConfirmationPage = (props) => {
118
98
  </div>
119
99
  );
120
100
  };
101
+
102
+ ConfirmationPage.propTypes = {
103
+ texts: PropTypes.shape({
104
+ print: PropTypes.string,
105
+ history: PropTypes.string,
106
+ homePage: PropTypes.string,
107
+ successMessage: PropTypes.string,
108
+ orderDetails: PropTypes.string,
109
+ fasterPaymentNote: PropTypes.string,
110
+ billingAddress: PropTypes.string,
111
+ payNow: PropTypes.string,
112
+ yourOrderNumber: PropTypes.string,
113
+ emailLabel: PropTypes.string,
114
+ emailRequiredText: PropTypes.string,
115
+ emailInvalidText: PropTypes.string,
116
+ firstNameLabel: PropTypes.string,
117
+ required: PropTypes.string,
118
+ lastNameLabel: PropTypes.string,
119
+ streetAddressLabel: PropTypes.string,
120
+ buildingNumberLabel: PropTypes.string,
121
+ cityLabel: PropTypes.string,
122
+ stateLabel: PropTypes.string,
123
+ countryLabel: PropTypes.string,
124
+ zipCodeLabel: PropTypes.string,
125
+ refundPolicy: PropTypes.string
126
+ }),
127
+ products: PropTypes.array,
128
+ countriesList: PropTypes.array,
129
+ lang: PropTypes.string,
130
+ total: PropTypes.string,
131
+ userEmail: PropTypes.string,
132
+ orderNumber: PropTypes.string,
133
+ confirmationTitle: PropTypes.string,
134
+ handleHome: PropTypes.func,
135
+ handlePrint: PropTypes.func,
136
+ handleHistory: PropTypes.func,
137
+ handleRefundPolicyLink: PropTypes.func
138
+ };
@@ -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,14 +78,13 @@ 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
  >
84
85
  {props.imageURL ? (
85
86
  <div
86
87
  style={{
87
- // backgroundColor: "red",
88
88
  width: "50%",
89
89
  textAlign: "right",
90
90
  paddingRight: 20
@@ -92,14 +92,7 @@ const PaymentMethodButton = (props) => {
92
92
  >
93
93
  <img
94
94
  src={props.imageURL}
95
- // src={`https://qawaim-images.s3-ap-southeast-1.amazonaws.com/payments/visa.png`}
96
- // alt=""
97
- // srcset=""
98
- // height={"100%"}
99
- // width={"30%"}
100
95
  style={{
101
- // height: "100%",
102
- // aspectRatio: "6/4",
103
96
  maxWidth: 70,
104
97
  maxHeight: 70,
105
98
  height: "auto"
@@ -109,7 +102,6 @@ const PaymentMethodButton = (props) => {
109
102
  ) : null}
110
103
  <div
111
104
  style={{
112
- // backgroundColor: "blue",
113
105
  width: "50%",
114
106
  textAlign: props.imageURL ? "left" : "center"
115
107
  }}
@@ -128,4 +120,7 @@ const PaymentMethodButton = (props) => {
128
120
  );
129
121
  };
130
122
 
131
- export default PaymentMethod;
123
+ PaymentMethod.propTypes = {
124
+ wallet: PropTypes.bool,
125
+ handlePaymentMethod: PropTypes.func
126
+ };
@@ -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,22 @@ export const PricingPlans = (props) => {
55
56
  </Container>
56
57
  );
57
58
  };
59
+
60
+ PricingPlans.propTypes = {
61
+ plans: PropTypes.arrayOf(
62
+ PropTypes.shape({
63
+ title: PropTypes.string,
64
+ title_ar: PropTypes.string,
65
+ subtitle: PropTypes.string,
66
+ subtitle_ar: PropTypes.string,
67
+ price: PropTypes.number,
68
+ currency: PropTypes.string,
69
+ cycleText: PropTypes.string,
70
+ buttonText: PropTypes.string,
71
+ features: PropTypes.array,
72
+ features_ar: PropTypes.array,
73
+ selectedPlan: PropTypes.bool
74
+ })
75
+ ),
76
+ lang: PropTypes.string
77
+ };
@@ -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
  };
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import ExpandMore from "@mui/icons-material/ExpandMore";
3
+ import Typography from "@mui/material/Typography";
4
+ import Accordion from "@mui/material/Accordion";
5
+ import AccordionSummary from "@mui/material/AccordionSummary";
6
+ import AccordionDetails from "@mui/material/AccordionDetails";
7
+ import PropTypes from "prop-types";
8
+
9
+ export const HawaAccordian = (props) => {
10
+ return (
11
+ <Accordion elevation={0}>
12
+ <AccordionSummary
13
+ expandIcon={<ExpandMore />}
14
+ aria-controls="panel1a-content"
15
+ id="panel1a-header"
16
+ >
17
+ <Typography>{props.title}</Typography>
18
+ </AccordionSummary>
19
+ <AccordionDetails>
20
+ <Typography>{props.content} </Typography>
21
+ </AccordionDetails>
22
+ </Accordion>
23
+ );
24
+ };
25
+ HawaAccordian.propTypes = {
26
+ title: PropTypes.string,
27
+ content: PropTypes.string
28
+ };
@@ -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,18 @@ export const HawaAlert = (props) => {
10
11
  </Alert>
11
12
  );
12
13
  };
14
+ HawaAlert.propTypes = {
15
+ /**
16
+ * The severity of the alert. This defines the color and icon used.
17
+ */
18
+ severity: PropTypes.oneOf(["error", "info", "success", "warning"]),
19
+ /**
20
+ * The title of the alert in bold. Can be left empty.
21
+ */
22
+ title: PropTypes.string,
23
+ /**
24
+ * The text of the alert.
25
+ */
26
+ text: PropTypes.string,
27
+ hideIcon: PropTypes.bool
28
+ };
@@ -0,0 +1,61 @@
1
+ import { useTheme } from "@mui/system";
2
+ import React from "react";
3
+ import styled from "@emotion/styled";
4
+ import PropTypes from "prop-types";
5
+
6
+ const ColorInput = styled.input`
7
+ -webkit-appearance: none;
8
+ -moz-appearance: none;
9
+ appearance: none;
10
+ border: none;
11
+ cursor: pointer;
12
+ height: 35px;
13
+ border-radius: ${(props) => props.borderRadius}px;
14
+ background-color: ${(props) => props.value};
15
+ &::-webkit-color-swatch {
16
+ border: none;
17
+ }
18
+ &::-moz-color-swatch {
19
+ border: none;
20
+ }
21
+ `;
22
+ const ColorText = styled.input`
23
+ -webkit-appearance: none;
24
+ -moz-appearance: none;
25
+ appearance: none;
26
+ border: none;
27
+ // height: 30px;
28
+ padding: 10px;
29
+ border-radius: ${(props) => props.borderRadius}px;
30
+ &::-webkit-color-swatch {
31
+ border: none;
32
+ }
33
+ &::-moz-color-swatch {
34
+ border: none;
35
+ }
36
+ `;
37
+ export const HawaColorPicker = (props) => {
38
+ const theme = useTheme();
39
+ return (
40
+ <div style={{ display: "flex", flexDirection: "row" }}>
41
+ <ColorText
42
+ type={"text"}
43
+ value={props.color}
44
+ borderRadius={theme.allBorderRadius}
45
+ onChange={props.handleChange}
46
+ />
47
+ <div style={{ width: 10 }} />
48
+ <ColorInput
49
+ type={"color"}
50
+ value={props.color}
51
+ onChange={props.handleChange}
52
+ borderRadius={theme.allBorderRadius}
53
+ />
54
+ </div>
55
+ );
56
+ };
57
+
58
+ HawaColorPicker.propTypes = {
59
+ color: PropTypes.string,
60
+ handleChange: PropTypes.func
61
+ };
@@ -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
+ };