@sikka/hawa 0.0.6 → 0.0.9

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 (57) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +2 -1
  4. package/src/blocks/Account/UserProfile.js +57 -7
  5. package/src/blocks/AuthForms/NewPasswordForm.js +59 -42
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +46 -33
  7. package/src/blocks/AuthForms/SignInForm.js +60 -32
  8. package/src/blocks/AuthForms/SignUpForm.js +74 -45
  9. package/src/blocks/Payment/ChargeWalletForm.js +38 -17
  10. package/src/blocks/Payment/CreditCardForm.js +50 -21
  11. package/src/blocks/Payment/PayWithWallet.js +4 -25
  12. package/src/blocks/Payment/SelectPayment.js +18 -39
  13. package/src/layout/Box.js +9 -9
  14. package/src/stories/BlocksStories/AuthForm.stories.js +9 -9
  15. package/src/stories/BlocksStories/PaymentForm.stories.js +10 -6
  16. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  17. package/src/stories/Introduction.stories.mdx +229 -0
  18. package/src/stories/LayoutStories/Box.stories.js +4 -4
  19. package/src/stories/UIStories/ActionButton.stories.js +15 -22
  20. package/src/stories/UIStories/AdaptiveButton.stories.js +43 -42
  21. package/src/stories/UIStories/Alert.stories.js +4 -17
  22. package/src/stories/UIStories/LogoButtons.stories.js +90 -0
  23. package/src/stories/UIStories/RadioSelector.stories.js +20 -35
  24. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  25. package/src/themes/HawaProvider.js +64 -20
  26. package/src/ui/ActionButton.js +12 -11
  27. package/src/ui/AdaptiveButton.js +43 -159
  28. package/src/ui/HawaAlert.js +6 -6
  29. package/src/ui/HawaButton.js +6 -6
  30. package/src/ui/HawaInputLabel.js +4 -4
  31. package/src/ui/HawaLogoButton.js +102 -12
  32. package/src/ui/HawaRadio.js +50 -28
  33. package/src/ui/HawaSettingsRow.js +71 -0
  34. package/src/ui/HawaTextField.js +29 -35
  35. package/src/ui/HawaTypography.js +5 -6
  36. package/src/ui/index.js +2 -15
  37. package/storybook-static/iframe.html +1 -1
  38. package/storybook-static/main.5731dbe3.iframe.bundle.js +1 -0
  39. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +76 -0
  40. package/storybook-static/{vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt → vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt} +0 -15
  41. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +1 -0
  42. package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
  43. package/src/stories/GlobalVariables.stories.js +0 -44
  44. package/src/stories/Introduction.stories.js +0 -233
  45. package/src/ui/ApplePayButton.js +0 -93
  46. package/src/ui/GithubButton.js +0 -90
  47. package/src/ui/GoogleButton.js +0 -82
  48. package/src/ui/GooglePayButton.js +0 -93
  49. package/src/ui/MadaButton.js +0 -93
  50. package/src/ui/PayPalButton.js +0 -93
  51. package/src/ui/STCPayButton.js +0 -93
  52. package/src/ui/TwitterButton.js +0 -83
  53. package/src/ui/VisaMasterButton.js +0 -93
  54. package/src/ui/WalletButton.js +0 -24
  55. package/storybook-static/main.e55ce615.iframe.bundle.js +0 -1
  56. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +0 -76
  57. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +0 -1
@@ -1,93 +0,0 @@
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 GooglePayButton = (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/google-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,93 +0,0 @@
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
- };
@@ -1,93 +0,0 @@
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,93 +0,0 @@
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,83 +0,0 @@
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
- let currentTheme = Object.keys(theme.actionButton).find(
12
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
13
- );
14
- if (currentTheme) {
15
- buttonStyle = {
16
- cursor: "pointer",
17
- display: "flex",
18
- flexDirection: "row",
19
- alignItems: "center",
20
- justifyContent: "center",
21
- marginTop: theme.layout[currentTheme].margin,
22
- border: props.outlined ? "2px solid black" : "none",
23
- borderRadius: theme.layout[currentTheme].borderRadius,
24
- backgroundColor: "white",
25
- "&:hover": {
26
- backgroundColor: darken("#ffffff", 0.1)
27
- }
28
- };
29
- } else {
30
- buttonStyle = {
31
- cursor: "pointer",
32
- display: "flex",
33
- flexDirection: "row",
34
- alignItems: "center",
35
- justifyContent: "center",
36
- marginTop: theme.margins,
37
- border: props.outlined ? "2px solid black" : "none",
38
- borderRadius: 0,
39
- backgroundColor: "white",
40
- "&:hover": {
41
- backgroundColor: darken("#ffffff", 0.1)
42
- }
43
- };
44
- }
45
- const StyledButton = styled(Button)(({ theme }) => {
46
- return {
47
- // "label + &": {
48
- // marginTop: theme.spacing(3)
49
- // },
50
-
51
- borderRadius: 4,
52
- position: "relative",
53
- border: "1px solid #ced4da",
54
- fontSize: 16,
55
- // width: "auto",
56
- height: 50,
57
- // padding: "10px 12px",
58
- ...buttonStyle,
59
- "&:focus": {
60
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
61
- borderColor: theme.palette.primary.main
62
- }
63
- };
64
- });
65
- return (
66
- <StyledButton onClick={props.handleClick}>
67
- <TwitterIcon />
68
- <div style={{ width: 10 }} />
69
- <p
70
- style={{
71
- color: "black",
72
- fontSize: 14,
73
- textAlign: "center",
74
- letterSpacing: 0.4,
75
- fontFamily: "Roboto",
76
- fontWeight: 500
77
- }}
78
- >
79
- {props.buttonText}
80
- </p>
81
- </StyledButton>
82
- );
83
- };
@@ -1,93 +0,0 @@
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
- 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/visa-master.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
- };
@@ -1,24 +0,0 @@
1
- import React from "react";
2
- import WalletIcon from "@mui/icons-material/AccountBalanceWallet";
3
- import { HawaLogoButton } from "./HawaLogoButton";
4
-
5
- export const WalletButton = (props) => {
6
- return (
7
- <HawaLogoButton {...props}>
8
- <WalletIcon />
9
- <div style={{ width: 10 }} />
10
- <p
11
- style={{
12
- color: "black",
13
- fontSize: 14,
14
- textAlign: "center",
15
- letterSpacing: 0.4,
16
- fontFamily: "Roboto",
17
- fontWeight: 500
18
- }}
19
- >
20
- {props.buttonText}
21
- </p>
22
- </HawaLogoButton>
23
- );
24
- };