@sikka/hawa 0.0.28 → 0.0.31
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 +5 -4
- package/src/blocks/Account/UserProfileForm.js +5 -0
- package/src/blocks/AuthForms/NewPasswordForm.js +18 -1
- package/src/blocks/AuthForms/ResetPasswordForm.js +10 -1
- package/src/blocks/AuthForms/SignInForm.js +19 -1
- package/src/blocks/AuthForms/SignUpForm.js +44 -1
- package/src/blocks/Payment/ChargeWalletForm.js +4 -1
- package/src/blocks/Payment/CheckoutForm.js +17 -1
- package/src/blocks/Payment/Confirmation.js +24 -1
- package/src/blocks/Payment/{PaymentMethod.js → Form/PaymentMethod.js} +0 -10
- package/src/blocks/Pricing/PricingPlans.js +15 -1
- package/src/elements/HawaAccordian.js +28 -0
- package/src/elements/HawaAlert.js +10 -1
- package/src/elements/HawaColorPicker.js +62 -0
- package/src/elements/HawaLogoButton.js +18 -1
- package/src/elements/HawaPopMenu.js +7 -1
- package/src/elements/HawaRadio.js +7 -1
- package/src/elements/HawaRange.js +26 -0
- package/src/elements/HawaSearchBar.js +17 -0
- package/src/elements/HawaSettingsRow.js +15 -5
- package/src/elements/{OfflineBanner.js → HawaSnackbar.js} +3 -8
- package/src/elements/HawaTable.js +65 -20
- package/src/elements/index.js +5 -1
- package/src/layout/HawaAppLayout.js +15 -59
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.4bd34158.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.6c796c97.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.b026595c.iframe.bundle.js.LICENSE.txt → vendors~main.6c796c97.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.6c796c97.iframe.bundle.js.map +1 -0
- package/storybook-static/main.9dd59e4f.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.b026595c.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.b026595c.iframe.bundle.js.map +0 -1
|
@@ -94,6 +94,23 @@ export const NewPasswordForm = (props) => {
|
|
|
94
94
|
);
|
|
95
95
|
};
|
|
96
96
|
NewPasswordForm.propTypes = {
|
|
97
|
-
|
|
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
|
+
}),
|
|
98
115
|
handleNewPassword: PropTypes.func
|
|
99
116
|
};
|
|
@@ -60,7 +60,16 @@ export const ResetPasswordForm = (props) => {
|
|
|
60
60
|
);
|
|
61
61
|
};
|
|
62
62
|
ResetPasswordForm.propTypes = {
|
|
63
|
-
|
|
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
|
+
}),
|
|
64
73
|
emailSentText: PropTypes.string,
|
|
65
74
|
handleResetPassword: PropTypes.func
|
|
66
75
|
};
|
|
@@ -143,7 +143,25 @@ export const SignInForm = (props) => {
|
|
|
143
143
|
);
|
|
144
144
|
};
|
|
145
145
|
SignInForm.propTypes = {
|
|
146
|
-
|
|
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
|
+
}),
|
|
147
165
|
viaGoogle: PropTypes.bool,
|
|
148
166
|
viaGithub: PropTypes.bool,
|
|
149
167
|
viaTwitter: PropTypes.bool,
|
|
@@ -163,8 +163,51 @@ export const SignUpForm = (props) => {
|
|
|
163
163
|
);
|
|
164
164
|
};
|
|
165
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
|
+
|
|
166
186
|
SignUpForm.propTypes = {
|
|
167
|
-
|
|
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
|
+
}),
|
|
168
211
|
viaGoogle: PropTypes.bool,
|
|
169
212
|
viaGithub: PropTypes.bool,
|
|
170
213
|
viaTwitter: PropTypes.bool,
|
|
@@ -67,6 +67,9 @@ export const ChargeWalletForm = (props) => {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
ChargeWalletForm.propTypes = {
|
|
70
|
-
texts: PropTypes.
|
|
70
|
+
texts: PropTypes.shape({
|
|
71
|
+
amountLabel: PropTypes.string,
|
|
72
|
+
chargeWallet: PropTypes.string
|
|
73
|
+
}),
|
|
71
74
|
handleChargeWallet: PropTypes.func
|
|
72
75
|
};
|
|
@@ -246,7 +246,23 @@ export const CheckoutForm = (props) => {
|
|
|
246
246
|
};
|
|
247
247
|
|
|
248
248
|
CheckoutForm.propTypes = {
|
|
249
|
-
texts: 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
|
+
}),
|
|
250
266
|
lang: PropTypes.string,
|
|
251
267
|
countriesList: PropTypes.array,
|
|
252
268
|
products: PropTypes.array,
|
|
@@ -100,7 +100,30 @@ export const ConfirmationPage = (props) => {
|
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
ConfirmationPage.propTypes = {
|
|
103
|
-
texts: 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
|
+
}),
|
|
104
127
|
products: PropTypes.array,
|
|
105
128
|
countriesList: PropTypes.array,
|
|
106
129
|
lang: PropTypes.string,
|
|
@@ -85,7 +85,6 @@ const PaymentMethodButton = (props) => {
|
|
|
85
85
|
{props.imageURL ? (
|
|
86
86
|
<div
|
|
87
87
|
style={{
|
|
88
|
-
// backgroundColor: "red",
|
|
89
88
|
width: "50%",
|
|
90
89
|
textAlign: "right",
|
|
91
90
|
paddingRight: 20
|
|
@@ -93,14 +92,7 @@ const PaymentMethodButton = (props) => {
|
|
|
93
92
|
>
|
|
94
93
|
<img
|
|
95
94
|
src={props.imageURL}
|
|
96
|
-
// src={`https://qawaim-images.s3-ap-southeast-1.amazonaws.com/payments/visa.png`}
|
|
97
|
-
// alt=""
|
|
98
|
-
// srcset=""
|
|
99
|
-
// height={"100%"}
|
|
100
|
-
// width={"30%"}
|
|
101
95
|
style={{
|
|
102
|
-
// height: "100%",
|
|
103
|
-
// aspectRatio: "6/4",
|
|
104
96
|
maxWidth: 70,
|
|
105
97
|
maxHeight: 70,
|
|
106
98
|
height: "auto"
|
|
@@ -110,7 +102,6 @@ const PaymentMethodButton = (props) => {
|
|
|
110
102
|
) : null}
|
|
111
103
|
<div
|
|
112
104
|
style={{
|
|
113
|
-
// backgroundColor: "blue",
|
|
114
105
|
width: "50%",
|
|
115
106
|
textAlign: props.imageURL ? "left" : "center"
|
|
116
107
|
}}
|
|
@@ -130,7 +121,6 @@ const PaymentMethodButton = (props) => {
|
|
|
130
121
|
};
|
|
131
122
|
|
|
132
123
|
PaymentMethod.propTypes = {
|
|
133
|
-
texts: PropTypes.object,
|
|
134
124
|
wallet: PropTypes.bool,
|
|
135
125
|
handlePaymentMethod: PropTypes.func
|
|
136
126
|
};
|
|
@@ -58,6 +58,20 @@ export const PricingPlans = (props) => {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
PricingPlans.propTypes = {
|
|
61
|
-
plans: 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
|
+
),
|
|
62
76
|
lang: PropTypes.string
|
|
63
77
|
};
|
|
@@ -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
|
+
};
|
|
@@ -12,8 +12,17 @@ export const HawaAlert = (props) => {
|
|
|
12
12
|
);
|
|
13
13
|
};
|
|
14
14
|
HawaAlert.propTypes = {
|
|
15
|
-
|
|
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
|
+
*/
|
|
16
22
|
title: PropTypes.string,
|
|
23
|
+
/**
|
|
24
|
+
* The text of the alert.
|
|
25
|
+
*/
|
|
17
26
|
text: PropTypes.string,
|
|
18
27
|
hideIcon: PropTypes.bool
|
|
19
28
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
max-width: 70px;
|
|
24
|
+
-webkit-appearance: none;
|
|
25
|
+
-moz-appearance: none;
|
|
26
|
+
appearance: none;
|
|
27
|
+
border: none;
|
|
28
|
+
// height: 30px;
|
|
29
|
+
padding: 10px;
|
|
30
|
+
border-radius: ${(props) => props.borderRadius}px;
|
|
31
|
+
&::-webkit-color-swatch {
|
|
32
|
+
border: none;
|
|
33
|
+
}
|
|
34
|
+
&::-moz-color-swatch {
|
|
35
|
+
border: none;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
export const HawaColorPicker = (props) => {
|
|
39
|
+
const theme = useTheme();
|
|
40
|
+
return (
|
|
41
|
+
<div style={{ display: "flex", flexDirection: "row" }}>
|
|
42
|
+
<ColorText
|
|
43
|
+
type={"text"}
|
|
44
|
+
value={props.color}
|
|
45
|
+
borderRadius={theme.allBorderRadius}
|
|
46
|
+
onChange={props.handleChange}
|
|
47
|
+
/>
|
|
48
|
+
<div style={{ width: 10 }} />
|
|
49
|
+
<ColorInput
|
|
50
|
+
type={"color"}
|
|
51
|
+
value={props.color}
|
|
52
|
+
onChange={props.handleChange}
|
|
53
|
+
borderRadius={theme.allBorderRadius}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
HawaColorPicker.propTypes = {
|
|
60
|
+
color: PropTypes.string,
|
|
61
|
+
handleChange: PropTypes.func
|
|
62
|
+
};
|
|
@@ -106,6 +106,23 @@ export const HawaLogoButton = (props) => {
|
|
|
106
106
|
|
|
107
107
|
HawaLogoButton.propTypes = {
|
|
108
108
|
lang: PropTypes.string,
|
|
109
|
-
|
|
109
|
+
/**
|
|
110
|
+
* The logo/icon of the button
|
|
111
|
+
*/
|
|
112
|
+
logo: PropTypes.oneOf([
|
|
113
|
+
"google",
|
|
114
|
+
"github",
|
|
115
|
+
"twitter",
|
|
116
|
+
"wallet",
|
|
117
|
+
"googlepay",
|
|
118
|
+
"applepay",
|
|
119
|
+
"stcpay",
|
|
120
|
+
"visa/master",
|
|
121
|
+
"paypal",
|
|
122
|
+
"mada"
|
|
123
|
+
]),
|
|
124
|
+
/**
|
|
125
|
+
* The text next to the logo in the button
|
|
126
|
+
*/
|
|
110
127
|
buttonText: PropTypes.string
|
|
111
128
|
};
|
|
@@ -41,5 +41,11 @@ export const HawaPopMenu = (props) => {
|
|
|
41
41
|
|
|
42
42
|
HawaPopMenu.propTypes = {
|
|
43
43
|
handleClose: PropTypes.func,
|
|
44
|
-
menuItems: PropTypes.
|
|
44
|
+
menuItems: PropTypes.arrayOf(
|
|
45
|
+
PropTypes.shape({
|
|
46
|
+
icon: PropTypes.element,
|
|
47
|
+
label: PropTypes.string,
|
|
48
|
+
action: PropTypes.func
|
|
49
|
+
})
|
|
50
|
+
)
|
|
45
51
|
};
|
|
@@ -31,7 +31,13 @@ export const HawaRadio = (props) => {
|
|
|
31
31
|
};
|
|
32
32
|
HawaRadio.propTypes = {
|
|
33
33
|
lang: PropTypes.string,
|
|
34
|
-
options: PropTypes.
|
|
34
|
+
options: PropTypes.arrayOf(
|
|
35
|
+
PropTypes.shape({
|
|
36
|
+
label: PropTypes.string,
|
|
37
|
+
value: PropTypes.string
|
|
38
|
+
})
|
|
39
|
+
),
|
|
35
40
|
defaultValue: PropTypes.string,
|
|
41
|
+
handleChange: PropTypes.func,
|
|
36
42
|
location: PropTypes.string
|
|
37
43
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Slider from "@mui/material/Slider";
|
|
3
|
+
import Stack from "@mui/material/Stack";
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
|
|
6
|
+
export const HawaRange = (props) => {
|
|
7
|
+
return (
|
|
8
|
+
<Stack spacing={2} direction="row" alignItems="center">
|
|
9
|
+
{props.startElement}
|
|
10
|
+
<Slider
|
|
11
|
+
size="small"
|
|
12
|
+
aria-label="Volume"
|
|
13
|
+
value={props.value}
|
|
14
|
+
onChange={props.handleChange}
|
|
15
|
+
/>
|
|
16
|
+
{props.endElement}
|
|
17
|
+
</Stack>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
HawaRange.propTypes = {
|
|
21
|
+
startElement: PropTypes.element,
|
|
22
|
+
endElement: PropTypes.element,
|
|
23
|
+
defaultValue: PropTypes.string,
|
|
24
|
+
handleChange: PropTypes.func,
|
|
25
|
+
location: PropTypes.string
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Search } from "@mui/icons-material";
|
|
2
|
+
import { InputAdornment } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { HawaTextField } from "./HawaTextField";
|
|
5
|
+
|
|
6
|
+
export const HawaSearchBar = (props) => {
|
|
7
|
+
return (
|
|
8
|
+
<HawaTextField
|
|
9
|
+
endAdornment={
|
|
10
|
+
<InputAdornment position="start">
|
|
11
|
+
<Search />
|
|
12
|
+
</InputAdornment>
|
|
13
|
+
}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import Checkbox from "@mui/material/Checkbox";
|
|
5
|
-
import { HawaTypography } from "./HawaTypography";
|
|
6
4
|
import Container from "@mui/material/Container";
|
|
5
|
+
import { HawaTypography } from "./HawaTypography";
|
|
7
6
|
import { HawaTextField } from "./HawaTextField";
|
|
8
7
|
import { HawaRadio } from "./HawaRadio";
|
|
9
8
|
import { HawaSwitch } from "./HawaSwitch";
|
|
9
|
+
import { HawaColorPicker } from "./HawaColorPicker";
|
|
10
|
+
import { HawaRange } from "./HawaRange";
|
|
11
|
+
|
|
10
12
|
export const HawaSettingsRow = (props) => {
|
|
11
13
|
return (
|
|
12
14
|
<Container variant="settingsRow">
|
|
13
15
|
<HawaTypography>{props.settingsLabel}</HawaTypography>
|
|
14
16
|
{props.settingsType === "checkbox" && <Checkbox {...props} />}
|
|
15
17
|
{props.settingsType === "text" && <HawaTextField {...props} />}
|
|
18
|
+
{props.settingsType === "boolean" && <HawaSwitch {...props} />}
|
|
19
|
+
{props.settingsType === "range" && <HawaRange {...props} />}
|
|
20
|
+
{props.settingsType === "color" && <HawaColorPicker {...props} />}
|
|
16
21
|
{props.settingsType === "radio" && (
|
|
17
22
|
<HawaRadio location="inSettings" {...props} />
|
|
18
23
|
)}
|
|
19
|
-
{props.settingsType === "boolean" && <HawaSwitch {...props} />}
|
|
20
24
|
</Container>
|
|
21
25
|
);
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
HawaSettingsRow.propTypes = {
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
settingsLabel: PropTypes.string,
|
|
30
|
+
settingsType: PropTypes.oneOf([
|
|
31
|
+
"checkbox",
|
|
32
|
+
"text",
|
|
33
|
+
"radio",
|
|
34
|
+
"boolean",
|
|
35
|
+
"color"
|
|
36
|
+
])
|
|
27
37
|
};
|
|
@@ -3,15 +3,10 @@ import Snackbar from "@mui/material/Snackbar";
|
|
|
3
3
|
import AlertTitle from "@mui/material/AlertTitle";
|
|
4
4
|
import Alert from "@mui/material/Alert";
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const HawaSnackbar = (props) => {
|
|
7
7
|
return (
|
|
8
|
-
<Snackbar
|
|
9
|
-
|
|
10
|
-
// style={{ outline: "1px solid red" }}
|
|
11
|
-
open={props.open}
|
|
12
|
-
onClose={props.handleClose}
|
|
13
|
-
>
|
|
14
|
-
<Alert icon={false} severity={"error"} variant="offline">
|
|
8
|
+
<Snackbar open={props.open} onClose={props.handleClose}>
|
|
9
|
+
<Alert icon={false} severity={props.severity}>
|
|
15
10
|
{props.title && <AlertTitle>{props.title}</AlertTitle>}
|
|
16
11
|
{props.text}
|
|
17
12
|
</Alert>
|
|
@@ -5,6 +5,8 @@ import TableCell from "@mui/material/TableCell";
|
|
|
5
5
|
import TableContainer from "@mui/material/TableContainer";
|
|
6
6
|
import TableHead from "@mui/material/TableHead";
|
|
7
7
|
import TableRow from "@mui/material/TableRow";
|
|
8
|
+
import PropTypes from "prop-types";
|
|
9
|
+
import { Button } from "@mui/material";
|
|
8
10
|
|
|
9
11
|
export const HawaTable = (props) => {
|
|
10
12
|
let isArabic = props.lang === "ar";
|
|
@@ -25,31 +27,66 @@ export const HawaTable = (props) => {
|
|
|
25
27
|
{col}
|
|
26
28
|
</TableCell>
|
|
27
29
|
))}
|
|
30
|
+
{props.actions && (
|
|
31
|
+
<TableCell
|
|
32
|
+
align={isArabic ? "right" : "left"}
|
|
33
|
+
style={{ fontWeight: 700 }}
|
|
34
|
+
variant={isArabic ? "borderedRight" : "borderedLeft"}
|
|
35
|
+
>
|
|
36
|
+
Actions
|
|
37
|
+
</TableCell>
|
|
38
|
+
)}
|
|
28
39
|
</TableRow>
|
|
29
40
|
</TableHead>
|
|
30
41
|
|
|
31
42
|
<TableBody>
|
|
32
|
-
{props.rows
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
?
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
{props.rows ? (
|
|
44
|
+
props.rows.map((singleRow, j) => (
|
|
45
|
+
<TableRow key={j}>
|
|
46
|
+
{singleRow.map((r, i) => (
|
|
47
|
+
<TableCell
|
|
48
|
+
align={isArabic ? "right" : "left"}
|
|
49
|
+
key={i}
|
|
50
|
+
component="th"
|
|
51
|
+
scope="row"
|
|
52
|
+
variant={
|
|
53
|
+
i > 0
|
|
54
|
+
? isArabic
|
|
55
|
+
? "borderedRight"
|
|
56
|
+
: "borderedLeft"
|
|
57
|
+
: "body"
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
{r}
|
|
61
|
+
</TableCell>
|
|
62
|
+
))}
|
|
63
|
+
{props.actions && (
|
|
64
|
+
<TableCell
|
|
65
|
+
align={isArabic ? "right" : "left"}
|
|
66
|
+
style={{ fontWeight: 700 }}
|
|
67
|
+
variant={isArabic ? "borderedRight" : "borderedLeft"}
|
|
68
|
+
>
|
|
69
|
+
{props.actions.map((act) => (
|
|
70
|
+
<Button
|
|
71
|
+
style={{ margin: 2 }}
|
|
72
|
+
variant="outlined"
|
|
73
|
+
size="small"
|
|
74
|
+
onClick={() => props.handleActionClick(singleRow)}
|
|
75
|
+
>
|
|
76
|
+
{act}
|
|
77
|
+
</Button>
|
|
78
|
+
))}
|
|
79
|
+
</TableCell>
|
|
80
|
+
)}
|
|
81
|
+
</TableRow>
|
|
82
|
+
))
|
|
83
|
+
) : (
|
|
84
|
+
<TableRow align="center">
|
|
85
|
+
<TableCell align={"center"} component="th" colSpan={6}>
|
|
86
|
+
{props.noDataText}
|
|
87
|
+
</TableCell>
|
|
51
88
|
</TableRow>
|
|
52
|
-
)
|
|
89
|
+
)}
|
|
53
90
|
</TableBody>
|
|
54
91
|
{props.end && (
|
|
55
92
|
<TableRow>
|
|
@@ -73,3 +110,11 @@ export const HawaTable = (props) => {
|
|
|
73
110
|
</TableContainer>
|
|
74
111
|
);
|
|
75
112
|
};
|
|
113
|
+
HawaTable.propTypes = {
|
|
114
|
+
handleActionClick: PropTypes.func,
|
|
115
|
+
noDataText: PropTypes.string,
|
|
116
|
+
lang: PropTypes.string,
|
|
117
|
+
columns: PropTypes.array,
|
|
118
|
+
rows: PropTypes.array,
|
|
119
|
+
end: PropTypes.array
|
|
120
|
+
};
|
package/src/elements/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./AdaptiveButton";
|
|
2
2
|
export * from "./ActionButton";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./HawaSnackbar";
|
|
4
4
|
export * from "./HawaCheckbox";
|
|
5
5
|
export * from "./HawaRadio";
|
|
6
6
|
export * from "./HawaItemCard";
|
|
@@ -9,9 +9,13 @@ export * from "./HawaSettingsRow";
|
|
|
9
9
|
export * from "./HawaLogoButton";
|
|
10
10
|
export * from "./HawaButton";
|
|
11
11
|
export * from "./HawaSelect";
|
|
12
|
+
export * from "./HawaRange";
|
|
12
13
|
export * from "./HawaTextField";
|
|
13
14
|
export * from "./HawaTextArea";
|
|
14
15
|
export * from "./HawaInputLabel";
|
|
15
16
|
export * from "./HawaTypography";
|
|
16
17
|
export * from "./HawaAlert";
|
|
17
18
|
export * from "./HawaTable";
|
|
19
|
+
export * from "./HawaColorPicker";
|
|
20
|
+
export * from "./HawaSearchBar";
|
|
21
|
+
export * from "./HawaAccordian";
|