@sikka/hawa 0.0.36 → 0.0.40
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 +3 -1
- package/README.md +2 -1
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +5 -3
- package/src/Hooks.js +61 -0
- package/src/blocks/AuthForms/CodeConfirmation.js +94 -0
- package/src/blocks/AuthForms/index.js +1 -0
- package/src/blocks/Misc/NotFound.js +47 -0
- package/src/blocks/Misc/index.js +1 -0
- package/src/blocks/Pricing/PricingPlans.js +3 -3
- package/src/elements/HawaChip.js +6 -0
- package/src/elements/{HawaRadio.js → HawaPanelTabs.js} +3 -2
- package/src/elements/HawaSettingsRow.js +2 -2
- package/src/elements/HawaSnackbar.js +11 -8
- package/src/elements/PinInput.js +141 -0
- package/src/elements/index.js +2 -2
- package/src/index.js +2 -0
- package/src/layout/HawaAppBar.js +0 -1
- package/src/styles.css +4 -0
- package/src/styles.scss +3 -1
- package/src/theme/HawaTheme.js +927 -0
- package/src/theme/index.js +2 -0
- package/src/util.js +11 -1
- package/storybook-static/0.a2c13f8ca8477800b11f.manager.bundle.js +2 -0
- package/storybook-static/{0.0d994c92.iframe.bundle.js.LICENSE.txt → 0.a2c13f8ca8477800b11f.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/0.d94b248f.iframe.bundle.js +3 -0
- package/storybook-static/{4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt → 0.d94b248f.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/0.d94b248f.iframe.bundle.js.map +1 -0
- package/storybook-static/1.37f89487.iframe.bundle.js +1 -0
- package/storybook-static/1.d522251f2377f7751924.manager.bundle.js +1 -0
- package/storybook-static/{2.430bf1e3.iframe.bundle.js → 2.89943a03.iframe.bundle.js} +1 -1
- package/storybook-static/5.a331b0a36ded1c541923.manager.bundle.js +2 -0
- package/storybook-static/5.a331b0a36ded1c541923.manager.bundle.js.LICENSE.txt +31 -0
- package/storybook-static/6.3a1fb0c3.iframe.bundle.js +3 -0
- package/storybook-static/6.3a1fb0c3.iframe.bundle.js.LICENSE.txt +31 -0
- package/storybook-static/6.3a1fb0c3.iframe.bundle.js.map +1 -0
- package/storybook-static/6.aee6c4935c69d480fc0d.manager.bundle.js +1 -0
- package/storybook-static/7.5b8a4de4b5fa42d8de02.manager.bundle.js +1 -0
- package/storybook-static/7.f33530b1.iframe.bundle.js +1 -0
- package/storybook-static/8.a3dec9c37e8951a17939.manager.bundle.js +2 -0
- package/storybook-static/{6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt → 8.a3dec9c37e8951a17939.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/8.b569e86b.iframe.bundle.js +1 -0
- package/storybook-static/{8.76c3cbf398692028e834.manager.bundle.js → 9.d04fdaada645cd23cb4b.manager.bundle.js} +1 -1
- package/storybook-static/9.f9db5c90.iframe.bundle.js +3 -0
- package/storybook-static/{7.9ce807e3.iframe.bundle.js.LICENSE.txt → 9.f9db5c90.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/9.f9db5c90.iframe.bundle.js.map +1 -0
- package/storybook-static/iframe.html +19 -3
- package/storybook-static/index.html +2 -2
- package/storybook-static/main.066fa5c5.iframe.bundle.js +1 -0
- package/storybook-static/main.750dea0e0e515fd26844.manager.bundle.js +1 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/runtime~main.1bd817501fb34a0cb56b.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.9be73be4.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.40879e99.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.3cf4a535.iframe.bundle.js.LICENSE.txt → vendors~main.40879e99.iframe.bundle.js.LICENSE.txt} +15 -0
- package/storybook-static/vendors~main.40879e99.iframe.bundle.js.map +1 -0
- package/storybook-static/vendors~main.ed8bc18573e141ab3b26.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.11281b487bf96f5ff19e.manager.bundle.js.LICENSE.txt → vendors~main.ed8bc18573e141ab3b26.manager.bundle.js.LICENSE.txt} +18 -18
- package/src/elements/HawaTextArea.js +0 -26
- package/storybook-static/0.0d994c92.iframe.bundle.js +0 -3
- package/storybook-static/0.0d994c92.iframe.bundle.js.map +0 -1
- package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +0 -1
- package/storybook-static/1.aabc3f3a.iframe.bundle.js +0 -1
- package/storybook-static/4.0fcda1281dc1961dbe94.manager.bundle.js +0 -2
- package/storybook-static/5.63ab4f94d50a3acf080d.manager.bundle.js +0 -1
- package/storybook-static/6.13a534cb.iframe.bundle.js +0 -1
- package/storybook-static/6.a6d45262f7e98f3f18d3.manager.bundle.js +0 -2
- package/storybook-static/7.097710753af9a1c41b80.manager.bundle.js +0 -1
- package/storybook-static/7.9ce807e3.iframe.bundle.js +0 -3
- package/storybook-static/7.9ce807e3.iframe.bundle.js.map +0 -1
- package/storybook-static/8.1bf48ea7.iframe.bundle.js +0 -1
- package/storybook-static/main.3f5171ae.iframe.bundle.js +0 -1
- package/storybook-static/main.9d5968bcf15d21f5487c.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.708d7ac1.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.c8dac23bc753439736f0.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.11281b487bf96f5ff19e.manager.bundle.js +0 -2
- package/storybook-static/vendors~main.3cf4a535.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.3cf4a535.iframe.bundle.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./NotFound.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import Container from "@mui/material/Container";
|
|
3
|
-
import { HawaPricingCard,
|
|
3
|
+
import { HawaPricingCard, HawaPanelTabs } from "../../elements";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
|
|
6
6
|
export const PricingPlans = (props) => {
|
|
@@ -16,7 +16,7 @@ export const PricingPlans = (props) => {
|
|
|
16
16
|
marginBottom: 10
|
|
17
17
|
}}
|
|
18
18
|
>
|
|
19
|
-
<
|
|
19
|
+
<HawaPanelTabs
|
|
20
20
|
location="inPricing"
|
|
21
21
|
handleChange={(e) => setCurrentCycle(e)}
|
|
22
22
|
defaultValue="monthly"
|
|
@@ -28,7 +28,7 @@ export const PricingPlans = (props) => {
|
|
|
28
28
|
]}
|
|
29
29
|
/>
|
|
30
30
|
|
|
31
|
-
<
|
|
31
|
+
<HawaPanelTabs
|
|
32
32
|
location="inPricing"
|
|
33
33
|
handleChange={(e) => {
|
|
34
34
|
setCurrentCurrency(e);
|
|
@@ -3,7 +3,7 @@ import Button from "@mui/material/Button";
|
|
|
3
3
|
import Container from "@mui/material/Container";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const HawaPanelTabs = (props) => {
|
|
7
7
|
const [value, setValue] = useState(props.defaultValue);
|
|
8
8
|
return (
|
|
9
9
|
<Container variant={props.location || "panelTabs"}>
|
|
@@ -29,7 +29,8 @@ export const HawaRadio = (props) => {
|
|
|
29
29
|
</Container>
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
HawaPanelTabs.propTypes = {
|
|
33
34
|
lang: PropTypes.string,
|
|
34
35
|
options: PropTypes.arrayOf(
|
|
35
36
|
PropTypes.shape({
|
|
@@ -4,7 +4,7 @@ import Checkbox from "@mui/material/Checkbox";
|
|
|
4
4
|
import Container from "@mui/material/Container";
|
|
5
5
|
import { HawaTypography } from "./HawaTypography";
|
|
6
6
|
import { HawaTextField } from "./HawaTextField";
|
|
7
|
-
import {
|
|
7
|
+
import { HawaPanelTabs } from "./HawaPanelTabs";
|
|
8
8
|
import { HawaSwitch } from "./HawaSwitch";
|
|
9
9
|
import { HawaColorPicker } from "./HawaColorPicker";
|
|
10
10
|
import { HawaRange } from "./HawaRange";
|
|
@@ -19,7 +19,7 @@ export const HawaSettingsRow = (props) => {
|
|
|
19
19
|
{props.settingsType === "range" && <HawaRange {...props} />}
|
|
20
20
|
{props.settingsType === "color" && <HawaColorPicker {...props} />}
|
|
21
21
|
{props.settingsType === "radio" && (
|
|
22
|
-
<
|
|
22
|
+
<HawaPanelTabs location="inSettings" {...props} />
|
|
23
23
|
)}
|
|
24
24
|
</Container>
|
|
25
25
|
);
|
|
@@ -6,27 +6,26 @@ import { IconButton } from "@mui/material";
|
|
|
6
6
|
import CloseIcon from "@mui/icons-material/Close";
|
|
7
7
|
|
|
8
8
|
export const HawaSnackbar = (props) => {
|
|
9
|
-
|
|
10
|
-
const [position, setPosition] = useState({vertical : "", horizontal : ""});
|
|
9
|
+
const [position, setPosition] = useState({ vertical: "", horizontal: "" });
|
|
11
10
|
|
|
12
11
|
useEffect(() => {
|
|
13
|
-
if(props.position){
|
|
12
|
+
if (props.position) {
|
|
14
13
|
const p = props.position.split("-");
|
|
15
|
-
setPosition({vertical
|
|
14
|
+
setPosition({ vertical: p[0], horizontal: p[1] });
|
|
16
15
|
}
|
|
17
|
-
}, [props.position])
|
|
16
|
+
}, [props.position]);
|
|
18
17
|
|
|
19
18
|
return (
|
|
20
19
|
<Snackbar
|
|
21
20
|
open={props.open}
|
|
22
|
-
autoHideDuration={props.
|
|
21
|
+
autoHideDuration={props.autoHide ? props.duration : null}
|
|
23
22
|
onClose={props.handleClose}
|
|
24
23
|
anchorOrigin={position}
|
|
25
24
|
action={
|
|
26
25
|
<>
|
|
27
26
|
<IconButton
|
|
28
27
|
aria-label="close"
|
|
29
|
-
style={{color: "black"}}
|
|
28
|
+
style={{ color: "black" }}
|
|
30
29
|
sx={{ p: 0.5 }}
|
|
31
30
|
onClick={props.handleClose}
|
|
32
31
|
>
|
|
@@ -35,7 +34,11 @@ export const HawaSnackbar = (props) => {
|
|
|
35
34
|
</>
|
|
36
35
|
}
|
|
37
36
|
>
|
|
38
|
-
<Alert
|
|
37
|
+
<Alert
|
|
38
|
+
icon={false}
|
|
39
|
+
severity={props.severity}
|
|
40
|
+
onClose={props.isClosable ? props.handleClose : null}
|
|
41
|
+
>
|
|
39
42
|
{props.title && <AlertTitle>{props.title}</AlertTitle>}
|
|
40
43
|
{props.text}
|
|
41
44
|
</Alert>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Input,
|
|
3
|
+
makeStyles,
|
|
4
|
+
TextField,
|
|
5
|
+
InputLabel,
|
|
6
|
+
Typography,
|
|
7
|
+
Stack
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import { object } from "prop-types";
|
|
10
|
+
import React, { useEffect, useState } from "react";
|
|
11
|
+
import { replaceAt } from "../util";
|
|
12
|
+
|
|
13
|
+
export const HawaPinInput = ({
|
|
14
|
+
children,
|
|
15
|
+
type,
|
|
16
|
+
defaultValue,
|
|
17
|
+
onChange,
|
|
18
|
+
onComplete,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const [value, setValue] = useState(
|
|
22
|
+
defaultValue ? defaultValue.split("") : []
|
|
23
|
+
);
|
|
24
|
+
const [pinLength, setPinLength] = useState(0);
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
let length = 0;
|
|
28
|
+
React.Children.map(children, (child) => {
|
|
29
|
+
if (
|
|
30
|
+
React.isValidElement(child) &&
|
|
31
|
+
child.type?.displayName &&
|
|
32
|
+
child.type?.displayName === "HawaPinInputField"
|
|
33
|
+
) {
|
|
34
|
+
length++;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
setPinLength(length);
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
40
|
+
const childrenWithProps = React.Children.map(children, (child, index) => {
|
|
41
|
+
if (React.isValidElement(child)) {
|
|
42
|
+
if (
|
|
43
|
+
child.type?.displayName &&
|
|
44
|
+
child.type?.displayName === "HawaPinInputField" &&
|
|
45
|
+
defaultValue &&
|
|
46
|
+
defaultValue[index]
|
|
47
|
+
) {
|
|
48
|
+
return React.cloneElement(child, {
|
|
49
|
+
type,
|
|
50
|
+
defaultValue: defaultValue[index],
|
|
51
|
+
index: index,
|
|
52
|
+
setValue: setValue,
|
|
53
|
+
value: value,
|
|
54
|
+
onChangeAction: (currentValue) => onChange(currentValue),
|
|
55
|
+
onCompleteAction: (finalValue) => onComplete(finalValue),
|
|
56
|
+
pinLength: pinLength
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return React.cloneElement(child, {
|
|
60
|
+
type,
|
|
61
|
+
setValue: setValue,
|
|
62
|
+
value: value,
|
|
63
|
+
index: index,
|
|
64
|
+
onChangeAction: (currentValue) => onChange(currentValue),
|
|
65
|
+
onCompleteAction: (finalValue) => onComplete(finalValue),
|
|
66
|
+
pinLength: pinLength
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return child;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (value.length === pinLength) {
|
|
74
|
+
onComplete(value);
|
|
75
|
+
}
|
|
76
|
+
}, [value]);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<div style={props.inForm && { width: "100%" }}>
|
|
80
|
+
<div style={{ width: props.fullWidth ? "100%" : "fit-content" }}>
|
|
81
|
+
<div
|
|
82
|
+
style={{
|
|
83
|
+
display: "flex",
|
|
84
|
+
flexDirection: "row",
|
|
85
|
+
justifyContent: "space-between",
|
|
86
|
+
alignItems: "center"
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
{props.label && <InputLabel>{props.label}</InputLabel>}
|
|
90
|
+
{props.helperText && (
|
|
91
|
+
<Typography
|
|
92
|
+
style={{ marginBottom: !props.label && 10 }}
|
|
93
|
+
variant="validation"
|
|
94
|
+
>
|
|
95
|
+
{props.helperText}
|
|
96
|
+
</Typography>
|
|
97
|
+
)}
|
|
98
|
+
</div>
|
|
99
|
+
<Stack
|
|
100
|
+
direction={"row"}
|
|
101
|
+
spacing={2}
|
|
102
|
+
justifyContent="center"
|
|
103
|
+
alignItems={"center"}
|
|
104
|
+
>
|
|
105
|
+
{childrenWithProps}
|
|
106
|
+
</Stack>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const HawaPinInputField = (props) => {
|
|
113
|
+
return (
|
|
114
|
+
<Input
|
|
115
|
+
type={props.type && props.type == "alphanumeric" ? "text" : "number"}
|
|
116
|
+
id={"pinInput" + props.index}
|
|
117
|
+
defaultValue={props.defaultValue || ""}
|
|
118
|
+
variant="pin"
|
|
119
|
+
disableUnderline
|
|
120
|
+
inputProps={{ maxLength: 1 }}
|
|
121
|
+
onChange={(e) => {
|
|
122
|
+
let newValue = props.value;
|
|
123
|
+
newValue[props.index] = e.target.value;
|
|
124
|
+
props.setValue(newValue);
|
|
125
|
+
props.onChangeAction(newValue.toString().replaceAll(",", ""));
|
|
126
|
+
if (
|
|
127
|
+
parseInt(e.target.attributes["maxlength"].value) >= 1 &&
|
|
128
|
+
e.target.value != ""
|
|
129
|
+
) {
|
|
130
|
+
let i = document.getElementById("pinInput" + (props.index + 1));
|
|
131
|
+
if (i) {
|
|
132
|
+
i.focus();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (props.value.length === props.pinLength) {
|
|
136
|
+
props.onCompleteAction(props.value.toString().replaceAll(",", ""));
|
|
137
|
+
}
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
140
|
+
);
|
|
141
|
+
};
|
package/src/elements/index.js
CHANGED
|
@@ -2,7 +2,8 @@ export * from "./AdaptiveButton";
|
|
|
2
2
|
export * from "./ActionButton";
|
|
3
3
|
export * from "./HawaSnackbar";
|
|
4
4
|
export * from "./HawaCheckbox";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./HawaPanelTabs";
|
|
6
|
+
export * from "./HawaChip";
|
|
6
7
|
export * from "./HawaItemCard";
|
|
7
8
|
export * from "./HawaPricingCard";
|
|
8
9
|
export * from "./HawaSettingsRow";
|
|
@@ -11,7 +12,6 @@ export * from "./HawaButton";
|
|
|
11
12
|
export * from "./HawaSelect";
|
|
12
13
|
export * from "./HawaRange";
|
|
13
14
|
export * from "./HawaTextField";
|
|
14
|
-
export * from "./HawaTextArea";
|
|
15
15
|
export * from "./HawaInputLabel";
|
|
16
16
|
export * from "./HawaTypography";
|
|
17
17
|
export * from "./HawaAlert";
|
package/src/index.js
CHANGED
package/src/layout/HawaAppBar.js
CHANGED
|
@@ -22,7 +22,6 @@ export const HawaAppBar = (props) => {
|
|
|
22
22
|
const handleCloseNavMenu = () => setAnchorElNav(null);
|
|
23
23
|
const handleCloseUserMenu = () => setAnchorElUser(null);
|
|
24
24
|
|
|
25
|
-
console.log("theme is ", theme);
|
|
26
25
|
return (
|
|
27
26
|
<AppBar position="static" variant="appbar">
|
|
28
27
|
<Container variant="appbar">
|
package/src/styles.css
CHANGED