@sikka/hawa 0.0.3 → 0.0.6

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 (158) hide show
  1. package/.github/workflows/hawa-publish-push.yml +45 -0
  2. package/.github/workflows/hawa-publish.yml +2 -0
  3. package/es/index.es.js +1 -0
  4. package/lib/index.js +1 -0
  5. package/package.json +24 -13
  6. package/rollup.config.js +2 -2
  7. package/src/Assets/images/card-background/1.jpeg +0 -0
  8. package/src/Assets/images/card-background/10.jpeg +0 -0
  9. package/src/Assets/images/card-background/11.jpeg +0 -0
  10. package/src/Assets/images/card-background/12.jpeg +0 -0
  11. package/src/Assets/images/card-background/13.jpeg +0 -0
  12. package/src/Assets/images/card-background/14.jpeg +0 -0
  13. package/src/Assets/images/card-background/15.jpeg +0 -0
  14. package/src/Assets/images/card-background/16.jpeg +0 -0
  15. package/src/Assets/images/card-background/17.jpeg +0 -0
  16. package/src/Assets/images/card-background/18.jpeg +0 -0
  17. package/src/Assets/images/card-background/19.jpeg +0 -0
  18. package/src/Assets/images/card-background/2.jpeg +0 -0
  19. package/src/Assets/images/card-background/20.jpeg +0 -0
  20. package/src/Assets/images/card-background/21.jpeg +0 -0
  21. package/src/Assets/images/card-background/22.jpeg +0 -0
  22. package/src/Assets/images/card-background/23.jpeg +0 -0
  23. package/src/Assets/images/card-background/24.jpeg +0 -0
  24. package/src/Assets/images/card-background/25.jpeg +0 -0
  25. package/src/Assets/images/card-background/3.jpeg +0 -0
  26. package/src/Assets/images/card-background/4.jpeg +0 -0
  27. package/src/Assets/images/card-background/5.jpeg +0 -0
  28. package/src/Assets/images/card-background/6.jpeg +0 -0
  29. package/src/Assets/images/card-background/7.jpeg +0 -0
  30. package/src/Assets/images/card-background/8.jpeg +0 -0
  31. package/src/Assets/images/card-background/9.jpeg +0 -0
  32. package/src/Assets/images/card-type/amex.png +0 -0
  33. package/src/Assets/images/card-type/diners.png +0 -0
  34. package/src/Assets/images/card-type/discover.png +0 -0
  35. package/src/Assets/images/card-type/mastercard.png +0 -0
  36. package/src/Assets/images/card-type/troy.png +0 -0
  37. package/src/Assets/images/card-type/unionpay.png +0 -0
  38. package/src/Assets/images/card-type/visa.png +0 -0
  39. package/src/blocks/Account/UserProfile.js +11 -11
  40. package/src/blocks/Account/UserSettings.js +11 -11
  41. package/src/blocks/AuthForms/NewPasswordForm.js +83 -10
  42. package/src/blocks/AuthForms/ResetPasswordForm.js +50 -8
  43. package/src/blocks/AuthForms/SignInForm.js +96 -13
  44. package/src/blocks/AuthForms/SignUpForm.js +113 -13
  45. package/src/blocks/Payment/ChargeWalletForm.js +32 -0
  46. package/src/blocks/Payment/CreditCardForm.js +31 -0
  47. package/src/blocks/Payment/Form/CForm.js +328 -0
  48. package/src/blocks/Payment/Form/Card.js +242 -0
  49. package/src/blocks/Payment/Gateway/GooglePay.js +251 -0
  50. package/src/blocks/Payment/Gateway/Payfort.js +90 -0
  51. package/src/blocks/Payment/Gateway/Paypal.js +138 -0
  52. package/src/blocks/Payment/Gateway/Wallet.js +149 -0
  53. package/src/blocks/Payment/PayWithWallet.js +35 -0
  54. package/src/blocks/Payment/PaymentMethod.js +132 -0
  55. package/src/blocks/Payment/SelectPayment.js +94 -0
  56. package/src/blocks/Payment/index.js +18 -0
  57. package/src/index.js +4 -1
  58. package/src/layout/Box.js +30 -17
  59. package/src/stories/BlocksStories/AuthForm.stories.js +105 -0
  60. package/src/stories/BlocksStories/PaymentForm.stories.js +82 -0
  61. package/src/stories/{UserAccount.stories.js → BlocksStories/UserAccount.stories.js} +2 -2
  62. package/src/stories/GlobalVariables.stories.js +33 -90
  63. package/src/stories/HawaProvider.stories.js +0 -1
  64. package/src/stories/Introduction.stories.js +132 -110
  65. package/src/stories/LayoutStories/Box.stories.js +56 -0
  66. package/src/stories/UIStories/ActionButton.stories.js +53 -0
  67. package/src/stories/{AdaptiveButton.stories.js → UIStories/AdaptiveButton.stories.js} +3 -3
  68. package/src/stories/UIStories/Alert.stories.js +55 -0
  69. package/src/stories/{CheckBox.stories.js → UIStories/CheckBox.stories.js} +3 -4
  70. package/src/stories/UIStories/InputLabel.stories.js +13 -0
  71. package/src/stories/{RadioSelector.stories.js → UIStories/RadioSelector.stories.js} +5 -6
  72. package/src/stories/{TextField.stories.js → UIStories/TextField.stories.js} +4 -5
  73. package/src/styles.scss +679 -0
  74. package/src/themes/HawaProvider.js +110 -16
  75. package/src/ui/ActionButton.js +35 -10
  76. package/src/ui/AdaptiveButton.js +29 -29
  77. package/src/ui/ApplePayButton.js +93 -0
  78. package/src/ui/AutoCompleteField.js +0 -1
  79. package/src/ui/DragDropImages.js +2 -2
  80. package/src/ui/GithubButton.js +90 -0
  81. package/src/ui/GoogleButton.js +82 -0
  82. package/src/ui/GooglePayButton.js +93 -0
  83. package/src/ui/HawaAlert.js +37 -0
  84. package/src/ui/HawaButton.js +48 -0
  85. package/src/ui/{Checkbox.js → HawaCheckbox.js} +3 -3
  86. package/src/ui/HawaInputLabel.js +32 -0
  87. package/src/ui/HawaLogoButton.js +48 -0
  88. package/src/ui/{RadioSelector.js → HawaRadio.js} +1 -1
  89. package/src/ui/{TextArea.js → HawaTextArea.js} +2 -2
  90. package/src/ui/HawaTextField.js +113 -0
  91. package/src/ui/HawaTypography.js +29 -0
  92. package/src/ui/MadaButton.js +93 -0
  93. package/src/ui/PayPalButton.js +93 -0
  94. package/src/ui/RadioBox.js +2 -2
  95. package/src/ui/STCPayButton.js +93 -0
  96. package/src/ui/SelectedField.js +4 -4
  97. package/src/ui/StyledTooltip.js +1 -1
  98. package/src/ui/TabPanel.js +1 -1
  99. package/src/ui/TwitterButton.js +83 -0
  100. package/src/ui/VisaMasterButton.js +93 -0
  101. package/src/ui/WalletButton.js +24 -0
  102. package/src/ui/index.js +23 -11
  103. package/storybook-static/0.0d994c92.iframe.bundle.js +3 -0
  104. package/storybook-static/{1.4e43f671.iframe.bundle.js.LICENSE.txt → 0.0d994c92.iframe.bundle.js.LICENSE.txt} +0 -0
  105. package/storybook-static/0.0d994c92.iframe.bundle.js.map +1 -0
  106. package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +1 -0
  107. package/storybook-static/1.aabc3f3a.iframe.bundle.js +1 -0
  108. package/storybook-static/{3.c1dc7159.iframe.bundle.js → 2.430bf1e3.iframe.bundle.js} +1 -1
  109. package/storybook-static/4.0fcda1281dc1961dbe94.manager.bundle.js +2 -0
  110. package/storybook-static/{4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt → 4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt} +0 -0
  111. package/storybook-static/{5.88fe62ee92ff5ca67829.manager.bundle.js → 5.63ab4f94d50a3acf080d.manager.bundle.js} +1 -1
  112. package/storybook-static/{7.69d2e532.iframe.bundle.js → 6.704d1e8d.iframe.bundle.js} +1 -1
  113. package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js → 6.a6d45262f7e98f3f18d3.manager.bundle.js} +2 -2
  114. package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt → 6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt} +0 -0
  115. package/storybook-static/{7.5ec31f3702b08ab0b71c.manager.bundle.js → 7.097710753af9a1c41b80.manager.bundle.js} +1 -1
  116. package/storybook-static/{8.68cd1217.iframe.bundle.js → 7.9ce807e3.iframe.bundle.js} +3 -3
  117. package/storybook-static/{8.68cd1217.iframe.bundle.js.LICENSE.txt → 7.9ce807e3.iframe.bundle.js.LICENSE.txt} +0 -0
  118. package/storybook-static/7.9ce807e3.iframe.bundle.js.map +1 -0
  119. package/storybook-static/{8.5ce13be7612bd3a6b864.manager.bundle.js → 8.76c3cbf398692028e834.manager.bundle.js} +1 -1
  120. package/storybook-static/{9.488e3969.iframe.bundle.js → 8.c4cb6081.iframe.bundle.js} +1 -1
  121. package/storybook-static/iframe.html +1 -1
  122. package/storybook-static/index.html +1 -1
  123. package/storybook-static/main.ac6e4b72b033097dad76.manager.bundle.js +1 -0
  124. package/storybook-static/main.e55ce615.iframe.bundle.js +1 -0
  125. package/storybook-static/{runtime~main.cc29f4c2175f187a3707.manager.bundle.js → runtime~main.c8dac23bc753439736f0.manager.bundle.js} +1 -1
  126. package/storybook-static/runtime~main.cfefe972.iframe.bundle.js +1 -0
  127. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +76 -0
  128. package/storybook-static/{vendors~main.d144d840.iframe.bundle.js.LICENSE.txt → vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt} +3 -30
  129. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +1 -0
  130. package/storybook-static/vendors~main.a697e07137d366f95f76.manager.bundle.js +2 -0
  131. package/storybook-static/{vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt → vendors~main.a697e07137d366f95f76.manager.bundle.js.LICENSE.txt} +0 -0
  132. package/tools/build-styles.js +17 -0
  133. package/src/blocks/AuthForms/viaFacebook.js +0 -0
  134. package/src/blocks/AuthForms/viaGithub.js +0 -0
  135. package/src/blocks/AuthForms/viaGoogle.js +0 -0
  136. package/src/blocks/AuthForms/viaTwitter.js +0 -0
  137. package/src/stories/ActionButton.stories.js +0 -49
  138. package/src/stories/Alert.stories.js +0 -41
  139. package/src/stories/AuthForm.stories.js +0 -79
  140. package/src/stories/Box.stories.js +0 -64
  141. package/src/stories/InputLabel.stories.js +0 -92
  142. package/src/ui/StyledAlert.js +0 -30
  143. package/src/ui/StyledInputLabel.js +0 -19
  144. package/src/ui/TextField.js +0 -62
  145. package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +0 -1
  146. package/storybook-static/0.dd3d47f5.iframe.bundle.js +0 -1
  147. package/storybook-static/1.4e43f671.iframe.bundle.js +0 -3
  148. package/storybook-static/1.4e43f671.iframe.bundle.js.map +0 -1
  149. package/storybook-static/2.9a757207.iframe.bundle.js +0 -1
  150. package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +0 -2
  151. package/storybook-static/8.68cd1217.iframe.bundle.js.map +0 -1
  152. package/storybook-static/main.65cb2769.iframe.bundle.js +0 -1
  153. package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +0 -1
  154. package/storybook-static/runtime~main.6e2e1544.iframe.bundle.js +0 -1
  155. package/storybook-static/vendors~main.d144d840.iframe.bundle.js +0 -3
  156. package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +0 -1
  157. package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +0 -2
  158. package/yarn-error.log +0 -10910
