@sikka/hawa 0.0.9 → 0.0.12

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.
Files changed (68) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +5 -4
  4. package/src/blocks/Account/UserProfileForm.js +80 -0
  5. package/src/blocks/Account/UserSettingsForm.js +17 -0
  6. package/src/blocks/Account/index.js +2 -2
  7. package/src/blocks/AuthForms/NewPasswordForm.js +57 -85
  8. package/src/blocks/AuthForms/ResetPasswordForm.js +43 -42
  9. package/src/blocks/AuthForms/SignInForm.js +99 -98
  10. package/src/blocks/AuthForms/SignUpForm.js +106 -104
  11. package/src/blocks/Payment/ChargeWalletForm.js +40 -37
  12. package/src/blocks/Payment/CreditCardForm.js +49 -44
  13. package/src/blocks/Payment/PayWithWallet.js +16 -6
  14. package/src/blocks/Payment/PaymentMethod.js +0 -1
  15. package/src/blocks/Payment/SelectPayment.js +53 -55
  16. package/src/index.js +0 -1
  17. package/src/layout/Box.js +36 -33
  18. package/src/stories/BlocksStories/Account/UserProfile.stories.js +21 -0
  19. package/src/stories/BlocksStories/Account/UserSettings.stories.js +21 -0
  20. package/src/stories/BlocksStories/Auth/NewPassword.stories.js +60 -0
  21. package/src/stories/BlocksStories/Auth/ResetPassword.stories.js +59 -0
  22. package/src/stories/BlocksStories/Auth/SignIn.stories.js +89 -0
  23. package/src/stories/BlocksStories/Auth/SignUp.stories.js +90 -0
  24. package/src/stories/BlocksStories/Payment/ChargeWallet.stories.js +30 -0
  25. package/src/stories/BlocksStories/Payment/PayWithCreditCard.stories.js +37 -0
  26. package/src/stories/BlocksStories/Payment/PayWithWallet.stories.js +17 -0
  27. package/src/stories/BlocksStories/Payment/PaymentSelection.stories.js +60 -0
  28. package/src/stories/LayoutStories/Box.stories.js +9 -20
  29. package/src/stories/UIStories/ActionButton.stories.js +1 -6
  30. package/src/stories/UIStories/AdaptiveButton.stories.js +1 -6
  31. package/src/stories/UIStories/Alert.stories.js +2 -3
  32. package/src/stories/UIStories/LogoButtons.stories.js +47 -64
  33. package/src/stories/UIStories/RadioSelector.stories.js +15 -44
  34. package/src/stories/UIStories/SettingsRow.stories.js +3 -16
  35. package/src/themes/HawaProvider.js +187 -178
  36. package/src/themes/QawaimTheme.js +199 -0
  37. package/src/ui/ActionButton.js +32 -35
  38. package/src/ui/AdaptiveButton.js +3 -8
  39. package/src/ui/HawaAlert.js +22 -24
  40. package/src/ui/HawaButton.js +43 -44
  41. package/src/ui/HawaInputLabel.js +22 -23
  42. package/src/ui/HawaLogoButton.js +7 -45
  43. package/src/ui/HawaRadio.js +18 -61
  44. package/src/ui/HawaSettingsRow.js +1 -27
  45. package/src/ui/HawaTextArea.js +1 -1
  46. package/src/ui/HawaTextField.js +146 -93
  47. package/src/ui/HawaTypography.js +19 -21
  48. package/src/ui/Row.js +1 -1
  49. package/src/ui/StyledTooltip.js +1 -1
  50. package/src/ui/TabPanel.js +1 -1
  51. package/storybook-static/8.1bf48ea7.iframe.bundle.js +1 -0
  52. package/storybook-static/iframe.html +1 -1
  53. package/storybook-static/index.html +1 -1
  54. package/storybook-static/main.a9a16923.iframe.bundle.js +1 -0
  55. package/storybook-static/{runtime~main.cfefe972.iframe.bundle.js → runtime~main.f1ebae9b.iframe.bundle.js} +1 -1
  56. package/storybook-static/vendors~main.f8d30727.iframe.bundle.js +76 -0
  57. package/storybook-static/{vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt → vendors~main.f8d30727.iframe.bundle.js.LICENSE.txt} +0 -0
  58. package/storybook-static/vendors~main.f8d30727.iframe.bundle.js.map +1 -0
  59. package/src/blocks/Account/UserProfile.js +0 -65
  60. package/src/blocks/Account/UserSettings.js +0 -15
  61. package/src/stories/BlocksStories/AuthForm.stories.js +0 -105
  62. package/src/stories/BlocksStories/PaymentForm.stories.js +0 -86
  63. package/src/stories/BlocksStories/UserForm.stories.js +0 -41
  64. package/src/stories/HawaProvider.stories.js +0 -22
  65. package/storybook-static/8.c4cb6081.iframe.bundle.js +0 -1
  66. package/storybook-static/main.5731dbe3.iframe.bundle.js +0 -1
  67. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +0 -76
  68. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +0 -1
@@ -1,37 +1,35 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
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 { hawaTheme, themeName } = useContext(ThemeProvider);
10
- const currentTheme = Object.keys(hawaTheme.alerts).find(
11
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
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
- alertStyle = {
17
- ...hawaTheme.alerts[currentTheme]
18
- };
19
- } else {
20
- alertStyle = {
21
- marginBottom: 10
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
- return {
27
- ...alertStyle
28
- };
29
- });
23
+ // const StyledAlert = styled(Alert)(({ theme }) => {
24
+ // return {
25
+ // ...alertStyle
26
+ // };
27
+ // });
30
28
 
