@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.
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +2 -1
- package/src/blocks/Account/UserProfile.js +57 -7
- package/src/blocks/AuthForms/NewPasswordForm.js +59 -42
- package/src/blocks/AuthForms/ResetPasswordForm.js +46 -33
- package/src/blocks/AuthForms/SignInForm.js +60 -32
- package/src/blocks/AuthForms/SignUpForm.js +74 -45
- package/src/blocks/Payment/ChargeWalletForm.js +38 -17
- package/src/blocks/Payment/CreditCardForm.js +50 -21
- package/src/blocks/Payment/PayWithWallet.js +4 -25
- package/src/blocks/Payment/SelectPayment.js +18 -39
- package/src/layout/Box.js +9 -9
- package/src/stories/BlocksStories/AuthForm.stories.js +9 -9
- package/src/stories/BlocksStories/PaymentForm.stories.js +10 -6
- package/src/stories/BlocksStories/UserForm.stories.js +41 -0
- package/src/stories/Introduction.stories.mdx +229 -0
- package/src/stories/LayoutStories/Box.stories.js +4 -4
- package/src/stories/UIStories/ActionButton.stories.js +15 -22
- package/src/stories/UIStories/AdaptiveButton.stories.js +43 -42
- package/src/stories/UIStories/Alert.stories.js +4 -17
- package/src/stories/UIStories/LogoButtons.stories.js +90 -0
- package/src/stories/UIStories/RadioSelector.stories.js +20 -35
- package/src/stories/UIStories/SettingsRow.stories.js +64 -0
- package/src/themes/HawaProvider.js +64 -20
- package/src/ui/ActionButton.js +12 -11
- package/src/ui/AdaptiveButton.js +43 -159
- package/src/ui/HawaAlert.js +6 -6
- package/src/ui/HawaButton.js +6 -6
- package/src/ui/HawaInputLabel.js +4 -4
- package/src/ui/HawaLogoButton.js +102 -12
- package/src/ui/HawaRadio.js +50 -28
- package/src/ui/HawaSettingsRow.js +71 -0
- package/src/ui/HawaTextField.js +29 -35
- package/src/ui/HawaTypography.js +5 -6
- package/src/ui/index.js +2 -15
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.5731dbe3.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt → vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt} +0 -15
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +1 -0
- package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
- package/src/stories/GlobalVariables.stories.js +0 -44
- package/src/stories/Introduction.stories.js +0 -233
- package/src/ui/ApplePayButton.js +0 -93
- package/src/ui/GithubButton.js +0 -90
- package/src/ui/GoogleButton.js +0 -82
- package/src/ui/GooglePayButton.js +0 -93
- package/src/ui/MadaButton.js +0 -93
- package/src/ui/PayPalButton.js +0 -93
- package/src/ui/STCPayButton.js +0 -93
- package/src/ui/TwitterButton.js +0 -83
- package/src/ui/VisaMasterButton.js +0 -93
- package/src/ui/WalletButton.js +0 -24
- package/storybook-static/main.e55ce615.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +0 -1
|
@@ -2,50 +2,39 @@ import React from "react";
|
|
|
2
2
|
import { HawaProvider } from "../../themes/HawaProvider";
|
|
3
3
|
import { HawaRadio } from "../../ui";
|
|
4
4
|
|
|
5
|
-
const Template = (args) => {
|
|
6
|
-
const theme = {
|
|
7
|
-
borderRadius: 5,
|
|
8
|
-
primaryColor: "green",
|
|
9
|
-
secondaryColor: "red",
|
|
10
|
-
// margins: "10px",
|
|
11
|
-
paddings: 10
|
|
12
|
-
};
|
|
13
|
-
return (
|
|
14
|
-
<HawaProvider theme={theme}>
|
|
15
|
-
<HawaRadio {...args} />
|
|
16
|
-
</HawaProvider>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
5
|
export default {
|
|
20
6
|
title: "UI/RadioSelector",
|
|
21
7
|
component: HawaRadio,
|
|
22
8
|
argTypes: {
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
theme: {
|
|
10
|
+
options: ["primary", "secondary", "default"],
|
|
11
|
+
control: { type: "select" }
|
|
25
12
|
}
|
|
26
13
|
},
|
|
27
14
|
args: {
|
|
28
|
-
|
|
29
|
-
{ text: "Option 1", label: "option1" },
|
|
30
|
-
{ text: "Option 2", label: "option2" },
|
|
31
|
-
{ text: "Option 3", label: "option3" }
|
|
32
|
-
]
|
|
15
|
+
theme: "primary"
|
|
33
16
|
}
|
|
34
17
|
};
|
|
35
18
|
|
|
19
|
+
const Template = (args) => {
|
|
20
|
+
return (
|
|
21
|
+
<HawaProvider themeName={args.theme}>
|
|
22
|
+
<HawaRadio
|
|
23
|
+
defaultValue="option1"
|
|
24
|
+
options={[
|
|
25
|
+
{ text: "Option 1", label: "option1" },
|
|
26
|
+
{ text: "Option 2", label: "option2" },
|
|
27
|
+
{ text: "Option 3", label: "option3" }
|
|
28
|
+
]}
|
|
29
|
+
/>
|
|
30
|
+
</HawaProvider>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
36
33
|
export const Light = Template.bind({});
|
|
37
34
|
|
|
38
35
|
Light.args = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{ text: "Option 2", label: "option2" },
|
|
42
|
-
{ text: "Option 3", label: "option3" }
|
|
43
|
-
],
|
|
44
|
-
selectedColor: "blue",
|
|
45
|
-
borderRadius: 12,
|
|
46
|
-
defaultValue: "option2",
|
|
47
|
-
bgSelectedColor: "red",
|
|
48
|
-
textSelectedColor: "white",
|
|
36
|
+
theme: "primary",
|
|
37
|
+
|
|
49
38
|
handleChange: () => {
|
|
50
39
|
console.log("handleChange goes here");
|
|
51
40
|
}
|
|
@@ -57,11 +46,7 @@ Dark.args = {
|
|
|
57
46
|
{ text: "Option 2", label: "option2" },
|
|
58
47
|
{ text: "Option 3", label: "option3" }
|
|
59
48
|
],
|
|
60
|
-
selectedColor: "blue",
|
|
61
|
-
borderRadius: 12,
|
|
62
49
|
defaultValue: "option2",
|
|
63
|
-
bgSelectedColor: "blue",
|
|
64
|
-
textSelectedColor: "white",
|
|
65
50
|
handleChange: () => {
|
|
66
51
|
console.log("handleChange goes here");
|
|
67
52
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
SelectPayment,
|
|
4
|
+
CreditCardForm,
|
|
5
|
+
ChargeWalletForm,
|
|
6
|
+
PayWithWallet
|
|
7
|
+
} from "../../blocks/Payment";
|
|
8
|
+
import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
|
|
9
|
+
import { HawaSettingsRow } from "../../ui";
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: "UI/SettingsRow",
|
|
13
|
+
component: [SelectPayment, CreditCardForm],
|
|
14
|
+
argTypes: {
|
|
15
|
+
theme: {
|
|
16
|
+
options: ["primary", "secondary", "default"],
|
|
17
|
+
control: { type: "select" }
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
options: ["checkbox", "text", "default"],
|
|
21
|
+
control: { type: "select" }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
theme: "primary",
|
|
26
|
+
type: "checkbox"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const HawaSettingsRowTemplate = (args) => {
|
|
31
|
+
return (
|
|
32
|
+
<HawaProvider themeName={args.theme}>
|
|
33
|
+
<HawaSettingsRow settingsType={args.type} />
|
|
34
|
+
</HawaProvider>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Checkbox = HawaSettingsRowTemplate.bind({});
|
|
39
|
+
Checkbox.args = {
|
|
40
|
+
theme: "primary",
|
|
41
|
+
type: "checkbox"
|
|
42
|
+
};
|
|
43
|
+
export const Text = (args) => {
|
|
44
|
+
return (
|
|
45
|
+
<HawaProvider themeName={args.theme}>
|
|
46
|
+
<HawaSettingsRow settingsType={args.type} />
|
|
47
|
+
</HawaProvider>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
Text.args = {
|
|
51
|
+
theme: "primary",
|
|
52
|
+
type: "text"
|
|
53
|
+
};
|
|
54
|
+
export const Radio = (args) => {
|
|
55
|
+
return (
|
|
56
|
+
<HawaProvider themeName={args.theme}>
|
|
57
|
+
<HawaSettingsRow settingsType={args.type} />
|
|
58
|
+
</HawaProvider>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
Radio.args = {
|
|
62
|
+
theme: "primary",
|
|
63
|
+
type: "radio"
|
|
64
|
+
};
|
|
@@ -1,7 +1,12 @@
|
|
|
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",
|
|
@@ -16,27 +21,33 @@ export const defaultTheme = {
|
|
|
16
21
|
testcolor: "green",
|
|
17
22
|
margins: 10,
|
|
18
23
|
paddings: 10,
|
|
19
|
-
allBorderRadius: 10,
|
|
20
24
|
typography: {
|
|
25
|
+
fontFamily: ["IBMPlex"].join(","),
|
|
21
26
|
primary: { color: "black" },
|
|
22
27
|
secondary: { color: "white" }
|
|
23
28
|
},
|
|
24
29
|
logoButton: {
|
|
25
30
|
primary: {
|
|
26
31
|
borderRadius: 10,
|
|
27
|
-
backgroundColor:
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
backgroundColor: allPrimaryAction,
|
|
33
|
+
// margin: 10,
|
|
34
|
+
marginTop: 10,
|
|
35
|
+
padding: 30,
|
|
36
|
+
paddingTop: 0,
|
|
37
|
+
paddingBottom: 0,
|
|
30
38
|
border: "1px solid #ced4da",
|
|
31
39
|
height: 50,
|
|
32
40
|
"&:focus": {
|
|
33
|
-
borderColor:
|
|
41
|
+
borderColor: allPrimaryAction
|
|
34
42
|
}
|
|
35
43
|
},
|
|
36
44
|
secondary: {
|
|
37
45
|
borderRadius: 10,
|
|
38
46
|
backgroundColor: "#f90900",
|
|
39
|
-
|
|
47
|
+
marginTop: 10,
|
|
48
|
+
padding: 30,
|
|
49
|
+
paddingTop: 0,
|
|
50
|
+
paddingBottom: 0,
|
|
40
51
|
border: "1px solid #ced4da",
|
|
41
52
|
height: 50,
|
|
42
53
|
"&:focus": {
|
|
@@ -47,7 +58,8 @@ export const defaultTheme = {
|
|
|
47
58
|
actionButton: {
|
|
48
59
|
primary: {
|
|
49
60
|
borderRadius: 10,
|
|
50
|
-
backgroundColor: "#f90900",
|
|
61
|
+
// backgroundColor: "#f90900",
|
|
62
|
+
backgroundColor: allPrimaryAction,
|
|
51
63
|
color: "white",
|
|
52
64
|
margin: 10,
|
|
53
65
|
padding: 10,
|
|
@@ -86,29 +98,26 @@ export const defaultTheme = {
|
|
|
86
98
|
inputFields: {
|
|
87
99
|
primary: {
|
|
88
100
|
backgroundColor: "white",
|
|
89
|
-
display: "flex",
|
|
90
|
-
flexDirection: "column",
|
|
91
|
-
alignItems: "flex-start",
|
|
92
|
-
justifyContent: "flex-start",
|
|
93
101
|
borderRadius: 10,
|
|
94
102
|
"&:focus": {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
103
|
+
borderColor: "red",
|
|
104
|
+
borderWidth: 1,
|
|
105
|
+
border: "1px solid black"
|
|
106
|
+
},
|
|
107
|
+
"&:hover": {
|
|
108
|
+
borderColor: "red",
|
|
109
|
+
borderWidth: 1,
|
|
110
|
+
border: "1px solid black"
|
|
98
111
|
}
|
|
99
112
|
},
|
|
100
113
|
secondary: {
|
|
101
114
|
backgroundColor: "white",
|
|
102
|
-
|
|
103
|
-
flexDirection: "column",
|
|
104
|
-
alignItems: "flex-start",
|
|
105
|
-
justifyContent: "flex-start",
|
|
115
|
+
|
|
106
116
|
borderRadius: 10
|
|
107
117
|
}
|
|
108
118
|
},
|
|
109
119
|
alerts: {
|
|
110
120
|
primary: {
|
|
111
|
-
// marginTop: 10,
|
|
112
121
|
marginBottom: 10,
|
|
113
122
|
padding: 10,
|
|
114
123
|
borderRadius: 10
|
|
@@ -118,12 +127,45 @@ export const defaultTheme = {
|
|
|
118
127
|
padding: 10,
|
|
119
128
|
borderRadius: 10
|
|
120
129
|
}
|
|
130
|
+
},
|
|
131
|
+
settingsRow: {
|
|
132
|
+
primary: {
|
|
133
|
+
display: "flex",
|
|
134
|
+
flexDirection: "row",
|
|
135
|
+
justifyContent: "space-between",
|
|
136
|
+
alignItems: "center",
|
|
137
|
+
backgroundColor: "#F5F5F5",
|
|
138
|
+
margin: 0,
|
|
139
|
+
padding: 10,
|
|
140
|
+
borderRadius: 10
|
|
141
|
+
},
|
|
142
|
+
secondary: {
|
|
143
|
+
display: "flex",
|
|
144
|
+
flexDirection: "row",
|
|
145
|
+
justifyContent: "space-between",
|
|
146
|
+
alignItems: "center",
|
|
147
|
+
backgroundColor: "blue",
|
|
148
|
+
margin: 0,
|
|
149
|
+
padding: 5,
|
|
150
|
+
borderRadius: 10
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
radioSelector: {
|
|
154
|
+
primary: {
|
|
155
|
+
padding: 10,
|
|
156
|
+
borderRadius: 10
|
|
157
|
+
},
|
|
158
|
+
secondary: {
|
|
159
|
+
padding: 10,
|
|
160
|
+
borderRadius: 10
|
|
161
|
+
}
|
|
121
162
|
}
|
|
122
163
|
};
|
|
123
164
|
|
|
124
165
|
export const ThemeProvider = createContext(defaultTheme);
|
|
125
166
|
|
|
126
167
|
export const HawaProvider = ({ theme, ...props }) => {
|
|
168
|
+
console.log("theme is ", theme);
|
|
127
169
|
if (props.size === "large") {
|
|
128
170
|
theme = {
|
|
129
171
|
...theme,
|
|
@@ -132,7 +174,9 @@ export const HawaProvider = ({ theme, ...props }) => {
|
|
|
132
174
|
};
|
|
133
175
|
}
|
|
134
176
|
return (
|
|
135
|
-
<ThemeProvider.Provider
|
|
177
|
+
<ThemeProvider.Provider
|
|
178
|
+
value={{ hawaTheme: defaultTheme, themeName: props.themeName }}
|
|
179
|
+
>
|
|
136
180
|
{props.children}
|
|
137
181
|
</ThemeProvider.Provider>
|
|
138
182
|
);
|
package/src/ui/ActionButton.js
CHANGED
|
@@ -4,20 +4,22 @@ import { ThemeProvider } from "../themes/HawaProvider";
|
|
|
4
4
|
import { styled, darken } from "@mui/material/styles";
|
|
5
5
|
|
|
6
6
|
export const ActionButton = (props) => {
|
|
7
|
-
const
|
|
8
|
-
const currentTheme = Object.keys(
|
|
9
|
-
(
|
|
7
|
+
const { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
8
|
+
const currentTheme = Object.keys(hawaTheme.actionButton).find(
|
|
9
|
+
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
10
10
|
);
|
|
11
11
|
let actionButtonStyle = {};
|
|
12
12
|
|
|
13
13
|
if (currentTheme) {
|
|
14
14
|
actionButtonStyle = {
|
|
15
|
-
...
|
|
16
|
-
margin: props.last ? 0 :
|
|
17
|
-
marginTop: props.last
|
|
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,
|
|
18
20
|
"&:hover": {
|
|
19
21
|
backgroundColor: darken(
|
|
20
|
-
|
|
22
|
+
hawaTheme.actionButton[currentTheme]?.backgroundColor,
|
|
21
23
|
0.1
|
|
22
24
|
)
|
|
23
25
|
}
|
|
@@ -27,14 +29,13 @@ export const ActionButton = (props) => {
|
|
|
27
29
|
backgroundColor: "black",
|
|
28
30
|
color: "white",
|
|
29
31
|
padding: 10,
|
|
30
|
-
marginTop: props.last ? 10 * 2 : 0
|
|
32
|
+
marginTop: props.last ? 10 * 2 : 0,
|
|
33
|
+
borderRadius: 0
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
const StyledButton = styled(Button)(({ theme }) => {
|
|
35
|
-
return {
|
|
36
|
-
...actionButtonStyle
|
|
37
|
-
};
|
|
38
|
+
return { ...actionButtonStyle };
|
|
38
39
|
});
|
|
39
40
|
return <StyledButton {...props}>{props.text}</StyledButton>;
|
|
40
41
|
};
|
package/src/ui/AdaptiveButton.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState, useContext } from "react";
|
|
2
2
|
import Button from "@mui/material/Button";
|
|
3
3
|
import Tooltip from "@mui/material/Tooltip";
|
|
4
|
-
import { motion } from "framer-motion";
|
|
5
4
|
import PropTypes from "prop-types";
|
|
6
5
|
import { ThemeProvider } from "../themes/HawaProvider";
|
|
7
6
|
import { StyledTooltip } from "./StyledTooltip";
|
|
@@ -19,81 +18,35 @@ export const AdaptiveButton = (props) => {
|
|
|
19
18
|
//full button
|
|
20
19
|
if (showText) {
|
|
21
20
|
return (
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
<Button
|
|
22
|
+
disableRipple
|
|
23
|
+
disabled={props.disabled}
|
|
24
|
+
aria-label={props.buttonLabel}
|
|
25
|
+
color={props.danger ? "secondary" : "primary"}
|
|
26
|
+
onClick={props.handleClick}
|
|
27
|
+
style={{
|
|
28
|
+
backgroundColor: theme.primaryColor,
|
|
27
29
|
borderRadius: theme.borderRadius,
|
|
28
|
-
|
|
30
|
+
padding: theme.paddings,
|
|
31
|
+
color: getTextColor(theme.primaryColor)
|
|
32
|
+
// color: hovered
|
|
33
|
+
// ? "#ffffff"
|
|
34
|
+
// : props.danger
|
|
35
|
+
// ? "#f50057"
|
|
36
|
+
// : "var(--blue)"
|
|
29
37
|
}}
|
|
30
|
-
onMouseEnter={() => setHovered(true)}
|
|
31
|
-
onMouseLeave={() => setHovered(false)}
|
|
32
|
-
onMouseDown={() => setHovered(true)}
|
|
33
|
-
onMouseUp={() => setHovered(false)}
|
|
34
|
-
onMouseOver={() => setHovered(true)}
|
|
35
|
-
onMouseOut={() => setHovered(false)}
|
|
36
38
|
>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
backgroundColor: theme.primaryColor,
|
|
45
|
-
borderRadius: theme.borderRadius,
|
|
46
|
-
padding: theme.paddings,
|
|
47
|
-
color: getTextColor(theme.primaryColor)
|
|
48
|
-
// color: hovered
|
|
49
|
-
// ? "#ffffff"
|
|
50
|
-
// : props.danger
|
|
51
|
-
// ? "#f50057"
|
|
52
|
-
// : "var(--blue)"
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
55
|
-
{props.icon}
|
|
56
|
-
{props.showText ? (
|
|
57
|
-
<span style={{ marginLeft: props.icon ? 5 : 0 }}>
|
|
58
|
-
{props.buttonLabel}
|
|
59
|
-
</span>
|
|
60
|
-
) : null}
|
|
61
|
-
</Button>
|
|
62
|
-
</motion.div>
|
|
39
|
+
{props.icon}
|
|
40
|
+
{props.showText ? (
|
|
41
|
+
<span style={{ marginLeft: props.icon ? 5 : 0 }}>
|
|
42
|
+
{props.buttonLabel}
|
|
43
|
+
</span>
|
|
44
|
+
) : null}
|
|
45
|
+
</Button>
|
|
63
46
|
);
|
|
64
47
|
} else if (props.buttonLabelOnly) {
|
|
65
48
|
return (
|
|
66
|
-
|
|
67
|
-
transition={{ duration: 0.2 }}
|
|
68
|
-
initial={{
|
|
69
|
-
width: "fit-content",
|
|
70
|
-
backgroundColor: props.buttonColor,
|
|
71
|
-
borderRadius: theme.borderRadius
|
|
72
|
-
}}
|
|
73
|
-
whileTap={{ scale: 1.2 }}
|
|
74
|
-
whileHover={{
|
|
75
|
-
backgroundColor: props.hoverColor,
|
|
76
|
-
borderRadius: theme.borderRadius
|
|
77
|
-
}}
|
|
78
|
-
onMouseEnter={() => setHovered(true)}
|
|
79
|
-
onMouseLeave={() => setHovered(false)}
|
|
80
|
-
onMouseDown={() => {
|
|
81
|
-
setHovered(true);
|
|
82
|
-
setTooltip(true);
|
|
83
|
-
}}
|
|
84
|
-
onMouseUp={() => {
|
|
85
|
-
setHovered(false);
|
|
86
|
-
setTooltip(true);
|
|
87
|
-
}}
|
|
88
|
-
onMouseOver={() => {
|
|
89
|
-
setHovered(true);
|
|
90
|
-
setTooltip(true);
|
|
91
|
-
}}
|
|
92
|
-
onMouseOut={() => {
|
|
93
|
-
setHovered(false);
|
|
94
|
-
// setTooltip(true);
|
|
95
|
-
}}
|
|
96
|
-
>
|
|
49
|
+
<>
|
|
97
50
|
<Tooltip
|
|
98
51
|
placement={screenSize.width > 400 ? "bottom-center" : "top-center"}
|
|
99
52
|
enterTouchDelay={100}
|
|
@@ -146,100 +99,31 @@ export const AdaptiveButton = (props) => {
|
|
|
146
99
|
{props.buttonLabel}
|
|
147
100
|
</Button>
|
|
148
101
|
</Tooltip>
|
|
149
|
-
|
|
102
|
+
</>
|
|
150
103
|
);
|
|
151
104
|
} else {
|
|
152
105
|
//icon only
|
|
153
106
|
return (
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
onMouseDown={() => {
|
|
171
|
-
setHovered(true);
|
|
172
|
-
setTooltip(true);
|
|
173
|
-
}}
|
|
174
|
-
onMouseUp={() => {
|
|
175
|
-
setHovered(false);
|
|
176
|
-
setTooltip(true);
|
|
177
|
-
}}
|
|
178
|
-
onMouseOver={() => {
|
|
179
|
-
setHovered(true);
|
|
180
|
-
setTooltip(true);
|
|
181
|
-
}}
|
|
182
|
-
onMouseOut={() => {
|
|
183
|
-
setHovered(false);
|
|
184
|
-
// setTooltip(true);
|
|
185
|
-
}}
|
|
186
|
-
>
|
|
187
|
-
<StyledTooltip hintTitle="Example" hintContent="More explaination here">
|
|
188
|
-
<Button
|
|
189
|
-
disabled={props.disabled}
|
|
190
|
-
size="small"
|
|
191
|
-
disableRipple
|
|
192
|
-
aria-label={props.buttonLabel}
|
|
193
|
-
onClick={props.handleClick}
|
|
194
|
-
color={props.danger ? "secondary" : "primary"}
|
|
195
|
-
style={{
|
|
196
|
-
padding: 10,
|
|
197
|
-
color: hovered
|
|
198
|
-
? "#ffffff"
|
|
199
|
-
: props.danger
|
|
200
|
-
? "#f50057"
|
|
201
|
-
: "var(--blue)"
|
|
202
|
-
}}
|
|
203
|
-
>
|
|
204
|
-
{props.icon}
|
|
205
|
-
</Button>
|
|
206
|
-
</StyledTooltip>
|
|
207
|
-
{/* <Tooltip
|
|
208
|
-
placement={screenSize.width > 400 ? "bottom-center" : "top-center"}
|
|
209
|
-
enterTouchDelay={100}
|
|
210
|
-
title={
|
|
211
|
-
props.hint ? (
|
|
212
|
-
props.hint
|
|
213
|
-
) : (
|
|
214
|
-
<div>
|
|
215
|
-
<div
|
|
216
|
-
style={{
|
|
217
|
-
fontSize: 20,
|
|
218
|
-
fontWeight: 800,
|
|
219
|
-
padding: 10,
|
|
220
|
-
paddingBottom: 5,
|
|
221
|
-
textAlign: "center"
|
|
222
|
-
}}
|
|
223
|
-
>
|
|
224
|
-
{props.hintTitle}
|
|
225
|
-
</div>
|
|
226
|
-
<div
|
|
227
|
-
style={{
|
|
228
|
-
fontSize: 13,
|
|
229
|
-
fontWeight: 100,
|
|
230
|
-
padding: 10,
|
|
231
|
-
textAlign: "center"
|
|
232
|
-
}}
|
|
233
|
-
>
|
|
234
|
-
{props.hintContent}
|
|
235
|
-
</div>
|
|
236
|
-
</div>
|
|
237
|
-
)
|
|
238
|
-
}
|
|
107
|
+
<StyledTooltip hintTitle="Example" hintContent="More explaination here">
|
|
108
|
+
<Button
|
|
109
|
+
disabled={props.disabled}
|
|
110
|
+
size="small"
|
|
111
|
+
disableRipple
|
|
112
|
+
aria-label={props.buttonLabel}
|
|
113
|
+
onClick={props.handleClick}
|
|
114
|
+
color={props.danger ? "secondary" : "primary"}
|
|
115
|
+
style={{
|
|
116
|
+
padding: 10,
|
|
117
|
+
color: hovered
|
|
118
|
+
? "#ffffff"
|
|
119
|
+
: props.danger
|
|
120
|
+
? "#f50057"
|
|
121
|
+
: "var(--blue)"
|
|
122
|
+
}}
|
|
239
123
|
>
|
|
240
|
-
|
|
241
|
-
</
|
|
242
|
-
</
|
|
124
|
+
{props.icon}
|
|
125
|
+
</Button>
|
|
126
|
+
</StyledTooltip>
|
|
243
127
|
);
|
|
244
128
|
}
|
|
245
129
|
};
|
package/src/ui/HawaAlert.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
2
|
import { ThemeProvider } from "../themes/HawaProvider";
|
|
3
|
-
import { styled
|
|
3
|
+
import { styled } from "@mui/material/styles";
|
|
4
4
|
|
|
5
5
|
import Alert from "@mui/material/Alert";
|
|
6
6
|
import AlertTitle from "@mui/material/AlertTitle";
|
|
7
7
|
|
|
8
8
|
export const HawaAlert = (props) => {
|
|
9
|
-
const
|
|
10
|
-
const currentTheme = Object.keys(
|
|
11
|
-
(
|
|
9
|
+
const { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
10
|
+
const currentTheme = Object.keys(hawaTheme.alerts).find(
|
|
11
|
+
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
12
12
|
);
|
|
13
13
|
let alertStyle = {};
|
|
14
14
|
|
|
15
15
|
if (currentTheme) {
|
|
16
16
|
alertStyle = {
|
|
17
|
-
...
|
|
17
|
+
...hawaTheme.alerts[currentTheme]
|
|
18
18
|
};
|
|
19
19
|
} else {
|
|
20
20
|
alertStyle = {
|
|
@@ -29,7 +29,7 @@ export const HawaAlert = (props) => {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<StyledAlert
|
|
32
|
+
<StyledAlert {...props}>
|
|
33
33
|
{props.title && <AlertTitle>{props.title}</AlertTitle>}
|
|
34
34
|
{props.text}
|
|
35
35
|
</StyledAlert>
|
package/src/ui/HawaButton.js
CHANGED
|
@@ -4,19 +4,19 @@ import { styled, darken } from "@mui/material/styles";
|
|
|
4
4
|
import Button from "@mui/material/Button";
|
|
5
5
|
|
|
6
6
|
export const HawaButton = (props) => {
|
|
7
|
-
const
|
|
7
|
+
const { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
8
8
|
let buttonStyle = {};
|
|
9
|
-
let currentTheme = Object.keys(
|
|
10
|
-
(
|
|
9
|
+
let currentTheme = Object.keys(hawaTheme.actionButton).find(
|
|
10
|
+
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
11
11
|
);
|
|
12
12
|
if (currentTheme) {
|
|
13
13
|
buttonStyle = {
|
|
14
|
-
...
|
|
14
|
+
...hawaTheme.actionButton[currentTheme],
|
|
15
15
|
// marginTop: theme.actionButton[currentTheme].margin,
|
|
16
16
|
border: props.outlined ? "2px solid black" : "none",
|
|
17
17
|
// borderRadius: theme.actionButton[currentTheme].borderRadius,
|
|
18
18
|
backgroundColor: "white",
|
|
19
|
-
|
|
19
|
+
// height: 50,
|
|
20
20
|
"&:hover": {
|
|
21
21
|
backgroundColor: darken("#ffffff", 0.1)
|
|
22
22
|
}
|
|
@@ -29,7 +29,7 @@ export const HawaButton = (props) => {
|
|
|
29
29
|
flexDirection: "row",
|
|
30
30
|
alignItems: "center",
|
|
31
31
|
justifyContent: "center",
|
|
32
|
-
marginTop:
|
|
32
|
+
marginTop: hawaTheme.actionButton[currentTheme]?.margin,
|
|
33
33
|
border: props.outlined ? "2px solid black" : "none",
|
|
34
34
|
borderRadius: 0,
|
|
35
35
|
//backgroundColor: "white",
|
package/src/ui/HawaInputLabel.js
CHANGED
|
@@ -3,18 +3,18 @@ import { useContext } from "react";
|
|
|
3
3
|
import { ThemeProvider } from "../themes/HawaProvider";
|
|
4
4
|
|
|
5
5
|
export const HawaInputLabel = (props) => {
|
|
6
|
-
const
|
|
6
|
+
const { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
7
7
|
let labelStyle = {};
|
|
8
8
|
|
|
9
|
-
let currentTheme = Object.keys(
|
|
10
|
-
(
|
|
9
|
+
let currentTheme = Object.keys(hawaTheme.actionButton).find(
|
|
10
|
+
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
11
11
|
);
|
|
12
12
|
if (currentTheme) {
|
|
13
13
|
labelStyle = {
|
|
14
14
|
margin: 15,
|
|
15
15
|
marginRight: 5,
|
|
16
16
|
marginLeft: 5,
|
|
17
|
-
color:
|
|
17
|
+
color: hawaTheme?.layout[currentTheme].color
|
|
18
18
|
};
|
|
19
19
|
} else {
|
|
20
20
|
labelStyle = {
|