@sikka/hawa 0.0.12 → 0.0.15
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/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/Account/UserProfileForm.js +3 -4
- package/src/blocks/Account/UserSettingsForm.js +3 -7
- package/src/blocks/AuthForms/NewPasswordForm.js +57 -38
- package/src/blocks/AuthForms/ResetPasswordForm.js +36 -39
- package/src/blocks/AuthForms/SignInForm.js +73 -65
- package/src/blocks/AuthForms/SignUpForm.js +61 -44
- package/src/blocks/Payment/ChargeWalletForm.js +1 -1
- package/src/blocks/Payment/CreditCardForm.js +1 -1
- package/src/blocks/Payment/PayWithWallet.js +1 -1
- package/src/blocks/Payment/SelectPayment.js +1 -1
- package/src/blocks/Pricing/PricingPlans.js +57 -0
- package/src/{ui → elements}/ActionButton.js +0 -0
- package/src/elements/AdaptiveButton.js +32 -0
- package/src/{ui → elements}/AutoCompleteField.js +0 -0
- package/src/{ui → elements}/DragDropImages.js +0 -0
- package/src/{ui → elements}/Hawa.js +0 -0
- package/src/{ui → elements}/HawaAlert.js +1 -1
- package/src/elements/HawaAppBar.js +139 -0
- package/src/{ui → elements}/HawaButton.js +0 -0
- package/src/{ui → elements}/HawaCheckbox.js +0 -0
- package/src/{ui → elements}/HawaInputLabel.js +0 -0
- package/src/elements/HawaListItem.js +21 -0
- package/src/{ui → elements}/HawaLogoButton.js +0 -0
- package/src/elements/HawaPricingCard.js +133 -0
- package/src/{ui → elements}/HawaRadio.js +1 -1
- package/src/elements/HawaSettingsRow.js +27 -0
- package/src/elements/HawaSwitch.js +6 -0
- package/src/{ui → elements}/HawaTextArea.js +0 -0
- package/src/elements/HawaTextField.js +26 -0
- package/src/{ui → elements}/HawaTypography.js +0 -0
- package/src/{ui → elements}/RadioBox.js +0 -0
- package/src/{ui → elements}/Row.js +0 -0
- package/src/{ui → elements}/SelectedField.js +0 -0
- package/src/{ui → elements}/StyledTooltip.js +0 -0
- package/src/{ui → elements}/TabPanel.js +0 -0
- package/src/{ui → elements}/index.js +3 -1
- package/src/layout/HawaAppLayout.js +246 -0
- package/src/layout/index.js +1 -0
- package/src/stories/BlocksStories/Account/UserSettings.stories.js +36 -2
- package/src/stories/BlocksStories/Auth/NewPassword.stories.js +2 -1
- package/src/stories/BlocksStories/Auth/ResetPassword.stories.js +1 -2
- package/src/stories/BlocksStories/Auth/SignUp.stories.js +1 -0
- package/src/stories/BlocksStories/Pricing/BillingPlans.stories.js +63 -0
- package/src/stories/BlocksStories/Pricing/LandingPlans.stories.js +63 -0
- package/src/stories/ElementsStories/AdaptiveButton.stories.js +51 -0
- package/src/stories/{UIStories → ElementsStories}/Alert.stories.js +1 -1
- package/src/stories/{UIStories → ElementsStories}/InputLabel.stories.js +1 -1
- package/src/stories/ElementsStories/ItemCard.stories.js +18 -0
- package/src/stories/{UIStories → ElementsStories}/LogoButtons.stories.js +1 -1
- package/src/stories/ElementsStories/PricingCard.stories.js +91 -0
- package/src/stories/ElementsStories/RadioSelector.stories.js +36 -0
- package/src/stories/ElementsStories/SettingsRow.stories.js +63 -0
- package/src/stories/{UIStories → ElementsStories}/TextField.stories.js +1 -1
- package/src/stories/LayoutStories/AppBar.stories.js +29 -0
- package/src/stories/LayoutStories/AppLayout.stories.js +52 -0
- package/src/stories/LayoutStories/Box.stories.js +4 -13
- package/src/styles.css +1 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.66955578.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.b4186832.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.f8d30727.iframe.bundle.js.LICENSE.txt → vendors~main.b4186832.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.b4186832.iframe.bundle.js.map +1 -0
- package/src/stories/UIStories/ActionButton.stories.js +0 -41
- package/src/stories/UIStories/AdaptiveButton.stories.js +0 -76
- package/src/stories/UIStories/CheckBox.stories.js +0 -34
- package/src/stories/UIStories/RadioSelector.stories.js +0 -24
- package/src/stories/UIStories/SettingsRow.stories.js +0 -51
- package/src/themes/HawaProvider.js +0 -192
- package/src/themes/QawaimTheme.js +0 -199
- package/src/ui/AdaptiveButton.js +0 -131
- package/src/ui/HawaSettingsRow.js +0 -45
- package/src/ui/HawaTextField.js +0 -160
- package/storybook-static/main.a9a16923.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.f8d30727.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.f8d30727.iframe.bundle.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HawaTextField, HawaLogoButton } from "../../
|
|
2
|
+
import { HawaTextField, HawaLogoButton } from "../../elements";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { FormProvider, useForm } from "react-hook-form";
|
|
4
|
+
import { Controller, FormProvider, useForm } from "react-hook-form";
|
|
5
5
|
import PersonIcon from "@mui/icons-material/PermIdentityOutlined";
|
|
6
6
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
7
7
|
import EmailIcon from "@mui/icons-material/MailOutline";
|
|
@@ -16,7 +16,8 @@ export const SignUpForm = (props) => {
|
|
|
16
16
|
const methods = useForm();
|
|
17
17
|
const {
|
|
18
18
|
formState: { errors },
|
|
19
|
-
handleSubmit
|
|
19
|
+
handleSubmit,
|
|
20
|
+
control
|
|
20
21
|
} = methods;
|
|
21
22
|
|
|
22
23
|
return (
|
|
@@ -32,32 +33,47 @@ export const SignUpForm = (props) => {
|
|
|
32
33
|
)} */}
|
|
33
34
|
<FormProvider {...methods}>
|
|
34
35
|
<form onSubmit={handleSubmit(props.handleSignUp)}>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
type="text"
|
|
38
|
-
label={props.texts.fullNameLabel}
|
|
36
|
+
<Controller
|
|
37
|
+
control={control}
|
|
39
38
|
name="fullName"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
render={({ field }) => (
|
|
40
|
+
<HawaTextField
|
|
41
|
+
fullWidth
|
|
42
|
+
type="text"
|
|
43
|
+
value={field.value ?? ""}
|
|
44
|
+
label={props.texts.fullNameLabel}
|
|
45
|
+
placeholder={props.texts.fullNamePlaceholder}
|
|
46
|
+
helperText={errors.fullName?.message}
|
|
47
|
+
startAdornment={
|
|
48
|
+
<InputAdornment position="start">
|
|
49
|
+
<PersonIcon />
|
|
50
|
+
</InputAdornment>
|
|
51
|
+
}
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
|
+
rules={{
|
|
55
|
+
required: props.texts.fullNameRequiredText
|
|
56
|
+
}}
|
|
48
57
|
/>
|
|
49
58
|
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
type="text"
|
|
53
|
-
label={props.texts.emailLabel}
|
|
54
|
-
placeholder={props.texts.emailPlaceholder}
|
|
59
|
+
<Controller
|
|
60
|
+
control={control}
|
|
55
61
|
name="email"
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
render={({ field }) => (
|
|
63
|
+
<HawaTextField
|
|
64
|
+
fullWidth
|
|
65
|
+
type="text"
|
|
66
|
+
value={field.value ?? ""}
|
|
67
|
+
label={props.texts.emailLabel}
|
|
68
|
+
helperText={errors.email?.message}
|
|
69
|
+
placeholder={props.texts.emailPlaceholder}
|
|
70
|
+
startAdornment={
|
|
71
|
+
<InputAdornment position="start">
|
|
72
|
+
<EmailIcon />
|
|
73
|
+
</InputAdornment>
|
|
74
|
+
}
|
|
75
|
+
/>
|
|
76
|
+
)}
|
|
61
77
|
rules={{
|
|
62
78
|
required: props.texts.emailRequiredText,
|
|
63
79
|
pattern: {
|
|
@@ -66,27 +82,28 @@ export const SignUpForm = (props) => {
|
|
|
66
82
|
message: props.texts.emailInvalidText
|
|
67
83
|
}
|
|
68
84
|
}}
|
|
69
|
-
helperText={errors.email?.message}
|
|
70
85
|
/>
|
|
71
|
-
<
|
|
72
|
-
|
|
86
|
+
<Controller
|
|
87
|
+
control={control}
|
|
73
88
|
name="password"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
render={({ field }) => (
|
|
90
|
+
<HawaTextField
|
|
91
|
+
fullWidth
|
|
92
|
+
type="password"
|
|
93
|
+
defaultValue={field.value ?? ""}
|
|
94
|
+
value={field.value ?? ""}
|
|
95
|
+
label={props.texts.passwordLabel}
|
|
96
|
+
placeholder={props.texts.passwordPlaceholder}
|
|
97
|
+
helperText={errors.password?.message}
|
|
98
|
+
startAdornment={
|
|
99
|
+
<InputAdornment position="start">
|
|
100
|
+
<PasswordIcon />
|
|
101
|
+
</InputAdornment>
|
|
102
|
+
}
|
|
103
|
+
{...field}
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
rules={{ required: props.texts.passwordRequiredText }}
|
|
90
107
|
/>
|
|
91
108
|
|
|
92
109
|
<Button fullWidth variant="last" type="submit">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { HawaTextField } from "../../
|
|
2
|
+
import { HawaTextField } from "../../elements";
|
|
3
3
|
import { FormProvider, useForm } from "react-hook-form";
|
|
4
4
|
import Container from "@mui/material/Container";
|
|
5
5
|
import Button from "@mui/material/Button";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HawaTextField, ActionButton } from "../../
|
|
2
|
+
import { HawaTextField, ActionButton } from "../../elements";
|
|
3
3
|
import { Box } from "../../layout";
|
|
4
4
|
import { FormProvider, useForm } from "react-hook-form";
|
|
5
5
|
import { Button, Container } from "@mui/material";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import { HawaTextField, HawaTypography, HawaLogoButton } from "../../
|
|
3
|
+
import { HawaTextField, HawaTypography, HawaLogoButton } from "../../elements";
|
|
4
4
|
import { Container } from "@mui/material";
|
|
5
5
|
|
|
6
6
|
export const SelectPayment = (props) => {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import Container from "@mui/material/Container";
|
|
3
|
+
import { HawaPricingCard, HawaRadio } from "../../elements";
|
|
4
|
+
|
|
5
|
+
export const PricingPlans = (props) => {
|
|
6
|
+
const [currentCurrency, setCurrentCurrency] = useState("sar");
|
|
7
|
+
const [currentCycle, setCurrentCycle] = useState("monthly");
|
|
8
|
+
return (
|
|
9
|
+
<Container style={{ width: "fit-content" }} variant="plain">
|
|
10
|
+
<div
|
|
11
|
+
style={{
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "row",
|
|
14
|
+
justifyContent: "space-between",
|
|
15
|
+
marginBottom: 10
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
<HawaRadio
|
|
19
|
+
location="inPricing"
|
|
20
|
+
handleChange={(e) => setCurrentCycle(e)}
|
|
21
|
+
defaultValue="monthly"
|
|
22
|
+
options={[
|
|
23
|
+
{ label: `Monthly`, value: `monthly` },
|
|
24
|
+
{ label: `3 Months`, value: `3-months` },
|
|
25
|
+
{ label: `6 Months`, value: `6-months` },
|
|
26
|
+
{ label: `Annually`, value: `annually` }
|
|
27
|
+
]}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<HawaRadio
|
|
31
|
+
location="inPricing"
|
|
32
|
+
handleChange={(e) => {
|
|
33
|
+
setCurrentCurrency(e);
|
|
34
|
+
}}
|
|
35
|
+
defaultValue="sar"
|
|
36
|
+
options={[
|
|
37
|
+
{ label: `USD`, value: `usd` },
|
|
38
|
+
{ label: `SAR`, value: `sar` }
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<Container variant="pricing">
|
|
44
|
+
{props.plans.map((plan) => {
|
|
45
|
+
return (
|
|
46
|
+
<HawaPricingCard
|
|
47
|
+
lang={props.lang}
|
|
48
|
+
{...plan}
|
|
49
|
+
currency={currentCurrency}
|
|
50
|
+
cycleText={currentCycle}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
})}
|
|
54
|
+
</Container>
|
|
55
|
+
</Container>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import Tooltip from "@mui/material/Tooltip";
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
import { StyledTooltip } from "./StyledTooltip";
|
|
6
|
+
import { getTextColor } from "../util";
|
|
7
|
+
|
|
8
|
+
export const AdaptiveButton = (props) => {
|
|
9
|
+
if (props.showText) {
|
|
10
|
+
return (
|
|
11
|
+
<Button variant="adaptive-dark" onClick={props.onClick}>
|
|
12
|
+
{props.icon}
|
|
13
|
+
<div style={{ width: 10 }} />
|
|
14
|
+
{props.buttonText}
|
|
15
|
+
</Button>
|
|
16
|
+
);
|
|
17
|
+
} else {
|
|
18
|
+
//icon only
|
|
19
|
+
return (
|
|
20
|
+
<Tooltip title={props.buttonText} placement="top">
|
|
21
|
+
<Button variant="adaptive-dark" onClick={props.onClick}>
|
|
22
|
+
{props.icon}
|
|
23
|
+
</Button>
|
|
24
|
+
</Tooltip>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
AdaptiveButton.propTypes = {
|
|
30
|
+
buttonText: PropTypes.string,
|
|
31
|
+
showText: PropTypes.bool
|
|
32
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import AppBar from "@mui/material/AppBar";
|
|
3
|
+
import Box from "@mui/material/Box";
|
|
4
|
+
import Toolbar from "@mui/material/Toolbar";
|
|
5
|
+
import IconButton from "@mui/material/IconButton";
|
|
6
|
+
import Typography from "@mui/material/Typography";
|
|
7
|
+
import Menu from "@mui/material/Menu";
|
|
8
|
+
import MenuIcon from "@mui/icons-material/Menu";
|
|
9
|
+
import Container from "@mui/material/Container";
|
|
10
|
+
import Avatar from "@mui/material/Avatar";
|
|
11
|
+
import Button from "@mui/material/Button";
|
|
12
|
+
import Tooltip from "@mui/material/Tooltip";
|
|
13
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
14
|
+
|
|
15
|
+
const pages = ["Products", "Pricing", "Blog"];
|
|
16
|
+
const settings = ["Profile", "Account", "Dashboard", "Logout"];
|
|
17
|
+
|
|
18
|
+
export const HawaAppBar = (props) => {
|
|
19
|
+
const [anchorElNav, setAnchorElNav] = React.useState(null);
|
|
20
|
+
const [anchorElUser, setAnchorElUser] = React.useState(null);
|
|
21
|
+
|
|
22
|
+
const handleOpenNavMenu = (event) => {
|
|
23
|
+
setAnchorElNav(event.currentTarget);
|
|
24
|
+
};
|
|
25
|
+
const handleOpenUserMenu = (event) => {
|
|
26
|
+
setAnchorElUser(event.currentTarget);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleCloseNavMenu = () => {
|
|
30
|
+
setAnchorElNav(null);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const handleCloseUserMenu = () => {
|
|
34
|
+
setAnchorElUser(null);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<AppBar position="static">
|
|
39
|
+
<Container maxWidth="xl" variant="appbar">
|
|
40
|
+
<Toolbar disableGutters>
|
|
41
|
+
<Typography
|
|
42
|
+
variant="h6"
|
|
43
|
+
noWrap
|
|
44
|
+
component="div"
|
|
45
|
+
sx={{ mr: 2, display: { xs: "none", md: "flex" } }}
|
|
46
|
+
>
|
|
47
|
+
LOGO
|
|
48
|
+
</Typography>
|
|
49
|
+
|
|
50
|
+
<Box sx={{ flexGrow: 1, display: { xs: "flex", md: "none" } }}>
|
|
51
|
+
<IconButton
|
|
52
|
+
size="large"
|
|
53
|
+
aria-label="account of current user"
|
|
54
|
+
aria-controls="menu-appbar"
|
|
55
|
+
aria-haspopup="true"
|
|
56
|
+
onClick={props.handleOpenSideMenu}
|
|
57
|
+
color="inherit"
|
|
58
|
+
>
|
|
59
|
+
<MenuIcon />
|
|
60
|
+
</IconButton>
|
|
61
|
+
<Menu
|
|
62
|
+
id="menu-appbar"
|
|
63
|
+
anchorEl={anchorElNav}
|
|
64
|
+
anchorOrigin={{
|
|
65
|
+
vertical: "bottom",
|
|
66
|
+
horizontal: "left"
|
|
67
|
+
}}
|
|
68
|
+
keepMounted
|
|
69
|
+
transformOrigin={{
|
|
70
|
+
vertical: "top",
|
|
71
|
+
horizontal: "left"
|
|
72
|
+
}}
|
|
73
|
+
open={Boolean(anchorElNav)}
|
|
74
|
+
onClose={handleCloseNavMenu}
|
|
75
|
+
sx={{
|
|
76
|
+
display: { xs: "block", md: "none" }
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
{pages.map((page) => (
|
|
80
|
+
<MenuItem key={page} onClick={handleCloseNavMenu}>
|
|
81
|
+
<Typography textAlign="center">{page}</Typography>
|
|
82
|
+
</MenuItem>
|
|
83
|
+
))}
|
|
84
|
+
</Menu>
|
|
85
|
+
</Box>
|
|
86
|
+
<Typography
|
|
87
|
+
variant="h6"
|
|
88
|
+
noWrap
|
|
89
|
+
component="div"
|
|
90
|
+
sx={{ flexGrow: 1, display: { xs: "flex", md: "none" } }}
|
|
91
|
+
>
|
|
92
|
+
LOGO
|
|
93
|
+
</Typography>
|
|
94
|
+
<Box sx={{ flexGrow: 1, display: { xs: "none", md: "flex" } }}>
|
|
95
|
+
{pages.map((page) => (
|
|
96
|
+
<Button
|
|
97
|
+
key={page}
|
|
98
|
+
onClick={handleCloseNavMenu}
|
|
99
|
+
sx={{ my: 2, color: "white", display: "block" }}
|
|
100
|
+
>
|
|
101
|
+
{page}
|
|
102
|
+
</Button>
|
|
103
|
+
))}
|
|
104
|
+
</Box>
|
|
105
|
+
|
|
106
|
+
<Box sx={{ flexGrow: 0 }}>
|
|
107
|
+
<Tooltip title="Open settings">
|
|
108
|
+
<IconButton onClick={handleOpenUserMenu} sx={{ p: 0 }}>
|
|
109
|
+
<Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" />
|
|
110
|
+
</IconButton>
|
|
111
|
+
</Tooltip>
|
|
112
|
+
<Menu
|
|
113
|
+
sx={{ mt: "45px" }}
|
|
114
|
+
id="menu-appbar"
|
|
115
|
+
anchorEl={anchorElUser}
|
|
116
|
+
anchorOrigin={{
|
|
117
|
+
vertical: "top",
|
|
118
|
+
horizontal: "right"
|
|
119
|
+
}}
|
|
120
|
+
keepMounted
|
|
121
|
+
transformOrigin={{
|
|
122
|
+
vertical: "top",
|
|
123
|
+
horizontal: "right"
|
|
124
|
+
}}
|
|
125
|
+
open={Boolean(anchorElUser)}
|
|
126
|
+
onClose={handleCloseUserMenu}
|
|
127
|
+
>
|
|
128
|
+
{settings.map((setting) => (
|
|
129
|
+
<MenuItem key={setting} onClick={handleCloseUserMenu}>
|
|
130
|
+
<Typography textAlign="center">{setting}</Typography>
|
|
131
|
+
</MenuItem>
|
|
132
|
+
))}
|
|
133
|
+
</Menu>
|
|
134
|
+
</Box>
|
|
135
|
+
</Toolbar>
|
|
136
|
+
</Container>
|
|
137
|
+
</AppBar>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ListItemButton, ListItemText } from "@mui/material";
|
|
3
|
+
import InboxIcon from "@mui/icons-material/MoveToInbox";
|
|
4
|
+
|
|
5
|
+
export const HawaListItem = (props) => {
|
|
6
|
+
return (
|
|
7
|
+
<ListItemButton
|
|
8
|
+
variant={props.selected && "clicked"}
|
|
9
|
+
key={props.text}
|
|
10
|
+
sx={{
|
|
11
|
+
minHeight: 48,
|
|
12
|
+
justifyContent: props.open ? "initial" : "center",
|
|
13
|
+
px: 2.5
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
<InboxIcon />
|
|
17
|
+
<div style={{ width: 20 }} />
|
|
18
|
+
<ListItemText primary={props.text} sx={{ opacity: props.open ? 1 : 0 }} />
|
|
19
|
+
</ListItemButton>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Container from "@mui/material/Container";
|
|
3
|
+
import { Button, Typography } from "@mui/material";
|
|
4
|
+
import CheckIcon from "@mui/icons-material/CheckCircleOutlined";
|
|
5
|
+
export const HawaPricingCard = (props) => {
|
|
6
|
+
let isArabic = props.lang === "ar";
|
|
7
|
+
let cycleTextsArabic = {
|
|
8
|
+
monthly: "شهرياً",
|
|
9
|
+
"3-months": "كل 3 أشهر",
|
|
10
|
+
"6-months": "كل 6 أشهر",
|
|
11
|
+
annually: "سنوياً"
|
|
12
|
+
};
|
|
13
|
+
let cycleTextsEnglish = {
|
|
14
|
+
monthly: "Monthly",
|
|
15
|
+
"3-months": "3 Months",
|
|
16
|
+
"6-months": "6 Months",
|
|
17
|
+
annually: "Annually"
|
|
18
|
+
};
|
|
19
|
+
let currencyMapping = {
|
|
20
|
+
usd: isArabic ? "دولار" : "$",
|
|
21
|
+
sar: isArabic ? "ريال" : "SAR"
|
|
22
|
+
};
|
|
23
|
+
let featuresMapping = isArabic ? props.features_ar : props.features;
|
|
24
|
+
return (
|
|
25
|
+
<Container
|
|
26
|
+
maxWidth="xs"
|
|
27
|
+
variant={props.selectedPlan ? "selected-plan-card" : "plan-card"}
|
|
28
|
+
style={{ direction: isArabic ? "rtl" : "ltr" }}
|
|
29
|
+
>
|
|
30
|
+
<Container variant="plan-header">
|
|
31
|
+
<Typography variant="h3" fontWeight={500}>
|
|
32
|
+
{isArabic ? props.title_ar : props.title}
|
|
33
|
+
</Typography>
|
|
34
|
+
<Typography variant="caption">
|
|
35
|
+
{isArabic ? props.subtitle_ar : props.subtitle}
|
|
36
|
+
</Typography>
|
|
37
|
+
<br />
|
|
38
|
+
<Typography
|
|
39
|
+
variant="h4"
|
|
40
|
+
fontWeight={500}
|
|
41
|
+
style={{ display: "flex", alignItems: "center" }}
|
|
42
|
+
>
|
|
43
|
+
{props.lang === "ar" ? (
|
|
44
|
+
<div
|
|
45
|
+
style={{
|
|
46
|
+
width: "100%",
|
|
47
|
+
display: "flex",
|
|
48
|
+
flexDirection: "column",
|
|
49
|
+
justifyContent: "center"
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<div style={{ display: "flex", flexDirection: "row" }}>
|
|
53
|
+
{props.price}
|
|
54
|
+
<div style={{ width: 5 }} />
|
|
55
|
+
{/* <Typography>{props.currency?.toUpperCase()}</Typography> */}
|
|
56
|
+
<Typography>
|
|
57
|
+
{currencyMapping[props.currency?.toLowerCase()]}
|
|
58
|
+
</Typography>
|
|
59
|
+
</div>
|
|
60
|
+
<Typography style={{ fontSize: 14, margin: 5 }}>
|
|
61
|
+
{isArabic
|
|
62
|
+
? cycleTextsArabic[props.cycleText]
|
|
63
|
+
: cycleTextsEnglish[props.cycleText]}
|
|
64
|
+
</Typography>
|
|
65
|
+
</div>
|
|
66
|
+
) : (
|
|
67
|
+
<div
|
|
68
|
+
style={{
|
|
69
|
+
width: "100%",
|
|
70
|
+
display: "flex",
|
|
71
|
+
flexDirection: "column",
|
|
72
|
+
justifyContent: "center"
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
<div style={{ display: "flex", flexDirection: "row" }}>
|
|
76
|
+
<Typography>
|
|
77
|
+
{currencyMapping[props.currency?.toLowerCase()]}
|
|
78
|
+
</Typography>
|
|
79
|
+
{/* <Typography>{props.currency?.toUpperCase()}</Typography> */}
|
|
80
|
+
<div style={{ width: 5 }} />
|
|
81
|
+
{props.price}
|
|
82
|
+
</div>
|
|
83
|
+
<Typography style={{ fontSize: 14, margin: 5 }}>
|
|
84
|
+
{props.lang === "ar"
|
|
85
|
+
? cycleTextsArabic[props.cycleText]
|
|
86
|
+
: cycleTextsEnglish[props.cycleText]}
|
|
87
|
+
</Typography>
|
|
88
|
+
</div>
|
|
89
|
+
)}
|
|
90
|
+
</Typography>
|
|
91
|
+
</Container>
|
|
92
|
+
|
|
93
|
+
<div
|
|
94
|
+
style={{ padding: 20, color: props.selectedPlan ? "white" : "black" }}
|
|
95
|
+
>
|
|
96
|
+
{featuresMapping?.map((feature) => {
|
|
97
|
+
return (
|
|
98
|
+
<div
|
|
99
|
+
style={{
|
|
100
|
+
display: "flex",
|
|
101
|
+
flexDirection: "row",
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
justifyContent: "flex-start",
|
|
104
|
+
marginTop: 10,
|
|
105
|
+
width: "100%"
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
<div
|
|
109
|
+
style={{
|
|
110
|
+
display: "flex",
|
|
111
|
+
flexDirection: "row",
|
|
112
|
+
justifyContent: "flex-end",
|
|
113
|
+
width: "10%"
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<CheckIcon fontSize="small" />
|
|
117
|
+
</div>
|
|
118
|
+
<div style={{ width: 10 }} />
|
|
119
|
+
<Typography variant="subtitle2">{feature}</Typography>
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
})}
|
|
123
|
+
</div>
|
|
124
|
+
<Button
|
|
125
|
+
onClick={props.selectPlan}
|
|
126
|
+
variant={props.selectedPlan ? "outlined" : "contained"}
|
|
127
|
+
style={{ margin: 20 }}
|
|
128
|
+
>
|
|
129
|
+
{props.buttonText}
|
|
130
|
+
</Button>
|
|
131
|
+
</Container>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
@@ -5,7 +5,7 @@ import Container from "@mui/material/Container";
|
|
|
5
5
|
export const HawaRadio = (props) => {
|
|
6
6
|
const [value, setValue] = useState(props.defaultValue);
|
|
7
7
|
return (
|
|
8
|
-
<Container variant="
|
|
8
|
+
<Container variant={props.location || "panelTabs"}>
|
|
9
9
|
{props.options.map((singleOption, i) => {
|
|
10
10
|
return (
|
|
11
11
|
<Button
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import Checkbox from "@mui/material/Checkbox";
|
|
5
|
+
import { HawaTypography } from "./HawaTypography";
|
|
6
|
+
import Container from "@mui/material/Container";
|
|
7
|
+
import { HawaTextField } from "./HawaTextField";
|
|
8
|
+
import { HawaRadio } from "./HawaRadio";
|
|
9
|
+
import { HawaSwitch } from "./HawaSwitch";
|
|
10
|
+
export const HawaSettingsRow = (props) => {
|
|
11
|
+
return (
|
|
12
|
+
<Container variant="settingsRow">
|
|
13
|
+
<HawaTypography>{props.settingsLabel}</HawaTypography>
|
|
14
|
+
{props.settingsType === "checkbox" && <Checkbox {...props} />}
|
|
15
|
+
{props.settingsType === "text" && <HawaTextField {...props} />}
|
|
16
|
+
{props.settingsType === "radio" && (
|
|
17
|
+
<HawaRadio location="inSettings" {...props} />
|
|
18
|
+
)}
|
|
19
|
+
{props.settingsType === "boolean" && <HawaSwitch {...props} />}
|
|
20
|
+
</Container>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
HawaSettingsRow.propTypes = {
|
|
25
|
+
type: PropTypes.oneOf(["text", "number", "password"]),
|
|
26
|
+
helperText: PropTypes.string
|
|
27
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Input from "@mui/material/Input";
|
|
3
|
+
import InputLabel from "@mui/material/InputLabel";
|
|
4
|
+
import { Typography } from "@mui/material";
|
|
5
|
+
|
|
6
|
+
export const HawaTextField = (props) => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
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
|
+
<Input disableUnderline {...props} />
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|