31
29
  return (
32
- <StyledAlert {...props}>
30
+ <Alert>
33
31
  {props.title && <AlertTitle>{props.title}</AlertTitle>}
34
32
  {props.text}
35
- </StyledAlert>
33
+ </Alert>
36
34
  );
37
35
  };
@@ -1,48 +1,47 @@
1
- import React, { useContext } from "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
- const { hawaTheme, themeName } = useContext(ThemeProvider);
8
- let buttonStyle = {};
9
- let currentTheme = Object.keys(hawaTheme.actionButton).find(
10
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
- );
12
- if (currentTheme) {
13
- buttonStyle = {
14
- ...hawaTheme.actionButton[currentTheme],
15
- // marginTop: theme.actionButton[currentTheme].margin,
16
- border: props.outlined ? "2px solid black" : "none",
17
- // borderRadius: theme.actionButton[currentTheme].borderRadius,
18
- backgroundColor: "white",
19
- // height: 50,
20
- "&:hover": {
21
- backgroundColor: darken("#ffffff", 0.1)
22
- }
23
- };
24
- } else {
25
- // Default theme
26
- buttonStyle = {
27
- cursor: "pointer",
28
- display: "flex",
29
- flexDirection: "row",
30
- alignItems: "center",
31
- justifyContent: "center",
32
- marginTop: hawaTheme.actionButton[currentTheme]?.margin,
33
- border: props.outlined ? "2px solid black" : "none",
34
- borderRadius: 0,
35
- //backgroundColor: "white",
36
- backgroundColor: "red",
37
- "&:hover": {
38
- backgroundColor: darken("#ffffff", 0.1)
39
- }
40
- };
41
- }
42
- const StyledButton = styled(Button)(({ theme }) => {
43
- return {
44
- ...buttonStyle
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
  };
@@ -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
- const { hawaTheme, themeName } = useContext(ThemeProvider);
7
- let labelStyle = {};
4
+ // let labelStyle = {};
8
5
 
9
- let currentTheme = Object.keys(hawaTheme.actionButton).find(
10
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
- );
12
- if (currentTheme) {
13
- labelStyle = {
14
- margin: 15,
15
- marginRight: 5,
16
- marginLeft: 5,
17
- color: hawaTheme?.layout[currentTheme].color
18
- };
19
- } else {
20
- labelStyle = {
21
- margin: 15,
22
- marginRight: 0,
23
- marginLeft: 0,
24
- color: "black"
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 style={labelStyle}>
25
+ <InputLabel
26
+ // style={labelStyle}
27
+ >
29
28
  <div style={{ fontSize: 15 }}>{props.label}</div>
30
29
  </InputLabel>
31
30
  );
@@ -1,50 +1,12 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
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
- <StyledButton {...props}>
83
+ <Button {...props} variant="withLogo">
122
84
  {logoElement}
123
85
  <div style={{ width: 10 }} />
124
- <p
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
- </p>
136
- </StyledButton>
97
+ </Typography>
98
+ </Button>
137
99
  );
138
100
  };
@@ -1,73 +1,30 @@
1
- import { Typography } from "@mui/material";
2
- import React, { useState, useContext } from "react";
3
- import { Box } from "../layout";
4
- import { ThemeProvider } from "../themes/HawaProvider";
1
+ import React, { useState } from "react";
2
+ import Button from "@mui/material/Button";
3
+ import Container from "@mui/material/Container";
5
4
 
6
5
  export const HawaRadio = (props) => {
7
6
  const [value, setValue] = useState(props.defaultValue);
8
-
9
- const { hawaTheme, themeName } = useContext(ThemeProvider);
10
- const currentTheme = Object.keys(hawaTheme.radioSelector).find(
11
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
12
- );
13
- let radioSelectorStyle = {};
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
- }
38
-
39
7
  return (
40
- <Box horizontal maxWidth={"fit-content"}>
41
- {props.options.map((singleOption) => {
8
+ <Container variant="selection">
9
+ {props.options.map((singleOption, i) => {
42
10
  return (
43
- <div
44
- key={singleOption.label}
11
+ <Button
12
+ key={i}
45
13
  onClick={() => {
46
- setValue(singleOption.label);
47
- if (props.handleChange) {
48
- props.handleChange();
49
- }
50
- }}
51
- style={{
52
- ...radioSelectorStyle,
53
- backgroundColor:
54
- value.toLowerCase() === singleOption.label.toLowerCase()
55
- ? currentTheme
56
- ? hawaTheme.actionButton[currentTheme]?.backgroundColor
57
- : "black"
58
- : hawaTheme?.layout[currentTheme]?.backgroundColor,
59
- color:
60
- value.toLowerCase() === singleOption.label.toLowerCase()
61
- ? hawaTheme.actionButton[currentTheme]?.color
62
- : currentTheme
63
- ? hawaTheme?.layout[currentTheme]?.color
64
- : "black"
14
+ props.handleChange(singleOption.value);
15
+ setValue(singleOption.value);
65
16
  }}
17
+ fullWidth
18
+ variant={
19
+ value?.toLowerCase() === singleOption.value?.toLowerCase()
20
+ ? "selected"
21
+ : "unselected"
22
+ }
66
23
  >
67
- <Typography>{singleOption.text}</Typography>
68
- </div>
24
+ {singleOption.label}
25
+ </Button>
69
26
  );
70
27
  })}
71
- </Box>
28
+ </Container>
72
29
  );
73
30
  };
@@ -1,38 +1,12 @@
1
- import React, { useContext } from "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>
@@ -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%",