@sikka/hawa 0.0.24 → 0.0.27

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.
@@ -18,7 +18,6 @@ export const ResetPasswordForm = (props) => {
18
18
  <Container maxWidth="xs" variant="auth">
19
19
  {!props.sent ? (
20
20
  <form onSubmit={handleSubmit(props.handleResetPassword)}>
21
- {console.log("eror ", errors.email?.message)}
22
21
  <Controller
23
22
  control={control}
24
23
  name="email"
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { HawaTextField, HawaLogoButton } from "../../elements";
2
+ import { HawaTextField, HawaLogoButton, HawaAlert } from "../../elements";
3
3
  import { Controller, useForm } from "react-hook-form";
4
4
  import InputAdornment from "@mui/material/InputAdornment";
5
5
  import EmailIcon from "@mui/icons-material/MailOutline";
@@ -25,11 +25,12 @@ export const SignInForm = (props) => {
25
25
  variant="auth"
26
26
  style={{ direction: props.lang === "ar" ? "rtl" : "ltr" }}
27
27
  >
28
- {props.error && (
29
- <Alert severity="error" variant="inContainer">
30
- {props.errorTitle && <AlertTitle>{props.errorTitle}</AlertTitle>}
31
- {props.errorText}
32
- </Alert>
28
+ {props.showError && (
29
+ <HawaAlert
30
+ title={props.errorTitle}
31
+ text={props.errorText}
32
+ severity="error"
33
+ />
33
34
  )}
34
35
  <form onSubmit={handleSubmit(props.handleSignIn)}>
35
36
  <Controller
@@ -4,7 +4,7 @@ import AlertTitle from "@mui/material/AlertTitle";
4
4
 
5
5
  export const HawaAlert = (props) => {
6
6
  return (
7
- <Alert severity={props.severity}>
7
+ <Alert severity={props.severity} icon={props.hideIcon}>
8
8
  {props.title && <AlertTitle>{props.title}</AlertTitle>}
9
9
  {props.text}
10
10
  </Alert>
@@ -1,47 +1,6 @@
1
1
  import React from "react";
2
- // import { ThemeProvider } from "../themes/HawaProvider";
3
- // import { styled, darken } from "@mui/material/styles";
4
2
  import Button from "@mui/material/Button";
5
3
 
6
4
  export const HawaButton = (props) => {
7
- // let buttonStyle = {};
8
- // let currentTheme = Object.keys(hawaTheme.actionButton).find(
9
- // (tName) => tName.toLowerCase() === themeName?.toLowerCase()
10
- // );
11
- // if (currentTheme) {
12
- // buttonStyle = {
13
- // ...hawaTheme.actionButton[currentTheme],
14
- // // marginTop: theme.actionButton[currentTheme].margin,
15
- // border: props.outlined ? "2px solid black" : "none",
16
- // // borderRadius: theme.actionButton[currentTheme].borderRadius,
17
- // backgroundColor: "white",
18
- // // height: 50,
19
- // "&:hover": {
20
- // backgroundColor: darken("#ffffff", 0.1)
21
- // }
22
- // };
23
- // } else {
24
- // // Default theme
25
- // buttonStyle = {
26
- // cursor: "pointer",
27
- // display: "flex",
28
- // flexDirection: "row",
29
- // alignItems: "center",
30
- // justifyContent: "center",
31
- // marginTop: hawaTheme.actionButton[currentTheme]?.margin,
32
- // border: props.outlined ? "2px solid black" : "none",
33
- // borderRadius: 0,
34
- // //backgroundColor: "white",
35
- // backgroundColor: "red",
36
- // "&:hover": {
37
- // backgroundColor: darken("#ffffff", 0.1)
38
- // }
39
- // };
40
- // }
41
- // const StyledButton = styled(Button)(({ theme }) => {
42
- // return {
43
- // ...buttonStyle
44
- // };
45
- // });
46
5
  return <Button {...props}>{props.children}</Button>;
47
6
  };
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import FormControlLabel from "@mui/material/FormControlLabel";
3
3
  import Checkbox from "@mui/material/Checkbox";
4
- // import PropTypes from "prop-types";
5
4
 
6
5
  export const HawaCheckbox = (props) => {
7
6
  console.log("props : ", props);
@@ -1,30 +1,8 @@
1
1
  import InputLabel from "@mui/material/InputLabel";
2
2
 
3
3
  export const HawaInputLabel = (props) => {
4
- // let labelStyle = {};
5
-
6
- // let currentTheme = Object.keys(hawaTheme.actionButton).find(
7
- // (tName) => tName.toLowerCase() === themeName?.toLowerCase()
8
- // );
9
- // if (currentTheme) {
10
- // labelStyle = {
11
- // margin: 15,
12
- // marginRight: 5,
13
- // marginLeft: 5,
14
- // color: hawaTheme?.layout[currentTheme].color
15
- // };
16
- // } else {
17
- // labelStyle = {
18
- // margin: 15,
19
- // marginRight: 0,
20
- // marginLeft: 0,
21
- // color: "black"
22
- // };
23
- // }
24
4
  return (
25
- <InputLabel
26
- // style={labelStyle}
27
- >
5
+ <InputLabel>
28
6
  <div style={{ fontSize: 15 }}>{props.label}</div>
29
7
  </InputLabel>
30
8
  );
@@ -0,0 +1,56 @@
1
+ import React from "react";
2
+ import Container from "@mui/material/Container";
3
+ import Button from "@mui/material/Button";
4
+
5
+ export const HawaItemCard = (props) => {
6
+ let isArabic = props.lang === "ar";
7
+ const handleParentClick = (e) => {
8
+ e.stopPropagation();
9
+ props.onCardClick();
10
+ };
11
+ return (
12
+ <Container
13
+ onClick={handleParentClick}
14
+ maxWidth="xs"
15
+ variant="card-container"
16
+ dataValue="parent"
17
+ // variant={props.selectedPlan ? "selected-plan-card" : "plan-card"}
18
+ style={{ direction: isArabic ? "rtl" : "ltr" }}
19
+ >
20
+ {props.header && (
21
+ <Container style={{ zIndex: 20 }} variant="card-header">
22
+ {props.headerActions && (
23
+ <div
24
+ style={{
25
+ margin: 0,
26
+ marginRight: -20,
27
+ marginLeft: -20,
28
+ marginBottom: -20,
29
+ // backgroundColor: "red",
30
+ display: "flex",
31
+ paddingTop: 5,
32
+ paddingLeft: 5,
33
+ paddingRight: 5,
34
+ justifyContent: "flex-end"
35
+ }}
36
+ >
37
+ {props.headerActions}
38
+ </div>
39
+ )}
40
+ {props.header}
41
+ </Container>
42
+ )}
43
+ {props.content && (
44
+ <Container style={{ zIndex: 20 }} variant="card-content">
45
+ {props.content}
46
+ </Container>
47
+ )}
48
+
49
+ {props.actions && (
50
+ <Container style={{ zIndex: 20 }} variant="card-actions">
51
+ {props.actions}
52
+ </Container>
53
+ )}
54
+ </Container>
55
+ );
56
+ };
@@ -1,38 +1,26 @@
1
+ import { useTheme } from "@mui/system";
1
2
  import React from "react";
2
- import { Controller, useFormContext } from "react-hook-form";
3
- import { StyledInputLabel } from ".";
4
3
 
5
4
  export const HawaTextArea = (props) => {
6
- const { control } = useFormContext();
7
- const { name, rules, shouldUnregister, inputLabel, helperText } = props;
8
-
5
+ const theme = useTheme();
6
+ console.log("theme is ", theme);
9
7
  return (
10
- <Controller
11
- render={({ field }) => (
12
- <label>
13
- {inputLabel ? <StyledInputLabel label={inputLabel} /> : null}
14
- <textarea
15
- style={{
16
- color: "black",
17
- backgroundColor: props.bgColor || "white",
18
- // borderRadius: props.bdRadius || 10,
19
- borderBottom: "none",
20
- border: "none",
21
- width: "100%",
22
- padding: 0,
23
- margin: 0,
24
- marginBottom: 0,
25
- resize: props.resize || "vertical"
26
- }}
27
- value={field.value ?? ""}
28
- {...field}
29
- />
30
- </label>
31
- )}
32
- name={name}
33
- rules={rules}
34
- control={control}
35
- shouldUnregister={shouldUnregister}
36
- />
8
+ <label>
9
+ {/* {inputLabel ? <StyledInputLabel label={inputLabel} /> : null} */}
10
+ <textarea
11
+ style={{
12
+ color: "black",
13
+ backgroundColor: props.bgColor || "white",
14
+ borderBottom: "none",
15
+ border: "none",
16
+ width: "100%",
17
+ padding: 0,
18
+ margin: 0,
19
+ marginBottom: 0,
20
+ resize: props.resize || "vertical"
21
+ }}
22
+ // value={field.value ?? ""}
23
+ />
24
+ </label>
37
25
  );
38
26
  };
@@ -5,28 +5,24 @@ import Typography from "@mui/material/Typography";
5
5
 
6
6
  export const HawaTextField = (props) => {
7
7
  return (
8
- <div
9
- style={
10
- props.inForm && {
11
- width: "100%"
12
- }
13
- }
14
- >
15
- <div
16
- style={{
17
- display: "flex",
18
- flexDirection: "row",
19
- justifyContent: "space-between",
20
- alignItems: "center"
21
- }}
22
- >
23
- {props.label && <InputLabel>{props.label}</InputLabel>}
8
+ <div style={props.inForm && { width: "100%" }}>
9
+ <div style={{ width: props.fullWidth ? "100%" : "fit-content" }}>
10
+ <div
11
+ style={{
12
+ display: "flex",
13
+ flexDirection: "row",
14
+ justifyContent: "space-between",
15
+ alignItems: "center"
16
+ }}
17
+ >
18
+ {props.label && <InputLabel>{props.label}</InputLabel>}
24
19
 
25
- {props.helperText && (
26
- <Typography variant="validation">{props.helperText}</Typography>
27
- )}
20
+ {props.helperText && (
21
+ <Typography variant="validation">{props.helperText}</Typography>
22
+ )}
23
+ </div>
24
+ <Input disableUnderline {...props} />
28
25
  </div>
29
- <Input disableUnderline {...props} />
30
26
  </div>
31
27
  );
32
28
  };
@@ -8,7 +8,6 @@ const useStyles = makeStyles((theme) => ({
8
8
  },
9
9
  panel: {
10
10
  backgroundColor: "var(--lightGrey)",
11
- // borderRadius: "var(--borderR)",
12
11
  height: "100%",
13
12
  width: "100%",
14
13
  padding: 10
@@ -1,15 +1,17 @@
1
1
  export * from "./AdaptiveButton";
2
2
  export * from "./ActionButton";
3
+ export * from "./OfflineBanner";
3
4
  export * from "./HawaCheckbox";
4
5
  export * from "./HawaRadio";
6
+ export * from "./HawaItemCard";
5
7
  export * from "./HawaPricingCard";
6
8
  export * from "./HawaSettingsRow";
7
9
  export * from "./HawaLogoButton";
8
10
  export * from "./HawaButton";
9
11
  export * from "./HawaSelect";
10
12
  export * from "./HawaTextField";
13
+ export * from "./HawaTextArea";
11
14
  export * from "./HawaInputLabel";
12
15
  export * from "./HawaTypography";
13
16
  export * from "./HawaAlert";
14
17
  export * from "./HawaTable";
15
- export * from "./OfflineBanner";
package/src/layout/Box.js CHANGED
@@ -1,41 +1,5 @@
1
1
  import React from "react";
2
2
 
3
3
  export const Box = (props) => {
4
- // let boxStyle = {};
5
-
6
- // let currentTheme = Object.keys(hawaTheme.layout).find(
7
- // (tName) => tName.toLowerCase() === themeName?.toLowerCase()
8
- // );
9
- // if (currentTheme) {
10
- // boxStyle = {
11
- // display: "flex",
12
- // flexDirection: props.horizontal ? "row" : "column",
13
- // ...hawaTheme?.layout[currentTheme],
14
- // backgroundColor: props.noColor
15
- // ? "none"
16
- // : hawaTheme.layout[currentTheme].backgroundColor,
17
- // padding: props.noPadding ? 0 : hawaTheme?.layout[currentTheme].padding,
18
- // margin: props.noMargin ? 0 : hawaTheme?.layout[currentTheme].margin,
19
- // maxWidth: props.maxWidth
20
- // };
21
- // } else {
22
- // boxStyle = {
23
- // display: "flex",
24
- // flexDirection: props.horizontal ? "row" : "column",
25
- // color: "white",
26
- // marginTop: props.last ? 10 * 2 : 0,
27
- // backgroundColor: props.noColor ? "none" : "lightGrey",
28
- // padding: props.noPadding ? 0 : 10,
29
- // margin: props.noMargin ? 0 : 10,
30
- // maxWidth: props.maxWidth,
31
- // };
32
- // }
33
-
34
- return (
35
- <div
36
- // style={boxStyle}
37
- >
38
- {props.children}
39
- </div>
40
- );
4
+ return <div>{props.children}</div>;
41
5
  };