@sikka/hawa 0.0.18 → 0.0.21
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.
- package/.github/workflows/hawa-publish-push.yml +0 -1
- package/README.md +0 -8
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/Account/UserProfileForm.js +1 -1
- package/src/blocks/Account/UserSettingsForm.js +2 -2
- package/src/blocks/AuthForms/SignInForm.js +2 -0
- package/src/blocks/AuthForms/SignUpForm.js +2 -0
- package/src/blocks/Payment/ChargeWalletForm.js +6 -1
- package/src/blocks/Payment/CheckoutForm.js +245 -0
- package/src/blocks/Payment/Confirmation.js +117 -0
- package/src/blocks/Payment/CreditCardForm.js +5 -4
- package/src/blocks/Payment/PayWithWallet.js +3 -3
- package/src/blocks/Payment/SelectPayment.js +1 -1
- package/src/blocks/Payment/index.js +2 -0
- package/src/elements/AdaptiveButton.js +0 -2
- package/src/elements/HawaListItem.js +2 -1
- package/src/elements/HawaLogoButton.js +1 -2
- package/src/elements/HawaPricingCard.js +2 -1
- package/src/elements/HawaSelect.js +26 -0
- package/src/elements/HawaSwitch.js +1 -1
- package/src/elements/HawaTable.js +39 -3
- package/src/elements/HawaTextField.js +10 -4
- package/src/elements/HawaTypography.js +0 -1
- package/src/elements/index.js +1 -0
- package/src/layout/HawaDialog.js +5 -7
- package/storybook-static/{0.42b12e88e2d7c13fc83c.manager.bundle.js → 0.f47eb24a4893a96ec307.manager.bundle.js} +1 -1
- package/storybook-static/{4.6efb4495a449edfbd0b0.manager.bundle.js → 4.0fcda1281dc1961dbe94.manager.bundle.js} +2 -2
- package/storybook-static/{4.6efb4495a449edfbd0b0.manager.bundle.js.LICENSE.txt → 4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/{5.fdf5c7287259585b43a3.manager.bundle.js → 5.63ab4f94d50a3acf080d.manager.bundle.js} +1 -1
- package/storybook-static/{6.19c48a8c.iframe.bundle.js → 6.13a534cb.iframe.bundle.js} +0 -0
- package/storybook-static/{6.8f7b9049856bdace5643.manager.bundle.js → 6.a6d45262f7e98f3f18d3.manager.bundle.js} +2 -2
- package/storybook-static/{6.8f7b9049856bdace5643.manager.bundle.js.LICENSE.txt → 6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/{7.dfc01154563c92ef9ccf.manager.bundle.js → 7.097710753af9a1c41b80.manager.bundle.js} +1 -1
- package/storybook-static/{8.c1928a9f13347c159613.manager.bundle.js → 8.76c3cbf398692028e834.manager.bundle.js} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.ac6e4b72b033097dad76.manager.bundle.js +1 -0
- package/storybook-static/main.e1b79522.iframe.bundle.js +1 -0
- package/storybook-static/{runtime~main.2c77505f.iframe.bundle.js → runtime~main.708d7ac1.iframe.bundle.js} +1 -1
- package/storybook-static/{runtime~main.1373976137528887a7ad.manager.bundle.js → runtime~main.c8dac23bc753439736f0.manager.bundle.js} +1 -1
- package/storybook-static/vendors~main.4ff76500.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.78f2cf4f.iframe.bundle.js.LICENSE.txt → vendors~main.4ff76500.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.4ff76500.iframe.bundle.js.map +1 -0
- package/storybook-static/vendors~main.a697e07137d366f95f76.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.41b22d5a0c6132a028f1.manager.bundle.js.LICENSE.txt → vendors~main.a697e07137d366f95f76.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/main.c1b22dad.iframe.bundle.js +0 -1
- package/storybook-static/main.d9e1c87c8c22202eed3c.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.41b22d5a0c6132a028f1.manager.bundle.js +0 -2
- package/storybook-static/vendors~main.78f2cf4f.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.78f2cf4f.iframe.bundle.js.map +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { HawaTextField, HawaTable, HawaSelect } from "../../elements";
|
|
3
|
+
import { Controller, FormProvider, useForm } from "react-hook-form";
|
|
4
|
+
import Button from "@mui/material/Button";
|
|
5
|
+
import Container from "@mui/material/Container";
|
|
6
|
+
import Typography from "@mui/material/Typography";
|
|
7
|
+
import Divider from "@mui/material/Divider";
|
|
8
|
+
|
|
9
|
+
export const ConfirmationPage = (props) => {
|
|
10
|
+
let isArabic = props.lang === "ar";
|
|
11
|
+
const methods = useForm();
|
|
12
|
+
const {
|
|
13
|
+
formState: { errors },
|
|
14
|
+
handleSubmit,
|
|
15
|
+
register,
|
|
16
|
+
control
|
|
17
|
+
} = methods;
|
|
18
|
+
|
|
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
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
style={{
|
|
35
|
+
display: "flex",
|
|
36
|
+
flexDirection: "column",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
alignItems: "center"
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<Container maxWidth="sm" style={{ direction: isArabic ? "rtl" : "ltr" }}>
|
|
42
|
+
<Typography
|
|
43
|
+
align="center"
|
|
44
|
+
variant="h3"
|
|
45
|
+
fontWeight={400}
|
|
46
|
+
style={{ marginBottom: 10 }}
|
|
47
|
+
>
|
|
48
|
+
{props.confirmationTitle}
|
|
49
|
+
</Typography>
|
|
50
|
+
<Divider variant="middle" />
|
|
51
|
+
|
|
52
|
+
<Typography
|
|
53
|
+
align="center"
|
|
54
|
+
variant="body1"
|
|
55
|
+
// fontWeight={500}
|
|
56
|
+
style={{ marginBottom: 10 }}
|
|
57
|
+
>
|
|
58
|
+
{props.texts.successMessage} <strong>{props.userEmail}</strong>
|
|
59
|
+
</Typography>
|
|
60
|
+
<Typography align="center" variant="body1">
|
|
61
|
+
{props.texts.yourOrderNumber}
|
|
62
|
+
</Typography>
|
|
63
|
+
<Typography
|
|
64
|
+
align="center"
|
|
65
|
+
variant="body1"
|
|
66
|
+
fontWeight={700}
|
|
67
|
+
style={{ marginBottom: 10 }}
|
|
68
|
+
>
|
|
69
|
+
{props.orderNumber}
|
|
70
|
+
</Typography>
|
|
71
|
+
<Divider variant="middle" />
|
|
72
|
+
|
|
73
|
+
<Typography
|
|
74
|
+
align="center"
|
|
75
|
+
variant="h5"
|
|
76
|
+
fontWeight={500}
|
|
77
|
+
style={{ marginBottom: 10 }}
|
|
78
|
+
>
|
|
79
|
+
{props.texts.orderDetails}
|
|
80
|
+
</Typography>
|
|
81
|
+
|
|
82
|
+
<HawaTable
|
|
83
|
+
lang={props.lang}
|
|
84
|
+
columns={["Product", "Price"]}
|
|
85
|
+
rows={props.products}
|
|
86
|
+
end={["Total", props.total]}
|
|
87
|
+
/>
|
|
88
|
+
<Divider variant="middle" />
|
|
89
|
+
<Button onClick={props.handlePrint} variant="contained">
|
|
90
|
+
{props.texts.print}
|
|
91
|
+
</Button>
|
|
92
|
+
<Button onClick={props.handleHistory} variant="last">
|
|
93
|
+
{props.texts.history}
|
|
94
|
+
</Button>
|
|
95
|
+
<Button onClick={props.handleHome} variant="last">
|
|
96
|
+
{props.texts.homePage}
|
|
97
|
+
</Button>
|
|
98
|
+
<Typography align="center" variant="body2" style={{ marginTop: 10 }}>
|
|
99
|
+
{props.texts.fasterPaymentNote}
|
|
100
|
+
</Typography>
|
|
101
|
+
</Container>
|
|
102
|
+
<a
|
|
103
|
+
style={{
|
|
104
|
+
marginTop: 10,
|
|
105
|
+
paddingTop: 10,
|
|
106
|
+
padding: 5,
|
|
107
|
+
cursor: "pointer"
|
|
108
|
+
}}
|
|
109
|
+
onClick={props.handleRefundPolicyLink}
|
|
110
|
+
>
|
|
111
|
+
<Typography align="center" variant="caption" fontWeight={500}>
|
|
112
|
+
{props.texts.refundPolicy}
|
|
113
|
+
</Typography>
|
|
114
|
+
</a>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HawaTextField
|
|
3
|
-
import { Box } from "../../layout";
|
|
2
|
+
import { HawaTextField } from "../../elements";
|
|
4
3
|
import { FormProvider, useForm } from "react-hook-form";
|
|
5
|
-
import
|
|
4
|
+
import Button from "@mui/material/Button";
|
|
5
|
+
import Container from "@mui/material/Container";
|
|
6
6
|
|
|
7
7
|
export const CreditCardForm = (props) => {
|
|
8
8
|
const methods = useForm();
|
|
@@ -19,8 +19,9 @@ export const CreditCardForm = (props) => {
|
|
|
19
19
|
fullWidth
|
|
20
20
|
name="password"
|
|
21
21
|
placeholder="Enter password"
|
|
22
|
-
type="
|
|
22
|
+
type="tel"
|
|
23
23
|
label="Card Number"
|
|
24
|
+
// variant="unscrollable"
|
|
24
25
|
// startAdornment={
|
|
25
26
|
// <InputAdornment position="start">
|
|
26
27
|
// <PasswordIcon />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import Typography from "@mui/material/Typography";
|
|
3
|
+
import Container from "@mui/material/Container";
|
|
4
|
+
import Button from "@mui/material/Button";
|
|
5
5
|
|
|
6
6
|
export const PayWithWallet = (props) => {
|
|
7
7
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { HawaTextField, HawaTypography, HawaLogoButton } from "../../elements";
|
|
4
|
-
import
|
|
4
|
+
import Container from "@mui/material/Container";
|
|
5
5
|
|
|
6
6
|
export const SelectPayment = (props) => {
|
|
7
7
|
return (
|
|
@@ -2,8 +2,6 @@ import React, { useState } from "react";
|
|
|
2
2
|
import Button from "@mui/material/Button";
|
|
3
3
|
import Tooltip from "@mui/material/Tooltip";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import { StyledTooltip } from "./StyledTooltip";
|
|
6
|
-
import { getTextColor } from "../util";
|
|
7
5
|
|
|
8
6
|
export const AdaptiveButton = (props) => {
|
|
9
7
|
if (props.showText) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import ListItemText from "@mui/material/ListItemButton";
|
|
3
|
+
import ListItemButton from "@mui/material/ListItemText";
|
|
3
4
|
import InboxIcon from "@mui/icons-material/MoveToInbox";
|
|
4
5
|
|
|
5
6
|
export const HawaListItem = (props) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
// import { styled, darken } from "@mui/material/styles";
|
|
3
2
|
import Button from "@mui/material/Button";
|
|
4
3
|
import GitHubIcon from "@mui/icons-material/GitHub";
|
|
5
4
|
import TwitterIcon from "@mui/icons-material/Twitter";
|
|
6
5
|
import WalletIcon from "@mui/icons-material/AccountBalanceWallet";
|
|
7
|
-
import
|
|
6
|
+
import Typography from "@mui/material/Typography";
|
|
8
7
|
|
|
9
8
|
export const HawaLogoButton = (props) => {
|
|
10
9
|
let logoElement = "";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Container from "@mui/material/Container";
|
|
3
|
-
import
|
|
3
|
+
import Button from "@mui/material/Button";
|
|
4
|
+
import Typography from "@mui/material/Typography";
|
|
4
5
|
import CheckIcon from "@mui/icons-material/CheckCircleOutlined";
|
|
5
6
|
export const HawaPricingCard = (props) => {
|
|
6
7
|
let isArabic = props.lang === "ar";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import InputLabel from "@mui/material/InputLabel";
|
|
3
|
+
import Select from "@mui/material/Select";
|
|
4
|
+
import Typography from "@mui/material/Typography";
|
|
5
|
+
|
|
6
|
+
export const HawaSelect = (props) => {
|
|
7
|
+
return (
|
|
8
|
+
<div style={{ width: "100%" }}>
|
|
9
|
+
<div
|
|
10
|
+
style={{
|
|
11
|
+
display: "flex",
|
|
12
|
+
flexDirection: "row",
|
|
13
|
+
justifyContent: "space-between",
|
|
14
|
+
alignItems: "center"
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<InputLabel>{props.label}</InputLabel>
|
|
18
|
+
|
|
19
|
+
{props.helperText && (
|
|
20
|
+
<Typography variant="validation">{props.helperText}</Typography>
|
|
21
|
+
)}
|
|
22
|
+
</div>
|
|
23
|
+
<Select {...props}>{props.children}</Select>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -7,25 +7,43 @@ import TableHead from "@mui/material/TableHead";
|
|
|
7
7
|
import TableRow from "@mui/material/TableRow";
|
|
8
8
|
|
|
9
9
|
export const HawaTable = (props) => {
|
|
10
|
+
let isArabic = props.lang === "ar";
|
|
10
11
|
return (
|
|
11
|
-
<TableContainer>
|
|
12
|
+
<TableContainer style={{ direction: isArabic ? "rtl" : "ltr" }}>
|
|
12
13
|
<Table aria-label="a dense table">
|
|
13
14
|
<TableHead>
|
|
14
15
|
<TableRow>
|
|
15
16
|
{props.columns.map((col, i) => (
|
|
16
|
-
<TableCell
|
|
17
|
+
<TableCell
|
|
18
|
+
align={isArabic ? "right" : "left"}
|
|
19
|
+
key={i}
|
|
20
|
+
style={{ fontWeight: 700 }}
|
|
21
|
+
variant={
|
|
22
|
+
i > 0 ? (isArabic ? "borderedRight" : "borderedLeft") : "body"
|
|
23
|
+
}
|
|
24
|
+
>
|
|
25
|
+
{col}
|
|
26
|
+
</TableCell>
|
|
17
27
|
))}
|
|
18
28
|
</TableRow>
|
|
19
29
|
</TableHead>
|
|
30
|
+
|
|
20
31
|
<TableBody>
|
|
21
32
|
{props.rows.map((singleRow, j) => (
|
|
22
33
|
<TableRow key={j}>
|
|
23
34
|
{singleRow.map((r, i) => (
|
|
24
35
|
<TableCell
|
|
36
|
+
align={isArabic ? "right" : "left"}
|
|
25
37
|
key={i}
|
|
26
38
|
component="th"
|
|
27
39
|
scope="row"
|
|
28
|
-
variant={
|
|
40
|
+
variant={
|
|
41
|
+
i > 0
|
|
42
|
+
? isArabic
|
|
43
|
+
? "borderedRight"
|
|
44
|
+
: "borderedLeft"
|
|
45
|
+
: "body"
|
|
46
|
+
}
|
|
29
47
|
>
|
|
30
48
|
{r}
|
|
31
49
|
</TableCell>
|
|
@@ -33,6 +51,24 @@ export const HawaTable = (props) => {
|
|
|
33
51
|
</TableRow>
|
|
34
52
|
))}
|
|
35
53
|
</TableBody>
|
|
54
|
+
{props.end && (
|
|
55
|
+
<TableRow>
|
|
56
|
+
{props.end.map((e, k) => (
|
|
57
|
+
<TableCell
|
|
58
|
+
align={isArabic ? "right" : "left"}
|
|
59
|
+
style={{ fontWeight: 700 }}
|
|
60
|
+
key={k}
|
|
61
|
+
component="th"
|
|
62
|
+
scope="row"
|
|
63
|
+
variant={
|
|
64
|
+
k > 0 ? (isArabic ? "borderedRight" : "borderedLeft") : "body"
|
|
65
|
+
}
|
|
66
|
+
>
|
|
67
|
+
{e}
|
|
68
|
+
</TableCell>
|
|
69
|
+
))}
|
|
70
|
+
</TableRow>
|
|
71
|
+
)}
|
|
36
72
|
</Table>
|
|
37
73
|
</TableContainer>
|
|
38
74
|
);
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Input from "@mui/material/Input";
|
|
3
3
|
import InputLabel from "@mui/material/InputLabel";
|
|
4
|
-
import
|
|
4
|
+
import Typography from "@mui/material/Typography";
|
|
5
5
|
|
|
6
6
|
export const HawaTextField = (props) => {
|
|
7
7
|
return (
|
|
8
|
-
|
|
8
|
+
<div
|
|
9
|
+
style={
|
|
10
|
+
props.inForm && {
|
|
11
|
+
width: "100%"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
>
|
|
9
15
|
<div
|
|
10
16
|
style={{
|
|
11
17
|
display: "flex",
|
|
@@ -14,13 +20,13 @@ export const HawaTextField = (props) => {
|
|
|
14
20
|
alignItems: "center"
|
|
15
21
|
}}
|
|
16
22
|
>
|
|
17
|
-
<InputLabel>{props.label}</InputLabel>
|
|
23
|
+
{props.label && <InputLabel>{props.label}</InputLabel>}
|
|
18
24
|
|
|
19
25
|
{props.helperText && (
|
|
20
26
|
<Typography variant="validation">{props.helperText}</Typography>
|
|
21
27
|
)}
|
|
22
28
|
</div>
|
|
23
29
|
<Input disableUnderline {...props} />
|
|
24
|
-
|
|
30
|
+
</div>
|
|
25
31
|
);
|
|
26
32
|
};
|
package/src/elements/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./HawaPricingCard";
|
|
|
8
8
|
export * from "./HawaSettingsRow";
|
|
9
9
|
export * from "./HawaLogoButton";
|
|
10
10
|
export * from "./HawaButton";
|
|
11
|
+
export * from "./HawaSelect";
|
|
11
12
|
export * from "./HawaTextField";
|
|
12
13
|
export * from "./HawaInputLabel";
|
|
13
14
|
export * from "./HawaTypography";
|
package/src/layout/HawaDialog.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import CloseIcon from "@mui/icons-material/Close";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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) => {
|