@sikka/hawa 0.0.14 → 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/AuthForms/NewPasswordForm.js +57 -38
- package/src/blocks/AuthForms/ResetPasswordForm.js +36 -39
- package/src/blocks/AuthForms/SignInForm.js +71 -58
- package/src/blocks/AuthForms/SignUpForm.js +60 -43
- package/src/blocks/Pricing/PricingPlans.js +19 -9
- package/src/elements/HawaAlert.js +1 -1
- package/src/elements/HawaAppBar.js +139 -0
- package/src/elements/HawaListItem.js +21 -0
- package/src/elements/HawaPricingCard.js +40 -22
- package/src/elements/HawaTextField.js +15 -149
- package/src/elements/index.js +2 -0
- package/src/layout/HawaAppLayout.js +246 -0
- package/src/layout/index.js +1 -0
- 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 +21 -4
- package/src/stories/BlocksStories/Pricing/LandingPlans.stories.js +23 -5
- package/src/stories/LayoutStories/AppBar.stories.js +29 -0
- package/src/stories/LayoutStories/AppLayout.stories.js +52 -0
- package/storybook-static/iframe.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.5eab66d3.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/storybook-static/main.e382d866.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
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,8 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import Container from "@mui/material/Container";
|
|
3
3
|
import { HawaPricingCard, HawaRadio } from "../../elements";
|
|
4
4
|
|
|
5
5
|
export const PricingPlans = (props) => {
|
|
6
|
+
const [currentCurrency, setCurrentCurrency] = useState("sar");
|
|
7
|
+
const [currentCycle, setCurrentCycle] = useState("monthly");
|
|
6
8
|
return (
|
|
7
9
|
<Container style={{ width: "fit-content" }} variant="plain">
|
|
8
10
|
<div
|
|
@@ -10,26 +12,27 @@ export const PricingPlans = (props) => {
|
|
|
10
12
|
display: "flex",
|
|
11
13
|
flexDirection: "row",
|
|
12
14
|
justifyContent: "space-between",
|
|
13
|
-
|
|
14
15
|
marginBottom: 10
|
|
15
16
|
}}
|
|
16
17
|
>
|
|
17
18
|
<HawaRadio
|
|
18
19
|
location="inPricing"
|
|
19
|
-
handleChange={(e) =>
|
|
20
|
-
defaultValue="
|
|
20
|
+
handleChange={(e) => setCurrentCycle(e)}
|
|
21
|
+
defaultValue="monthly"
|
|
21
22
|
options={[
|
|
22
|
-
{ label: `Monthly`, value: `
|
|
23
|
+
{ label: `Monthly`, value: `monthly` },
|
|
23
24
|
{ label: `3 Months`, value: `3-months` },
|
|
24
25
|
{ label: `6 Months`, value: `6-months` },
|
|
25
|
-
{ label: `Annually`, value: `
|
|
26
|
+
{ label: `Annually`, value: `annually` }
|
|
26
27
|
]}
|
|
27
28
|
/>
|
|
28
29
|
|
|
29
30
|
<HawaRadio
|
|
30
31
|
location="inPricing"
|
|
31
|
-
handleChange={(e) =>
|
|
32
|
-
|
|
32
|
+
handleChange={(e) => {
|
|
33
|
+
setCurrentCurrency(e);
|
|
34
|
+
}}
|
|
35
|
+
defaultValue="sar"
|
|
33
36
|
options={[
|
|
34
37
|
{ label: `USD`, value: `usd` },
|
|
35
38
|
{ label: `SAR`, value: `sar` }
|
|
@@ -39,7 +42,14 @@ export const PricingPlans = (props) => {
|
|
|
39
42
|
|
|
40
43
|
<Container variant="pricing">
|
|
41
44
|
{props.plans.map((plan) => {
|
|
42
|
-
return
|
|
45
|
+
return (
|
|
46
|
+
<HawaPricingCard
|
|
47
|
+
lang={props.lang}
|
|
48
|
+
{...plan}
|
|
49
|
+
currency={currentCurrency}
|
|
50
|
+
cycleText={currentCycle}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
43
53
|
})}
|
|
44
54
|
</Container>
|
|
45
55
|
</Container>
|
|
@@ -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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -3,27 +3,42 @@ import Container from "@mui/material/Container";
|
|
|
3
3
|
import { Button, Typography } from "@mui/material";
|
|
4
4
|
import CheckIcon from "@mui/icons-material/CheckCircleOutlined";
|
|
5
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;
|
|
6
24
|
return (
|
|
7
25
|
<Container
|
|
8
26
|
maxWidth="xs"
|
|
9
27
|
variant={props.selectedPlan ? "selected-plan-card" : "plan-card"}
|
|
10
|
-
style={{ direction:
|
|
28
|
+
style={{ direction: isArabic ? "rtl" : "ltr" }}
|
|
11
29
|
>
|
|
12
30
|
<Container variant="plan-header">
|
|
13
31
|
<Typography variant="h3" fontWeight={500}>
|
|
14
|
-
{props.title}
|
|
32
|
+
{isArabic ? props.title_ar : props.title}
|
|
33
|
+
</Typography>
|
|
34
|
+
<Typography variant="caption">
|
|
35
|
+
{isArabic ? props.subtitle_ar : props.subtitle}
|
|
15
36
|
</Typography>
|
|
16
|
-
<Typography variant="caption">{props.subtitle}</Typography>
|
|
17
37
|
<br />
|
|
18
38
|
<Typography
|
|
19
39
|
variant="h4"
|
|
20
40
|
fontWeight={500}
|
|
21
|
-
style={{
|
|
22
|
-
display: "flex",
|
|
23
|
-
// flexDirection: "column",
|
|
24
|
-
alignItems: "center"
|
|
25
|
-
// justifyContent: props.lang === "ar" ? "" : "center"
|
|
26
|
-
}}
|
|
41
|
+
style={{ display: "flex", alignItems: "center" }}
|
|
27
42
|
>
|
|
28
43
|
{props.lang === "ar" ? (
|
|
29
44
|
<div
|
|
@@ -32,16 +47,20 @@ export const HawaPricingCard = (props) => {
|
|
|
32
47
|
display: "flex",
|
|
33
48
|
flexDirection: "column",
|
|
34
49
|
justifyContent: "center"
|
|
35
|
-
// alignItems: "center"
|
|
36
50
|
}}
|
|
37
51
|
>
|
|
38
52
|
<div style={{ display: "flex", flexDirection: "row" }}>
|
|
39
53
|
{props.price}
|
|
40
54
|
<div style={{ width: 5 }} />
|
|
41
|
-
<Typography>{props.currency}</Typography>
|
|
55
|
+
{/* <Typography>{props.currency?.toUpperCase()}</Typography> */}
|
|
56
|
+
<Typography>
|
|
57
|
+
{currencyMapping[props.currency?.toLowerCase()]}
|
|
58
|
+
</Typography>
|
|
42
59
|
</div>
|
|
43
60
|
<Typography style={{ fontSize: 14, margin: 5 }}>
|
|
44
|
-
{
|
|
61
|
+
{isArabic
|
|
62
|
+
? cycleTextsArabic[props.cycleText]
|
|
63
|
+
: cycleTextsEnglish[props.cycleText]}
|
|
45
64
|
</Typography>
|
|
46
65
|
</div>
|
|
47
66
|
) : (
|
|
@@ -51,32 +70,30 @@ export const HawaPricingCard = (props) => {
|
|
|
51
70
|
display: "flex",
|
|
52
71
|
flexDirection: "column",
|
|
53
72
|
justifyContent: "center"
|
|
54
|
-
// alignItems: "center"
|
|
55
73
|
}}
|
|
56
74
|
>
|
|
57
75
|
<div style={{ display: "flex", flexDirection: "row" }}>
|
|
58
|
-
<Typography>
|
|
76
|
+
<Typography>
|
|
77
|
+
{currencyMapping[props.currency?.toLowerCase()]}
|
|
78
|
+
</Typography>
|
|
79
|
+
{/* <Typography>{props.currency?.toUpperCase()}</Typography> */}
|
|
59
80
|
<div style={{ width: 5 }} />
|
|
60
81
|
{props.price}
|
|
61
82
|
</div>
|
|
62
83
|
<Typography style={{ fontSize: 14, margin: 5 }}>
|
|
63
|
-
{props.
|
|
84
|
+
{props.lang === "ar"
|
|
85
|
+
? cycleTextsArabic[props.cycleText]
|
|
86
|
+
: cycleTextsEnglish[props.cycleText]}
|
|
64
87
|
</Typography>
|
|
65
88
|
</div>
|
|
66
89
|
)}
|
|
67
|
-
{/* {props.lang === "ar" ? null : (
|
|
68
|
-
<Typography style={{ fontSize: 14, margin: 5 }}>
|
|
69
|
-
{" / "}
|
|
70
|
-
{props.cycleText}
|
|
71
|
-
</Typography>
|
|
72
|
-
)} */}
|
|
73
90
|
</Typography>
|
|
74
91
|
</Container>
|
|
75
92
|
|
|
76
93
|
<div
|
|
77
94
|
style={{ padding: 20, color: props.selectedPlan ? "white" : "black" }}
|
|
78
95
|
>
|
|
79
|
-
{
|
|
96
|
+
{featuresMapping?.map((feature) => {
|
|
80
97
|
return (
|
|
81
98
|
<div
|
|
82
99
|
style={{
|
|
@@ -105,6 +122,7 @@ export const HawaPricingCard = (props) => {
|
|
|
105
122
|
})}
|
|
106
123
|
</div>
|
|
107
124
|
<Button
|
|
125
|
+
onClick={props.selectPlan}
|
|
108
126
|
variant={props.selectedPlan ? "outlined" : "contained"}
|
|
109
127
|
style={{ margin: 20 }}
|
|
110
128
|
>
|
|
@@ -1,160 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
// import InputBase from "@mui/material/InputBase";
|
|
3
|
-
// import Typography from "@mui/material/Typography";
|
|
4
|
-
// import { styled } from "@mui/material/styles";
|
|
5
|
-
// import PropTypes from "prop-types";
|
|
6
|
-
// import { HawaInputLabel } from "./HawaInputLabel";
|
|
7
|
-
// import { Controller, useFormContext } from "react-hook-form";
|
|
8
2
|
import Input from "@mui/material/Input";
|
|
9
3
|
import InputLabel from "@mui/material/InputLabel";
|
|
4
|
+
import { Typography } from "@mui/material";
|
|
10
5
|
|
|
11
6
|
export const HawaTextField = (props) => {
|
|
12
|
-
// const { control, register } = useFormContext();
|
|
13
|
-
|
|
14
|
-
// const currentTheme = Object.keys(hawaTheme.inputFields).find(
|
|
15
|
-
// (tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
16
|
-
// );
|
|
17
|
-
// let textFieldStyle = {};
|
|
18
|
-
|
|
19
|
-
// if (currentTheme) {
|
|
20
|
-
// textFieldStyle = {
|
|
21
|
-
// ...hawaTheme.inputFields[currentTheme],
|
|
22
|
-
// margin: props.last ? 0 : hawaTheme.inputFields[currentTheme].margin,
|
|
23
|
-
// marginTop: props.last
|
|
24
|
-
// ? hawaTheme.inputFields[currentTheme].margin * 2
|
|
25
|
-
// : 0,
|
|
26
|
-
// };
|
|
27
|
-
// } else {
|
|
28
|
-
// textFieldStyle = {
|
|
29
|
-
// backgroundColor: "white"
|
|
30
|
-
// };
|
|
31
|
-
// }
|
|
32
|
-
|
|
33
|
-
// const StyledTextField = styled(InputBase)(({ theme }) => {
|
|
34
|
-
// return {
|
|
35
|
-
// // "& .MuiInputBase-input": {
|
|
36
|
-
// // // border: "1px solid #ced4da",
|
|
37
|
-
// // fontSize: 16,
|
|
38
|
-
// // // padding: "10px 12px",
|
|
39
|
-
// // marginBottom: props.helperText ? 5 : 0,
|
|
40
|
-
// // // paddingLeft: 10,
|
|
41
|
-
// // // paddingRight: 10,
|
|
42
|
-
// // ...textFieldStyle
|
|
43
|
-
// // },
|
|
44
|
-
// // "& .MuiInputBase-root": {
|
|
45
|
-
// // border: "1px solid #ced4da",
|
|
46
|
-
// // fontSize: 16,
|
|
47
|
-
// // // width: "auto",
|
|
48
|
-
// // // padding: "10px 12px",
|
|
49
|
-
// // marginBottom: props.helperText ? 5 : 0,
|
|
50
|
-
// // // paddingLeft: 10,
|
|
51
|
-
// // // paddingRight: 10,
|
|
52
|
-
|
|
53
|
-
// // // ...textFieldStyle,
|
|
54
|
-
// // backgroundColor: "blue"
|
|
55
|
-
// // // "&:focus": {
|
|
56
|
-
// // // borderColor: "red",
|
|
57
|
-
// // // borderWidth: 1,
|
|
58
|
-
// // // outline: "1px solid black",
|
|
59
|
-
// // // backgroundColor: "red"
|
|
60
|
-
// // // }
|
|
61
|
-
// // // "& input:valid + fieldset": {
|
|
62
|
-
// // // borderColor: "green",
|
|
63
|
-
// // // borderWidth: 2
|
|
64
|
-
// // // },
|
|
65
|
-
// // // "& input:invalid + fieldset": {
|
|
66
|
-
// // // borderColor: "red",
|
|
67
|
-
// // // borderWidth: 2
|
|
68
|
-
// // // },
|
|
69
|
-
// // // "& input:valid:focus + fieldset": {
|
|
70
|
-
// // // borderLeftWidth: 6,
|
|
71
|
-
// // // padding: "4px !important" // override inline-style
|
|
72
|
-
// // // }
|
|
73
|
-
// // },
|
|
74
|
-
|
|
75
|
-
// // "&:hover": {
|
|
76
|
-
// // borderColor: "red",
|
|
77
|
-
// // borderWidth: 1,
|
|
78
|
-
// // outline: "1px solid black"
|
|
79
|
-
// // },
|
|
80
|
-
|
|
81
|
-
// // paddingLeft: 10,
|
|
82
|
-
// // paddingRight: 10,
|
|
83
|
-
// // border: "none"
|
|
84
|
-
|
|
85
|
-
// // position: "relative",
|
|
86
|
-
// // backgroundColor: "green"
|
|
87
|
-
// ...textFieldStyle
|
|
88
|
-
// };
|
|
89
|
-
// });
|
|
90
|
-
|
|
91
7
|
return (
|
|
92
8
|
<>
|
|
93
|
-
<
|
|
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>
|
|
94
23
|
<Input disableUnderline {...props} />
|
|
95
24
|
</>
|
|
96
|
-
// <FormControl variant="hawa" style={{ marginTop: 10 }}>
|
|
97
|
-
|
|
98
|
-
// </FormControl>
|
|
99
|
-
// <TextField
|
|
100
|
-
// fullWidth
|
|
101
|
-
// type="text"
|
|
102
|
-
// // inputProps={{
|
|
103
|
-
// // shrink: true
|
|
104
|
-
// // }}
|
|
105
|
-
// // InputProps={{
|
|
106
|
-
// // disableUnderline: true,
|
|
107
|
-
// // shrink: true
|
|
108
|
-
// // }}
|
|
109
|
-
// InputLabelProps={{
|
|
110
|
-
// shrink: true
|
|
111
|
-
// }}
|
|
112
|
-
// {...props}
|
|
113
|
-
// />
|
|
114
|
-
// <Controller
|
|
115
|
-
// render={({ field }) => (
|
|
116
|
-
// <>
|
|
117
|
-
// {props.inputLabel && <InputLabel label={props.inputLabel} />}
|
|
118
|
-
|
|
119
|
-
// <TextField
|
|
120
|
-
// fullWidth={true}
|
|
121
|
-
// // helperText={props.helperText}
|
|
122
|
-
// type={props.type ?? "text"}
|
|
123
|
-
// // placeholder={props.placeholder}
|
|
124
|
-
// // inputProps={
|
|
125
|
-
// // props.type === "number"
|
|
126
|
-
// // ? {
|
|
127
|
-
// // inputMode: "numeric",
|
|
128
|
-
// // min: "0",
|
|
129
|
-
// // max: "9999999",
|
|
130
|
-
// // step: "0.01"
|
|
131
|
-
// // }
|
|
132
|
-
// // : {}
|
|
133
|
-
// // }
|
|
134
|
-
|
|
135
|
-
// defaultValue={props.defaultValue && ""}
|
|
136
|
-
// value={props.value && ""}
|
|
137
|
-
// {...props}
|
|
138
|
-
// // {...field}
|
|
139
|
-
// {...register(props.name)}
|
|
140
|
-
// />
|
|
141
|
-
// <Typography
|
|
142
|
-
// variant="caption"
|
|
143
|
-
// style={{ margin: 5, marginBottom: 0, color: "red" }}
|
|
144
|
-
// >
|
|
145
|
-
// {props.helperText}
|
|
146
|
-
// </Typography>
|
|
147
|
-
// </>
|
|
148
|
-
// )}
|
|
149
|
-
// name={props.name}
|
|
150
|
-
// rules={props.rules}
|
|
151
|
-
// control={control}
|
|
152
|
-
// shouldUnregister={props.shouldUnregister}
|
|
153
|
-
// />
|
|
154
25
|
);
|
|
155
26
|
};
|
|
156
|
-
|
|
157
|
-
// HawaTextField.propTypes = {
|
|
158
|
-
// type: PropTypes.oneOf(["text", "number", "password"]),
|
|
159
|
-
// helperText: PropTypes.string
|
|
160
|
-
// };
|
package/src/elements/index.js
CHANGED