@sikka/hawa 0.0.1 → 0.0.2
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/README.md +48 -19
- package/dist/index.es.js +37 -0
- package/dist/index.js +37 -0
- package/package.json +1 -1
- package/rollup.config.js +3 -13
- package/src/components/Hawa/AdaptiveButton/{AdaptiveButton.jsx → AdaptiveButton.js} +57 -64
- package/src/components/Hawa/AdaptiveButton/index.js +1 -1
- package/src/components/Hawa/AuthForms/NewPasswordForm.js +23 -0
- package/src/components/Hawa/AuthForms/ResetPasswordForm.js +21 -0
- package/src/components/Hawa/AuthForms/SignInForm.js +25 -0
- package/src/components/Hawa/AuthForms/SignUpForm.js +26 -0
- package/src/components/Hawa/AuthForms/index.js +4 -0
- package/src/components/Hawa/AuthForms/viaFacebook.js +0 -0
- package/src/components/Hawa/AuthForms/viaGithub.js +0 -0
- package/src/components/Hawa/AuthForms/viaGoogle.js +0 -0
- package/src/components/Hawa/AuthForms/viaTwitter.js +0 -0
- package/src/components/Hawa/AutoCompleteField/AutoCompleteField.jsx +7 -7
- package/src/components/Hawa/AutoCompleteField/index.js +1 -1
- package/src/components/Hawa/Box/Box.js +18 -0
- package/src/components/Hawa/Box/index.js +1 -0
- package/src/components/Hawa/Checkbox/Checkbox.jsx +7 -7
- package/src/components/Hawa/DragDropImages/DragDropImages.jsx +13 -13
- package/src/components/Hawa/DragDropImages/index.js +1 -1
- package/src/components/Hawa/HawaProvider/HawaProvider.js +4 -4
- package/src/components/Hawa/InputLabel/StyledInputLabel.js +15 -0
- package/src/components/Hawa/InputLabel/index.js +1 -1
- package/src/components/Hawa/RadioBox/RadioBox.jsx +1 -1
- package/src/components/Hawa/RadioBox/index.js +1 -1
- package/src/components/Hawa/RadioSelector/RadioSelector.jsx +5 -5
- package/src/components/Hawa/RadioSelector/index.js +1 -1
- package/src/components/Hawa/Row/Row.jsx +20 -22
- package/src/components/Hawa/SelectedField/SelectedField.jsx +1 -1
- package/src/components/Hawa/SelectedField/index.js +1 -1
- package/src/components/Hawa/StyledAlert/StyledAlert.js +15 -0
- package/src/components/Hawa/StyledAlert/index.js +1 -0
- package/src/components/Hawa/StyledTooltip/StyledTooltip.js +46 -0
- package/src/components/Hawa/StyledTooltip/index.js +1 -0
- package/src/components/Hawa/TabPanel/TabPanel.jsx +1 -2
- package/src/components/Hawa/TextArea/TextArea.jsx +11 -12
- package/src/components/Hawa/TextField/{TextField.jsx → TextField.js} +23 -10
- package/src/components/Hawa/TextField/index.js +1 -1
- package/src/components/Hawa/index.js +0 -1
- package/src/stories/AdaptiveButton.stories.js +3 -7
- package/src/stories/Alert.stories.js +48 -0
- package/src/stories/AuthForm.stories.js +76 -0
- package/src/stories/Box.stories.js +45 -0
- package/src/stories/CheckBox.stories.js +2 -1
- package/src/stories/RadioSelector.stories.js +2 -2
- package/src/stories/TextField.stories.js +17 -26
- package/src/styles.css +0 -3
- package/src/util.js +20 -0
- package/storybook-static/0.12392f0b.iframe.bundle.js +1 -0
- package/storybook-static/0.55b012452099ace2dca6.manager.bundle.js +1 -0
- package/storybook-static/1.0f38715c61c7c3cd11db.manager.bundle.js +1 -0
- package/storybook-static/1.7c0dc86d.iframe.bundle.js +3 -0
- package/storybook-static/{4.f6eb74f4.iframe.bundle.js.LICENSE.txt → 1.7c0dc86d.iframe.bundle.js.LICENSE.txt} +8 -8
- package/storybook-static/1.7c0dc86d.iframe.bundle.js.map +1 -0
- package/storybook-static/10.9f2923a7561bc20fffdb.manager.bundle.js +1 -0
- package/storybook-static/{11.49c687eaa6261f8b7be2.manager.bundle.js → 11.f4e922583ae35da460f3.manager.bundle.js} +2 -2
- package/storybook-static/{11.49c687eaa6261f8b7be2.manager.bundle.js.LICENSE.txt → 11.f4e922583ae35da460f3.manager.bundle.js.LICENSE.txt} +12 -12
- package/storybook-static/{12.c9538ed3766c96f289e7.manager.bundle.js → 12.1415460941f0bdcb8fa8.manager.bundle.js} +1 -1
- package/storybook-static/2.ee357266.iframe.bundle.js +1 -0
- package/storybook-static/3.592ce28f.iframe.bundle.js +1 -0
- package/storybook-static/{5.fa71488e730c5c7f885f.manager.bundle.js → 5.f459d151315e6780c20f.manager.bundle.js} +2 -2
- package/storybook-static/{5.fa71488e730c5c7f885f.manager.bundle.js.LICENSE.txt → 5.f459d151315e6780c20f.manager.bundle.js.LICENSE.txt} +8 -8
- package/storybook-static/6.3bd64d820f3745f262ff.manager.bundle.js +1 -0
- package/storybook-static/{7.b34baecbd082bc7b188d.manager.bundle.js → 7.3d04765dbf3f1dcd706c.manager.bundle.js} +1 -1
- package/storybook-static/7.af56919f.iframe.bundle.js +1 -0
- package/storybook-static/8.8e2132ec.iframe.bundle.js +3 -0
- package/storybook-static/{6.fbc7b90b.iframe.bundle.js.LICENSE.txt → 8.8e2132ec.iframe.bundle.js.LICENSE.txt} +12 -12
- package/storybook-static/8.8e2132ec.iframe.bundle.js.map +1 -0
- package/storybook-static/{8.15577edffecf900a8de2.manager.bundle.js → 8.b541eadfcb9164835dfc.manager.bundle.js} +1 -1
- package/storybook-static/9.109ea555.iframe.bundle.js +1 -0
- package/storybook-static/9.411ac8e451bbb10926c7.manager.bundle.js +1 -0
- package/storybook-static/iframe.html +348 -138
- package/storybook-static/index.html +51 -47
- package/storybook-static/main.78b7d418.iframe.bundle.js +1 -0
- package/storybook-static/main.9bb085ebb152f5b19a2a.manager.bundle.js +1 -0
- package/storybook-static/{runtime~main.909d038f912f063e8837.manager.bundle.js → runtime~main.9468098d21070636985f.manager.bundle.js} +1 -1
- package/storybook-static/runtime~main.ffc8677e.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.4aa936b1.iframe.bundle.js +3 -0
- package/storybook-static/{vendors~main.73411ca9.iframe.bundle.js.LICENSE.txt → vendors~main.4aa936b1.iframe.bundle.js.LICENSE.txt} +148 -148
- package/storybook-static/vendors~main.4aa936b1.iframe.bundle.js.map +1 -0
- package/storybook-static/vendors~main.a935f15a2179a6eff5fd.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.d3455eed64b243c89325.manager.bundle.js.LICENSE.txt → vendors~main.a935f15a2179a6eff5fd.manager.bundle.js.LICENSE.txt} +110 -88
- package/src/components/Hawa/InputLabel/StyledInputLabel.jsx +0 -36
- 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/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/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.a806a38f.iframe.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/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
package/package.json
CHANGED
package/rollup.config.js
CHANGED
|
@@ -9,21 +9,11 @@ export default [
|
|
|
9
9
|
{
|
|
10
10
|
input: "src/index.js",
|
|
11
11
|
output: [
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
format: "cjs"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
file: "dist/index.es.js",
|
|
18
|
-
format: "es",
|
|
19
|
-
exports: "named"
|
|
20
|
-
}
|
|
12
|
+
{ file: "dist/index.js", format: "cjs" },
|
|
13
|
+
{ file: "dist/index.es.js", format: "es", exports: "named" }
|
|
21
14
|
],
|
|
22
15
|
plugins: [
|
|
23
|
-
postcss({
|
|
24
|
-
plugins: [],
|
|
25
|
-
minimize: true
|
|
26
|
-
}),
|
|
16
|
+
postcss({ plugins: [], minimize: true }),
|
|
27
17
|
babel({
|
|
28
18
|
exclude: "node_modules/**",
|
|
29
19
|
presets: [
|
|
@@ -3,11 +3,13 @@ import Button from "@material-ui/core/Button";
|
|
|
3
3
|
import Tooltip from "@material-ui/core/Tooltip";
|
|
4
4
|
import { motion } from "framer-motion";
|
|
5
5
|
import { ThemeProvider } from "../HawaProvider";
|
|
6
|
+
import { StyledTooltip } from "../StyledTooltip";
|
|
7
|
+
import PropTypes from "prop-types";
|
|
8
|
+
import { getTextColor } from "../../../util";
|
|
6
9
|
|
|
7
10
|
const AdaptiveButton = (props) => {
|
|
8
|
-
const { showText
|
|
11
|
+
const { showText } = props;
|
|
9
12
|
const theme = useContext(ThemeProvider);
|
|
10
|
-
|
|
11
13
|
const screenSize = {
|
|
12
14
|
width: 1500,
|
|
13
15
|
height: 200
|
|
@@ -19,51 +21,35 @@ const AdaptiveButton = (props) => {
|
|
|
19
21
|
return (
|
|
20
22
|
<motion.div
|
|
21
23
|
transition={{ duration: 0.2 }}
|
|
22
|
-
|
|
23
|
-
// direction: "rtl",
|
|
24
|
-
backgroundColor: buttonColor,
|
|
25
|
-
color: textColor,
|
|
26
|
-
borderRadius: theme.borderRadius,
|
|
27
|
-
width: "fit-content"
|
|
28
|
-
}}
|
|
24
|
+
whileTap={{ scale: 1.2 }}
|
|
29
25
|
whileHover={{
|
|
30
|
-
backgroundColor: props.hoverColor,
|
|
31
|
-
borderRadius: borderRadius
|
|
26
|
+
// backgroundColor: props.hoverColor,
|
|
27
|
+
borderRadius: theme.borderRadius,
|
|
28
|
+
color: "red"
|
|
32
29
|
}}
|
|
33
|
-
whileTap={{ scale: 1.2 }}
|
|
34
30
|
onMouseEnter={() => setHovered(true)}
|
|
35
31
|
onMouseLeave={() => setHovered(false)}
|
|
36
|
-
onMouseDown={() =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
onMouseUp={() => {
|
|
41
|
-
setHovered(false);
|
|
42
|
-
setTooltip(true);
|
|
43
|
-
}}
|
|
44
|
-
onMouseOver={() => {
|
|
45
|
-
setHovered(true);
|
|
46
|
-
setTooltip(true);
|
|
47
|
-
}}
|
|
48
|
-
onMouseOut={() => {
|
|
49
|
-
setHovered(false);
|
|
50
|
-
// setTooltip(true);
|
|
51
|
-
}}
|
|
32
|
+
onMouseDown={() => setHovered(true)}
|
|
33
|
+
onMouseUp={() => setHovered(false)}
|
|
34
|
+
onMouseOver={() => setHovered(true)}
|
|
35
|
+
onMouseOut={() => setHovered(false)}
|
|
52
36
|
>
|
|
53
37
|
<Button
|
|
54
|
-
disabled={props.disabled}
|
|
55
38
|
disableRipple
|
|
39
|
+
disabled={props.disabled}
|
|
56
40
|
aria-label={props.buttonLabel}
|
|
57
41
|
color={props.danger ? "secondary" : "primary"}
|
|
58
42
|
onClick={props.handleClick}
|
|
59
43
|
style={{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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)"
|
|
67
53
|
}}
|
|
68
54
|
>
|
|
69
55
|
{props.icon}
|
|
@@ -78,18 +64,16 @@ const AdaptiveButton = (props) => {
|
|
|
78
64
|
} else if (props.buttonLabelOnly) {
|
|
79
65
|
return (
|
|
80
66
|
<motion.div
|
|
81
|
-
transition={{
|
|
82
|
-
duration: 0.2
|
|
83
|
-
}}
|
|
67
|
+
transition={{ duration: 0.2 }}
|
|
84
68
|
initial={{
|
|
85
69
|
width: "fit-content",
|
|
86
70
|
backgroundColor: props.buttonColor,
|
|
87
|
-
borderRadius: borderRadius
|
|
71
|
+
borderRadius: theme.borderRadius
|
|
88
72
|
}}
|
|
89
73
|
whileTap={{ scale: 1.2 }}
|
|
90
74
|
whileHover={{
|
|
91
75
|
backgroundColor: props.hoverColor,
|
|
92
|
-
borderRadius: borderRadius
|
|
76
|
+
borderRadius: theme.borderRadius
|
|
93
77
|
}}
|
|
94
78
|
onMouseEnter={() => setHovered(true)}
|
|
95
79
|
onMouseLeave={() => setHovered(false)}
|
|
@@ -152,7 +136,6 @@ const AdaptiveButton = (props) => {
|
|
|
152
136
|
color={props.danger ? "secondary" : "primary"}
|
|
153
137
|
style={{
|
|
154
138
|
padding: 10,
|
|
155
|
-
|
|
156
139
|
color: hovered
|
|
157
140
|
? "#ffffff"
|
|
158
141
|
: props.danger
|
|
@@ -173,14 +156,14 @@ const AdaptiveButton = (props) => {
|
|
|
173
156
|
initial={{
|
|
174
157
|
width: "fit-content",
|
|
175
158
|
backgroundColor: props.buttonColor,
|
|
176
|
-
borderRadius: borderRadius,
|
|
159
|
+
borderRadius: theme.borderRadius,
|
|
177
160
|
// padding: 5,
|
|
178
161
|
margin: 5
|
|
179
162
|
}}
|
|
180
163
|
whileTap={{ scale: 1.2 }}
|
|
181
164
|
whileHover={{
|
|
182
165
|
backgroundColor: props.hoverColor,
|
|
183
|
-
borderRadius: borderRadius
|
|
166
|
+
borderRadius: theme.borderRadius
|
|
184
167
|
}}
|
|
185
168
|
onMouseEnter={() => setHovered(true)}
|
|
186
169
|
onMouseLeave={() => setHovered(false)}
|
|
@@ -201,7 +184,27 @@ const AdaptiveButton = (props) => {
|
|
|
201
184
|
// setTooltip(true);
|
|
202
185
|
}}
|
|
203
186
|
>
|
|
204
|
-
<
|
|
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
|
|
205
208
|
placement={screenSize.width > 400 ? "bottom-center" : "top-center"}
|
|
206
209
|
enterTouchDelay={100}
|
|
207
210
|
title={
|
|
@@ -234,28 +237,18 @@ const AdaptiveButton = (props) => {
|
|
|
234
237
|
)
|
|
235
238
|
}
|
|
236
239
|
>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
size="small"
|
|
240
|
-
disableRipple
|
|
241
|
-
aria-label={props.buttonLabel}
|
|
242
|
-
onClick={props.handleClick}
|
|
243
|
-
color={props.danger ? "secondary" : "primary"}
|
|
244
|
-
style={{
|
|
245
|
-
padding: 10,
|
|
246
|
-
color: hovered
|
|
247
|
-
? "#ffffff"
|
|
248
|
-
: props.danger
|
|
249
|
-
? "#f50057"
|
|
250
|
-
: "var(--blue)"
|
|
251
|
-
}}
|
|
252
|
-
>
|
|
253
|
-
{props.icon}
|
|
254
|
-
</Button>
|
|
255
|
-
</Tooltip>
|
|
240
|
+
|
|
241
|
+
</Tooltip> */}
|
|
256
242
|
</motion.div>
|
|
257
243
|
);
|
|
258
244
|
}
|
|
259
245
|
};
|
|
260
246
|
|
|
247
|
+
AdaptiveButton.propTypes = {
|
|
248
|
+
buttonLabel: PropTypes.string,
|
|
249
|
+
danger: PropTypes.bool,
|
|
250
|
+
disabled: PropTypes.bool,
|
|
251
|
+
showText: PropTypes.bool
|
|
252
|
+
};
|
|
253
|
+
|
|
261
254
|
export default AdaptiveButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./AdaptiveButton.
|
|
1
|
+
export * from "./AdaptiveButton.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeProvider } from "../HawaProvider";
|
|
3
|
+
import { StyledInputLabel } from "../InputLabel";
|
|
4
|
+
import { StyledTextField } from "../TextField";
|
|
5
|
+
export const NewPasswordForm = (props) => {
|
|
6
|
+
const theme = useContext(ThemeProvider);
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
style={{
|
|
10
|
+
backgroundColor: theme.paperColors,
|
|
11
|
+
padding: theme.paddings,
|
|
12
|
+
borderRadius: theme.borderRadius,
|
|
13
|
+
margin: theme.margins
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
<StyledInputLabel label="Password" />
|
|
17
|
+
<StyledTextField type="password" />
|
|
18
|
+
<StyledInputLabel label="Confirm Password" />
|
|
19
|
+
<StyledTextField type="password" />
|
|
20
|
+
{props.children}
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeProvider } from "../HawaProvider";
|
|
3
|
+
import { StyledInputLabel } from "../InputLabel";
|
|
4
|
+
import { StyledTextField } from "../TextField";
|
|
5
|
+
export const ResetPasswordForm = (props) => {
|
|
6
|
+
const theme = useContext(ThemeProvider);
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
style={{
|
|
10
|
+
backgroundColor: theme.paperColors,
|
|
11
|
+
padding: theme.paddings,
|
|
12
|
+
borderRadius: theme.borderRadius,
|
|
13
|
+
margin: theme.margins
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
<StyledInputLabel label="Email" />
|
|
17
|
+
<StyledTextField type="text" />
|
|
18
|
+
{props.children}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeProvider } from "../HawaProvider";
|
|
3
|
+
import { StyledInputLabel } from "../InputLabel";
|
|
4
|
+
import { StyledTextField } from "../TextField";
|
|
5
|
+
|
|
6
|
+
export const SignInForm = (props) => {
|
|
7
|
+
const theme = useContext(ThemeProvider);
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
style={{
|
|
11
|
+
backgroundColor: theme.paperColors,
|
|
12
|
+
padding: theme.paddings,
|
|
13
|
+
borderRadius: theme.borderRadius,
|
|
14
|
+
margin: theme.margins
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<StyledInputLabel label="Email" />
|
|
18
|
+
<StyledTextField type="text" />
|
|
19
|
+
<StyledInputLabel label="Password" />
|
|
20
|
+
<StyledTextField type="text" />
|
|
21
|
+
|
|
22
|
+
{props.children}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeProvider } from "../HawaProvider";
|
|
3
|
+
import { StyledInputLabel } from "../InputLabel";
|
|
4
|
+
import { StyledTextField } from "../TextField";
|
|
5
|
+
|
|
6
|
+
export const SignUpForm = (props) => {
|
|
7
|
+
const theme = useContext(ThemeProvider);
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
style={{
|
|
11
|
+
backgroundColor: theme.paperColors,
|
|
12
|
+
padding: theme.paddings,
|
|
13
|
+
borderRadius: theme.borderRadius,
|
|
14
|
+
margin: theme.margins
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<StyledInputLabel label="Email" />
|
|
18
|
+
<StyledTextField type="text" />
|
|
19
|
+
<StyledInputLabel label="Password" />
|
|
20
|
+
<StyledTextField type="text" />
|
|
21
|
+
<StyledInputLabel label="Confirm Password" />
|
|
22
|
+
<StyledTextField type="text" />
|
|
23
|
+
{props.children}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { Controller, useFormContext } from "react-hook-form"
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
3
3
|
// import Autocomplete from "@material-ui/lab/Autocomplete";
|
|
4
4
|
|
|
5
5
|
export const AutoCompleteField = (props) => {
|
|
6
|
-
const { control } = useFormContext()
|
|
7
|
-
const { name, rules, shouldUnregister } = props
|
|
6
|
+
const { control } = useFormContext();
|
|
7
|
+
const { name, rules, shouldUnregister } = props;
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<React.Fragment>
|
|
@@ -25,9 +25,9 @@ export const AutoCompleteField = (props) => {
|
|
|
25
25
|
// {...props}
|
|
26
26
|
// className={"theme_form_input"}
|
|
27
27
|
// />
|
|
28
|
-
)
|
|
28
|
+
);
|
|
29
29
|
}}
|
|
30
30
|
/>
|
|
31
31
|
</React.Fragment>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./AutoCompleteField.jsx"
|
|
1
|
+
export * from "./AutoCompleteField.jsx";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeProvider } from "../HawaProvider";
|
|
3
|
+
|
|
4
|
+
export const Box = (props) => {
|
|
5
|
+
const theme = useContext(ThemeProvider);
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
style={{
|
|
9
|
+
backgroundColor: theme.paperColors,
|
|
10
|
+
padding: theme.paddings,
|
|
11
|
+
borderRadius: theme.borderRadius,
|
|
12
|
+
margin: theme.margins
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
{props.children}
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Box.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
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"
|
|
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
5
|
|
|
6
6
|
export const StyledCheckbox = (props) => {
|
|
7
|
-
console.log("props : ", props)
|
|
7
|
+
console.log("props : ", props);
|
|
8
8
|
return (
|
|
9
9
|
<React.Fragment>
|
|
10
10
|
<FormControlLabel
|
|
@@ -16,5 +16,5 @@ export const StyledCheckbox = (props) => {
|
|
|
16
16
|
}
|
|
17
17
|
/>
|
|
18
18
|
</React.Fragment>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
-
import axios from "axios";
|
|
2
|
+
// import axios from "axios";
|
|
3
3
|
import { getToken } from "../token";
|
|
4
4
|
import { useDropzone } from "react-dropzone";
|
|
5
5
|
import useTranslation from "next-translate/useTranslation";
|
|
@@ -52,18 +52,18 @@ const DragDropItemImage = ({
|
|
|
52
52
|
}
|
|
53
53
|
]);
|
|
54
54
|
try {
|
|
55
|
-
await axios.post(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
);
|
|
55
|
+
// await axios.post(
|
|
56
|
+
// `${process.env.NEXT_PUBLIC_QAWAIM_API_URL}/deleteImages`,
|
|
57
|
+
// {
|
|
58
|
+
// deletedFiles: [
|
|
59
|
+
// {
|
|
60
|
+
// img_url: acceptedFiles[file]?.img_url,
|
|
61
|
+
// _id: acceptedFiles[file]?._id
|
|
62
|
+
// }
|
|
63
|
+
// ],
|
|
64
|
+
// itemId: itemId
|
|
65
|
+
// }
|
|
66
|
+
// );
|
|
67
67
|
refetchSingleMenu();
|
|
68
68
|
acceptedFiles.splice(file, 1);
|
|
69
69
|
setFiles(acceptedFiles);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./DragDropImages.jsx";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
|
|
3
3
|
const defaultValue = {
|
|
4
|
-
borderRadius:
|
|
4
|
+
borderRadius: 10,
|
|
5
5
|
primaryColor: "blue",
|
|
6
6
|
secondaryColor: "grey",
|
|
7
|
-
margins:
|
|
8
|
-
paddings:
|
|
7
|
+
margins: 10,
|
|
8
|
+
paddings: 5
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const ThemeProvider = createContext(defaultValue);
|
|
12
12
|
|
|
13
|
-
export const HawaProvider = ({theme, ...props}) => {
|
|
13
|
+
export const HawaProvider = ({ theme, ...props }) => {
|
|
14
14
|
return (
|
|
15
15
|
<ThemeProvider.Provider value={theme || defaultValue}>
|
|
16
16
|
{props.children}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import InputLabel from "@material-ui/core/InputLabel";
|
|
2
|
+
|
|
3
|
+
export const StyledInputLabel = (props) => {
|
|
4
|
+
return (
|
|
5
|
+
<InputLabel
|
|
6
|
+
style={{
|
|
7
|
+
margin: 15,
|
|
8
|
+
marginRight: 0,
|
|
9
|
+
marginLeft: 0
|
|
10
|
+
}}
|
|
11
|
+
>
|
|
12
|
+
<div style={{ fontSize: 15, color: "black" }}>{props.label}</div>
|
|
13
|
+
</InputLabel>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./StyledInputLabel.
|
|
1
|
+
export * from "./StyledInputLabel.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./RadioBox.jsx"
|
|
1
|
+
export * from "./RadioBox.jsx";
|
|
@@ -16,19 +16,19 @@ export const StyledRadioSelector = (props) => {
|
|
|
16
16
|
marginBottom: 10
|
|
17
17
|
}}
|
|
18
18
|
>
|
|
19
|
-
{props.options.map((
|
|
19
|
+
{props.options.map((singleOption) => {
|
|
20
20
|
return (
|
|
21
21
|
<div
|
|
22
|
-
key={
|
|
22
|
+
key={singleOption.label}
|
|
23
23
|
className="radio_option"
|
|
24
24
|
onClick={() => {
|
|
25
|
-
setValue(
|
|
25
|
+
setValue(singleOption.label);
|
|
26
26
|
if (props.handleChange) {
|
|
27
27
|
props.handleChange();
|
|
28
28
|
}
|
|
29
29
|
}}
|
|
30
30
|
style={
|
|
31
|
-
value.toLowerCase() ===
|
|
31
|
+
value.toLowerCase() === singleOption.label.toLowerCase()
|
|
32
32
|
? {
|
|
33
33
|
borderRadius: theme.borderRadius,
|
|
34
34
|
padding: theme.paddings,
|
|
@@ -42,7 +42,7 @@ export const StyledRadioSelector = (props) => {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
>
|
|
45
|
-
{
|
|
45
|
+
{singleOption.text}
|
|
46
46
|
</div>
|
|
47
47
|
);
|
|
48
48
|
})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./RadioSelector.jsx"
|
|
1
|
+
export * from "./RadioSelector.jsx";
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
export const Row = (props) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
return (
|
|
3
|
+
<div
|
|
4
|
+
style={{
|
|
5
|
+
backgroundColor: "var(--light)",
|
|
6
|
+
borderRadius: "var(--borderR)",
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "row",
|
|
9
|
+
justifyContent: "space-between",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
height: 50,
|
|
12
|
+
padding: 10,
|
|
13
|
+
marginBottom: 20,
|
|
14
|
+
width: "100%"
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<div style={{ fontWeight: 800 }}>{props.title}</div>
|
|
18
|
+
{props.actionComponent}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./SelectedField.jsx"
|
|
1
|
+
export * from "./SelectedField.jsx";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// import * as Alert from "@material-ui/lab/Alert";
|
|
2
|
+
// import styles from "../styles/Theme.module.css";
|
|
3
|
+
|
|
4
|
+
export const StyledAlert = (props) => {
|
|
5
|
+
return (
|
|
6
|
+
<div>{props.text}</div>
|
|
7
|
+
// <Alert
|
|
8
|
+
// {...props}
|
|
9
|
+
// // className={styles.styled_alert}
|
|
10
|
+
// // style={{ borderRadius: "var(--borderR)" }}
|
|
11
|
+
// >
|
|
12
|
+
// {props.children}
|
|
13
|
+
// </Alert>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./StyledAlert.js";
|