@sikka/hawa 0.0.90 → 0.0.91
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/dist/styles.css +3 -3
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/AuthForms/SignInForm.js +10 -2
- package/src/elements/HawaPhoneInput.js +65 -59
- package/src/styles.css +3 -3
- package/tailwind.config.js +18 -0
package/package.json
CHANGED
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
HawaTextField,
|
|
4
4
|
HawaLogoButton,
|
|
5
5
|
HawaAlert,
|
|
6
|
-
HawaButton
|
|
6
|
+
HawaButton,
|
|
7
|
+
HawaPhoneInput
|
|
7
8
|
} from "../../elements";
|
|
8
9
|
import { Controller, useForm } from "react-hook-form";
|
|
9
10
|
import PropTypes from "prop-types";
|
|
@@ -51,7 +52,7 @@ export const SignInForm = (props) => {
|
|
|
51
52
|
}
|
|
52
53
|
}}
|
|
53
54
|
/>
|
|
54
|
-
) : (
|
|
55
|
+
) : props.signInType === "username" ? (
|
|
55
56
|
<Controller
|
|
56
57
|
control={control}
|
|
57
58
|
name="username"
|
|
@@ -70,6 +71,13 @@ export const SignInForm = (props) => {
|
|
|
70
71
|
required: props.texts.usernameRequired
|
|
71
72
|
}}
|
|
72
73
|
/>
|
|
74
|
+
) : (
|
|
75
|
+
<Controller
|
|
76
|
+
control={control}
|
|
77
|
+
name="phone"
|
|
78
|
+
render={({ field }) => <HawaPhoneInput label="Phone number" />}
|
|
79
|
+
rules={{ required: props.texts.passwordRequiredText }}
|
|
80
|
+
/>
|
|
73
81
|
)}
|
|
74
82
|
<Controller
|
|
75
83
|
control={control}
|
|
@@ -19,7 +19,7 @@ const Option = ({
|
|
|
19
19
|
</div>
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
export const HawaPhoneInput = ({ preferredCountry }) => {
|
|
22
|
+
export const HawaPhoneInput = ({ preferredCountry, label }) => {
|
|
23
23
|
const [code, setCode] = useState(preferredCountry ?? "");
|
|
24
24
|
const [selectedCountry, setSelectedCountry] = useState("+966");
|
|
25
25
|
const [tel, setTel] = useState("");
|
|
@@ -43,65 +43,71 @@ export const HawaPhoneInput = ({ preferredCountry }) => {
|
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<div
|
|
46
|
-
style={{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}}
|
|
46
|
+
// style={{
|
|
47
|
+
// justifyContent: "center",
|
|
48
|
+
// alignItems: "center",
|
|
49
|
+
// height: "100%"
|
|
50
|
+
// }}
|
|
51
|
+
className="flex flex-col mb-3"
|
|
53
52
|
>
|
|
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
|
-
|
|
53
|
+
{label && (
|
|
54
|
+
<label className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300">
|
|
55
|
+
{label}
|
|
56
|
+
</label>
|
|
57
|
+
)}
|
|
58
|
+
<div className="flex flex-row">
|
|
59
|
+
<Select
|
|
60
|
+
styles={{
|
|
61
|
+
input: (base) => ({
|
|
62
|
+
...base,
|
|
63
|
+
fontSize: "0.875rem",
|
|
64
|
+
"input:focus": {
|
|
65
|
+
boxShadow: "none"
|
|
66
|
+
},
|
|
67
|
+
lineHeight: "1.25rem",
|
|
68
|
+
padding: "0.37rem"
|
|
69
|
+
}),
|
|
70
|
+
singleValue: (base) => ({
|
|
71
|
+
...base,
|
|
72
|
+
fontSize: "0.875rem",
|
|
73
|
+
textAlign: "right"
|
|
74
|
+
}),
|
|
75
|
+
control: (base) => ({
|
|
76
|
+
...base,
|
|
77
|
+
width: 64,
|
|
78
|
+
borderRadius: "0.5rem",
|
|
79
|
+
borderTopRightRadius: 0,
|
|
80
|
+
borderBottomRightRadius: 0
|
|
81
|
+
}),
|
|
82
|
+
menu: (base) => ({
|
|
83
|
+
...base,
|
|
84
|
+
width: 190,
|
|
85
|
+
borderRadius: "0.5rem"
|
|
86
|
+
})
|
|
87
|
+
}}
|
|
88
|
+
components={{
|
|
89
|
+
Option,
|
|
90
|
+
DropdownIndicator: () => null,
|
|
91
|
+
IndicatorSeparator: () => null
|
|
92
|
+
}}
|
|
93
|
+
options={Countries}
|
|
94
|
+
isCreatable={false}
|
|
95
|
+
isMulti={false}
|
|
96
|
+
isSearchable={true}
|
|
97
|
+
isClearable={false}
|
|
98
|
+
placeholder="+966"
|
|
99
|
+
defaultValue={Countries[0]}
|
|
100
|
+
onInputChange={() => console.log("changed to")}
|
|
101
|
+
onChange={(newValue, action) => {
|
|
102
|
+
console.log("test n", newValue);
|
|
103
|
+
setSelectedCountry(newValue);
|
|
104
|
+
}}
|
|
105
|
+
/>
|
|
106
|
+
<input
|
|
107
|
+
type="number"
|
|
108
|
+
className="bg-gray-50 appearance-none border rounded-l-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 border-l-0"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
105
111
|
</div>
|
|
106
112
|
);
|
|
107
113
|
};
|
package/src/styles.css
CHANGED
|
@@ -685,15 +685,15 @@ video {
|
|
|
685
685
|
.-mb-px {
|
|
686
686
|
margin-bottom: -1px;
|
|
687
687
|
}
|
|
688
|
+
.mb-3 {
|
|
689
|
+
margin-bottom: 0.75rem;
|
|
690
|
+
}
|
|
688
691
|
.ml-1 {
|
|
689
692
|
margin-left: 0.25rem;
|
|
690
693
|
}
|
|
691
694
|
.mt-2 {
|
|
692
695
|
margin-top: 0.5rem;
|
|
693
696
|
}
|
|
694
|
-
.mb-3 {
|
|
695
|
-
margin-bottom: 0.75rem;
|
|
696
|
-
}
|
|
697
697
|
.mt-5 {
|
|
698
698
|
margin-top: 1.25rem;
|
|
699
699
|
}
|
package/tailwind.config.js
CHANGED
|
@@ -7,6 +7,24 @@ module.exports = {
|
|
|
7
7
|
plex: ["IBM Plex Sans Arabic"]
|
|
8
8
|
},
|
|
9
9
|
extend: {
|
|
10
|
+
transitionProperty: {
|
|
11
|
+
height: "height"
|
|
12
|
+
},
|
|
13
|
+
keyframes: {
|
|
14
|
+
collapse: {
|
|
15
|
+
"0%,100%": { transform: "scaleY(0)" },
|
|
16
|
+
"10%": { transform: "scaleY(0)" },
|
|
17
|
+
"20%": { transform: "scaleY(0)" },
|
|
18
|
+
"30%": { transform: "scaleY(0)" },
|
|
19
|
+
"40%": { transform: "scaleY(0)" },
|
|
20
|
+
"50%": { transform: "scaleY(0)" },
|
|
21
|
+
"60%": { transform: "scaleY(0)" },
|
|
22
|
+
// "100%": { transform: "scaleY(1)" },
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
animation: {
|
|
26
|
+
collapsing: "collapse"
|
|
27
|
+
},
|
|
10
28
|
colors: {
|
|
11
29
|
primary: {
|
|
12
30
|
200: "#C4DEFD",
|