@sikka/hawa 0.0.4 → 0.0.7
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 +9 -8
- package/src/blocks/Account/UserProfile.js +61 -11
- package/src/blocks/Account/UserSettings.js +11 -11
- package/src/blocks/AuthForms/NewPasswordForm.js +85 -11
- package/src/blocks/AuthForms/ResetPasswordForm.js +47 -8
- package/src/blocks/AuthForms/SignInForm.js +91 -13
- package/src/blocks/AuthForms/SignUpForm.js +119 -12
- package/src/blocks/Payment/ChargeWalletForm.js +53 -0
- package/src/blocks/Payment/CreditCardForm.js +60 -0
- package/src/blocks/Payment/Form/CForm.js +10 -8
- package/src/blocks/Payment/Gateway/Wallet.js +5 -5
- package/src/blocks/Payment/PayWithWallet.js +14 -0
- package/src/blocks/Payment/PaymentMethod.js +2 -2
- package/src/blocks/Payment/SelectPayment.js +76 -0
- package/src/blocks/Payment/index.js +18 -0
- package/src/index.js +3 -1
- package/src/layout/Box.js +31 -18
- package/src/stories/BlocksStories/AuthForm.stories.js +103 -0
- package/src/stories/BlocksStories/PaymentForm.stories.js +86 -0
- package/src/stories/BlocksStories/UserForm.stories.js +41 -0
- package/src/stories/GlobalVariables.stories.js +33 -90
- package/src/stories/HawaProvider.stories.js +0 -1
- package/src/stories/Introduction.stories.js +132 -110
- package/src/stories/LayoutStories/Box.stories.js +56 -0
- package/src/stories/UIStories/ActionButton.stories.js +53 -0
- package/src/stories/{AdaptiveButton.stories.js → UIStories/AdaptiveButton.stories.js} +3 -3
- package/src/stories/UIStories/Alert.stories.js +42 -0
- package/src/stories/{CheckBox.stories.js → UIStories/CheckBox.stories.js} +3 -4
- package/src/stories/UIStories/InputLabel.stories.js +13 -0
- package/src/stories/UIStories/RadioSelector.stories.js +53 -0
- package/src/stories/UIStories/SettingsRow.stories.js +64 -0
- package/src/stories/{TextField.stories.js → UIStories/TextField.stories.js} +4 -5
- package/src/themes/HawaProvider.js +151 -18
- package/src/ui/ActionButton.js +38 -10
- package/src/ui/AdaptiveButton.js +29 -29
- package/src/ui/ApplePayButton.js +26 -0
- package/src/ui/AutoCompleteField.js +0 -1
- package/src/ui/DragDropImages.js +2 -2
- package/src/ui/GithubButton.js +24 -0
- package/src/ui/GoogleButton.js +23 -0
- package/src/ui/GooglePayButton.js +26 -0
- package/src/ui/HawaAlert.js +37 -0
- package/src/ui/HawaButton.js +48 -0
- package/src/ui/{Checkbox.js → HawaCheckbox.js} +3 -3
- package/src/ui/HawaInputLabel.js +32 -0
- package/src/ui/HawaLogoButton.js +43 -0
- package/src/ui/HawaRadio.js +73 -0
- package/src/ui/HawaSettingsRow.js +71 -0
- package/src/ui/{TextArea.js → HawaTextArea.js} +2 -2
- package/src/ui/HawaTextField.js +110 -0
- package/src/ui/HawaTypography.js +29 -0
- package/src/ui/MadaButton.js +26 -0
- package/src/ui/PayPalButton.js +26 -0
- package/src/ui/RadioBox.js +2 -2
- package/src/ui/STCPayButton.js +26 -0
- package/src/ui/SelectedField.js +4 -4
- package/src/ui/StyledTooltip.js +1 -1
- package/src/ui/TabPanel.js +1 -1
- package/src/ui/TwitterButton.js +27 -0
- package/src/ui/VisaMasterButton.js +26 -0
- package/src/ui/WalletButton.js +24 -0
- package/src/ui/index.js +23 -11
- package/storybook-static/0.0d994c92.iframe.bundle.js +3 -0
- package/storybook-static/{1.4e43f671.iframe.bundle.js.LICENSE.txt → 0.0d994c92.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/0.0d994c92.iframe.bundle.js.map +1 -0
- package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +1 -0
- package/storybook-static/1.aabc3f3a.iframe.bundle.js +1 -0
- package/storybook-static/{3.c1dc7159.iframe.bundle.js → 2.430bf1e3.iframe.bundle.js} +1 -1
- package/storybook-static/4.0fcda1281dc1961dbe94.manager.bundle.js +2 -0
- package/storybook-static/{4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt → 4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/{5.88fe62ee92ff5ca67829.manager.bundle.js → 5.63ab4f94d50a3acf080d.manager.bundle.js} +1 -1
- package/storybook-static/{7.69d2e532.iframe.bundle.js → 6.704d1e8d.iframe.bundle.js} +1 -1
- package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js → 6.a6d45262f7e98f3f18d3.manager.bundle.js} +2 -2
- package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt → 6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/{7.5ec31f3702b08ab0b71c.manager.bundle.js → 7.097710753af9a1c41b80.manager.bundle.js} +1 -1
- package/storybook-static/{8.68cd1217.iframe.bundle.js → 7.9ce807e3.iframe.bundle.js} +3 -3
- package/storybook-static/{8.68cd1217.iframe.bundle.js.LICENSE.txt → 7.9ce807e3.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/7.9ce807e3.iframe.bundle.js.map +1 -0
- package/storybook-static/{8.5ce13be7612bd3a6b864.manager.bundle.js → 8.76c3cbf398692028e834.manager.bundle.js} +1 -1
- package/storybook-static/{9.488e3969.iframe.bundle.js → 8.c4cb6081.iframe.bundle.js} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.ac6e4b72b033097dad76.manager.bundle.js +1 -0
- package/storybook-static/main.b7ffaed0.iframe.bundle.js +1 -0
- package/storybook-static/{runtime~main.cc29f4c2175f187a3707.manager.bundle.js → runtime~main.c8dac23bc753439736f0.manager.bundle.js} +1 -1
- package/storybook-static/runtime~main.cfefe972.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.8ebae370.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.d144d840.iframe.bundle.js.LICENSE.txt → vendors~main.8ebae370.iframe.bundle.js.LICENSE.txt} +3 -30
- package/storybook-static/vendors~main.8ebae370.iframe.bundle.js.map +1 -0
- package/storybook-static/vendors~main.a697e07137d366f95f76.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt → vendors~main.a697e07137d366f95f76.manager.bundle.js.LICENSE.txt} +0 -0
- package/src/blocks/AuthForms/viaFacebook.js +0 -0
- package/src/blocks/AuthForms/viaGithub.js +0 -0
- package/src/blocks/AuthForms/viaGoogle.js +0 -0
- package/src/blocks/AuthForms/viaTwitter.js +0 -0
- package/src/blocks/index.js +0 -13
- package/src/stories/ActionButton.stories.js +0 -49
- package/src/stories/Alert.stories.js +0 -41
- package/src/stories/AuthForm.stories.js +0 -79
- package/src/stories/Box.stories.js +0 -64
- package/src/stories/InputLabel.stories.js +0 -92
- package/src/stories/RadioSelector.stories.js +0 -69
- package/src/stories/UserAccount.stories.js +0 -46
- package/src/ui/RadioSelector.js +0 -51
- package/src/ui/StyledAlert.js +0 -30
- package/src/ui/StyledInputLabel.js +0 -19
- package/src/ui/TextField.js +0 -62
- package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +0 -1
- package/storybook-static/0.dd3d47f5.iframe.bundle.js +0 -1
- package/storybook-static/1.4e43f671.iframe.bundle.js +0 -3
- package/storybook-static/1.4e43f671.iframe.bundle.js.map +0 -1
- package/storybook-static/2.9a757207.iframe.bundle.js +0 -1
- package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +0 -2
- package/storybook-static/8.68cd1217.iframe.bundle.js.map +0 -1
- package/storybook-static/main.65cb2769.iframe.bundle.js +0 -1
- package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.6e2e1544.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.d144d840.iframe.bundle.js +0 -3
- package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +0 -2
- package/yarn-error.log +0 -10910
|
@@ -1,44 +1,177 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
|
|
3
3
|
//make the text color of the action buttons different from the text color of the layout
|
|
4
|
+
let allPrimaryBG = "#f90900";
|
|
5
|
+
let allPrimaryAction = "#B20D30";
|
|
4
6
|
export const defaultTheme = {
|
|
7
|
+
allPrimaryBG: "#f90900",
|
|
8
|
+
allPrimaryAction: "#138A36",
|
|
9
|
+
allBorderRadius: 10,
|
|
5
10
|
borderRadius: 10,
|
|
6
11
|
primaryColor: "blue",
|
|
7
12
|
secondaryColor: "grey",
|
|
8
|
-
primaryActionColor: '#f72585', //Colors of the buttons
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
// primaryActionColor: '#f72585', //Colors of the buttons
|
|
14
|
+
primaryActionColor: "grey", //Colors of the buttons
|
|
15
|
+
secondaryActionColor: "#4cc9f0", //Colors of the buttons
|
|
16
|
+
layoutColor: "#d3d4d9", //Colors of boxes and cards
|
|
17
|
+
textColor: "black", //Colors of text everywhere
|
|
18
|
+
inputColor: "white", //Color of input fields
|
|
19
|
+
lightBackground: "#FBF5F3", //
|
|
20
|
+
darkBackground: "#0F0E0E",
|
|
21
|
+
testcolor: "green",
|
|
22
|
+
margins: 10,
|
|
23
|
+
paddings: 10,
|
|
24
|
+
typography: {
|
|
25
|
+
primary: { color: "black" },
|
|
26
|
+
secondary: { color: "white" }
|
|
27
|
+
},
|
|
28
|
+
logoButton: {
|
|
29
|
+
primary: {
|
|
30
|
+
borderRadius: 10,
|
|
31
|
+
backgroundColor: allPrimaryAction,
|
|
32
|
+
// margin: 10,
|
|
33
|
+
marginTop: 10,
|
|
34
|
+
padding: 10,
|
|
35
|
+
border: "1px solid #ced4da",
|
|
36
|
+
height: 50,
|
|
37
|
+
"&:focus": {
|
|
38
|
+
borderColor: allPrimaryAction
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
secondary: {
|
|
42
|
+
borderRadius: 10,
|
|
43
|
+
backgroundColor: "#f90900",
|
|
44
|
+
marginTop: 10,
|
|
45
|
+
padding: 10,
|
|
46
|
+
border: "1px solid #ced4da",
|
|
47
|
+
height: 50,
|
|
48
|
+
"&:focus": {
|
|
49
|
+
borderColor: "green"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
actionButton: {
|
|
54
|
+
primary: {
|
|
55
|
+
borderRadius: 10,
|
|
56
|
+
// backgroundColor: "#f90900",
|
|
57
|
+
backgroundColor: allPrimaryAction,
|
|
58
|
+
color: "white",
|
|
59
|
+
margin: 10,
|
|
60
|
+
padding: 10,
|
|
61
|
+
border: "1px solid #ced4da",
|
|
62
|
+
fontSize: 16,
|
|
63
|
+
height: 50,
|
|
64
|
+
"&:focus": {
|
|
65
|
+
borderColor: "red"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
secondary: {
|
|
69
|
+
borderRadius: 10,
|
|
70
|
+
margin: 10,
|
|
71
|
+
padding: 10,
|
|
72
|
+
backgroundColor: "#FF8811",
|
|
73
|
+
color: "black"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
20
76
|
layout: {
|
|
21
77
|
primary: {
|
|
22
|
-
backgroundColor:
|
|
78
|
+
backgroundColor: "#d3d4d9",
|
|
79
|
+
color: "black",
|
|
80
|
+
margin: 10,
|
|
81
|
+
padding: 10,
|
|
82
|
+
borderRadius: 10
|
|
23
83
|
},
|
|
24
84
|
secondary: {
|
|
25
|
-
backgroundColor:
|
|
85
|
+
backgroundColor: "#001E3C",
|
|
86
|
+
// backgroundColor: "red",
|
|
87
|
+
color: "white",
|
|
88
|
+
margin: 10,
|
|
89
|
+
padding: 10,
|
|
90
|
+
borderRadius: 10
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
inputFields: {
|
|
94
|
+
primary: {
|
|
95
|
+
backgroundColor: "white",
|
|
96
|
+
borderRadius: 10,
|
|
97
|
+
"&:focus": {
|
|
98
|
+
borderColor: "red",
|
|
99
|
+
borderWidth: 1,
|
|
100
|
+
border: "1px solid black"
|
|
101
|
+
},
|
|
102
|
+
"&:hover": {
|
|
103
|
+
borderColor: "red",
|
|
104
|
+
borderWidth: 1,
|
|
105
|
+
border: "1px solid black"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
secondary: {
|
|
109
|
+
backgroundColor: "white",
|
|
110
|
+
|
|
111
|
+
borderRadius: 10
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
alerts: {
|
|
115
|
+
primary: {
|
|
116
|
+
marginBottom: 10,
|
|
117
|
+
padding: 10,
|
|
118
|
+
borderRadius: 10
|
|
119
|
+
},
|
|
120
|
+
secondary: {
|
|
121
|
+
marginBottom: 10,
|
|
122
|
+
padding: 10,
|
|
123
|
+
borderRadius: 10
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
settingsRow: {
|
|
127
|
+
primary: {
|
|
128
|
+
display: "flex",
|
|
129
|
+
flexDirection: "row",
|
|
130
|
+
justifyContent: "space-between",
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
backgroundColor: "#F5F5F5",
|
|
133
|
+
margin: 0,
|
|
134
|
+
padding: 10,
|
|
135
|
+
borderRadius: 10
|
|
136
|
+
},
|
|
137
|
+
secondary: {
|
|
138
|
+
display: "flex",
|
|
139
|
+
flexDirection: "row",
|
|
140
|
+
justifyContent: "space-between",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
backgroundColor: "blue",
|
|
143
|
+
margin: 0,
|
|
144
|
+
padding: 5,
|
|
145
|
+
borderRadius: 10
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
radioSelector: {
|
|
149
|
+
primary: {
|
|
150
|
+
padding: 10,
|
|
151
|
+
borderRadius: 10
|
|
152
|
+
},
|
|
153
|
+
secondary: {
|
|
154
|
+
padding: 10,
|
|
155
|
+
borderRadius: 10
|
|
26
156
|
}
|
|
27
157
|
}
|
|
28
|
-
}
|
|
158
|
+
};
|
|
29
159
|
|
|
30
160
|
export const ThemeProvider = createContext(defaultTheme);
|
|
31
161
|
|
|
32
162
|
export const HawaProvider = ({ theme, ...props }) => {
|
|
33
|
-
|
|
163
|
+
console.log("theme is ", theme);
|
|
164
|
+
if (props.size === "large") {
|
|
34
165
|
theme = {
|
|
35
166
|
...theme,
|
|
36
167
|
paddings: 20,
|
|
37
168
|
margins: 20
|
|
38
|
-
}
|
|
169
|
+
};
|
|
39
170
|
}
|
|
40
171
|
return (
|
|
41
|
-
<ThemeProvider.Provider
|
|
172
|
+
<ThemeProvider.Provider
|
|
173
|
+
value={{ hawaTheme: defaultTheme, themeName: props.themeName }}
|
|
174
|
+
>
|
|
42
175
|
{props.children}
|
|
43
176
|
</ThemeProvider.Provider>
|
|
44
177
|
);
|
package/src/ui/ActionButton.js
CHANGED
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import Button from "@material
|
|
1
|
+
import Button from "@mui/material/Button";
|
|
2
2
|
import { useContext } from "react";
|
|
3
3
|
import { ThemeProvider } from "../themes/HawaProvider";
|
|
4
|
+
import { styled, darken } from "@mui/material/styles";
|
|
4
5
|
|
|
5
6
|
export const ActionButton = (props) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
8
|
+
const currentTheme = Object.keys(hawaTheme.actionButton).find(
|
|
9
|
+
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
10
|
+
);
|
|
11
|
+
let actionButtonStyle = {};
|
|
12
|
+
|
|
13
|
+
if (currentTheme) {
|
|
14
|
+
actionButtonStyle = {
|
|
15
|
+
...hawaTheme.actionButton[currentTheme],
|
|
16
|
+
margin: props.last ? 0 : hawaTheme.actionButton[currentTheme].margin,
|
|
17
|
+
marginTop: props.last
|
|
18
|
+
? hawaTheme.actionButton[currentTheme].margin * 2
|
|
19
|
+
: 0,
|
|
20
|
+
"&:hover": {
|
|
21
|
+
backgroundColor: darken(
|
|
22
|
+
hawaTheme.actionButton[currentTheme]?.backgroundColor,
|
|
23
|
+
0.1
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
} else {
|
|
28
|
+
actionButtonStyle = {
|
|
29
|
+
backgroundColor: "black",
|
|
30
|
+
color: "white",
|
|
31
|
+
padding: 10,
|
|
32
|
+
marginTop: props.last ? 10 * 2 : 0,
|
|
33
|
+
borderRadius: 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const StyledButton = styled(Button)(({ theme }) => {
|
|
38
|
+
return {
|
|
39
|
+
...actionButtonStyle
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return <StyledButton {...props}>{props.text}</StyledButton>;
|
|
15
43
|
};
|
package/src/ui/AdaptiveButton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useContext } from "react";
|
|
2
|
-
import Button from "@material
|
|
3
|
-
import Tooltip from "@material
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import Tooltip from "@mui/material/Tooltip";
|
|
4
4
|
import { motion } from "framer-motion";
|
|
5
5
|
import PropTypes from "prop-types";
|
|
6
6
|
import { ThemeProvider } from "../themes/HawaProvider";
|
|
@@ -101,30 +101,30 @@ export const AdaptiveButton = (props) => {
|
|
|
101
101
|
props.hint ? (
|
|
102
102
|
props.hint
|
|
103
103
|
) : (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</div>
|
|
116
|
-
<div
|
|
117
|
-
style={{
|
|
118
|
-
fontSize: 13,
|
|
119
|
-
fontWeight: 100,
|
|
120
|
-
padding: 10,
|
|
121
|
-
textAlign: "center"
|
|
122
|
-
}}
|
|
123
|
-
>
|
|
124
|
-
{props.hintContent}
|
|
125
|
-
</div>
|
|
104
|
+
<div>
|
|
105
|
+
<div
|
|
106
|
+
style={{
|
|
107
|
+
fontSize: 20,
|
|
108
|
+
fontWeight: 800,
|
|
109
|
+
padding: 10,
|
|
110
|
+
paddingBottom: 5,
|
|
111
|
+
textAlign: "center"
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
{props.hintTitle}
|
|
126
115
|
</div>
|
|
127
|
-
|
|
116
|
+
<div
|
|
117
|
+
style={{
|
|
118
|
+
fontSize: 13,
|
|
119
|
+
fontWeight: 100,
|
|
120
|
+
padding: 10,
|
|
121
|
+
textAlign: "center"
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
{props.hintContent}
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
128
|
}
|
|
129
129
|
>
|
|
130
130
|
<Button
|
|
@@ -139,8 +139,8 @@ export const AdaptiveButton = (props) => {
|
|
|
139
139
|
color: hovered
|
|
140
140
|
? "#ffffff"
|
|
141
141
|
: props.danger
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
? "#f50057"
|
|
143
|
+
: "var(--blue)"
|
|
144
144
|
}}
|
|
145
145
|
>
|
|
146
146
|
{props.buttonLabel}
|
|
@@ -197,8 +197,8 @@ export const AdaptiveButton = (props) => {
|
|
|
197
197
|
color: hovered
|
|
198
198
|
? "#ffffff"
|
|
199
199
|
: props.danger
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
? "#f50057"
|
|
201
|
+
: "var(--blue)"
|
|
202
202
|
}}
|
|
203
203
|
>
|
|
204
204
|
{props.icon}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HawaLogoButton } from "./HawaLogoButton";
|
|
3
|
+
|
|
4
|
+
export const ApplePayButton = (props) => {
|
|
5
|
+
return (
|
|
6
|
+
<HawaLogoButton {...props}>
|
|
7
|
+
<img
|
|
8
|
+
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png"
|
|
9
|
+
height={40}
|
|
10
|
+
/>{" "}
|
|
11
|
+
<div style={{ width: 10 }} />
|
|
12
|
+
<p
|
|
13
|
+
style={{
|
|
14
|
+
color: "black",
|
|
15
|
+
fontSize: 14,
|
|
16
|
+
textAlign: "center",
|
|
17
|
+
letterSpacing: 0.4,
|
|
18
|
+
fontFamily: "Roboto",
|
|
19
|
+
fontWeight: 500
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
{props.buttonText}
|
|
23
|
+
</p>
|
|
24
|
+
</HawaLogoButton>
|
|
25
|
+
);
|
|
26
|
+
};
|
package/src/ui/DragDropImages.js
CHANGED
|
@@ -3,8 +3,8 @@ import React, { useEffect, useState } from "react";
|
|
|
3
3
|
import { getToken } from "../token";
|
|
4
4
|
import { useDropzone } from "react-dropzone";
|
|
5
5
|
import useTranslation from "next-translate/useTranslation";
|
|
6
|
-
import Badge from "@material
|
|
7
|
-
import CloseIcon from "@
|
|
6
|
+
import Badge from "@mui/material/Badge";
|
|
7
|
+
import CloseIcon from "@mui/icons-material/Close";
|
|
8
8
|
import styles from "../styles/Theme.module.css";
|
|
9
9
|
|
|
10
10
|
const thumbsContainer = {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import GitHubIcon from "@mui/icons-material/GitHub";
|
|
3
|
+
import { HawaLogoButton } from "./HawaLogoButton";
|
|
4
|
+
|
|
5
|
+
export const GithubButton = (props) => {
|
|
6
|
+
return (
|
|
7
|
+
<HawaLogoButton {...props}>
|
|
8
|
+
<GitHubIcon />
|
|
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
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HawaLogoButton } from "./HawaLogoButton";
|
|
3
|
+
|
|
4
|
+
export const GoogleButton = (props) => {
|
|
5
|
+
return (
|
|
6
|
+
<HawaLogoButton {...props}>
|
|
7
|
+
<img src="https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg" />
|
|
8
|
+
<div style={{ width: 10 }} />
|
|
9
|
+
<p
|
|
10
|
+
style={{
|
|
11
|
+
color: "black",
|
|
12
|
+
fontSize: 14,
|
|
13
|
+
textAlign: "center",
|
|
14
|
+
letterSpacing: 0.4,
|
|
15
|
+
fontFamily: "Roboto",
|
|
16
|
+
fontWeight: 500
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
{props.buttonText}
|
|
20
|
+
</p>
|
|
21
|
+
</HawaLogoButton>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HawaLogoButton } from "./HawaLogoButton";
|
|
3
|
+
|
|
4
|
+
export const GooglePayButton = (props) => {
|
|
5
|
+
return (
|
|
6
|
+
<HawaLogoButton {...props}>
|
|
7
|
+
<img
|
|
8
|
+
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png"
|
|
9
|
+
height={20}
|
|
10
|
+
/>
|
|
11
|
+
<div style={{ width: 10 }} />
|
|
12
|
+
<p
|
|
13
|
+
style={{
|
|
14
|
+
color: "black",
|
|
15
|
+
fontSize: 14,
|
|
16
|
+
textAlign: "center",
|
|
17
|
+
letterSpacing: 0.4,
|
|
18
|
+
fontFamily: "Roboto",
|
|
19
|
+
fontWeight: 500
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
{props.buttonText}
|
|
23
|
+
</p>
|
|
24
|
+
</HawaLogoButton>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -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 { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
10
|
+
const currentTheme = Object.keys(hawaTheme.alerts).find(
|
|
11
|
+
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
12
|
+
);
|
|
13
|
+
let alertStyle = {};
|
|
14
|
+
|
|
15
|
+
if (currentTheme) {
|
|
16
|
+
alertStyle = {
|
|
17
|
+
...hawaTheme.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 {...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 { 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>;
|
|
48
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import FormControlLabel from "@material
|
|
3
|
-
import Checkbox from "@material
|
|
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
|
|
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 { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
7
|
+
let labelStyle = {};
|
|
8
|
+
|
|
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
|
+
}
|
|
27
|
+
return (
|
|
28
|
+
<InputLabel style={labelStyle}>
|
|
29
|
+
<div style={{ fontSize: 15 }}>{props.label}</div>
|
|
30
|
+
</InputLabel>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
8
|
+
let buttonStyle = {};
|
|
9
|
+
let currentTheme = Object.keys(hawaTheme.logoButton).find(
|
|
10
|
+
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
11
|
+
);
|
|
12
|
+
if (currentTheme) {
|
|
13
|
+
buttonStyle = {
|
|
14
|
+
...hawaTheme.logoButton[currentTheme],
|
|
15
|
+
backgroundColor: "white",
|
|
16
|
+
"&:hover": {
|
|
17
|
+
backgroundColor: darken("#ffffff", 0.1)
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
} else {
|
|
21
|
+
// Default theme
|
|
22
|
+
buttonStyle = {
|
|
23
|
+
cursor: "pointer",
|
|
24
|
+
display: "flex",
|
|
25
|
+
flexDirection: "row",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
justifyContent: "center",
|
|
28
|
+
marginTop: 10,
|
|
29
|
+
height: 50,
|
|
30
|
+
border: "1px solid #ced4da",
|
|
31
|
+
backgroundColor: "white",
|
|
32
|
+
"&:hover": {
|
|
33
|
+
backgroundColor: darken("#ffffff", 0.1)
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const StyledButton = styled(Button)(({ theme }) => {
|
|
38
|
+
return {
|
|
39
|
+
...buttonStyle
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return <StyledButton {...props}>{props.children}</StyledButton>;
|
|
43
|
+
};
|