@sikka/hawa 0.0.4 → 0.0.5

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 (96) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +10 -7
  4. package/src/blocks/Account/UserProfile.js +11 -11
  5. package/src/blocks/Account/UserSettings.js +11 -11
  6. package/src/blocks/AuthForms/NewPasswordForm.js +15 -8
  7. package/src/blocks/AuthForms/ResetPasswordForm.js +7 -8
  8. package/src/blocks/AuthForms/SignInForm.js +49 -13
  9. package/src/blocks/AuthForms/SignUpForm.js +61 -13
  10. package/src/blocks/Payment/CreditCardForm.js +31 -0
  11. package/src/blocks/Payment/Form/CForm.js +10 -8
  12. package/src/blocks/Payment/Gateway/Wallet.js +5 -5
  13. package/src/blocks/Payment/PaymentMethod.js +2 -2
  14. package/src/blocks/Payment/SelectPayment.js +95 -0
  15. package/src/blocks/Payment/index.js +16 -0
  16. package/src/index.js +3 -1
  17. package/src/layout/Box.js +31 -17
  18. package/src/stories/ActionButton.stories.js +23 -19
  19. package/src/stories/AdaptiveButton.stories.js +1 -1
  20. package/src/stories/BlocksStories/AuthForm.stories.js +99 -0
  21. package/src/stories/BlocksStories/PaymentForm.stories.js +111 -0
  22. package/src/stories/{UserAccount.stories.js → BlocksStories/UserAccount.stories.js} +2 -2
  23. package/src/stories/GlobalVariables.stories.js +33 -90
  24. package/src/stories/HawaProvider.stories.js +0 -1
  25. package/src/stories/LayoutStories/Box.stories.js +56 -0
  26. package/src/themes/HawaProvider.js +59 -17
  27. package/src/ui/ActionButton.js +35 -10
  28. package/src/ui/AdaptiveButton.js +29 -29
  29. package/src/ui/ApplePayButton.js +94 -0
  30. package/src/ui/AutoCompleteField.js +0 -1
  31. package/src/ui/Checkbox.js +2 -2
  32. package/src/ui/DragDropImages.js +2 -2
  33. package/src/ui/GithubButton.js +91 -0
  34. package/src/ui/GoogleButton.js +83 -0
  35. package/src/ui/GooglePayButton.js +94 -0
  36. package/src/ui/HawaInputLabel.js +33 -0
  37. package/src/ui/{TextArea.js → HawaTextArea.js} +2 -2
  38. package/src/ui/HawaTextField.js +118 -0
  39. package/src/ui/MadaButton.js +94 -0
  40. package/src/ui/PayPalButton.js +94 -0
  41. package/src/ui/RadioBox.js +2 -2
  42. package/src/ui/STCPayButton.js +94 -0
  43. package/src/ui/SelectedField.js +4 -4
  44. package/src/ui/StyledTooltip.js +1 -1
  45. package/src/ui/TabPanel.js +1 -1
  46. package/src/ui/TwitterButton.js +84 -0
  47. package/src/ui/VisaMasterButton.js +94 -0
  48. package/src/ui/WalletButton.js +91 -0
  49. package/src/ui/index.js +21 -12
  50. package/storybook-static/0.54f7e52e.iframe.bundle.js +1 -0
  51. package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +1 -0
  52. package/storybook-static/1.95be85dd.iframe.bundle.js +3 -0
  53. package/storybook-static/{1.4e43f671.iframe.bundle.js.LICENSE.txt → 1.95be85dd.iframe.bundle.js.LICENSE.txt} +0 -0
  54. package/storybook-static/1.95be85dd.iframe.bundle.js.map +1 -0
  55. package/storybook-static/2.eb601582.iframe.bundle.js +1 -0
  56. package/storybook-static/{3.c1dc7159.iframe.bundle.js → 3.d72f7fac.iframe.bundle.js} +0 -0
  57. package/storybook-static/4.0fcda1281dc1961dbe94.manager.bundle.js +2 -0
  58. package/storybook-static/{4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt → 4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt} +0 -0
  59. package/storybook-static/{5.88fe62ee92ff5ca67829.manager.bundle.js → 5.63ab4f94d50a3acf080d.manager.bundle.js} +1 -1
  60. package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js → 6.a6d45262f7e98f3f18d3.manager.bundle.js} +2 -2
  61. package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt → 6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt} +0 -0
  62. package/storybook-static/{7.5ec31f3702b08ab0b71c.manager.bundle.js → 7.097710753af9a1c41b80.manager.bundle.js} +1 -1
  63. package/storybook-static/{7.69d2e532.iframe.bundle.js → 7.ffb0d84b.iframe.bundle.js} +1 -1
  64. package/storybook-static/{8.5ce13be7612bd3a6b864.manager.bundle.js → 8.76c3cbf398692028e834.manager.bundle.js} +1 -1
  65. package/storybook-static/iframe.html +1 -1
  66. package/storybook-static/index.html +1 -1
  67. package/storybook-static/main.044648aa.iframe.bundle.js +1 -0
  68. package/storybook-static/main.ac6e4b72b033097dad76.manager.bundle.js +1 -0
  69. package/storybook-static/{runtime~main.6e2e1544.iframe.bundle.js → runtime~main.3e280e98.iframe.bundle.js} +1 -1
  70. package/storybook-static/{runtime~main.cc29f4c2175f187a3707.manager.bundle.js → runtime~main.c8dac23bc753439736f0.manager.bundle.js} +1 -1
  71. package/storybook-static/vendors~main.a697e07137d366f95f76.manager.bundle.js +2 -0
  72. package/storybook-static/{vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt → vendors~main.a697e07137d366f95f76.manager.bundle.js.LICENSE.txt} +0 -0
  73. package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js +76 -0
  74. package/storybook-static/{vendors~main.d144d840.iframe.bundle.js.LICENSE.txt → vendors~main.d75dc38b.iframe.bundle.js.LICENSE.txt} +3 -45
  75. package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js.map +1 -0
  76. package/src/blocks/AuthForms/viaFacebook.js +0 -0
  77. package/src/blocks/AuthForms/viaGithub.js +0 -0
  78. package/src/blocks/AuthForms/viaGoogle.js +0 -0
  79. package/src/blocks/AuthForms/viaTwitter.js +0 -0
  80. package/src/blocks/index.js +0 -13
  81. package/src/stories/AuthForm.stories.js +0 -79
  82. package/src/stories/Box.stories.js +0 -64
  83. package/src/ui/StyledInputLabel.js +0 -19
  84. package/src/ui/TextField.js +0 -62
  85. package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +0 -1
  86. package/storybook-static/0.dd3d47f5.iframe.bundle.js +0 -1
  87. package/storybook-static/1.4e43f671.iframe.bundle.js +0 -3
  88. package/storybook-static/1.4e43f671.iframe.bundle.js.map +0 -1
  89. package/storybook-static/2.9a757207.iframe.bundle.js +0 -1
  90. package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +0 -2
  91. package/storybook-static/main.65cb2769.iframe.bundle.js +0 -1
  92. package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +0 -1
  93. package/storybook-static/vendors~main.d144d840.iframe.bundle.js +0 -3
  94. package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +0 -1
  95. package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +0 -2
  96. package/yarn-error.log +0 -10910
