@sikka/hawa 0.0.113 → 0.0.114
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 +6 -0
- package/es/blocks/AuthForms/AppLanding.d.ts +3 -3
- package/es/blocks/AuthForms/NewPasswordForm.d.ts +1 -2
- package/es/blocks/AuthForms/ResetPasswordForm.d.ts +1 -1
- package/es/blocks/AuthForms/SignInForm.d.ts +6 -6
- package/es/blocks/AuthForms/SignInPhone.d.ts +1 -0
- package/es/blocks/AuthForms/SignUpForm.d.ts +5 -5
- package/es/elements/HawaChip.d.ts +1 -0
- package/es/index.es.js +1 -1
- package/lib/blocks/AuthForms/AppLanding.d.ts +3 -3
- package/lib/blocks/AuthForms/NewPasswordForm.d.ts +1 -2
- package/lib/blocks/AuthForms/ResetPasswordForm.d.ts +1 -1
- package/lib/blocks/AuthForms/SignInForm.d.ts +6 -6
- package/lib/blocks/AuthForms/SignInPhone.d.ts +1 -0
- package/lib/blocks/AuthForms/SignUpForm.d.ts +5 -5
- package/lib/elements/HawaChip.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/AuthForms/AppLanding.tsx +3 -3
- package/src/blocks/AuthForms/NewPasswordForm.tsx +1 -2
- package/src/blocks/AuthForms/ResetPasswordForm.tsx +1 -1
- package/src/blocks/AuthForms/SignInForm.tsx +6 -6
- package/src/blocks/AuthForms/SignInPhone.tsx +8 -10
- package/src/blocks/AuthForms/SignUpForm.tsx +7 -7
- package/src/elements/HawaChip.tsx +9 -5
- package/src/elements/HawaSearchBar.tsx +1 -1
- package/src/elements/HawaTextField.tsx +18 -5
- package/src/styles.css +6 -0
package/package.json
CHANGED
|
@@ -3,9 +3,9 @@ import { HawaButton } from "../../elements"
|
|
|
3
3
|
import { HawaContainer } from "../../layout/HawaContainer"
|
|
4
4
|
|
|
5
5
|
type AppLandingTypes = {
|
|
6
|
-
handleSignIn:
|
|
7
|
-
handleSignUp:
|
|
8
|
-
handleLanguage:
|
|
6
|
+
handleSignIn: () => void
|
|
7
|
+
handleSignUp: () => void
|
|
8
|
+
handleLanguage: () => void
|
|
9
9
|
texts: {
|
|
10
10
|
signIn: string
|
|
11
11
|
signUp: string
|
|
@@ -4,7 +4,7 @@ import { Controller, FormProvider, useForm } from "react-hook-form"
|
|
|
4
4
|
import { HawaContainer } from "../../layout"
|
|
5
5
|
|
|
6
6
|
type NewPasswordTypes = {
|
|
7
|
-
handleNewPassword:
|
|
7
|
+
handleNewPassword: () => void
|
|
8
8
|
passwordChanged: any
|
|
9
9
|
texts: {
|
|
10
10
|
passwordPlaceholder: string
|
|
@@ -17,7 +17,6 @@ type NewPasswordTypes = {
|
|
|
17
17
|
passwordMatchError: string
|
|
18
18
|
passwordChanged: string
|
|
19
19
|
}
|
|
20
|
-
handleSignIn: any
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
export const NewPasswordForm: React.FunctionComponent<NewPasswordTypes> = (
|
|
@@ -41,12 +41,12 @@ type SignInFormTypes = {
|
|
|
41
41
|
viaGoogle: boolean
|
|
42
42
|
viaGithub: boolean
|
|
43
43
|
viaTwitter: boolean
|
|
44
|
-
handleSignIn: any
|
|
45
|
-
handleRouteToSignUp:
|
|
46
|
-
handleForgotPassword:
|
|
47
|
-
handleGoogleSignIn:
|
|
48
|
-
handleGithubSignIn:
|
|
49
|
-
handleTwitterSignIn:
|
|
44
|
+
handleSignIn: (e: any) => void
|
|
45
|
+
handleRouteToSignUp: () => void
|
|
46
|
+
handleForgotPassword: () => void
|
|
47
|
+
handleGoogleSignIn: () => void
|
|
48
|
+
handleGithubSignIn: () => void
|
|
49
|
+
handleTwitterSignIn: () => void
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
|
|
@@ -11,29 +11,27 @@ type SignInPhoneTypes = {
|
|
|
11
11
|
handlePhoneChange: any
|
|
12
12
|
phoneRequiredText: any
|
|
13
13
|
SignInButtonText: any
|
|
14
|
+
handleSignIn: any
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export const SignInPhone: React.FunctionComponent<SignInPhoneTypes> = (
|
|
17
18
|
props
|
|
18
19
|
) => {
|
|
20
|
+
const methods = useForm()
|
|
19
21
|
const {
|
|
20
22
|
formState: { errors },
|
|
21
23
|
handleSubmit,
|
|
22
24
|
control,
|
|
23
|
-
} =
|
|
25
|
+
} = methods
|
|
24
26
|
|
|
25
27
|
const [userPhone, setUserPhone] = useState("")
|
|
26
|
-
const handlingSubmit = () => {
|
|
27
|
-
console.log("submitting ", userPhone)
|
|
28
|
-
}
|
|
29
28
|
return (
|
|
30
29
|
<HawaContainer>
|
|
31
30
|
<form
|
|
32
|
-
onSubmit={
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// }}
|
|
31
|
+
onSubmit={(e) => {
|
|
32
|
+
e.preventDefault()
|
|
33
|
+
props.handleSignIn(userPhone)
|
|
34
|
+
}}
|
|
37
35
|
>
|
|
38
36
|
<Controller
|
|
39
37
|
control={control}
|
|
@@ -42,11 +40,11 @@ export const SignInPhone: React.FunctionComponent<SignInPhoneTypes> = (
|
|
|
42
40
|
<HawaPhoneInput
|
|
43
41
|
country={props.country ?? ""}
|
|
44
42
|
label={props.label ?? ""}
|
|
45
|
-
{...field}
|
|
46
43
|
handleChange={(e: any) => {
|
|
47
44
|
console.log("test")
|
|
48
45
|
setUserPhone(e.target.value)
|
|
49
46
|
}}
|
|
47
|
+
{...field}
|
|
50
48
|
// handleChange={(e: any) => {
|
|
51
49
|
// // props.handlePhoneChange(e.target.value)
|
|
52
50
|
// setUserPhone(e.target.value)
|
|
@@ -49,11 +49,11 @@ type SignUpFormTypes = {
|
|
|
49
49
|
showNewsletterOption: boolean
|
|
50
50
|
showRefCode: boolean
|
|
51
51
|
showTermsOption: boolean
|
|
52
|
-
handleSignUp: any
|
|
53
|
-
handleRouteToSignIn:
|
|
54
|
-
handleGoogleSignUp:
|
|
55
|
-
handleGithubSignUp:
|
|
56
|
-
handleTwitterSignUp:
|
|
52
|
+
handleSignUp: (e: any) => void
|
|
53
|
+
handleRouteToSignIn: () => void
|
|
54
|
+
handleGoogleSignUp: () => void
|
|
55
|
+
handleGithubSignUp: () => void
|
|
56
|
+
handleTwitterSignUp: () => void
|
|
57
57
|
showError: any
|
|
58
58
|
errorTitle: any
|
|
59
59
|
errorText: any
|
|
@@ -78,7 +78,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
78
78
|
/>
|
|
79
79
|
)}
|
|
80
80
|
<FormProvider {...methods}>
|
|
81
|
-
<form onSubmit={handleSubmit(props.handleSignUp)}>
|
|
81
|
+
<form onSubmit={handleSubmit((e) => props.handleSignUp(e))}>
|
|
82
82
|
<Controller
|
|
83
83
|
control={control}
|
|
84
84
|
name="fullName"
|
|
@@ -228,7 +228,6 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
228
228
|
render={({ field }) => (
|
|
229
229
|
<HawaCheckbox
|
|
230
230
|
helperText={errors.terms_accepted?.message}
|
|
231
|
-
{...field}
|
|
232
231
|
onChange={() => console.log("te")}
|
|
233
232
|
label={
|
|
234
233
|
<span>
|
|
@@ -238,6 +237,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
238
237
|
</a>
|
|
239
238
|
</span>
|
|
240
239
|
}
|
|
240
|
+
{...field}
|
|
241
241
|
/>
|
|
242
242
|
)}
|
|
243
243
|
rules={{ required: props.texts.termsRequiredText }}
|
|
@@ -4,20 +4,24 @@ import React from "react"
|
|
|
4
4
|
type TChipTypes = {
|
|
5
5
|
label: string
|
|
6
6
|
size: "small" | "normal" | "large"
|
|
7
|
+
icon?: any
|
|
7
8
|
}
|
|
8
9
|
export const HawaChip: React.FunctionComponent<TChipTypes> = ({
|
|
9
10
|
size = "normal",
|
|
10
11
|
label,
|
|
12
|
+
icon,
|
|
11
13
|
}) => {
|
|
12
|
-
// small: "text-xs px-2.5 py-1.5",
|
|
13
|
-
// medium: "text-sm leading-4 px-3 py-2",
|
|
14
|
-
// large: "text-sm px-4 py-2",
|
|
15
14
|
let defaultStyles =
|
|
16
|
-
"rounded-lg bg-blue-200 px-2.5 py-0.5 font-bold text-blue-800 dark:bg-blue-200 dark:text-blue-800"
|
|
15
|
+
"flex flex-row w-fit gap-1 items-center rounded-lg bg-blue-200 px-2.5 py-0.5 font-bold text-blue-800 dark:bg-blue-200 dark:text-blue-800"
|
|
17
16
|
let sizeStyles = {
|
|
18
17
|
small: "h-fit text-xs",
|
|
19
18
|
normal: "h-full leading-4 px-3 py-2 text-xs ",
|
|
20
19
|
large: "",
|
|
21
20
|
}
|
|
22
|
-
return
|
|
21
|
+
return (
|
|
22
|
+
<span className={clsx(defaultStyles, sizeStyles[size])}>
|
|
23
|
+
{icon && icon}
|
|
24
|
+
{label}
|
|
25
|
+
</span>
|
|
26
|
+
)
|
|
23
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import clsx from "clsx"
|
|
3
|
-
|
|
3
|
+
import { FaSearch } from "react-icons/fa"
|
|
4
4
|
type TextFieldTypes = {
|
|
5
5
|
margin?: "none" | "normal" | "large"
|
|
6
6
|
width?: "small" | "normal" | "full"
|
|
@@ -53,11 +53,24 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
53
53
|
className="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
|
|
54
54
|
placeholder="Your message..."
|
|
55
55
|
/>
|
|
56
|
+
) : props.type === "search" ? (
|
|
57
|
+
<div className="relative">
|
|
58
|
+
<FaSearch
|
|
59
|
+
color="gray"
|
|
60
|
+
className="absolute top-1/2 left-3 -translate-y-1/2"
|
|
61
|
+
/>
|
|
62
|
+
<input
|
|
63
|
+
{...props}
|
|
64
|
+
className="mb-0 block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 pl-10 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
56
67
|
) : (
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
<div>
|
|
69
|
+
<input
|
|
70
|
+
{...props}
|
|
71
|
+
className="mb-0 block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
61
74
|
)}
|
|
62
75
|
|
|
63
76
|
{props.helperText && (
|
package/src/styles.css
CHANGED
|
@@ -541,6 +541,9 @@ video {
|
|
|
541
541
|
.bottom-4 {
|
|
542
542
|
bottom: 1rem;
|
|
543
543
|
}
|
|
544
|
+
.left-3 {
|
|
545
|
+
left: 0.75rem;
|
|
546
|
+
}
|
|
544
547
|
.top-5 {
|
|
545
548
|
top: 1.25rem;
|
|
546
549
|
}
|
|
@@ -1389,6 +1392,9 @@ video {
|
|
|
1389
1392
|
.pr-3 {
|
|
1390
1393
|
padding-right: 0.75rem;
|
|
1391
1394
|
}
|
|
1395
|
+
.pl-10 {
|
|
1396
|
+
padding-left: 2.5rem;
|
|
1397
|
+
}
|
|
1392
1398
|
.pt-0 {
|
|
1393
1399
|
padding-top: 0px;
|
|
1394
1400
|
}
|