@sikka/hawa 0.0.41 → 0.0.42
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 +12 -5
- package/src/blocks/Account/UserProfileForm.js +39 -1
- package/src/blocks/AuthForms/SignInForm.js +1 -1
- package/src/blocks/AuthForms/SignInPhone.js +43 -0
- package/src/blocks/AuthForms/SignUpForm.js +2 -0
- package/src/blocks/AuthForms/index.js +1 -0
- package/src/elements/AdaptiveButton.js +1 -1
- package/src/elements/HawaPhoneInput.js +48 -0
- package/src/elements/PinInput.js +9 -1
- package/src/elements/index.js +1 -1
- package/src/styles.css +54 -3
- package/src/theme/HawaTheme.js +26 -12
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.73b8ca43.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/{vendors~main.40879e99.iframe.bundle.js → vendors~main.55d84da5.iframe.bundle.js} +3 -3
- package/storybook-static/{vendors~main.40879e99.iframe.bundle.js.LICENSE.txt → vendors~main.55d84da5.iframe.bundle.js.LICENSE.txt} +6 -0
- package/storybook-static/vendors~main.55d84da5.iframe.bundle.js.map +1 -0
- package/src/elements/HawaInputLabel.js +0 -9
- package/storybook-static/main.066fa5c5.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.40879e99.iframe.bundle.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import PhoneInput from "react-phone-input-2";
|
|
2
|
+
import "react-phone-input-2/lib/material.css";
|
|
3
|
+
import { useTheme } from "@mui/system";
|
|
4
|
+
import { InputLabel } from "@mui/material";
|
|
5
|
+
|
|
6
|
+
export default function HawaPhoneInput(props) {
|
|
7
|
+
const {
|
|
8
|
+
country,
|
|
9
|
+
onChange,
|
|
10
|
+
value,
|
|
11
|
+
onlyContries,
|
|
12
|
+
preferredCountries,
|
|
13
|
+
inputProps,
|
|
14
|
+
required,
|
|
15
|
+
placeholder,
|
|
16
|
+
name,
|
|
17
|
+
label,
|
|
18
|
+
// onChange,
|
|
19
|
+
...rest
|
|
20
|
+
} = props;
|
|
21
|
+
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
{label && <InputLabel>{props.label}</InputLabel>}
|
|
26
|
+
<PhoneInput
|
|
27
|
+
country={country ?? null}
|
|
28
|
+
onChange={(e) => onChange(e)}
|
|
29
|
+
value={value ?? value}
|
|
30
|
+
onlyCountries={onlyContries?.length > 0 ? onlyContries : []}
|
|
31
|
+
preferredCountries={
|
|
32
|
+
preferredCountries?.length > 0 ? preferredCountries : []
|
|
33
|
+
}
|
|
34
|
+
inputProps={{
|
|
35
|
+
required: required ?? false,
|
|
36
|
+
name: name ?? null
|
|
37
|
+
}}
|
|
38
|
+
specialLabel={""}
|
|
39
|
+
placeholder={placeholder ?? ""}
|
|
40
|
+
inputStyle={{
|
|
41
|
+
width: "100%",
|
|
42
|
+
borderRadius: theme.allBorderRadius
|
|
43
|
+
}}
|
|
44
|
+
{...rest}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
package/src/elements/PinInput.js
CHANGED
|
@@ -116,6 +116,14 @@ export const HawaPinInputField = (props) => {
|
|
|
116
116
|
id={"pinInput" + props.index}
|
|
117
117
|
defaultValue={props.defaultValue || ""}
|
|
118
118
|
variant="pin"
|
|
119
|
+
onKeyDown={(e) => {
|
|
120
|
+
if (e.key === "Backspace") {
|
|
121
|
+
let i = document.getElementById("pinInput" + (props.index - 1));
|
|
122
|
+
if (e) {
|
|
123
|
+
i.focus();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}}
|
|
119
127
|
disableUnderline
|
|
120
128
|
inputProps={{ maxLength: 1 }}
|
|
121
129
|
onChange={(e) => {
|
|
@@ -128,7 +136,7 @@ export const HawaPinInputField = (props) => {
|
|
|
128
136
|
e.target.value != ""
|
|
129
137
|
) {
|
|
130
138
|
let i = document.getElementById("pinInput" + (props.index + 1));
|
|
131
|
-
if (i) {
|
|
139
|
+
if (i != null) {
|
|
132
140
|
i.focus();
|
|
133
141
|
}
|
|
134
142
|
}
|
package/src/elements/index.js
CHANGED
|
@@ -12,7 +12,6 @@ export * from "./HawaButton";
|
|
|
12
12
|
export * from "./HawaSelect";
|
|
13
13
|
export * from "./HawaRange";
|
|
14
14
|
export * from "./HawaTextField";
|
|
15
|
-
export * from "./HawaInputLabel";
|
|
16
15
|
export * from "./HawaTypography";
|
|
17
16
|
export * from "./HawaAlert";
|
|
18
17
|
export * from "./HawaTable";
|
|
@@ -21,3 +20,4 @@ export * from "./HawaSearchBar";
|
|
|
21
20
|
export * from "./HawaAccordian";
|
|
22
21
|
export * from "./DragDropImages";
|
|
23
22
|
export * from "./DraggableCard";
|
|
23
|
+
export * from "./HawaPhoneInput"
|
package/src/styles.css
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
.input {
|
|
2
4
|
color: black;
|
|
3
5
|
background-color: var(--light);
|
|
@@ -51,7 +53,56 @@
|
|
|
51
53
|
border-width: 2px;
|
|
52
54
|
cursor: pointer;
|
|
53
55
|
}
|
|
54
|
-
input[type=number]::-webkit-inner-spin-button,
|
|
55
|
-
input[type=number]::-webkit-outer-spin-button {
|
|
56
|
-
|
|
56
|
+
input[type="number"]::-webkit-inner-spin-button,
|
|
57
|
+
input[type="number"]::-webkit-outer-spin-button {
|
|
58
|
+
-webkit-appearance: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.phoneInput {
|
|
62
|
+
padding-top: 10px !important;
|
|
63
|
+
padding-bottom: 10px !important;
|
|
64
|
+
padding-right: 10px !important;
|
|
65
|
+
padding-left: 60px !important;
|
|
66
|
+
border-radius: var(--borderR) !important;
|
|
67
|
+
border: none !important;
|
|
68
|
+
height: 100% !important;
|
|
69
|
+
width: auto !important;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.phoneInput:hover {
|
|
73
|
+
border: none;
|
|
74
|
+
outline-color: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.phoneInput:focus {
|
|
78
|
+
/* border: 1px solid !important; */
|
|
79
|
+
/* border-color: #7f62fc !important; */
|
|
80
|
+
outline: 1px solid !important;
|
|
81
|
+
outline-color: #7f62fc !important;
|
|
82
|
+
}
|
|
83
|
+
.phoneInputContainer {
|
|
84
|
+
height: 43px !important;
|
|
85
|
+
width: 100% !important;
|
|
86
|
+
background-color: red !important;
|
|
87
|
+
max-width: 400px !important;
|
|
88
|
+
border-radius: var(--borderR) !important;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.phoneInputButton {
|
|
92
|
+
height: 100% !important;
|
|
93
|
+
border-radius: var(--borderR) !important;
|
|
94
|
+
background: none !important;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.react-tel-input .selected-flag {
|
|
98
|
+
/* background-color: red !important; */
|
|
99
|
+
/* height: 100% !important; */
|
|
100
|
+
border-radius: var(--borderR) !important;
|
|
101
|
+
border: none;
|
|
102
|
+
}
|
|
103
|
+
.phoneInputButton:focus {
|
|
104
|
+
background: none !important;
|
|
105
|
+
/* background-color: red !important; */
|
|
106
|
+
/* height: 100% !important; */
|
|
107
|
+
border-radius: var(--borderR) !important;
|
|
57
108
|
}
|
package/src/theme/HawaTheme.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { createTheme } from "@mui/material";
|
|
2
2
|
import { darken, lighten } from "@mui/material";
|
|
3
3
|
|
|
4
|
-
export const CreateHawaTheme = (
|
|
5
|
-
allBorderRadius
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
primaryActionTextColor
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
export const CreateHawaTheme = (optionsObject, breakpointsValues) => {
|
|
5
|
+
let allBorderRadius = optionsObject.borderRadius;
|
|
6
|
+
let primaryDangerColor = optionsObject.dangerColor;
|
|
7
|
+
let primaryActionColor = optionsObject.actionColor;
|
|
8
|
+
let primaryActionTextColor = optionsObject.actionTextColor;
|
|
9
|
+
let primaryLayoutColor = optionsObject.layoutColor;
|
|
10
|
+
let mainFont = optionsObject.font;
|
|
11
|
+
|
|
12
12
|
console.log("achra achraf", breakpointsValues);
|
|
13
13
|
return createTheme({
|
|
14
|
+
allBorderRadius: optionsObject.borderRadius,
|
|
15
|
+
primaryDangerColor: optionsObject.dangerColor,
|
|
16
|
+
primaryActionColor: optionsObject.actionColor,
|
|
17
|
+
primaryActionTextColor: optionsObject.actionTextColor,
|
|
18
|
+
primaryLayoutColor: optionsObject.layoutColor,
|
|
19
|
+
mainFont: optionsObject.font,
|
|
20
|
+
test: "something",
|
|
14
21
|
typography: { fontFamily: ["IBMPlex", "Roboto"].join(",") },
|
|
15
22
|
palette: {
|
|
16
23
|
primary: {
|
|
@@ -30,8 +37,6 @@ export const CreateHawaTheme = (
|
|
|
30
37
|
style: {
|
|
31
38
|
backgroundColor: primaryLayoutColor,
|
|
32
39
|
padding: 15,
|
|
33
|
-
// paddingLeft: 5,
|
|
34
|
-
// paddingRight: 5,
|
|
35
40
|
borderRadius: allBorderRadius
|
|
36
41
|
}
|
|
37
42
|
}
|
|
@@ -144,7 +149,15 @@ export const CreateHawaTheme = (
|
|
|
144
149
|
padding: 10,
|
|
145
150
|
":focus": { border: "none" }
|
|
146
151
|
}
|
|
147
|
-
}
|
|
152
|
+
},
|
|
153
|
+
variants: [
|
|
154
|
+
{
|
|
155
|
+
props: { variant: "phone" },
|
|
156
|
+
style: {
|
|
157
|
+
backgroundColor: "red"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
]
|
|
148
161
|
},
|
|
149
162
|
MuiInput: {
|
|
150
163
|
styleOverrides: {
|
|
@@ -203,7 +216,8 @@ export const CreateHawaTheme = (
|
|
|
203
216
|
borderRadius: allBorderRadius,
|
|
204
217
|
paddingLeft: 20,
|
|
205
218
|
paddingRight: 20,
|
|
206
|
-
padding: 20
|
|
219
|
+
padding: 20,
|
|
220
|
+
maxWidth: 600
|
|
207
221
|
}
|
|
208
222
|
},
|
|
209
223
|
variants: [
|
|
@@ -361,4 +361,4 @@
|
|
|
361
361
|
|
|
362
362
|
|
|
363
363
|
|
|
364
|
-
window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.9be73be4.iframe.bundle.js"></script><script src="vendors~main.
|
|
364
|
+
window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.9be73be4.iframe.bundle.js"></script><script src="vendors~main.55d84da5.iframe.bundle.js"></script><script src="main.73b8ca43.iframe.bundle.js"></script></body></html>
|