@sikka/hawa 0.0.136 → 0.0.138
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 +13 -29
- package/es/blocks/AuthForms/SignInForm.d.ts +0 -1
- package/es/blocks/AuthForms/SignUpForm.d.ts +1 -0
- package/es/elements/HawaCheckbox.d.ts +1 -0
- package/es/elements/HawaDrawer.d.ts +4 -14
- package/es/elements/HawaLogoButton.d.ts +1 -1
- package/es/elements/HawaTextField.d.ts +1 -0
- package/es/index.es.js +1 -1
- package/lib/blocks/AuthForms/SignInForm.d.ts +0 -1
- package/lib/blocks/AuthForms/SignUpForm.d.ts +1 -0
- package/lib/elements/HawaCheckbox.d.ts +1 -0
- package/lib/elements/HawaDrawer.d.ts +4 -14
- package/lib/elements/HawaLogoButton.d.ts +1 -1
- package/lib/elements/HawaTextField.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/AuthForms/SignInForm.tsx +16 -16
- package/src/blocks/AuthForms/SignUpForm.tsx +20 -17
- package/src/blocks/Payment/CheckoutForm.tsx +2 -11
- package/src/elements/HawaCheckbox.tsx +9 -3
- package/src/elements/HawaDrawer.tsx +53 -77
- package/src/elements/HawaLogoButton.tsx +12 -15
- package/src/elements/HawaSelect.tsx +2 -1
- package/src/elements/HawaTable.tsx +9 -4
- package/src/elements/HawaTextField.tsx +8 -1
- package/src/styles.css +13 -29
- package/storybook-static/{103.d48f1210.iframe.bundle.js → 103.af0e0958.iframe.bundle.js} +2 -2
- package/storybook-static/{103.d48f1210.iframe.bundle.js.LICENSE.txt → 103.af0e0958.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.18ef859c.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/main.237a650d.iframe.bundle.js +0 -1
package/package.json
CHANGED
|
@@ -22,7 +22,6 @@ type SignInFormTypes = {
|
|
|
22
22
|
usernameLabel?: string
|
|
23
23
|
usernamePlaceholder?: string
|
|
24
24
|
usernameRequired?: string
|
|
25
|
-
usernameRequiredText?: string
|
|
26
25
|
phoneRequiredText?: string
|
|
27
26
|
passwordLabel?: string
|
|
28
27
|
passwordPlaceholder?: string
|
|
@@ -77,8 +76,8 @@ export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
|
|
|
77
76
|
label={props.texts.emailLabel}
|
|
78
77
|
helperText={errors.email?.message}
|
|
79
78
|
placeholder={props.texts.emailPlaceholder}
|
|
80
|
-
{...field}
|
|
81
79
|
value={field.value ?? ""}
|
|
80
|
+
onChange={field.onChange}
|
|
82
81
|
/>
|
|
83
82
|
)}
|
|
84
83
|
rules={{
|
|
@@ -94,19 +93,21 @@ export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
|
|
|
94
93
|
<Controller
|
|
95
94
|
control={control}
|
|
96
95
|
name="username"
|
|
97
|
-
render={({ field }) =>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
render={({ field }) => {
|
|
97
|
+
return (
|
|
98
|
+
<HawaTextField
|
|
99
|
+
width="full"
|
|
100
|
+
type="text"
|
|
101
|
+
label={props.texts.usernameLabel}
|
|
102
|
+
helperText={errors.username?.message}
|
|
103
|
+
placeholder={props.texts.usernamePlaceholder}
|
|
104
|
+
onChange={field.onChange}
|
|
105
|
+
value={field.value ?? ""}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}}
|
|
108
109
|
rules={{
|
|
109
|
-
required: props.texts.
|
|
110
|
+
required: props.texts.usernameRequired,
|
|
110
111
|
}}
|
|
111
112
|
/>
|
|
112
113
|
) : (
|
|
@@ -124,11 +125,10 @@ export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
|
|
|
124
125
|
<HawaTextField
|
|
125
126
|
width="full"
|
|
126
127
|
type="password"
|
|
127
|
-
defaultValue={field.value ?? ""}
|
|
128
128
|
label={props.texts.passwordLabel}
|
|
129
129
|
placeholder={props.texts.passwordPlaceholder}
|
|
130
130
|
helperText={errors.password?.message}
|
|
131
|
-
{
|
|
131
|
+
onChange={field.onChange}
|
|
132
132
|
value={field.value ?? ""}
|
|
133
133
|
/>
|
|
134
134
|
)}
|
|
@@ -54,6 +54,7 @@ type SignUpFormTypes = {
|
|
|
54
54
|
handleGoogleSignUp: () => void
|
|
55
55
|
handleGithubSignUp: () => void
|
|
56
56
|
handleTwitterSignUp: () => void
|
|
57
|
+
handleRouteToTOS: () => void
|
|
57
58
|
showError: any
|
|
58
59
|
errorTitle: any
|
|
59
60
|
errorText: any
|
|
@@ -89,7 +90,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
89
90
|
label={props.texts.fullNameLabel}
|
|
90
91
|
placeholder={props.texts.fullNamePlaceholder}
|
|
91
92
|
helperText={errors.fullName?.message}
|
|
92
|
-
{
|
|
93
|
+
onChange={field.onChange}
|
|
93
94
|
value={field.value ?? ""}
|
|
94
95
|
/>
|
|
95
96
|
)}
|
|
@@ -108,7 +109,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
108
109
|
label={props.texts.emailLabel}
|
|
109
110
|
helperText={errors.email?.message}
|
|
110
111
|
placeholder={props.texts.emailPlaceholder}
|
|
111
|
-
{
|
|
112
|
+
onChange={field.onChange}
|
|
112
113
|
value={field.value ?? ""}
|
|
113
114
|
/>
|
|
114
115
|
)}
|
|
@@ -132,7 +133,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
132
133
|
label={props.texts.usernameLabel}
|
|
133
134
|
helperText={errors.username?.message}
|
|
134
135
|
placeholder={props.texts.usernamePlaceholder}
|
|
135
|
-
{
|
|
136
|
+
onChange={field.onChange}
|
|
136
137
|
value={field.value ?? ""}
|
|
137
138
|
/>
|
|
138
139
|
)}
|
|
@@ -148,11 +149,11 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
148
149
|
<HawaTextField
|
|
149
150
|
width="full"
|
|
150
151
|
type="password"
|
|
151
|
-
defaultValue={field.value ?? ""}
|
|
152
|
+
// defaultValue={field.value ?? ""}
|
|
152
153
|
label={props.texts.passwordLabel}
|
|
153
154
|
placeholder={props.texts.passwordPlaceholder}
|
|
154
155
|
helperText={errors.password?.message}
|
|
155
|
-
{
|
|
156
|
+
onChange={field.onChange}
|
|
156
157
|
value={field.value ?? ""}
|
|
157
158
|
/>
|
|
158
159
|
)}
|
|
@@ -165,11 +166,11 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
165
166
|
<HawaTextField
|
|
166
167
|
width="full"
|
|
167
168
|
type="password"
|
|
168
|
-
defaultValue={field.value ?? ""}
|
|
169
|
+
// defaultValue={field.value ?? ""}
|
|
169
170
|
label={props.texts.confirmPasswordLabel}
|
|
170
171
|
placeholder={props.texts.confirmPasswordPlaceholder}
|
|
171
172
|
helperText={errors.confirm_password?.message}
|
|
172
|
-
{
|
|
173
|
+
onChange={field.onChange}
|
|
173
174
|
value={field.value ?? ""}
|
|
174
175
|
/>
|
|
175
176
|
)}
|
|
@@ -187,8 +188,8 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
187
188
|
label={"Ref Code"}
|
|
188
189
|
placeholder={props.texts.passwordPlaceholder}
|
|
189
190
|
helperText={errors.password?.message}
|
|
190
|
-
{...field}
|
|
191
191
|
value={field.value ?? ""}
|
|
192
|
+
onChange={field.onChange}
|
|
192
193
|
/>
|
|
193
194
|
)}
|
|
194
195
|
/>
|
|
@@ -210,11 +211,9 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
210
211
|
{ value: "ad", label: "Advertisement" },
|
|
211
212
|
{ value: "other", label: "Other" },
|
|
212
213
|
]}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
{...field}
|
|
217
|
-
onChange={(e: any, o: any) => console.log("chooo", e)}
|
|
214
|
+
onChange={(e: any) => {
|
|
215
|
+
field.onChange(e.value)
|
|
216
|
+
}}
|
|
218
217
|
/>
|
|
219
218
|
)}
|
|
220
219
|
/>
|
|
@@ -227,17 +226,20 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
227
226
|
name="terms_accepted"
|
|
228
227
|
render={({ field }) => (
|
|
229
228
|
<HawaCheckbox
|
|
229
|
+
id="terms_accepted"
|
|
230
230
|
helperText={errors.terms_accepted?.message}
|
|
231
|
-
onChange={
|
|
231
|
+
onChange={field.onChange}
|
|
232
232
|
label={
|
|
233
233
|
<span>
|
|
234
234
|
{props.texts.iAcceptText}{" "}
|
|
235
|
-
<a
|
|
235
|
+
<a
|
|
236
|
+
onClick={props.handleRouteToTOS}
|
|
237
|
+
className="cursor-pointer text-blue-800"
|
|
238
|
+
>
|
|
236
239
|
{props.texts.termsText}
|
|
237
240
|
</a>
|
|
238
241
|
</span>
|
|
239
242
|
}
|
|
240
|
-
{...field}
|
|
241
243
|
/>
|
|
242
244
|
)}
|
|
243
245
|
rules={{ required: props.texts.termsRequiredText }}
|
|
@@ -251,8 +253,9 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
251
253
|
name="newsletter_accepted"
|
|
252
254
|
render={({ field }) => (
|
|
253
255
|
<HawaCheckbox
|
|
256
|
+
id="newsletter_accepted"
|
|
254
257
|
label={props.texts.subscribeToNewsletter}
|
|
255
|
-
{
|
|
258
|
+
onChange={field.onChange}
|
|
256
259
|
/>
|
|
257
260
|
)}
|
|
258
261
|
/>
|
|
@@ -238,20 +238,11 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
238
238
|
fullWidth
|
|
239
239
|
native
|
|
240
240
|
label={props.texts?.countryLabel + " *"}
|
|
241
|
-
// variant="standard"
|
|
242
241
|
helperText={errors.country?.message}
|
|
243
|
-
// displayEmpty
|
|
244
|
-
// disableUnderline
|
|
245
|
-
// validators={["required"]}
|
|
246
242
|
options={countries}
|
|
247
243
|
getOptionLabel={(countries) => countries.country_label}
|
|
248
|
-
//
|
|
249
|
-
|
|
250
|
-
// { label: "Saudi Arabia", value: "saudi_arabia" },
|
|
251
|
-
// { label: "Saudi Arabia", value: "saudi_arabia" },
|
|
252
|
-
// { label: "Saudi Arabia", value: "saudi_arabia" },
|
|
253
|
-
// ]}
|
|
254
|
-
{...field}
|
|
244
|
+
// {...field}
|
|
245
|
+
onChange={(e) => field.onChange(e.country_label)}
|
|
255
246
|
value={field.value ?? ""}
|
|
256
247
|
>
|
|
257
248
|
<option></option>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react"
|
|
2
2
|
|
|
3
3
|
type TCheckBoxTypes = {
|
|
4
4
|
centered?: boolean
|
|
5
5
|
label?: any
|
|
6
6
|
helperText?: any
|
|
7
|
+
id: string
|
|
7
8
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
|
|
8
9
|
}
|
|
9
10
|
|
|
@@ -17,18 +18,23 @@ export const HawaCheckbox: React.FunctionComponent<TCheckBoxTypes> = (
|
|
|
17
18
|
? "flex h-full items-center justify-center"
|
|
18
19
|
: "flex h-full items-start"
|
|
19
20
|
}
|
|
21
|
+
// onClick={(e: any) => props.onChange(e)}
|
|
20
22
|
>
|
|
21
23
|
<input
|
|
22
24
|
type="checkbox"
|
|
23
25
|
value=""
|
|
24
26
|
onChange={(e) => props.onChange(e)}
|
|
25
27
|
className="mt-0.5 rounded border-gray-300 bg-gray-100 text-blue-600 focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:ring-offset-gray-800 dark:focus:ring-blue-600"
|
|
26
|
-
{
|
|
28
|
+
id={props.id}
|
|
29
|
+
aria-label={props.label}
|
|
27
30
|
/>
|
|
28
31
|
{(props.label || props.helperText) && (
|
|
29
32
|
<div className=" flex flex-col">
|
|
30
33
|
{props.label && (
|
|
31
|
-
<label
|
|
34
|
+
<label
|
|
35
|
+
htmlFor={props.id}
|
|
36
|
+
className="mx-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
37
|
+
>
|
|
32
38
|
{props.label}
|
|
33
39
|
</label>
|
|
34
40
|
)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FC, ReactElement, ReactNode, useEffect, useState } from "react"
|
|
2
|
-
import {
|
|
2
|
+
import { FaChevronLeft, FaChevronRight } from "react-icons/fa"
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
|
|
5
5
|
type TDrawerTypes = {
|
|
@@ -8,6 +8,9 @@ type TDrawerTypes = {
|
|
|
8
8
|
position: any
|
|
9
9
|
heading: any
|
|
10
10
|
children?: ReactNode
|
|
11
|
+
drawerHeader?: any
|
|
12
|
+
drawerBody?: any
|
|
13
|
+
drawerFooter?: any
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
export const HawaDrawer: React.FunctionComponent<TDrawerTypes> = ({
|
|
@@ -19,53 +22,31 @@ export const HawaDrawer: React.FunctionComponent<TDrawerTypes> = ({
|
|
|
19
22
|
...props
|
|
20
23
|
}) => {
|
|
21
24
|
const leftDrawer =
|
|
22
|
-
"w-60 z-50 h-full absolute overflow-x-
|
|
25
|
+
"w-60 z-50 h-full absolute overflow-x-clip top-0 left-0 border-r bg-white"
|
|
23
26
|
const rightDrawer =
|
|
24
|
-
"w-60 z-50 h-full absolute overflow-x-
|
|
25
|
-
|
|
26
|
-
const isFunction = (data: any): data is (...args: any[]) => any =>
|
|
27
|
-
typeof data === "function"
|
|
28
|
-
// useEffect(() => {
|
|
29
|
-
// setOpenDrawer(true);
|
|
30
|
-
// }, [open]);
|
|
31
|
-
|
|
32
|
-
const childrenWithProps = React.Children.map(children, (child) => {
|
|
33
|
-
if (React.isValidElement(child) && isFunction(child.type)) {
|
|
34
|
-
switch (child.type.name) {
|
|
35
|
-
case "DrawerHeader":
|
|
36
|
-
return (
|
|
37
|
-
<DrawerHeader setOpen={setOpen} children={child.props.children} />
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
case "DrawerBody":
|
|
41
|
-
return <DrawerBody children={child.props.children} />
|
|
42
|
-
|
|
43
|
-
case "DrawerFooter":
|
|
44
|
-
return <DrawerFooter children={child.props.children} />
|
|
45
|
-
}
|
|
46
|
-
return React.cloneElement(child, {
|
|
47
|
-
// setOpen: setOpen,
|
|
48
|
-
// children: child.props.children,
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
// const drawerClass =
|
|
54
|
-
// open && position == "left"
|
|
55
|
-
// ? clsx("block", leftDrawer)
|
|
56
|
-
// : open && position == "right"
|
|
57
|
-
// ? clsx("block", rightDrawer)
|
|
58
|
-
// : "hidden w-0 "
|
|
27
|
+
"w-60 z-50 h-full absolute overflow-x-clip top-0 right-0 border-l bg-white"
|
|
59
28
|
|
|
60
29
|
return (
|
|
61
30
|
<div
|
|
62
31
|
className={clsx(
|
|
63
32
|
position == "left" ? leftDrawer : rightDrawer,
|
|
64
|
-
"
|
|
33
|
+
position == "left" ? "flex-row-reverse" : "flex-row",
|
|
34
|
+
"overflow-x-clip transition-all",
|
|
65
35
|
open ? "w-60" : "w-0"
|
|
66
36
|
)}
|
|
67
37
|
>
|
|
68
|
-
{
|
|
38
|
+
{props.drawerHeader && (
|
|
39
|
+
<DrawerHeader direction={position} setOpen={setOpen}>
|
|
40
|
+
{props.drawerHeader}
|
|
41
|
+
</DrawerHeader>
|
|
42
|
+
)}
|
|
43
|
+
|
|
44
|
+
{props.drawerBody && (
|
|
45
|
+
<DrawerBody direction={position}>{props.drawerBody}</DrawerBody>
|
|
46
|
+
)}
|
|
47
|
+
{props.drawerFooter && (
|
|
48
|
+
<DrawerFooter direction={position}>{props.drawerFooter}</DrawerFooter>
|
|
49
|
+
)}
|
|
69
50
|
</div>
|
|
70
51
|
)
|
|
71
52
|
}
|
|
@@ -73,11 +54,17 @@ export const HawaDrawer: React.FunctionComponent<TDrawerTypes> = ({
|
|
|
73
54
|
type TDrawerHeader = {
|
|
74
55
|
setOpen: any
|
|
75
56
|
children: ReactElement
|
|
57
|
+
direction: any
|
|
76
58
|
}
|
|
77
59
|
|
|
78
|
-
|
|
60
|
+
const DrawerHeader: FC<TDrawerHeader> = (props) => {
|
|
79
61
|
return (
|
|
80
|
-
<div
|
|
62
|
+
<div
|
|
63
|
+
className={clsx(
|
|
64
|
+
"flex w-full flex-row items-center justify-between border-b p-4",
|
|
65
|
+
props.direction == "left" ? "flex-row" : "flex-row-reverse"
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
81
68
|
{props.children}
|
|
82
69
|
<div
|
|
83
70
|
className="justify-self-end rounded border p-1 hover:cursor-pointer"
|
|
@@ -86,7 +73,11 @@ export const DrawerHeader: FC<TDrawerHeader> = (props) => {
|
|
|
86
73
|
props.setOpen(false)
|
|
87
74
|
}}
|
|
88
75
|
>
|
|
89
|
-
|
|
76
|
+
{props.direction == "left" ? (
|
|
77
|
+
<FaChevronLeft size={20} strokeWidth={2} />
|
|
78
|
+
) : (
|
|
79
|
+
<FaChevronRight size={20} strokeWidth={2} />
|
|
80
|
+
)}
|
|
90
81
|
</div>
|
|
91
82
|
</div>
|
|
92
83
|
)
|
|
@@ -94,50 +85,35 @@ export const DrawerHeader: FC<TDrawerHeader> = (props) => {
|
|
|
94
85
|
|
|
95
86
|
type TDrawerBody = {
|
|
96
87
|
children: ReactElement
|
|
88
|
+
direction: any
|
|
97
89
|
}
|
|
98
|
-
|
|
99
|
-
export const DrawerBody = (props: TDrawerBody) => {
|
|
100
|
-
return <div className="p-1">{props.children}</div>
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
type TDrawerFooter = {
|
|
104
|
-
children: ReactElement
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export const DrawerFooter = (props: TDrawerFooter) => {
|
|
90
|
+
const DrawerBody = (props: TDrawerBody) => {
|
|
108
91
|
return (
|
|
109
|
-
<div
|
|
92
|
+
<div
|
|
93
|
+
className={clsx(
|
|
94
|
+
"overflow-clip whitespace-nowrap p-4",
|
|
95
|
+
props.direction == "left" ? "flex-row" : "flex-row-reverse text-right"
|
|
96
|
+
)}
|
|
97
|
+
>
|
|
110
98
|
{props.children}
|
|
111
99
|
</div>
|
|
112
100
|
)
|
|
113
101
|
}
|
|
114
102
|
|
|
115
|
-
type
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
text: any
|
|
103
|
+
type TDrawerFooter = {
|
|
104
|
+
children: ReactElement
|
|
105
|
+
direction: any
|
|
119
106
|
}
|
|
120
|
-
const HawaDrawerItem: React.FunctionComponent<DrawerItemTypes> = (props) => {
|
|
121
|
-
let withIcon =
|
|
122
|
-
"flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
123
|
-
let withoutIcon =
|
|
124
|
-
"flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
125
107
|
|
|
108
|
+
const DrawerFooter = (props: TDrawerFooter) => {
|
|
126
109
|
return (
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
>
|
|
136
|
-
<path d="M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"></path>
|
|
137
|
-
<path d="M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"></path>
|
|
138
|
-
</svg> */}
|
|
139
|
-
<span className="ml-3">{props.text}</span>
|
|
140
|
-
</div>
|
|
141
|
-
</li>
|
|
110
|
+
<div
|
|
111
|
+
className={clsx(
|
|
112
|
+
"absolute bottom-0 w-full whitespace-nowrap border-t p-4",
|
|
113
|
+
props.direction == "left" ? "flex-row" : "flex-row-reverse text-right"
|
|
114
|
+
)}
|
|
115
|
+
>
|
|
116
|
+
{props.children}
|
|
117
|
+
</div>
|
|
142
118
|
)
|
|
143
119
|
}
|
|
@@ -2,19 +2,17 @@ import React from "react"
|
|
|
2
2
|
|
|
3
3
|
type LogoButtonTypes = {
|
|
4
4
|
lang?: any
|
|
5
|
-
logo?:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// "mada",
|
|
17
|
-
// ]),
|
|
5
|
+
logo?:
|
|
6
|
+
| "google"
|
|
7
|
+
| "github"
|
|
8
|
+
| "twitter"
|
|
9
|
+
| "wallet"
|
|
10
|
+
| "googlepay"
|
|
11
|
+
| "applepay"
|
|
12
|
+
| "stcpay"
|
|
13
|
+
| "visa/master"
|
|
14
|
+
| "paypal"
|
|
15
|
+
| "mada"
|
|
18
16
|
onClick?: any
|
|
19
17
|
buttonText?: any
|
|
20
18
|
}
|
|
@@ -145,14 +143,13 @@ export const HawaLogoButton: React.FunctionComponent<LogoButtonTypes> = (
|
|
|
145
143
|
</svg>
|
|
146
144
|
)
|
|
147
145
|
break
|
|
148
|
-
|
|
149
146
|
default:
|
|
150
147
|
break
|
|
151
148
|
}
|
|
152
149
|
return (
|
|
153
150
|
<button
|
|
154
151
|
style={{ direction: isArabic ? "rtl" : "ltr" }}
|
|
155
|
-
{
|
|
152
|
+
onClick={props.onClick}
|
|
156
153
|
className="my-2 flex h-11 w-full flex-row justify-center rounded-xl bg-white align-middle"
|
|
157
154
|
>
|
|
158
155
|
<div className="flex h-full flex-row items-center justify-end">
|
|
@@ -109,7 +109,8 @@ export const HawaSelect: React.FunctionComponent<SelectTypes> = (props) => {
|
|
|
109
109
|
isMulti={props.isMulti}
|
|
110
110
|
isSearchable={props.isSearchable}
|
|
111
111
|
onChange={(newValue: any, action) =>
|
|
112
|
-
props.onChange(newValue.label, action)
|
|
112
|
+
// props.onChange(newValue.label, action)
|
|
113
|
+
props.onChange(newValue, action)
|
|
113
114
|
}
|
|
114
115
|
components={{
|
|
115
116
|
Control,
|
|
@@ -47,13 +47,14 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
|
|
|
47
47
|
{props.rows ? (
|
|
48
48
|
props.rows.map((singleRow: any, j: any) => (
|
|
49
49
|
<tr
|
|
50
|
-
className="border-b bg-white dark:border-gray-700 dark:bg-gray-800"
|
|
51
50
|
key={j}
|
|
51
|
+
className="border-b bg-white dark:border-gray-700 dark:bg-gray-800"
|
|
52
52
|
>
|
|
53
53
|
{singleRow.map((r: any, i: any) => {
|
|
54
54
|
if (i === 0) {
|
|
55
55
|
return (
|
|
56
56
|
<th
|
|
57
|
+
key={i}
|
|
57
58
|
scope="row"
|
|
58
59
|
className={clsx(
|
|
59
60
|
sizeStyles[size],
|
|
@@ -64,7 +65,11 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
|
|
|
64
65
|
</th>
|
|
65
66
|
)
|
|
66
67
|
} else {
|
|
67
|
-
return
|
|
68
|
+
return (
|
|
69
|
+
<td key={i} className={clsx(sizeStyles[size])}>
|
|
70
|
+
{r}
|
|
71
|
+
</td>
|
|
72
|
+
)
|
|
68
73
|
}
|
|
69
74
|
})}
|
|
70
75
|
{props.actions && size !== "small" ? (
|
|
@@ -74,8 +79,8 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
|
|
|
74
79
|
className="flex flex-row gap-1"
|
|
75
80
|
// variant={isArabic ? "borderedRight" : "borderedLeft"}
|
|
76
81
|
>
|
|
77
|
-
{props.actions.map((act: any) => {
|
|
78
|
-
return <TableActionButton action={act} />
|
|
82
|
+
{props.actions.map((act: any, s: any) => {
|
|
83
|
+
return <TableActionButton key={s} action={act} />
|
|
79
84
|
})}
|
|
80
85
|
</td>
|
|
81
86
|
) : null}
|
|
@@ -16,6 +16,7 @@ type TextFieldTypes = {
|
|
|
16
16
|
name?: any
|
|
17
17
|
inputProps?: any
|
|
18
18
|
onChange?: any
|
|
19
|
+
ref?: any
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
@@ -37,6 +38,7 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
37
38
|
let defaultStyle = "flex h-fit max-h-fit flex-col justify-center"
|
|
38
39
|
return (
|
|
39
40
|
<div
|
|
41
|
+
// ref={props.ref}
|
|
40
42
|
className={clsx(defaultStyle, marginStyles[margin], widthStyles[width])}
|
|
41
43
|
>
|
|
42
44
|
{props.label && (
|
|
@@ -67,7 +69,12 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
67
69
|
) : (
|
|
68
70
|
<div>
|
|
69
71
|
<input
|
|
70
|
-
{
|
|
72
|
+
onChange={props.onChange}
|
|
73
|
+
type={props.type}
|
|
74
|
+
aria-label={props.label}
|
|
75
|
+
placeholder={props.placeholder}
|
|
76
|
+
defaultValue={props.defaultValue}
|
|
77
|
+
value={props.value}
|
|
71
78
|
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
79
|
/>
|
|
73
80
|
</div>
|