@@ -0,0 +1,94 @@
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
+ console.log(Object.keys(theme.actionButton));
13
+ let currentTheme = Object.keys(theme.actionButton).find(
14
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
15
+ );
16
+ if (currentTheme) {
17
+ buttonStyle = {
18
+ cursor: "pointer",
19
+ display: "flex",
20
+ flexDirection: "row",
21
+ alignItems: "center",
22
+ justifyContent: "center",
23
+ padding: 0,
24
+ marginTop: theme.actionButton[currentTheme].margin,
25
+ border: props.outlined ? "2px solid black" : "none",
26
+ borderRadius: theme.actionButton[currentTheme].borderRadius,
27
+ backgroundColor: "white",
28
+ "&:hover": {
29
+ backgroundColor: darken("#ffffff", 0.1)
30
+ }
31
+ };
32
+ } else {
33
+ buttonStyle = {
34
+ cursor: "pointer",
35
+ display: "flex",
36
+ flexDirection: "row",
37
+ alignItems: "center",
38
+ justifyContent: "center",
39
+ marginTop: theme.margins,
40
+ border: props.outlined ? "2px solid black" : "none",
41
+ borderRadius: 0,
42
+ backgroundColor: "white",
43
+ "&:hover": {
44
+ backgroundColor: darken("#ffffff", 0.1)
45
+ }
46
+ };
47
+ }
48
+
49
+ const StyledButton = styled(Button)(({ theme }) => {
50
+ return {
51
+ // "label + &": {
52
+ // marginTop: theme.spacing(3)
53
+ // },
54
+
55
+ borderRadius: 4,
56
+ position: "relative",
57
+ border: "1px solid #ced4da",
58
+ fontSize: 16,
59
+ // width: "auto",
60
+ height: 50,
61
+ // padding: "10px 12px",
62
+ ...buttonStyle,
63
+ "&:focus": {
64
+ // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
65
+ borderColor: theme.palette.primary.main
66
+ }
67
+ };
68
+ });
69
+
70
+ return (
71
+ <StyledButton
72
+ // style={buttonStyle}
73
+ onClick={props.handleClick}
74
+ >
75
+ <img
76
+ src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png"
77
+ height={30}
78
+ />{" "}
79
+ <div style={{ width: 10 }} />
80
+ <p
81
+ style={{
82
+ color: "black",
83
+ fontSize: 14,
84
+ textAlign: "center",
85
+ letterSpacing: 0.4,
86
+ fontFamily: "Roboto",
87
+ fontWeight: 500
88
+ }}
89
+ >
90
+ {props.buttonText}
91
+ </p>
92
+ </StyledButton>
93
+ );
94
+ };
@@ -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: {
@@ -0,0 +1,84 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeProvider } from "../themes/HawaProvider";
3
+ import TwitterIcon from "@mui/icons-material/Twitter";
4
+ import Button from "@mui/material/Button";
5
+ import { styled, alpha, darken } from "@mui/material/styles";
6
+
7
+ export const TwitterButton = (props) => {
8
+ const theme = useContext(ThemeProvider);
9
+ let buttonStyle = {};
10
+
11
+ console.log(Object.keys(theme.actionButton));
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
+ marginTop: theme.layout[currentTheme].margin,
23
+ border: props.outlined ? "2px solid black" : "none",
24
+ borderRadius: theme.layout[currentTheme].borderRadius,
25
+ backgroundColor: "white",
26
+ "&:hover": {
27
+ backgroundColor: darken("#ffffff", 0.1)
28
+ }
29
+ };
30
+ } else {
31
+ buttonStyle = {
32
+ cursor: "pointer",
33
+ display: "flex",
34
+ flexDirection: "row",
35
+ alignItems: "center",
36
+ justifyContent: "center",
37
+ marginTop: theme.margins,
38
+ border: props.outlined ? "2px solid black" : "none",
39
+ borderRadius: 0,
40
+ backgroundColor: "white",
41
+ "&:hover": {
42
+ backgroundColor: darken("#ffffff", 0.1)
43
+ }
44
+ };
45
+ }
46
+ const StyledButton = styled(Button)(({ theme }) => {
47
+ return {
48
+ // "label + &": {
49
+ // marginTop: theme.spacing(3)
50
+ // },
51
+
52
+ borderRadius: 4,
53
+ position: "relative",
54
+ border: "1px solid #ced4da",
55
+ fontSize: 16,
56
+ // width: "auto",
57
+ height: 50,
58
+ // padding: "10px 12px",
59
+ ...buttonStyle,
60
+ "&:focus": {
61
+ // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
62
+ borderColor: theme.palette.primary.main
63
+ }
64
+ };
65
+ });
66
+ return (
67
+ <StyledButton onClick={props.handleClick}>
68
+ <TwitterIcon />
69
+ <div style={{ width: 10 }} />
70
+ <p
71
+ style={{
72
+ color: "black",
73
+ fontSize: 14,
74
+ textAlign: "center",
75
+ letterSpacing: 0.4,
76
+ fontFamily: "Roboto",
77
+ fontWeight: 500
78
+ }}
79
+ >
80
+ {props.buttonText}
81
+ </p>
82
+ </StyledButton>
83
+ );
84
+ };
@@ -0,0 +1,94 @@
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 VisaMasterButton = (props) => {
9
+ const theme = useContext(ThemeProvider);
10
+ let buttonStyle = {};
11
+
12
+ console.log(Object.keys(theme.actionButton));
13
+ let currentTheme = Object.keys(theme.actionButton).find(
14
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
15
+ );
16
+ if (currentTheme) {
17
+ buttonStyle = {
18
+ cursor: "pointer",
19
+ display: "flex",
20
+ flexDirection: "row",
21
+ alignItems: "center",
22
+ justifyContent: "center",
23
+ padding: 0,
24
+ marginTop: theme.actionButton[currentTheme].margin,
25
+ border: props.outlined ? "2px solid black" : "none",
26
+ borderRadius: theme.actionButton[currentTheme].borderRadius,
27
+ backgroundColor: "white",
28
+ "&:hover": {
29
+ backgroundColor: darken("#ffffff", 0.1)
30
+ }
31
+ };
32
+ } else {
33
+ buttonStyle = {
34
+ cursor: "pointer",
35
+ display: "flex",
36
+ flexDirection: "row",
37
+ alignItems: "center",
38
+ justifyContent: "center",
39
+ marginTop: theme.margins,
40
+ border: props.outlined ? "2px solid black" : "none",
41
+ borderRadius: 0,
42
+ backgroundColor: "white",
43
+ "&:hover": {
44
+ backgroundColor: darken("#ffffff", 0.1)
45
+ }
46
+ };
47
+ }
48
+
49
+ const StyledButton = styled(Button)(({ theme }) => {
50
+ return {
51
+ // "label + &": {
52
+ // marginTop: theme.spacing(3)
53
+ // },
54
+
55
+ borderRadius: 4,
56
+ position: "relative",
57
+ border: "1px solid #ced4da",
58
+ fontSize: 16,
59
+ // width: "auto",
60
+ height: 50,
61
+ // padding: "10px 12px",
62
+ ...buttonStyle,
63
+ "&:focus": {
64
+ // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
65
+ borderColor: theme.palette.primary.main
66
+ }
67
+ };
68
+ });
69
+
70
+ return (
71
+ <StyledButton
72
+ // style={buttonStyle}
73
+ onClick={props.handleClick}
74
+ >
75
+ <img
76
+ src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png"
77
+ height={30}
78
+ />{" "}
79
+ <div style={{ width: 10 }} />
80
+ <p
81
+ style={{
82
+ color: "black",
83
+ fontSize: 14,
84
+ textAlign: "center",
85
+ letterSpacing: 0.4,
86
+ fontFamily: "Roboto",
87
+ fontWeight: 500
88
+ }}
89
+ >
90
+ {props.buttonText}
91
+ </p>
92
+ </StyledButton>
93
+ );
94
+ };
@@ -0,0 +1,91 @@
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 WalletIcon from "@mui/icons-material/AccountBalanceWallet";
7
+
8
+ export const WalletButton = (props) => {
9
+ const theme = useContext(ThemeProvider);
10
+ let buttonStyle = {};
11
+
12
+ console.log(Object.keys(theme.actionButton));
13
+ let currentTheme = Object.keys(theme.actionButton).find(
14
+ (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
15
+ );
16
+ if (currentTheme) {
17
+ buttonStyle = {
18
+ cursor: "pointer",
19
+ display: "flex",
20
+ flexDirection: "row",
21
+ alignItems: "center",
22
+ justifyContent: "center",
23
+ padding: 0,
24
+ marginTop: theme.actionButton[currentTheme].margin,
25
+ border: props.outlined ? "2px solid black" : "none",
26
+ borderRadius: theme.actionButton[currentTheme].borderRadius,
27
+ backgroundColor: "white",
28
+ "&:hover": {
29
+ backgroundColor: darken("#ffffff", 0.1)
30
+ }
31
+ };
32
+ } else {
33
+ buttonStyle = {
34
+ cursor: "pointer",
35
+ display: "flex",
36
+ flexDirection: "row",
37
+ alignItems: "center",
38
+ justifyContent: "center",
39
+ marginTop: theme.margins,
40
+ border: props.outlined ? "2px solid black" : "none",
41
+ borderRadius: 0,
42
+ backgroundColor: "white",
43
+ "&:hover": {
44
+ backgroundColor: darken("#ffffff", 0.1)
45
+ }
46
+ };
47
+ }
48
+
49
+ const StyledButton = styled(Button)(({ theme }) => {
50
+ return {
51
+ // "label + &": {
52
+ // marginTop: theme.spacing(3)
53
+ // },
54
+
55
+ borderRadius: 4,
56
+ position: "relative",
57
+ border: "1px solid #ced4da",
58
+ fontSize: 16,
59
+ // width: "auto",
60
+ height: 50,
61
+ // padding: "10px 12px",
62
+ ...buttonStyle,
63
+ "&:focus": {
64
+ // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
65
+ borderColor: theme.palette.primary.main
66
+ }
67
+ };
68
+ });
69
+
70
+ return (
71
+ <StyledButton
72
+ // style={buttonStyle}
73
+ onClick={props.handleClick}
74
+ >
75
+ <WalletIcon />
76
+ <div style={{ width: 10 }} />
77
+ <p
78
+ style={{
79
+ color: "black",
80
+ fontSize: 14,
81
+ textAlign: "center",
82
+ letterSpacing: 0.4,
83
+ fontFamily: "Roboto",
84
+ fontWeight: 500
85
+ }}
86
+ >
87
+ {props.buttonText}
88
+ </p>
89
+ </StyledButton>
90
+ );
91
+ };
package/src/ui/index.js CHANGED
@@ -1,13 +1,22 @@
1
- // export * from "./HawaProvider";
2
- export * from "./AdaptiveButton";
3
- export * from "./Checkbox";
4
- export * from "./RadioBox";
5
- export * from "./RadioSelector";
6
- export * from "./Row";
7
- export * from "./SelectedField";
8
- export * from "./TabPanel";
9
- export * from "./TextArea";
10
- export * from "./TextField";
11
- export * from "./StyledAlert";
12
- export * from "./StyledInputLabel";
1
+ // export * from "./AdaptiveButton";
13
2
  export * from "./ActionButton";
3
+ // export * from "./Checkbox";
4
+ // export * from "./RadioBox";
5
+ // export * from "./RadioSelector";
6
+ // export * from "./Row";
7
+ // export * from "./SelectedField";
8
+ // export * from "./TabPanel";
9
+ // export * from "./HawaTextArea";
10
+ export * from "./HawaTextField";
11
+ export * from "./HawaInputLabel";
12
+ // export * from "./StyledAlert";
13
+ export * from "./GoogleButton";
14
+ export * from "./GithubButton";
15
+ export * from "./TwitterButton";
16
+ export * from "./VisaMasterButton";
17
+ export * from "./MadaButton";
18
+ export * from "./STCPayButton";
19
+ export * from "./PayPalButton";
20
+ export * from "./ApplePayButton";
21
+ export * from "./GooglePayButton";
22
+ export * from "./WalletButton";