@@ -0,0 +1,37 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeProvider } from "../themes/HawaProvider";
3
+ import { styled, alpha } from "@mui/material/styles";
4
+
5
+ import Alert from "@mui/material/Alert";
6
+ import AlertTitle from "@mui/material/AlertTitle";
7
+
8
+ export const HawaAlert = (props) => {
9
+ const theme = useContext(ThemeProvider);
10
+ const currentTheme = Object.keys(theme.alerts).find(
11
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
12
+ );
13
+ let alertStyle = {};
14
+
15
+ if (currentTheme) {
16
+ alertStyle = {
17
+ ...theme.alerts[currentTheme]
18
+ };
19
+ } else {
20
+ alertStyle = {
21
+ marginBottom: 10
22
+ };
23
+ }
24
+
25
+ const StyledAlert = styled(Alert)(({ theme }) => {
26
+ return {
27
+ ...alertStyle
28
+ };
29
+ });
30
+
31
+ return (
32
+ <StyledAlert themeType={props.themeType} {...props}>
33
+ {props.title && <AlertTitle>{props.title}</AlertTitle>}
34
+ {props.text}
35
+ </StyledAlert>
36
+ );
37
+ };
@@ -0,0 +1,48 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeProvider } from "../themes/HawaProvider";
3
+ import { styled, darken } from "@mui/material/styles";
4
+ import Button from "@mui/material/Button";
5
+
6
+ export const HawaButton = (props) => {
7
+ const theme = useContext(ThemeProvider);
8
+ let buttonStyle = {};
9
+ let currentTheme = Object.keys(theme.actionButton).find(
10
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
11
+ );
12
+ if (currentTheme) {
13
+ buttonStyle = {
14
+ ...theme.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: theme.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>;
48
+ };
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import FormControlLabel from "@material-ui/core/FormControlLabel";
3
- import Checkbox from "@material-ui/core/Checkbox";
2
+ import FormControlLabel from "@mui/material/FormControlLabel";
3
+ import Checkbox from "@mui/material/Checkbox";
4
4
  // import PropTypes from "prop-types";
5
5
 
6
- export const StyledCheckbox = (props) => {
6
+ export const HawaCheckbox = (props) => {
7
7
  console.log("props : ", props);
8
8
  return (
9
9
  <React.Fragment>
@@ -0,0 +1,32 @@
1
+ import InputLabel from "@mui/material/InputLabel";
2
+ import { useContext } from "react";
3
+ import { ThemeProvider } from "../themes/HawaProvider";
4
+
5
+ export const HawaInputLabel = (props) => {
6
+ const theme = useContext(ThemeProvider);
7
+ let labelStyle = {};
8
+
9
+ let currentTheme = Object.keys(theme.actionButton).find(
10
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
11
+ );
12
+ if (currentTheme) {
13
+ labelStyle = {
14
+ margin: 15,
15
+ marginRight: 5,
16
+ marginLeft: 5,
17
+ color: theme.layout[currentTheme].color
18
+ };
19
+ } else {
20
+ labelStyle = {
21
+ margin: 15,
22
+ marginRight: 0,
23
+ marginLeft: 0,
24
+ color: "black"
25
+ };
26
+ }
27
+ return (
28
+ <InputLabel style={labelStyle}>
29
+ <div style={{ fontSize: 15 }}>{props.label}</div>
30
+ </InputLabel>
31
+ );
32
+ };
@@ -0,0 +1,48 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeProvider } from "../themes/HawaProvider";
3
+ import { styled, darken } from "@mui/material/styles";
4
+ import Button from "@mui/material/Button";
5
+
6
+ export const HawaLogoButton = (props) => {
7
+ const theme = useContext(ThemeProvider);
8
+ let buttonStyle = {};
9
+ let currentTheme = Object.keys(theme.logoButton).find(
10
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
11
+ );
12
+ if (currentTheme) {
13
+ buttonStyle = {
14
+ ...theme.logoButton[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: theme.logoButton[currentTheme]?.margin,
33
+ border: props.outlined ? "2px solid black" : "none",
34
+ // borderRadius: 0,
35
+ height: 50,
36
+ backgroundColor: "white",
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>;
48
+ };
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useContext } from "react";
2
2
  import { ThemeProvider } from "../themes/HawaProvider";
3
3
 
4
- export const StyledRadioSelector = (props) => {
4
+ export const HawaRadio = (props) => {
5
5
  const [value, setValue] = useState(props.defaultValue);
6
6
  const theme = useContext(ThemeProvider);
7
7
 
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
2
  import { Controller, useFormContext } from "react-hook-form";
3
- import { StyledInputLabel } from "../ui";
3
+ import { StyledInputLabel } from ".";
4
4
 
5
- export const StyledTextArea = (props) => {
5
+ export const HawaTextArea = (props) => {
6
6
  const { control } = useFormContext();
7
7
  const { name, rules, shouldUnregister, inputLabel, helperText } = props;
8
8
 
@@ -0,0 +1,113 @@
1
+ import React, { useContext } from "react";
2
+ import InputBase from "@mui/material/InputBase";
3
+ import Typography from "@mui/material/Typography";
4
+ import { styled, alpha } from "@mui/material/styles";
5
+ import PropTypes from "prop-types";
6
+ import { ThemeProvider } from "../themes/HawaProvider";
7
+ import { HawaInputLabel } from "./HawaInputLabel";
8
+ import { Controller, useFormContext } from "react-hook-form";
9
+
10
+ export const HawaTextField = (props) => {
11
+ const { control, register } = useFormContext();
12
+
13
+ const theme = useContext(ThemeProvider);
14
+ const currentTheme = Object.keys(theme.actionButton).find(
15
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
16
+ );
17
+ let textFieldStyle = {};
18
+
19
+ if (currentTheme) {
20
+ textFieldStyle = {
21
+ ...theme.inputFields[currentTheme],
22
+ margin: props.last ? 0 : theme.inputFields[currentTheme].margin,
23
+ marginTop: props.last ? theme.inputFields[currentTheme].margin * 2 : 0
24
+ };
25
+ } else {
26
+ textFieldStyle = {
27
+ backgroundColor: "white",
28
+ display: "flex",
29
+ flexDirection: "column",
30
+ alignItems: "flex-start",
31
+ justifyContent: "flex-start"
32
+ };
33
+ }
34
+
35
+ const StyledTextField = styled(InputBase)(({ theme }) => {
36
+ return {
37
+ // "label + &": {
38
+ // marginTop: theme.spacing(3)
39
+ // },
40
+ "& .MuiInputBase-input": {
41
+ backgroundColor: theme.palette.mode === "light" ? "#fcfcfb" : "#2b2b2b",
42
+ transition: theme.transitions.create([
43
+ "border-color",
44
+ "background-color",
45
+ "box-shadow"
46
+ ]),
47
+
48
+ "&:focus": {
49
+ // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
50
+ // borderColor: theme.palette.primary.main
51
+ // borderColor: theme.actionButton[currentTheme]?.backgroundColor
52
+ },
53
+ borderRadius: 4,
54
+ // position: "relative",
55
+ border: "1px solid #ced4da",
56
+ fontSize: 16,
57
+ // width: "auto",
58
+ padding: "10px 12px",
59
+ marginBottom: props.helperText ? 5 : 0,
60
+ ...textFieldStyle
61
+ }
62
+ };
63
+ });
64
+
65
+ return (
66
+ <Controller
67
+ render={({ field }) => (
68
+ <>
69
+ {props.inputLabel && (
70
+ <HawaInputLabel
71
+ themeType={props.themeType}
72
+ label={props.inputLabel}
73
+ />
74
+ )}
75
+
76
+ <StyledTextField
77
+ fullWidth={true}
78
+ // helperText={props.helperText}
79
+ type={props.type ?? "text"}
80
+ // placeholder={props.placeholder}
81
+ // inputProps={
82
+ // props.type === "number"
83
+ // ? {
84
+ // inputMode: "numeric",
85
+ // min: "0",
86
+ // max: "9999999",
87
+ // step: "0.01"
88
+ // }
89
+ // : {}
90
+ // }
91
+ defaultValue={props.defaultValue && ""}
92
+ value={props.value && ""}
93
+ {...props}
94
+ // {...field}
95
+ {...register(props.name)}
96
+ />
97
+ <Typography variant="caption" style={{ margin: 5, color: "red" }}>
98
+ {props.helperText}
99
+ </Typography>
100
+ </>
101
+ )}
102
+ name={props.name}
103
+ rules={props.rules}
104
+ control={control}
105
+ shouldUnregister={props.shouldUnregister}
106
+ />
107
+ );
108
+ };
109
+
110
+ HawaTextField.propTypes = {
111
+ type: PropTypes.oneOf(["text", "number", "password"]),
112
+ helperText: PropTypes.string
113
+ };
@@ -0,0 +1,29 @@
1
+ import React, { useContext } from "react";
2
+ import { styled, alpha } from "@mui/material/styles";
3
+ import PropTypes from "prop-types";
4
+ import { ThemeProvider } from "../themes/HawaProvider";
5
+ import Typography from "@mui/material/Typography";
6
+
7
+ export const HawaTypography = (props) => {
8
+ const theme = useContext(ThemeProvider);
9
+ const currentTheme = Object.keys(theme.actionButton).find(
10
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
11
+ );
12
+ let typographyStyle = {};
13
+
14
+ if (currentTheme) {
15
+ typographyStyle = { ...theme.typography[currentTheme] };
16
+ } else {
17
+ typographyStyle = {
18
+ color: "black"
19
+ };
20
+ }
21
+
22
+ const StyledTypography = styled(Typography)(({ theme }) => {
23
+ return {
24
+ ...typographyStyle
25
+ };
26
+ });
27
+
28
+ return <StyledTypography {...props}>{props.children}</StyledTypography>;
29
+ };
@@ -0,0 +1,93 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeProvider } from "../themes/HawaProvider";
3
+ import Button from "@mui/material/Button";
4
+ import { styled, darken } from "@mui/material/styles";
5
+
6
+ import GitHubIcon from "@mui/icons-material/GitHub";
7
+
8
+ export const MadaButton = (props) => {
9
+ const theme = useContext(ThemeProvider);
10
+ let buttonStyle = {};
11
+
12
+ let currentTheme = Object.keys(theme.actionButton).find(
13
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
14
+ );
15
+ if (currentTheme) {
16
+ buttonStyle = {
17
+ cursor: "pointer",
18
+ display: "flex",
19
+ flexDirection: "row",
20
+ alignItems: "center",
21
+ justifyContent: "center",
22
+ padding: 0,
23
+ marginTop: theme.actionButton[currentTheme].margin,
24
+ border: props.outlined ? "2px solid black" : "none",
25
+ borderRadius: theme.actionButton[currentTheme].borderRadius,
26
+ backgroundColor: "white",
27
+ "&:hover": {
28
+ backgroundColor: darken("#ffffff", 0.1)
29
+ }
30
+ };
31
+ } else {
32
+ buttonStyle = {
33
+ cursor: "pointer",
34
+ display: "flex",
35
+ flexDirection: "row",
36
+ alignItems: "center",
37
+ justifyContent: "center",
38
+ marginTop: theme.margins,
39
+ border: props.outlined ? "2px solid black" : "none",
40
+ borderRadius: 0,
41
+ backgroundColor: "white",
42
+ "&:hover": {
43
+ backgroundColor: darken("#ffffff", 0.1)
44
+ }
45
+ };
46
+ }
47
+
48
+ const StyledButton = styled(Button)(({ theme }) => {
49
+ return {
50
+ // "label + &": {
51
+ // marginTop: theme.spacing(3)
52
+ // },
53
+
54
+ borderRadius: 4,
55
+ position: "relative",
56
+ border: "1px solid #ced4da",
57
+ fontSize: 16,
58
+ // width: "auto",
59
+ height: 50,
60
+ // padding: "10px 12px",
61
+ ...buttonStyle,
62
+ "&:focus": {
63
+ // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
64
+ borderColor: theme.palette.primary.main
65
+ }
66
+ };
67
+ });
68
+
69
+ return (
70
+ <StyledButton
71
+ // style={buttonStyle}
72
+ onClick={props.handleClick}
73
+ >
74
+ <img
75
+ src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png"
76
+ height={30}
77
+ />{" "}
78
+ <div style={{ width: 10 }} />
79
+ <p
80
+ style={{
81
+ color: "black",
82
+ fontSize: 14,
83
+ textAlign: "center",
84
+ letterSpacing: 0.4,
85
+ fontFamily: "Roboto",
86
+ fontWeight: 500
87
+ }}
88
+ >
89
+ {props.buttonText}
90
+ </p>
91
+ </StyledButton>
92
+ );
93
+ };
@@ -0,0 +1,93 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeProvider } from "../themes/HawaProvider";
3
+ import Button from "@mui/material/Button";
4
+ import { styled, darken } from "@mui/material/styles";
5
+
6
+ import GitHubIcon from "@mui/icons-material/GitHub";
7
+
8
+ export const PayPalButton = (props) => {
9
+ const theme = useContext(ThemeProvider);
10
+ let buttonStyle = {};
11
+
12
+ let currentTheme = Object.keys(theme.actionButton).find(
13
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
14
+ );
15
+ if (currentTheme) {
16
+ buttonStyle = {
17
+ cursor: "pointer",
18
+ display: "flex",
19
+ flexDirection: "row",
20
+ alignItems: "center",
21
+ justifyContent: "center",
22
+ padding: 0,
23
+ marginTop: theme.actionButton[currentTheme].margin,
24
+ border: props.outlined ? "2px solid black" : "none",
25
+ borderRadius: theme.actionButton[currentTheme].borderRadius,
26
+ backgroundColor: "white",
27
+ "&:hover": {
28
+ backgroundColor: darken("#ffffff", 0.1)
29
+ }
30
+ };
31
+ } else {
32
+ buttonStyle = {
33
+ cursor: "pointer",
34
+ display: "flex",
35
+ flexDirection: "row",
36
+ alignItems: "center",
37
+ justifyContent: "center",
38
+ marginTop: theme.margins,
39
+ border: props.outlined ? "2px solid black" : "none",
40
+ borderRadius: 0,
41
+ backgroundColor: "white",
42
+ "&:hover": {
43
+ backgroundColor: darken("#ffffff", 0.1)
44
+ }
45
+ };
46
+ }
47
+
48
+ const StyledButton = styled(Button)(({ theme }) => {
49
+ return {
50
+ // "label + &": {
51
+ // marginTop: theme.spacing(3)
52
+ // },
53
+
54
+ borderRadius: 4,
55
+ position: "relative",
56
+ border: "1px solid #ced4da",
57
+ fontSize: 16,
58
+ // width: "auto",
59
+ height: 50,
60
+ // padding: "10px 12px",
61
+ ...buttonStyle,
62
+ "&:focus": {
63
+ // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
64
+ borderColor: theme.palette.primary.main
65
+ }
66
+ };
67
+ });
68
+
69
+ return (
70
+ <StyledButton
71
+ // style={buttonStyle}
72
+ onClick={props.handleClick}
73
+ >
74
+ <img
75
+ src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png"
76
+ height={25}
77
+ />{" "}
78
+ <div style={{ width: 10 }} />
79
+ <p
80
+ style={{
81
+ color: "black",
82
+ fontSize: 14,
83
+ textAlign: "center",
84
+ letterSpacing: 0.4,
85
+ fontFamily: "Roboto",
86
+ fontWeight: 500
87
+ }}
88
+ >
89
+ {props.buttonText}
90
+ </p>
91
+ </StyledButton>
92
+ );
93
+ };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Controller, useFormContext } from "react-hook-form";
3
- import FormControlLabel from "@material-ui/core/FormControlLabel";
4
- import Checkbox from "@material-ui/core/Checkbox";
3
+ import FormControlLabel from "@mui/material/FormControlLabel";
4
+ import Checkbox from "@mui/material/Checkbox";
5
5
 
6
6
  export const StyledRadioBox = (props) => {
7
7
  const { control } = useFormContext();
@@ -0,0 +1,93 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeProvider } from "../themes/HawaProvider";
3
+ import Button from "@mui/material/Button";
4
+ import { styled, darken } from "@mui/material/styles";
5
+
6
+ import GitHubIcon from "@mui/icons-material/GitHub";
7
+
8
+ export const STCPayButton = (props) => {
9
+ const theme = useContext(ThemeProvider);
10
+ let buttonStyle = {};
11
+
12
+ let currentTheme = Object.keys(theme.actionButton).find(
13
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
14
+ );
15
+ if (currentTheme) {
16
+ buttonStyle = {
17
+ cursor: "pointer",
18
+ display: "flex",
19
+ flexDirection: "row",
20
+ alignItems: "center",
21
+ justifyContent: "center",
22
+ padding: 0,
23
+ marginTop: theme.actionButton[currentTheme].margin,
24
+ border: props.outlined ? "2px solid black" : "none",
25
+ borderRadius: theme.actionButton[currentTheme].borderRadius,
26
+ backgroundColor: "white",
27
+ "&:hover": {
28
+ backgroundColor: darken("#ffffff", 0.1)
29
+ }
30
+ };
31
+ } else {
32
+ buttonStyle = {
33
+ cursor: "pointer",
34
+ display: "flex",
35
+ flexDirection: "row",
36
+ alignItems: "center",
37
+ justifyContent: "center",
38
+ marginTop: theme.margins,
39
+ border: props.outlined ? "2px solid black" : "none",
40
+ borderRadius: 0,
41
+ backgroundColor: "white",
42
+ "&:hover": {
43
+ backgroundColor: darken("#ffffff", 0.1)
44
+ }
45
+ };
46
+ }
47
+
48
+ const StyledButton = styled(Button)(({ theme }) => {
49
+ return {
50
+ // "label + &": {
51
+ // marginTop: theme.spacing(3)
52
+ // },
53
+
54
+ borderRadius: 4,
55
+ position: "relative",
56
+ border: "1px solid #ced4da",
57
+ fontSize: 16,
58
+ // width: "auto",
59
+ height: 50,
60
+ // padding: "10px 12px",
61
+ ...buttonStyle,
62
+ "&:focus": {
63
+ // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
64
+ borderColor: theme.palette.primary.main
65
+ }
66
+ };
67
+ });
68
+
69
+ return (
70
+ <StyledButton
71
+ // style={buttonStyle}
72
+ onClick={props.handleClick}
73
+ >
74
+ <img
75
+ src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png"
76
+ height={20}
77
+ />{" "}
78
+ <div style={{ width: 10 }} />
79
+ <p
80
+ style={{
81
+ color: "black",
82
+ fontSize: 14,
83
+ textAlign: "center",
84
+ letterSpacing: 0.4,
85
+ fontFamily: "Roboto",
86
+ fontWeight: 500
87
+ }}
88
+ >
89
+ {props.buttonText}
90
+ </p>
91
+ </StyledButton>
92
+ );
93
+ };
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import { Controller, useFormContext } from "react-hook-form";
3
- import FormHelperText from "@material-ui/core/FormHelperText";
4
- import FormControl from "@material-ui/core/FormControl";
5
- import MenuItem from "@material-ui/core/MenuItem";
6
- import Select from "@material-ui/core/Select";
3
+ import FormHelperText from "@mui/material/FormHelperText";
4
+ import FormControl from "@mui/material/FormControl";
5
+ import MenuItem from "@mui/material/MenuItem";
6
+ import Select from "@mui/material/Select";
7
7
 
8
8
  const MuiSelect = (props) => {
9
9
  const { name, options, required, error } = props;
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useContext } from "react";
2
- import Tooltip from "@material-ui/core/Tooltip";
2
+ import Tooltip from "@mui/material/Tooltip";
3
3
 
4
4
  export const StyledTooltip = (props) => {
5
5
  const screenSize = {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { makeStyles } from "@material-ui/core";
2
+ import { makeStyles } from "@mui/material/styles";
3
3
 
4
4
  const useStyles = makeStyles((theme) => ({
5
5
  panelsContainer: {