@sikka/hawa 0.0.1 → 0.0.4
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/.github/workflows/hawa-publish-push.yml +45 -0
- package/.github/workflows/hawa-publish.yml +45 -0
- package/.prettierrc +28 -28
- package/README.md +149 -119
- package/es/index.es.js +1 -0
- package/lib/index.js +1 -0
- package/package.json +59 -47
- package/rollup.config.js +30 -40
- package/src/Assets/images/card-background/1.jpeg +0 -0
- package/src/Assets/images/card-background/10.jpeg +0 -0
- package/src/Assets/images/card-background/11.jpeg +0 -0
- package/src/Assets/images/card-background/12.jpeg +0 -0
- package/src/Assets/images/card-background/13.jpeg +0 -0
- package/src/Assets/images/card-background/14.jpeg +0 -0
- package/src/Assets/images/card-background/15.jpeg +0 -0
- package/src/Assets/images/card-background/16.jpeg +0 -0
- package/src/Assets/images/card-background/17.jpeg +0 -0
- package/src/Assets/images/card-background/18.jpeg +0 -0
- package/src/Assets/images/card-background/19.jpeg +0 -0
- package/src/Assets/images/card-background/2.jpeg +0 -0
- package/src/Assets/images/card-background/20.jpeg +0 -0
- package/src/Assets/images/card-background/21.jpeg +0 -0
- package/src/Assets/images/card-background/22.jpeg +0 -0
- package/src/Assets/images/card-background/23.jpeg +0 -0
- package/src/Assets/images/card-background/24.jpeg +0 -0
- package/src/Assets/images/card-background/25.jpeg +0 -0
- package/src/Assets/images/card-background/3.jpeg +0 -0
- package/src/Assets/images/card-background/4.jpeg +0 -0
- package/src/Assets/images/card-background/5.jpeg +0 -0
- package/src/Assets/images/card-background/6.jpeg +0 -0
- package/src/Assets/images/card-background/7.jpeg +0 -0
- package/src/Assets/images/card-background/8.jpeg +0 -0
- package/src/Assets/images/card-background/9.jpeg +0 -0
- package/src/Assets/images/card-type/amex.png +0 -0
- package/src/Assets/images/card-type/diners.png +0 -0
- package/src/Assets/images/card-type/discover.png +0 -0
- package/src/Assets/images/card-type/mastercard.png +0 -0
- package/src/Assets/images/card-type/troy.png +0 -0
- package/src/Assets/images/card-type/unionpay.png +0 -0
- package/src/Assets/images/card-type/visa.png +0 -0
- package/src/blocks/Account/UserProfile.js +15 -0
- package/src/blocks/Account/UserSettings.js +15 -0
- package/src/blocks/Account/index.js +2 -0
- package/src/blocks/AuthForms/NewPasswordForm.js +17 -0
- package/src/blocks/AuthForms/ResetPasswordForm.js +14 -0
- package/src/blocks/AuthForms/SignInForm.js +19 -0
- package/src/blocks/AuthForms/SignUpForm.js +20 -0
- package/src/blocks/AuthForms/index.js +4 -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/Payment/Form/CForm.js +326 -0
- package/src/blocks/Payment/Form/Card.js +242 -0
- package/src/blocks/Payment/Gateway/GooglePay.js +251 -0
- package/src/blocks/Payment/Gateway/Payfort.js +90 -0
- package/src/blocks/Payment/Gateway/Paypal.js +138 -0
- package/src/blocks/Payment/Gateway/Wallet.js +149 -0
- package/src/blocks/Payment/PaymentMethod.js +132 -0
- package/src/blocks/index.js +13 -0
- package/src/index.js +2 -1
- package/src/layout/Box.js +25 -0
- package/src/layout/index.js +1 -0
- package/src/stories/ActionButton.stories.js +49 -0
- package/src/stories/AdaptiveButton.stories.js +80 -84
- package/src/stories/Alert.stories.js +41 -0
- package/src/stories/AuthForm.stories.js +79 -0
- package/src/stories/Box.stories.js +64 -0
- package/src/stories/CheckBox.stories.js +35 -33
- package/src/stories/GlobalVariables.stories.js +101 -108
- package/src/stories/HawaProvider.stories.js +23 -23
- package/src/stories/InputLabel.stories.js +92 -100
- package/src/stories/Introduction.stories.js +211 -0
- package/src/stories/RadioSelector.stories.js +69 -69
- package/src/stories/TextField.stories.js +50 -59
- package/src/stories/UserAccount.stories.js +46 -0
- package/src/styles.css +400 -403
- package/src/styles.scss +679 -0
- package/src/themes/HawaProvider.js +45 -0
- package/src/ui/ActionButton.js +15 -0
- package/src/{components/Hawa/AdaptiveButton/AdaptiveButton.jsx → ui/AdaptiveButton.js} +252 -261
- package/src/{components/Hawa/AutoCompleteField/AutoCompleteField.jsx → ui/AutoCompleteField.js} +33 -33
- package/src/{components/Hawa/Checkbox/Checkbox.jsx → ui/Checkbox.js} +21 -20
- package/src/{components/Hawa/DragDropImages/DragDropImages.jsx → ui/DragDropImages.js} +180 -180
- package/src/{components/Hawa/Hawa.jsx → ui/Hawa.js} +3 -3
- package/src/{components/Hawa/RadioBox/RadioBox.jsx → ui/RadioBox.js} +29 -29
- package/src/{components/Hawa/RadioSelector/RadioSelector.jsx → ui/RadioSelector.js} +51 -51
- package/src/ui/Row.js +21 -0
- package/src/{components/Hawa/SelectedField/SelectedField.jsx → ui/SelectedField.js} +46 -46
- package/src/ui/StyledAlert.js +30 -0
- package/src/ui/StyledInputLabel.js +19 -0
- package/src/ui/StyledTooltip.js +46 -0
- package/src/{components/Hawa/TabPanel/TabPanel.jsx → ui/TabPanel.js} +37 -38
- package/src/{components/Hawa/TextArea/TextArea.jsx → ui/TextArea.js} +38 -39
- package/src/ui/TextField.js +62 -0
- package/src/{components/Hawa → ui}/index.js +13 -11
- package/src/util.js +20 -0
- package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +1 -0
- package/storybook-static/0.dd3d47f5.iframe.bundle.js +1 -0
- package/storybook-static/1.4e43f671.iframe.bundle.js +3 -0
- package/storybook-static/{4.f6eb74f4.iframe.bundle.js.LICENSE.txt → 1.4e43f671.iframe.bundle.js.LICENSE.txt} +8 -8
- package/storybook-static/1.4e43f671.iframe.bundle.js.map +1 -0
- package/storybook-static/2.9a757207.iframe.bundle.js +1 -0
- package/storybook-static/3.c1dc7159.iframe.bundle.js +1 -0
- package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +2 -0
- package/storybook-static/{5.fa71488e730c5c7f885f.manager.bundle.js.LICENSE.txt → 4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt} +8 -8
- package/storybook-static/5.88fe62ee92ff5ca67829.manager.bundle.js +1 -0
- package/storybook-static/6.96d184f368dea006cb52.manager.bundle.js +2 -0
- package/storybook-static/{11.49c687eaa6261f8b7be2.manager.bundle.js.LICENSE.txt → 6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt} +12 -12
- package/storybook-static/{7.a806a38f.iframe.bundle.js → 7.5ec31f3702b08ab0b71c.manager.bundle.js} +1 -1
- package/storybook-static/7.69d2e532.iframe.bundle.js +1 -0
- package/storybook-static/8.5ce13be7612bd3a6b864.manager.bundle.js +1 -0
- package/storybook-static/8.68cd1217.iframe.bundle.js +3 -0
- package/storybook-static/{6.fbc7b90b.iframe.bundle.js.LICENSE.txt → 8.68cd1217.iframe.bundle.js.LICENSE.txt} +12 -12
- package/storybook-static/8.68cd1217.iframe.bundle.js.map +1 -0
- package/storybook-static/9.488e3969.iframe.bundle.js +1 -0
- package/storybook-static/iframe.html +348 -138
- package/storybook-static/index.html +59 -47
- package/storybook-static/main.65cb2769.iframe.bundle.js +1 -0
- package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.6e2e1544.iframe.bundle.js +1 -0
- package/storybook-static/runtime~main.cc29f4c2175f187a3707.manager.bundle.js +1 -0
- package/storybook-static/vendors~main.d144d840.iframe.bundle.js +3 -0
- package/storybook-static/{vendors~main.73411ca9.iframe.bundle.js.LICENSE.txt → vendors~main.d144d840.iframe.bundle.js.LICENSE.txt} +148 -148
- package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +1 -0
- package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.d3455eed64b243c89325.manager.bundle.js.LICENSE.txt → vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt} +104 -88
- package/tools/build-styles.js +17 -0
- package/yarn-error.log +10910 -0
- package/src/components/Hawa/AdaptiveButton/index.js +0 -1
- package/src/components/Hawa/AutoCompleteField/index.js +0 -1
- package/src/components/Hawa/Checkbox/index.js +0 -1
- package/src/components/Hawa/DragDropImages/index.js +0 -1
- package/src/components/Hawa/HawaProvider/HawaProvider.js +0 -19
- package/src/components/Hawa/HawaProvider/index.js +0 -1
- package/src/components/Hawa/InputLabel/StyledInputLabel.jsx +0 -36
- package/src/components/Hawa/InputLabel/index.js +0 -1
- package/src/components/Hawa/RadioBox/index.js +0 -1
- package/src/components/Hawa/RadioSelector/index.js +0 -1
- package/src/components/Hawa/Row/Row.jsx +0 -23
- package/src/components/Hawa/Row/index.js +0 -1
- package/src/components/Hawa/SelectedField/index.js +0 -1
- package/src/components/Hawa/TabPanel/index.js +0 -1
- package/src/components/Hawa/TextArea/index.js +0 -1
- package/src/components/Hawa/TextField/TextField.jsx +0 -41
- package/src/components/Hawa/TextField/index.js +0 -1
- package/storybook-static/0.86a7edfd.iframe.bundle.js +0 -1
- package/storybook-static/0.b73eaee9a88f178d62ed.manager.bundle.js +0 -1
- package/storybook-static/1.f296d183a17268696d73.manager.bundle.js +0 -1
- package/storybook-static/10.9998ba67d65d81d20896.manager.bundle.js +0 -1
- package/storybook-static/11.49c687eaa6261f8b7be2.manager.bundle.js +0 -2
- package/storybook-static/12.c9538ed3766c96f289e7.manager.bundle.js +0 -1
- package/storybook-static/4.f6eb74f4.iframe.bundle.js +0 -3
- package/storybook-static/4.f6eb74f4.iframe.bundle.js.map +0 -1
- package/storybook-static/5.ec6f37af.iframe.bundle.js +0 -1
- package/storybook-static/5.fa71488e730c5c7f885f.manager.bundle.js +0 -2
- package/storybook-static/6.8096ae4aadde0743697b.manager.bundle.js +0 -1
- package/storybook-static/6.fbc7b90b.iframe.bundle.js +0 -3
- package/storybook-static/6.fbc7b90b.iframe.bundle.js.map +0 -1
- package/storybook-static/7.b34baecbd082bc7b188d.manager.bundle.js +0 -1
- package/storybook-static/8.15577edffecf900a8de2.manager.bundle.js +0 -1
- package/storybook-static/9.d7d85aa0a49a98f17218.manager.bundle.js +0 -1
- package/storybook-static/main.355ffc59.iframe.bundle.js +0 -1
- package/storybook-static/main.ce406c7e93b98325390e.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.3d81579b.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.909d038f912f063e8837.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.73411ca9.iframe.bundle.js +0 -3
- package/storybook-static/vendors~main.73411ca9.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.d3455eed64b243c89325.manager.bundle.js +0 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Button from "@material-ui/core/Button";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { ThemeProvider } from "../themes/HawaProvider";
|
|
4
|
+
|
|
5
|
+
export const ActionButton = (props) => {
|
|
6
|
+
const theme = useContext(ThemeProvider);
|
|
7
|
+
return (
|
|
8
|
+
<Button style={{
|
|
9
|
+
color: theme.textColor,
|
|
10
|
+
backgroundColor: props.secondary ? theme.secondaryActionColor : theme.primaryActionColor,
|
|
11
|
+
borderRadius: theme.borderRadius,
|
|
12
|
+
marginTop: props.last ? theme.margins * 2 : 0
|
|
13
|
+
}}>{props.text}</Button>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -1,261 +1,252 @@
|
|
|
1
|
-
import React, { useState, useContext } from "react";
|
|
2
|
-
import Button from "@material-ui/core/Button";
|
|
3
|
-
import Tooltip from "@material-ui/core/Tooltip";
|
|
4
|
-
import { motion } from "framer-motion";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
{props.icon}
|
|
254
|
-
</Button>
|
|
255
|
-
</Tooltip>
|
|
256
|
-
</motion.div>
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export default AdaptiveButton;
|
|
1
|
+
import React, { useState, useContext } from "react";
|
|
2
|
+
import Button from "@material-ui/core/Button";
|
|
3
|
+
import Tooltip from "@material-ui/core/Tooltip";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
|
+
import { ThemeProvider } from "../themes/HawaProvider";
|
|
7
|
+
import { StyledTooltip } from "./StyledTooltip";
|
|
8
|
+
import { getTextColor } from "../util";
|
|
9
|
+
|
|
10
|
+
export const AdaptiveButton = (props) => {
|
|
11
|
+
const { showText } = props;
|
|
12
|
+
const theme = useContext(ThemeProvider);
|
|
13
|
+
const screenSize = {
|
|
14
|
+
width: 1500,
|
|
15
|
+
height: 200
|
|
16
|
+
};
|
|
17
|
+
const [tooltip, setTooltip] = useState(false);
|
|
18
|
+
const [hovered, setHovered] = useState(false);
|
|
19
|
+
//full button
|
|
20
|
+
if (showText) {
|
|
21
|
+
return (
|
|
22
|
+
<motion.div
|
|
23
|
+
transition={{ duration: 0.2 }}
|
|
24
|
+
whileTap={{ scale: 1.2 }}
|
|
25
|
+
whileHover={{
|
|
26
|
+
// backgroundColor: props.hoverColor,
|
|
27
|
+
borderRadius: theme.borderRadius,
|
|
28
|
+
color: "red"
|
|
29
|
+
}}
|
|
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
|
+
>
|
|
37
|
+
<Button
|
|
38
|
+
disableRipple
|
|
39
|
+
disabled={props.disabled}
|
|
40
|
+
aria-label={props.buttonLabel}
|
|
41
|
+
color={props.danger ? "secondary" : "primary"}
|
|
42
|
+
onClick={props.handleClick}
|
|
43
|
+
style={{
|
|
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>
|
|
63
|
+
);
|
|
64
|
+
} else if (props.buttonLabelOnly) {
|
|
65
|
+
return (
|
|
66
|
+
<motion.div
|
|
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
|
+
>
|
|
97
|
+
<Tooltip
|
|
98
|
+
placement={screenSize.width > 400 ? "bottom-center" : "top-center"}
|
|
99
|
+
enterTouchDelay={100}
|
|
100
|
+
title={
|
|
101
|
+
props.hint ? (
|
|
102
|
+
props.hint
|
|
103
|
+
) : (
|
|
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}
|
|
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>
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
>
|
|
130
|
+
<Button
|
|
131
|
+
disabled={props.disabled}
|
|
132
|
+
size="small"
|
|
133
|
+
disableRipple
|
|
134
|
+
aria-label={props.buttonLabel}
|
|
135
|
+
onClick={props.handleClick}
|
|
136
|
+
color={props.danger ? "secondary" : "primary"}
|
|
137
|
+
style={{
|
|
138
|
+
padding: 10,
|
|
139
|
+
color: hovered
|
|
140
|
+
? "#ffffff"
|
|
141
|
+
: props.danger
|
|
142
|
+
? "#f50057"
|
|
143
|
+
: "var(--blue)"
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
{props.buttonLabel}
|
|
147
|
+
</Button>
|
|
148
|
+
</Tooltip>
|
|
149
|
+
</motion.div>
|
|
150
|
+
);
|
|
151
|
+
} else {
|
|
152
|
+
//icon only
|
|
153
|
+
return (
|
|
154
|
+
<motion.div
|
|
155
|
+
transition={{ duration: 0.2 }}
|
|
156
|
+
initial={{
|
|
157
|
+
width: "fit-content",
|
|
158
|
+
backgroundColor: props.buttonColor,
|
|
159
|
+
borderRadius: theme.borderRadius,
|
|
160
|
+
// padding: 5,
|
|
161
|
+
margin: 5
|
|
162
|
+
}}
|
|
163
|
+
whileTap={{ scale: 1.2 }}
|
|
164
|
+
whileHover={{
|
|
165
|
+
backgroundColor: props.hoverColor,
|
|
166
|
+
borderRadius: theme.borderRadius
|
|
167
|
+
}}
|
|
168
|
+
onMouseEnter={() => setHovered(true)}
|
|
169
|
+
onMouseLeave={() => setHovered(false)}
|
|
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
|
+
}
|
|
239
|
+
>
|
|
240
|
+
|
|
241
|
+
</Tooltip> */}
|
|
242
|
+
</motion.div>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
AdaptiveButton.propTypes = {
|
|
248
|
+
buttonLabel: PropTypes.string,
|
|
249
|
+
danger: PropTypes.bool,
|
|
250
|
+
disabled: PropTypes.bool,
|
|
251
|
+
showText: PropTypes.bool
|
|
252
|
+
};
|
package/src/{components/Hawa/AutoCompleteField/AutoCompleteField.jsx → ui/AutoCompleteField.js}
RENAMED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { Controller, useFormContext } from "react-hook-form"
|
|
3
|
-
// import Autocomplete from "@material-ui/lab/Autocomplete";
|
|
4
|
-
|
|
5
|
-
export const AutoCompleteField = (props) => {
|
|
6
|
-
const { control } = useFormContext()
|
|
7
|
-
const { name, rules, shouldUnregister } = props
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<React.Fragment>
|
|
11
|
-
<Controller
|
|
12
|
-
name={name}
|
|
13
|
-
rules={rules}
|
|
14
|
-
control={control}
|
|
15
|
-
shouldUnregister={shouldUnregister}
|
|
16
|
-
className="theme_form_input"
|
|
17
|
-
render={({ field: { onChange, value } }) => {
|
|
18
|
-
return (
|
|
19
|
-
<input type="text" />
|
|
20
|
-
// <Autocomplete
|
|
21
|
-
// onChange={(e, data) => {
|
|
22
|
-
// onChange(data);
|
|
23
|
-
// }}
|
|
24
|
-
// value={value ?? ""}
|
|
25
|
-
// {...props}
|
|
26
|
-
// className={"theme_form_input"}
|
|
27
|
-
// />
|
|
28
|
-
)
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
</React.Fragment>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
3
|
+
// import Autocomplete from "@material-ui/lab/Autocomplete";
|
|
4
|
+
|
|
5
|
+
export const AutoCompleteField = (props) => {
|
|
6
|
+
const { control } = useFormContext();
|
|
7
|
+
const { name, rules, shouldUnregister } = props;
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<React.Fragment>
|
|
11
|
+
<Controller
|
|
12
|
+
name={name}
|
|
13
|
+
rules={rules}
|
|
14
|
+
control={control}
|
|
15
|
+
shouldUnregister={shouldUnregister}
|
|
16
|
+
className="theme_form_input"
|
|
17
|
+
render={({ field: { onChange, value } }) => {
|
|
18
|
+
return (
|
|
19
|
+
<input type="text" />
|
|
20
|
+
// <Autocomplete
|
|
21
|
+
// onChange={(e, data) => {
|
|
22
|
+
// onChange(data);
|
|
23
|
+
// }}
|
|
24
|
+
// value={value ?? ""}
|
|
25
|
+
// {...props}
|
|
26
|
+
// className={"theme_form_input"}
|
|
27
|
+
// />
|
|
28
|
+
);
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
</React.Fragment>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import FormControlLabel from "@material-ui/core/FormControlLabel"
|
|
3
|
-
import Checkbox from "@material-ui/core/Checkbox"
|
|
4
|
-
import PropTypes from "prop-types"
|
|
5
|
-
|
|
6
|
-
export const StyledCheckbox = (props) => {
|
|
7
|
-
console.log("props : ", props)
|
|
8
|
-
return (
|
|
9
|
-
<React.Fragment>
|
|
10
|
-
<FormControlLabel
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import FormControlLabel from "@material-ui/core/FormControlLabel";
|
|
3
|
+
import Checkbox from "@material-ui/core/Checkbox";
|
|
4
|
+
// import PropTypes from "prop-types";
|
|
5
|
+
|
|
6
|
+
export const StyledCheckbox = (props) => {
|
|
7
|
+
console.log("props : ", props);
|
|
8
|
+
return (
|
|
9
|
+
<React.Fragment>
|
|
10
|
+
<FormControlLabel
|
|
11
|
+
label={props.label}
|
|
12
|
+
control={
|
|
13
|
+
<Checkbox
|
|
14
|
+
style={{ color: props.color || null }}
|
|
15
|
+
defaultChecked={props.defaultValue}
|
|
16
|
+
/>
|
|
17
|
+
}
|
|
18
|
+
/>
|
|
19
|
+
</React.Fragment>
|
|
20
|
+
);
|
|
21
|
+
};
|