@sikka/hawa 0.0.8 → 0.0.11
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 +3 -2
- package/src/blocks/Account/UserProfile.js +55 -50
- package/src/blocks/Account/UserSettings.js +0 -1
- package/src/blocks/AuthForms/NewPasswordForm.js +57 -85
- package/src/blocks/AuthForms/ResetPasswordForm.js +43 -42
- package/src/blocks/AuthForms/SignInForm.js +92 -95
- package/src/blocks/AuthForms/SignUpForm.js +105 -104
- package/src/blocks/Payment/PaymentMethod.js +0 -1
- package/src/blocks/Payment/SelectPayment.js +53 -54
- package/src/index.js +0 -1
- package/src/layout/Box.js +36 -33
- package/src/stories/BlocksStories/AuthForm.stories.js +105 -39
- package/src/stories/BlocksStories/PaymentForm.stories.js +20 -35
- package/src/stories/BlocksStories/UserForm.stories.js +2 -16
- package/src/stories/LayoutStories/Box.stories.js +4 -10
- package/src/stories/UIStories/ActionButton.stories.js +1 -6
- package/src/stories/UIStories/AdaptiveButton.stories.js +1 -6
- package/src/stories/UIStories/Alert.stories.js +2 -3
- package/src/stories/UIStories/LogoButtons.stories.js +2 -6
- package/src/stories/UIStories/RadioSelector.stories.js +0 -3
- package/src/stories/UIStories/SettingsRow.stories.js +3 -16
- package/src/themes/HawaProvider.js +187 -178
- package/src/themes/QawaimTheme.js +199 -0
- package/src/ui/ActionButton.js +32 -35
- package/src/ui/AdaptiveButton.js +3 -8
- package/src/ui/HawaAlert.js +22 -24
- package/src/ui/HawaButton.js +43 -44
- package/src/ui/HawaInputLabel.js +22 -23
- package/src/ui/HawaLogoButton.js +7 -45
- package/src/ui/HawaRadio.js +25 -34
- package/src/ui/HawaSettingsRow.js +1 -27
- package/src/ui/HawaTextArea.js +1 -1
- package/src/ui/HawaTextField.js +146 -93
- package/src/ui/HawaTypography.js +19 -21
- package/src/ui/Row.js +1 -1
- package/src/ui/StyledTooltip.js +1 -1
- package/src/ui/TabPanel.js +1 -1
- package/storybook-static/8.1bf48ea7.iframe.bundle.js +1 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.b00949db.iframe.bundle.js +1 -0
- package/storybook-static/{runtime~main.cfefe972.iframe.bundle.js → runtime~main.f1ebae9b.iframe.bundle.js} +1 -1
- package/storybook-static/vendors~main.f8d30727.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt → vendors~main.f8d30727.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.f8d30727.iframe.bundle.js.map +1 -0
- package/src/stories/HawaProvider.stories.js +0 -22
- package/storybook-static/8.c4cb6081.iframe.bundle.js +0 -1
- package/storybook-static/main.5731dbe3.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +0 -1
package/src/ui/HawaAlert.js
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import { styled } from "@mui/material/styles";
|
|
1
|
+
import React from "react";
|
|
2
|
+
// import { styled } from "@mui/material/styles";
|
|
4
3
|
|
|
5
4
|
import Alert from "@mui/material/Alert";
|
|
6
5
|
import AlertTitle from "@mui/material/AlertTitle";
|
|
7
6
|
|
|
8
7
|
export const HawaAlert = (props) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let alertStyle = {};
|
|
8
|
+
// const currentTheme = Object.keys(hawaTheme.alerts).find(
|
|
9
|
+
// (tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
10
|
+
// );
|
|
11
|
+
// let alertStyle = {};
|
|
14
12
|
|
|
15
|
-
if (currentTheme) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} else {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
13
|
+
// if (currentTheme) {
|
|
14
|
+
// alertStyle = {
|
|
15
|
+
// ...hawaTheme.alerts[currentTheme]
|
|
16
|
+
// };
|
|
17
|
+
// } else {
|
|
18
|
+
// alertStyle = {
|
|
19
|
+
// marginBottom: 10
|
|
20
|
+
// };
|
|
21
|
+
// }
|
|
24
22
|
|
|
25
|
-
const StyledAlert = styled(Alert)(({ theme }) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
23
|
+
// const StyledAlert = styled(Alert)(({ theme }) => {
|
|
24
|
+
// return {
|
|
25
|
+
// ...alertStyle
|
|
26
|
+
// };
|
|
27
|
+
// });
|
|
30
28
|
|
|
31
29
|
return (
|
|
32
|
-
<
|
|
30
|
+
<Alert>
|
|
33
31
|
{props.title && <AlertTitle>{props.title}</AlertTitle>}
|
|
34
32
|
{props.text}
|
|
35
|
-
</
|
|
33
|
+
</Alert>
|
|
36
34
|
);
|
|
37
35
|
};
|
package/src/ui/HawaButton.js
CHANGED
|
@@ -1,48 +1,47 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { ThemeProvider } from "../themes/HawaProvider";
|
|
3
|
-
import { styled, darken } from "@mui/material/styles";
|
|
1
|
+
import React from "react";
|
|
2
|
+
// import { ThemeProvider } from "../themes/HawaProvider";
|
|
3
|
+
// import { styled, darken } from "@mui/material/styles";
|
|
4
4
|
import Button from "@mui/material/Button";
|
|
5
5
|
|
|
6
6
|
export const HawaButton = (props) => {
|
|
7
|
-
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
return <StyledButton {...props}>{props.children}</StyledButton>;
|
|
7
|
+
// let buttonStyle = {};
|
|
8
|
+
// let currentTheme = Object.keys(hawaTheme.actionButton).find(
|
|
9
|
+
// (tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
10
|
+
// );
|
|
11
|
+
// if (currentTheme) {
|
|
12
|
+
// buttonStyle = {
|
|
13
|
+
// ...hawaTheme.actionButton[currentTheme],
|
|
14
|
+
// // marginTop: theme.actionButton[currentTheme].margin,
|
|
15
|
+
// border: props.outlined ? "2px solid black" : "none",
|
|
16
|
+
// // borderRadius: theme.actionButton[currentTheme].borderRadius,
|
|
17
|
+
// backgroundColor: "white",
|
|
18
|
+
// // height: 50,
|
|
19
|
+
// "&:hover": {
|
|
20
|
+
// backgroundColor: darken("#ffffff", 0.1)
|
|
21
|
+
// }
|
|
22
|
+
// };
|
|
23
|
+
// } else {
|
|
24
|
+
// // Default theme
|
|
25
|
+
// buttonStyle = {
|
|
26
|
+
// cursor: "pointer",
|
|
27
|
+
// display: "flex",
|
|
28
|
+
// flexDirection: "row",
|
|
29
|
+
// alignItems: "center",
|
|
30
|
+
// justifyContent: "center",
|
|
31
|
+
// marginTop: hawaTheme.actionButton[currentTheme]?.margin,
|
|
32
|
+
// border: props.outlined ? "2px solid black" : "none",
|
|
33
|
+
// borderRadius: 0,
|
|
34
|
+
// //backgroundColor: "white",
|
|
35
|
+
// backgroundColor: "red",
|
|
36
|
+
// "&:hover": {
|
|
37
|
+
// backgroundColor: darken("#ffffff", 0.1)
|
|
38
|
+
// }
|
|
39
|
+
// };
|
|
40
|
+
// }
|
|
41
|
+
// const StyledButton = styled(Button)(({ theme }) => {
|
|
42
|
+
// return {
|
|
43
|
+
// ...buttonStyle
|
|
44
|
+
// };
|
|
45
|
+
// });
|
|
46
|
+
return <Button {...props}>{props.children}</Button>;
|
|
48
47
|
};
|
package/src/ui/HawaInputLabel.js
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import InputLabel from "@mui/material/InputLabel";
|
|
2
|
-
import { useContext } from "react";
|
|
3
|
-
import { ThemeProvider } from "../themes/HawaProvider";
|
|
4
2
|
|
|
5
3
|
export const HawaInputLabel = (props) => {
|
|
6
|
-
|
|
7
|
-
let labelStyle = {};
|
|
4
|
+
// let labelStyle = {};
|
|
8
5
|
|
|
9
|
-
let currentTheme = Object.keys(hawaTheme.actionButton).find(
|
|
10
|
-
|
|
11
|
-
);
|
|
12
|
-
if (currentTheme) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} else {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
6
|
+
// let currentTheme = Object.keys(hawaTheme.actionButton).find(
|
|
7
|
+
// (tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
8
|
+
// );
|
|
9
|
+
// if (currentTheme) {
|
|
10
|
+
// labelStyle = {
|
|
11
|
+
// margin: 15,
|
|
12
|
+
// marginRight: 5,
|
|
13
|
+
// marginLeft: 5,
|
|
14
|
+
// color: hawaTheme?.layout[currentTheme].color
|
|
15
|
+
// };
|
|
16
|
+
// } else {
|
|
17
|
+
// labelStyle = {
|
|
18
|
+
// margin: 15,
|
|
19
|
+
// marginRight: 0,
|
|
20
|
+
// marginLeft: 0,
|
|
21
|
+
// color: "black"
|
|
22
|
+
// };
|
|
23
|
+
// }
|
|
27
24
|
return (
|
|
28
|
-
<InputLabel
|
|
25
|
+
<InputLabel
|
|
26
|
+
// style={labelStyle}
|
|
27
|
+
>
|
|
29
28
|
<div style={{ fontSize: 15 }}>{props.label}</div>
|
|
30
29
|
</InputLabel>
|
|
31
30
|
);
|
package/src/ui/HawaLogoButton.js
CHANGED
|
@@ -1,50 +1,12 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import { styled, darken } from "@mui/material/styles";
|
|
1
|
+
import React from "react";
|
|
2
|
+
// import { styled, darken } from "@mui/material/styles";
|
|
4
3
|
import Button from "@mui/material/Button";
|
|
5
4
|
import GitHubIcon from "@mui/icons-material/GitHub";
|
|
6
5
|
import TwitterIcon from "@mui/icons-material/Twitter";
|
|
7
6
|
import WalletIcon from "@mui/icons-material/AccountBalanceWallet";
|
|
7
|
+
import { Typography } from "@mui/material";
|
|
8
8
|
|
|
9
9
|
export const HawaLogoButton = (props) => {
|
|
10
|
-
const { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
11
|
-
let buttonStyle = {};
|
|
12
|
-
let currentTheme = Object.keys(hawaTheme.logoButton).find(
|
|
13
|
-
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
14
|
-
);
|
|
15
|
-
if (currentTheme) {
|
|
16
|
-
buttonStyle = {
|
|
17
|
-
...hawaTheme.logoButton[currentTheme],
|
|
18
|
-
backgroundColor: "white",
|
|
19
|
-
"&:hover": {
|
|
20
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
} else {
|
|
24
|
-
// Default theme
|
|
25
|
-
buttonStyle = {
|
|
26
|
-
cursor: "pointer",
|
|
27
|
-
display: "flex",
|
|
28
|
-
flexDirection: "row",
|
|
29
|
-
alignItems: "center",
|
|
30
|
-
justifyContent: "center",
|
|
31
|
-
marginTop: 10,
|
|
32
|
-
height: 50,
|
|
33
|
-
padding: 30,
|
|
34
|
-
paddingTop: 0,
|
|
35
|
-
paddingBottom: 0,
|
|
36
|
-
border: "1px solid #ced4da",
|
|
37
|
-
backgroundColor: "white",
|
|
38
|
-
"&:hover": {
|
|
39
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const StyledButton = styled(Button)(({ theme }) => {
|
|
44
|
-
return {
|
|
45
|
-
...buttonStyle
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
10
|
let logoElement = "";
|
|
49
11
|
switch (props.logo?.toLowerCase()) {
|
|
50
12
|
case "google":
|
|
@@ -118,10 +80,10 @@ export const HawaLogoButton = (props) => {
|
|
|
118
80
|
break;
|
|
119
81
|
}
|
|
120
82
|
return (
|
|
121
|
-
<
|
|
83
|
+
<Button {...props} variant="withLogo">
|
|
122
84
|
{logoElement}
|
|
123
85
|
<div style={{ width: 10 }} />
|
|
124
|
-
<
|
|
86
|
+
<Typography
|
|
125
87
|
style={{
|
|
126
88
|
color: "black",
|
|
127
89
|
fontSize: 14,
|
|
@@ -132,7 +94,7 @@ export const HawaLogoButton = (props) => {
|
|
|
132
94
|
}}
|
|
133
95
|
>
|
|
134
96
|
{props.buttonText}
|
|
135
|
-
</
|
|
136
|
-
</
|
|
97
|
+
</Typography>
|
|
98
|
+
</Button>
|
|
137
99
|
);
|
|
138
100
|
};
|
package/src/ui/HawaRadio.js
CHANGED
|
@@ -1,40 +1,31 @@
|
|
|
1
1
|
import { Typography } from "@mui/material";
|
|
2
|
-
import React
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { Box } from "../layout";
|
|
4
|
-
import { ThemeProvider } from "../themes/HawaProvider";
|
|
5
4
|
|
|
6
5
|
export const HawaRadio = (props) => {
|
|
7
|
-
|
|
6
|
+
// if (currentTheme) {
|
|
7
|
+
// radioSelectorStyle = {
|
|
8
|
+
// ...hawaTheme.radioSelector[currentTheme],
|
|
9
|
+
// "-moz-user-select": "-moz-none",
|
|
10
|
+
// "-khtml-user-select": "none",
|
|
11
|
+
// "-webkit-user-select": "none",
|
|
12
|
+
// "-ms-user-select": "none",
|
|
13
|
+
// "user-select": "none"
|
|
14
|
+
// };
|
|
15
|
+
// } else {
|
|
16
|
+
// radioSelectorStyle = {
|
|
17
|
+
// display: "flex",
|
|
18
|
+
// flexDirection: "row",
|
|
19
|
+
// justifyContent: "space-between",
|
|
20
|
+
// alignItems: "center",
|
|
21
|
+
// backgroundColor: "#F5F5F5",
|
|
22
|
+
// margin: 0,
|
|
8
23
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (currentTheme) {
|
|
16
|
-
radioSelectorStyle = {
|
|
17
|
-
...hawaTheme.radioSelector[currentTheme],
|
|
18
|
-
"-moz-user-select": "-moz-none",
|
|
19
|
-
"-khtml-user-select": "none",
|
|
20
|
-
"-webkit-user-select": "none",
|
|
21
|
-
"-ms-user-select": "none",
|
|
22
|
-
"user-select": "none"
|
|
23
|
-
};
|
|
24
|
-
} else {
|
|
25
|
-
radioSelectorStyle = {
|
|
26
|
-
display: "flex",
|
|
27
|
-
flexDirection: "row",
|
|
28
|
-
justifyContent: "space-between",
|
|
29
|
-
alignItems: "center",
|
|
30
|
-
backgroundColor: "#F5F5F5",
|
|
31
|
-
margin: 0,
|
|
32
|
-
|
|
33
|
-
backgroundColor: "lightGrey",
|
|
34
|
-
color: "black",
|
|
35
|
-
padding: 10
|
|
36
|
-
};
|
|
37
|
-
}
|
|
24
|
+
// backgroundColor: "lightGrey",
|
|
25
|
+
// color: "black",
|
|
26
|
+
// padding: 10
|
|
27
|
+
// };
|
|
28
|
+
// }
|
|
38
29
|
|
|
39
30
|
return (
|
|
40
31
|
<Box horizontal maxWidth={"fit-content"}>
|
|
@@ -55,12 +46,12 @@ export const HawaRadio = (props) => {
|
|
|
55
46
|
? currentTheme
|
|
56
47
|
? hawaTheme.actionButton[currentTheme]?.backgroundColor
|
|
57
48
|
: "black"
|
|
58
|
-
: hawaTheme
|
|
49
|
+
: hawaTheme?.layout[currentTheme]?.backgroundColor,
|
|
59
50
|
color:
|
|
60
51
|
value.toLowerCase() === singleOption.label.toLowerCase()
|
|
61
52
|
? hawaTheme.actionButton[currentTheme]?.color
|
|
62
53
|
: currentTheme
|
|
63
|
-
? hawaTheme
|
|
54
|
+
? hawaTheme?.layout[currentTheme]?.color
|
|
64
55
|
: "black"
|
|
65
56
|
}}
|
|
66
57
|
>
|
|
@@ -1,38 +1,12 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { ThemeProvider } from "../themes/HawaProvider";
|
|
5
4
|
import { Box } from "../layout";
|
|
6
5
|
import Checkbox from "@mui/material/Checkbox";
|
|
7
6
|
import TextField from "@mui/material/TextField";
|
|
8
7
|
import { HawaTypography } from "./HawaTypography";
|
|
9
8
|
export const HawaSettingsRow = (props) => {
|
|
10
|
-
const { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
11
|
-
const currentTheme = Object.keys(hawaTheme.settingsRow).find(
|
|
12
|
-
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
13
|
-
);
|
|
14
|
-
let settingsRowStyle = {};
|
|
15
|
-
|
|
16
|
-
if (currentTheme) {
|
|
17
|
-
settingsRowStyle = {
|
|
18
|
-
...hawaTheme.settingsRow[currentTheme],
|
|
19
|
-
margin: props.last ? 0 : hawaTheme.settingsRow[currentTheme].margin,
|
|
20
|
-
marginTop: props.last ? hawaTheme.settingsRow[currentTheme].margin * 2 : 0
|
|
21
|
-
};
|
|
22
|
-
} else {
|
|
23
|
-
settingsRowStyle = {
|
|
24
|
-
display: "flex",
|
|
25
|
-
flexDirection: "row",
|
|
26
|
-
justifyContent: "space-between",
|
|
27
|
-
alignItems: "center",
|
|
28
|
-
backgroundColor: "#F5F5F5",
|
|
29
|
-
margin: 0,
|
|
30
9
|
|
|
31
|
-
backgroundColor: "lightGrey",
|
|
32
|
-
color: "black",
|
|
33
|
-
padding: 10
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
10
|
|
|
37
11
|
return (
|
|
38
12
|
<Box noColor>
|
package/src/ui/HawaTextArea.js
CHANGED
|
@@ -15,7 +15,7 @@ export const HawaTextArea = (props) => {
|
|
|
15
15
|
style={{
|
|
16
16
|
color: "black",
|
|
17
17
|
backgroundColor: props.bgColor || "white",
|
|
18
|
-
borderRadius: props.bdRadius || 10,
|
|
18
|
+
// borderRadius: props.bdRadius || 10,
|
|
19
19
|
borderBottom: "none",
|
|
20
20
|
border: "none",
|
|
21
21
|
width: "100%",
|