@sikka/hawa 0.0.95 → 0.0.97
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 +279 -211
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +19 -6
- package/rollup.config.js +14 -2
- package/src/blocks/Account/{UserProfileForm.js → UserProfileForm.tsx} +42 -41
- package/src/blocks/Account/UserSettingsForm.tsx +28 -0
- package/src/blocks/Account/index.ts +2 -0
- package/src/blocks/AuthForms/AppLanding.tsx +33 -0
- package/src/blocks/AuthForms/CodeConfirmation.tsx +59 -0
- package/src/blocks/AuthForms/{NewPasswordForm.js → NewPasswordForm.tsx} +49 -53
- package/src/blocks/AuthForms/{ResetPasswordForm.js → ResetPasswordForm.tsx} +35 -38
- package/src/blocks/AuthForms/{SignInForm.js → SignInForm.tsx} +73 -65
- package/src/blocks/AuthForms/SignInPhone.tsx +68 -0
- package/src/blocks/AuthForms/{SignUpForm.js → SignUpForm.tsx} +88 -82
- package/src/blocks/AuthForms/index.ts +7 -0
- package/src/blocks/Misc/NotFound.tsx +28 -0
- package/src/blocks/Misc/index.ts +1 -0
- package/src/blocks/Payment/ChargeWalletForm.tsx +70 -0
- package/src/blocks/Payment/{CheckoutForm.js → CheckoutForm.tsx} +82 -81
- package/src/blocks/Payment/Confirmation.tsx +96 -0
- package/src/blocks/Payment/{CreditCardForm.js → CreditCardForm.tsx} +48 -33
- package/src/blocks/Payment/PayWithWallet.tsx +29 -0
- package/src/blocks/Payment/{SelectPayment.js → SelectPayment.tsx} +33 -29
- package/src/blocks/Payment/{index.js → index.ts} +0 -0
- package/src/blocks/Pricing/{ComparingPlans.js → ComparingPlans.tsx} +51 -53
- package/src/blocks/Pricing/PricingPlans.tsx +72 -0
- package/src/blocks/Pricing/{index.js → index.ts} +0 -0
- package/src/blocks/{index.js → index.ts} +0 -0
- package/{countries.js → src/countries.ts} +245 -245
- package/src/elements/{AutoCompleteField.js → AutoCompleteField.tsx} +16 -9
- package/src/elements/{DragDropImages.js → DragDropImages.tsx} +78 -53
- package/src/elements/DraggableCard.tsx +29 -0
- package/src/elements/{HawaAccordian.js → HawaAccordian.tsx} +27 -23
- package/src/elements/HawaAdCard.tsx +48 -0
- package/src/elements/HawaAlert.tsx +30 -0
- package/src/elements/HawaButton.tsx +120 -0
- package/src/elements/HawaCheckbox.tsx +37 -0
- package/src/elements/HawaChip.tsx +12 -0
- package/src/elements/HawaColorPicker.tsx +38 -0
- package/src/elements/{HawaCopyrights.js → HawaCopyrights.tsx} +15 -8
- package/src/elements/HawaDrawer.tsx +84 -0
- package/src/elements/{HawaDrawerItem.js → HawaDrawerItem.tsx} +12 -7
- package/src/elements/{HawaItemCard.js → HawaItemCard.tsx} +35 -36
- package/src/elements/{HawaLogoButton.js → HawaLogoButton.tsx} +52 -56
- package/src/elements/HawaMenu.tsx +75 -0
- package/src/elements/{HawaModal.js → HawaModal.tsx} +30 -21
- package/src/elements/{HawaPanelTabs.js → HawaPanelTabs.tsx} +27 -27
- package/src/elements/HawaPhoneInput.tsx +112 -0
- package/src/elements/{HawaPricingCard.js → HawaPricingCard.tsx} +86 -47
- package/src/elements/HawaRadio.tsx +34 -0
- package/src/elements/HawaRange.tsx +47 -0
- package/src/elements/HawaSearchBar.tsx +9 -0
- package/src/elements/{HawaSelect.js → HawaSelect.tsx} +74 -31
- package/src/elements/HawaSettingsRow.tsx +56 -0
- package/src/elements/HawaSnackbar.tsx +73 -0
- package/src/elements/HawaSwitch.tsx +25 -0
- package/src/elements/{HawaTable.js → HawaTable.tsx} +33 -31
- package/src/elements/{HawaTabs.js → HawaTabs.tsx} +17 -12
- package/src/elements/HawaTextField.tsx +71 -0
- package/src/elements/HawaTooltip.tsx +35 -0
- package/src/elements/HawaTypography.tsx +11 -0
- package/src/elements/{TabPanel.js → TabPanel.tsx} +10 -5
- package/src/elements/{index.js → index.ts} +7 -4
- package/src/index.ts +3 -0
- package/src/layout/Box.tsx +5 -0
- package/src/layout/HawaBottomAppBar.tsx +54 -0
- package/src/layout/HawaContainer.tsx +24 -0
- package/src/layout/{HawaLayout.js → HawaLayout.tsx} +54 -49
- package/src/layout/{index.js → index.ts} +0 -0
- package/src/styles.css +279 -211
- package/src/{util.js → util.ts} +0 -0
- package/storybook-static/229.a3257e00.iframe.bundle.js +1 -0
- package/storybook-static/229.d6fb4f8f665962cef844.manager.bundle.js +1 -0
- package/storybook-static/295.67c251ec00675ab59b60.manager.bundle.js +1 -0
- package/storybook-static/51.786e9bbba427ee454dc0.manager.bundle.js +2 -0
- package/storybook-static/{0.1104ca18.iframe.bundle.js.LICENSE.txt → 51.786e9bbba427ee454dc0.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/51.acbbdb95.iframe.bundle.js +2 -0
- package/storybook-static/{0.cf71f8aa82edef0a7186.manager.bundle.js.LICENSE.txt → 51.acbbdb95.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/551.67cd309b0648b0a52636.manager.bundle.js +1 -0
- package/storybook-static/551.c82ea8f1.iframe.bundle.js +1 -0
- package/storybook-static/701.bcf1e718.iframe.bundle.js +1 -0
- package/storybook-static/733.8d2de9f8.iframe.bundle.js +2 -0
- package/storybook-static/{vendors~main.a40572d0.iframe.bundle.js.LICENSE.txt → 733.8d2de9f8.iframe.bundle.js.LICENSE.txt} +0 -10
- package/storybook-static/767.2f9c96fa3338c8d16078.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.d13ba71108048897ea4a.manager.bundle.js.LICENSE.txt → 767.2f9c96fa3338c8d16078.manager.bundle.js.LICENSE.txt} +0 -10
- package/storybook-static/807.14b8bfa7.iframe.bundle.js +2 -0
- package/storybook-static/{5.5b799f3fbf64cec8e51a.manager.bundle.js.LICENSE.txt → 807.14b8bfa7.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/807.4f52b2d047c5e8c5872f.manager.bundle.js +2 -0
- package/storybook-static/{6.6023eba1.iframe.bundle.js.LICENSE.txt → 807.4f52b2d047c5e8c5872f.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/897.386c170cbd1467abc7ca.manager.bundle.js +2 -0
- package/storybook-static/{8.f9b98ef3e089be1a16d6.manager.bundle.js.LICENSE.txt → 897.386c170cbd1467abc7ca.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/897.d9a35fd0.iframe.bundle.js +2 -0
- package/storybook-static/{9.63a5cf7a.iframe.bundle.js.LICENSE.txt → 897.d9a35fd0.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/935.07c1b6ea.iframe.bundle.js +1 -0
- package/storybook-static/935.0b4e9c201c33f3e66e81.manager.bundle.js +1 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.051275cac7b0dc69501c.manager.bundle.js +1 -0
- package/storybook-static/main.71507dcb.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.25eae181fe0f96887a15.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.4d0bf318.iframe.bundle.js +1 -0
- package/tailwind.config.js +16 -1
- package/tsconfig.json +25 -0
- package/src/blocks/Account/UserSettingsForm.js +0 -17
- package/src/blocks/Account/index.js +0 -2
- package/src/blocks/AuthForms/AppLanding.js +0 -40
- package/src/blocks/AuthForms/CodeConfirmation.js +0 -78
- package/src/blocks/AuthForms/SignInPhone.js +0 -38
- package/src/blocks/AuthForms/index.js +0 -7
- package/src/blocks/Misc/NotFound.js +0 -32
- package/src/blocks/Misc/index.js +0 -1
- package/src/blocks/Payment/ChargeWalletForm.js +0 -81
- package/src/blocks/Payment/Confirmation.js +0 -104
- package/src/blocks/Payment/Form/CForm.js +0 -316
- package/src/blocks/Payment/Form/Card.js +0 -242
- package/src/blocks/Payment/Form/PaymentMethod.js +0 -118
- package/src/blocks/Payment/Gateway/GooglePay.js +0 -251
- package/src/blocks/Payment/Gateway/Payfort.js +0 -90
- package/src/blocks/Payment/Gateway/Paypal.js +0 -138
- package/src/blocks/Payment/Gateway/Wallet.js +0 -148
- package/src/blocks/Payment/PayWithWallet.js +0 -20
- package/src/blocks/Pricing/PricingPlans.js +0 -88
- package/src/elements/DraggableCard.js +0 -24
- package/src/elements/HawaAlert.js +0 -41
- package/src/elements/HawaButton.js +0 -62
- package/src/elements/HawaCheckbox.js +0 -28
- package/src/elements/HawaChip.js +0 -9
- package/src/elements/HawaColorPicker.js +0 -57
- package/src/elements/HawaDrawer.js +0 -68
- package/src/elements/HawaMenu.js +0 -71
- package/src/elements/HawaPhoneInput.js +0 -106
- package/src/elements/HawaRadio.js +0 -31
- package/src/elements/HawaRange.js +0 -54
- package/src/elements/HawaSearchBar.js +0 -15
- package/src/elements/HawaSettingsRow.js +0 -34
- package/src/elements/HawaSnackbar.js +0 -44
- package/src/elements/HawaSwitch.js +0 -21
- package/src/elements/HawaTextField.js +0 -34
- package/src/elements/HawaTooltip.js +0 -19
- package/src/elements/HawaTypography.js +0 -5
- package/src/elements/PinInput.js +0 -141
- package/src/elements/SelectedField.js +0 -46
- package/src/index.js +0 -3
- package/src/layout/Box.js +0 -5
- package/src/layout/HawaAppLayout.js +0 -245
- package/src/layout/HawaAppLayout2.js +0 -254
- package/src/layout/HawaBottomAppBar.js +0 -76
- package/src/layout/HawaContainer.js +0 -8
- package/storybook-static/0.1104ca18.iframe.bundle.js +0 -3
- package/storybook-static/0.1104ca18.iframe.bundle.js.map +0 -1
- package/storybook-static/0.cf71f8aa82edef0a7186.manager.bundle.js +0 -2
- package/storybook-static/1.7e6ec5c45ae5b70c5149.manager.bundle.js +0 -1
- package/storybook-static/1.e3eafd38.iframe.bundle.js +0 -1
- package/storybook-static/2.3841b1a5.iframe.bundle.js +0 -1
- package/storybook-static/5.5b799f3fbf64cec8e51a.manager.bundle.js +0 -2
- package/storybook-static/6.6023eba1.iframe.bundle.js +0 -3
- package/storybook-static/6.6023eba1.iframe.bundle.js.map +0 -1
- package/storybook-static/6.b34ce31193a7fa1dd965.manager.bundle.js +0 -1
- package/storybook-static/7.632f8551.iframe.bundle.js +0 -1
- package/storybook-static/7.72879af713f755a7aa7e.manager.bundle.js +0 -1
- package/storybook-static/8.9a8f8b69.iframe.bundle.js +0 -1
- package/storybook-static/8.f9b98ef3e089be1a16d6.manager.bundle.js +0 -2
- package/storybook-static/9.1e1335092fade49cc986.manager.bundle.js +0 -1
- package/storybook-static/9.63a5cf7a.iframe.bundle.js +0 -3
- package/storybook-static/9.63a5cf7a.iframe.bundle.js.map +0 -1
- package/storybook-static/main.4bd27e4e7faa098302d1.manager.bundle.js +0 -1
- package/storybook-static/main.ea9904c2.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.67ec6e92.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.a58df7ba92d01c5088d3.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.a40572d0.iframe.bundle.js +0 -3
- package/storybook-static/vendors~main.a40572d0.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.d13ba71108048897ea4a.manager.bundle.js +0 -2
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react"
|
|
1
|
+
import React, { useEffect, useState } from "react"
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type CopyRightsTypes = {
|
|
4
|
+
withLogo: any
|
|
5
|
+
lang: any
|
|
6
|
+
version: any
|
|
7
|
+
}
|
|
4
8
|
|
|
9
|
+
export const HawaCopyrights: React.FunctionComponent<CopyRightsTypes> = (
|
|
10
|
+
props
|
|
11
|
+
) => {
|
|
5
12
|
return (
|
|
6
13
|
<div
|
|
7
14
|
style={{
|
|
@@ -11,15 +18,15 @@ export const HawaCopyrights = (props) => {
|
|
|
11
18
|
color: "grey",
|
|
12
19
|
fontSize: 14,
|
|
13
20
|
marginTop: 10,
|
|
14
|
-
marginBottom: 10
|
|
21
|
+
marginBottom: 10,
|
|
15
22
|
}}
|
|
16
23
|
>
|
|
17
24
|
{props.withLogo ? (
|
|
18
|
-
<a href={"https://qawaim.app/" + lang}>
|
|
25
|
+
<a href={"https://qawaim.app/" + props.lang}>
|
|
19
26
|
<div style={{ cursor: "pointer" }}>
|
|
20
27
|
<image
|
|
21
|
-
src="/qawaim-logo.svg"
|
|
22
|
-
alt="Qawaim"
|
|
28
|
+
// src="/qawaim-logo.svg"
|
|
29
|
+
// alt="Qawaim"
|
|
23
30
|
width={100}
|
|
24
31
|
height={50}
|
|
25
32
|
/>
|
|
@@ -29,5 +36,5 @@ export const HawaCopyrights = (props) => {
|
|
|
29
36
|
|
|
30
37
|
<div>{props.version}</div>
|
|
31
38
|
</div>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react"
|
|
2
|
+
import { FaDailymotion } from "react-icons/fa"
|
|
3
|
+
import clsx from "clsx"
|
|
4
|
+
|
|
5
|
+
type DrawerTypes = {
|
|
6
|
+
open: any
|
|
7
|
+
setOpen: any
|
|
8
|
+
position: any
|
|
9
|
+
heading: any
|
|
10
|
+
children: any
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const HawaDrawer: React.FunctionComponent<DrawerTypes> = ({
|
|
14
|
+
open,
|
|
15
|
+
setOpen,
|
|
16
|
+
position,
|
|
17
|
+
heading,
|
|
18
|
+
children,
|
|
19
|
+
}) => {
|
|
20
|
+
const leftDrawer =
|
|
21
|
+
"w-60 z-50 h-full absolute overflow-x-hidden top-0 left-0 border-r bg-white"
|
|
22
|
+
const rightDrawer =
|
|
23
|
+
"w-60 z-50 h-full absolute overflow-x-hidden top-0 right-0 border-l bg-white"
|
|
24
|
+
|
|
25
|
+
// useEffect(() => {
|
|
26
|
+
// setOpenDrawer(true);
|
|
27
|
+
// }, [open]);
|
|
28
|
+
|
|
29
|
+
const childrenWithProps = React.Children.map(children, (child) => {
|
|
30
|
+
// if (
|
|
31
|
+
// // React.isValidElement(child) &&
|
|
32
|
+
// // child.type.name == "DrawerHeader"
|
|
33
|
+
// ) {
|
|
34
|
+
// return React.cloneElement(child, {
|
|
35
|
+
// // setOpen: setOpen,
|
|
36
|
+
// // children: child.props.children,
|
|
37
|
+
// })
|
|
38
|
+
// }
|
|
39
|
+
// if (React.isValidElement(child) && child.type.name == "DrawerBody") {
|
|
40
|
+
// return React.cloneElement(child, { children: child.props })
|
|
41
|
+
// }
|
|
42
|
+
// if (React.isValidElement(child) && child.type.name == "DrawerFooter") {
|
|
43
|
+
// return React.cloneElement(child, { children: child.props.children })
|
|
44
|
+
// }
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const drawerClass =
|
|
48
|
+
open && position == "left"
|
|
49
|
+
? clsx("block", leftDrawer)
|
|
50
|
+
: open && position == "right"
|
|
51
|
+
? clsx("block", rightDrawer)
|
|
52
|
+
: "hidden"
|
|
53
|
+
|
|
54
|
+
return <div className={drawerClass}>{childrenWithProps}</div>
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const DrawerHeader = (props: any) => {
|
|
58
|
+
return (
|
|
59
|
+
<div className=" flex w-full flex-row items-center justify-between border-b py-4 px-1">
|
|
60
|
+
{props.children}
|
|
61
|
+
<div
|
|
62
|
+
className="justify-self-end rounded border p-1 hover:cursor-pointer"
|
|
63
|
+
onClick={() => {
|
|
64
|
+
console.log("running")
|
|
65
|
+
props.setOpen(false)
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<FaDailymotion size={20} strokeWidth={2} />
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const DrawerBody = (props: any) => {
|
|
75
|
+
return <div className="p-1">{props.children}</div>
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const DrawerFooter = (props: any) => {
|
|
79
|
+
return (
|
|
80
|
+
<div className="absolute bottom-0 w-full border-t py-4 px-1">
|
|
81
|
+
{props.children}
|
|
82
|
+
</div>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import React from "react"
|
|
1
|
+
import React from "react"
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type DrawerItemTypes = {
|
|
4
|
+
action: any
|
|
5
|
+
icon?: any
|
|
6
|
+
text: any
|
|
7
|
+
}
|
|
8
|
+
const HawaDrawerItem: React.FunctionComponent<DrawerItemTypes> = (props) => {
|
|
4
9
|
let withIcon =
|
|
5
|
-
"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"
|
|
10
|
+
"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"
|
|
6
11
|
let withoutIcon =
|
|
7
|
-
"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"
|
|
12
|
+
"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"
|
|
8
13
|
|
|
9
14
|
return (
|
|
10
15
|
<li onClick={props.action}>
|
|
@@ -22,7 +27,7 @@ const HawaDrawerItem = (props) => {
|
|
|
22
27
|
<span className="ml-3">{props.text}</span>
|
|
23
28
|
</div>
|
|
24
29
|
</li>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
27
32
|
|
|
28
|
-
export default HawaDrawerItem
|
|
33
|
+
export default HawaDrawerItem
|
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
import React, { useEffect } from "react"
|
|
2
|
-
import
|
|
3
|
-
import { useState } from "react";
|
|
1
|
+
import React, { useEffect } from "react"
|
|
2
|
+
import { useState } from "react"
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
type ItemCardTypes = {
|
|
5
|
+
actions: any
|
|
6
|
+
content: any
|
|
7
|
+
headerActions: any
|
|
8
|
+
// label: PropTypes.string,
|
|
9
|
+
// action: PropTypes.func,
|
|
10
|
+
header: any
|
|
11
|
+
lang: string
|
|
12
|
+
onCardClick?: any
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const HawaItemCard: React.FunctionComponent<ItemCardTypes> = ({
|
|
6
16
|
actions,
|
|
7
17
|
content,
|
|
8
18
|
headerActions,
|
|
9
19
|
header,
|
|
10
20
|
...props
|
|
11
21
|
}) => {
|
|
12
|
-
const [openActionHeader, setOpenActionHeader] = useState(false)
|
|
22
|
+
const [openActionHeader, setOpenActionHeader] = useState(false)
|
|
13
23
|
|
|
14
24
|
function handleOpenActionHeader() {
|
|
15
|
-
setOpenActionHeader(!openActionHeader)
|
|
25
|
+
setOpenActionHeader(!openActionHeader)
|
|
16
26
|
}
|
|
17
27
|
|
|
18
|
-
useEffect(() => {
|
|
28
|
+
useEffect((): any => {
|
|
19
29
|
window.onclick = () => {
|
|
20
|
-
console.log("clicking, state = ", openActionHeader)
|
|
30
|
+
console.log("clicking, state = ", openActionHeader)
|
|
21
31
|
if (openActionHeader) {
|
|
22
|
-
setOpenActionHeader(false)
|
|
32
|
+
setOpenActionHeader(false)
|
|
23
33
|
}
|
|
24
|
-
}
|
|
25
|
-
return () => (window.
|
|
26
|
-
}, [openActionHeader])
|
|
34
|
+
}
|
|
35
|
+
return () => (window.onclick = null)
|
|
36
|
+
}, [openActionHeader])
|
|
27
37
|
|
|
28
38
|
return (
|
|
29
39
|
<div
|
|
30
|
-
className="block
|
|
40
|
+
className="relative block max-w-sm rounded-lg border border-gray-200 bg-white pt-6 shadow-md dark:border-gray-700 dark:bg-gray-800 "
|
|
31
41
|
{...props}
|
|
32
42
|
>
|
|
33
43
|
{headerActions && (
|
|
34
|
-
<div className="
|
|
44
|
+
<div className="absolute right-0 top-0 flex justify-end pt-3 pr-3">
|
|
35
45
|
<button
|
|
36
46
|
id="dropdownButton"
|
|
37
47
|
data-dropdown-toggle="dropdown"
|
|
38
|
-
className="inline-block text-
|
|
48
|
+
className="inline-block rounded-lg text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-700"
|
|
39
49
|
type="button"
|
|
40
50
|
onClick={handleOpenActionHeader}
|
|
41
51
|
>
|
|
42
52
|
<span className="sr-only">Open dropdown</span>
|
|
43
53
|
<svg
|
|
44
|
-
className="
|
|
54
|
+
className="h-6 w-6"
|
|
45
55
|
aria-hidden="true"
|
|
46
56
|
fill="currentColor"
|
|
47
57
|
viewBox="0 0 20 20"
|
|
@@ -54,20 +64,20 @@ export const HawaItemCard = ({
|
|
|
54
64
|
id="dropdown"
|
|
55
65
|
className={`absolute ${
|
|
56
66
|
openActionHeader ? "block" : "hidden"
|
|
57
|
-
} right-0 top-7 z-10 w-44
|
|
67
|
+
} right-0 top-7 z-10 w-44 list-none divide-y divide-gray-100 rounded bg-white text-base shadow dark:bg-gray-700`}
|
|
58
68
|
>
|
|
59
69
|
<ul className="py-1" aria-labelledby="dropdownButton">
|
|
60
|
-
{headerActions.map((
|
|
70
|
+
{headerActions.map((singleAction: any) => {
|
|
61
71
|
return (
|
|
62
|
-
<li onClick={action}>
|
|
72
|
+
<li onClick={singleAction.action}>
|
|
63
73
|
<a
|
|
64
74
|
href="#"
|
|
65
|
-
className="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:
|
|
75
|
+
className="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
66
76
|
>
|
|
67
|
-
{label}
|
|
77
|
+
{singleAction.label}
|
|
68
78
|
</a>
|
|
69
79
|
</li>
|
|
70
|
-
)
|
|
80
|
+
)
|
|
71
81
|
})}
|
|
72
82
|
</ul>
|
|
73
83
|
</div>
|
|
@@ -81,18 +91,7 @@ export const HawaItemCard = ({
|
|
|
81
91
|
{content}
|
|
82
92
|
</p>
|
|
83
93
|
</div>
|
|
84
|
-
<div className="
|
|
94
|
+
<div className="mt-6 flex justify-end rounded-b-lg p-3">{actions}</div>
|
|
85
95
|
</div>
|
|
86
|
-
)
|
|
87
|
-
}
|
|
88
|
-
HawaItemCard.propTypes = {
|
|
89
|
-
lang: PropTypes.string,
|
|
90
|
-
actions: PropTypes.element,
|
|
91
|
-
content: PropTypes.element,
|
|
92
|
-
headerActions: PropTypes.arrayOf({
|
|
93
|
-
label: PropTypes.string,
|
|
94
|
-
action: PropTypes.func
|
|
95
|
-
}),
|
|
96
|
-
header: PropTypes.element,
|
|
97
|
-
onCardClick: PropTypes.func
|
|
98
|
-
};
|
|
96
|
+
)
|
|
97
|
+
}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import PropTypes from "prop-types";
|
|
1
|
+
import React from "react"
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
type LogoButtonTypes = {
|
|
4
|
+
lang?: any
|
|
5
|
+
logo?: any
|
|
6
|
+
// logo: PropTypes.oneOf([
|
|
7
|
+
// "google",
|
|
8
|
+
// "github",
|
|
9
|
+
// "twitter",
|
|
10
|
+
// "wallet",
|
|
11
|
+
// "googlepay",
|
|
12
|
+
// "applepay",
|
|
13
|
+
// "stcpay",
|
|
14
|
+
// "visa/master",
|
|
15
|
+
// "paypal",
|
|
16
|
+
// "mada",
|
|
17
|
+
// ]),
|
|
18
|
+
onClick?: any
|
|
19
|
+
buttonText?: any
|
|
20
|
+
}
|
|
21
|
+
export const HawaLogoButton: React.FunctionComponent<LogoButtonTypes> = (
|
|
22
|
+
props
|
|
23
|
+
) => {
|
|
24
|
+
let isArabic = props.lang === "ar"
|
|
25
|
+
let logoElement: any = ""
|
|
7
26
|
switch (props.logo?.toLowerCase()) {
|
|
8
27
|
case "google":
|
|
9
28
|
logoElement = (
|
|
@@ -12,8 +31,8 @@ export const HawaLogoButton = (props) => {
|
|
|
12
31
|
"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"
|
|
13
32
|
}
|
|
14
33
|
/>
|
|
15
|
-
)
|
|
16
|
-
break
|
|
34
|
+
)
|
|
35
|
+
break
|
|
17
36
|
case "github":
|
|
18
37
|
logoElement = (
|
|
19
38
|
<svg
|
|
@@ -21,12 +40,12 @@ export const HawaLogoButton = (props) => {
|
|
|
21
40
|
height="32px"
|
|
22
41
|
viewBox="0 0 32 32"
|
|
23
42
|
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
className="
|
|
43
|
+
className="h-7 w-7"
|
|
25
44
|
>
|
|
26
45
|
<path d="M16 0.396c-8.839 0-16 7.167-16 16 0 7.073 4.584 13.068 10.937 15.183 0.803 0.151 1.093-0.344 1.093-0.772 0-0.38-0.009-1.385-0.015-2.719-4.453 0.964-5.391-2.151-5.391-2.151-0.729-1.844-1.781-2.339-1.781-2.339-1.448-0.989 0.115-0.968 0.115-0.968 1.604 0.109 2.448 1.645 2.448 1.645 1.427 2.448 3.744 1.74 4.661 1.328 0.14-1.031 0.557-1.74 1.011-2.135-3.552-0.401-7.287-1.776-7.287-7.907 0-1.751 0.62-3.177 1.645-4.297-0.177-0.401-0.719-2.031 0.141-4.235 0 0 1.339-0.427 4.4 1.641 1.281-0.355 2.641-0.532 4-0.541 1.36 0.009 2.719 0.187 4 0.541 3.043-2.068 4.381-1.641 4.381-1.641 0.859 2.204 0.317 3.833 0.161 4.235 1.015 1.12 1.635 2.547 1.635 4.297 0 6.145-3.74 7.5-7.296 7.891 0.556 0.479 1.077 1.464 1.077 2.959 0 2.14-0.020 3.864-0.020 4.385 0 0.416 0.28 0.916 1.104 0.755 6.4-2.093 10.979-8.093 10.979-15.156 0-8.833-7.161-16-16-16z" />
|
|
27
46
|
</svg>
|
|
28
|
-
)
|
|
29
|
-
break
|
|
47
|
+
)
|
|
48
|
+
break
|
|
30
49
|
case "twitter":
|
|
31
50
|
logoElement = (
|
|
32
51
|
<svg
|
|
@@ -34,7 +53,7 @@ export const HawaLogoButton = (props) => {
|
|
|
34
53
|
xmlns="http://www.w3.org/2000/svg"
|
|
35
54
|
x="0px"
|
|
36
55
|
y="0px"
|
|
37
|
-
className="
|
|
56
|
+
className="h-5 w-5"
|
|
38
57
|
viewBox="0 0 512.002 512.002"
|
|
39
58
|
>
|
|
40
59
|
<path
|
|
@@ -53,16 +72,16 @@ export const HawaLogoButton = (props) => {
|
|
|
53
72
|
C507.7,94.204,503.76,93.294,500.398,94.784z"
|
|
54
73
|
/>
|
|
55
74
|
</svg>
|
|
56
|
-
)
|
|
57
|
-
break
|
|
75
|
+
)
|
|
76
|
+
break
|
|
58
77
|
case "mada":
|
|
59
78
|
logoElement = (
|
|
60
79
|
<img
|
|
61
80
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png"
|
|
62
81
|
className="h-6"
|
|
63
82
|
/>
|
|
64
|
-
)
|
|
65
|
-
break
|
|
83
|
+
)
|
|
84
|
+
break
|
|
66
85
|
case "stcpay":
|
|
67
86
|
logoElement = (
|
|
68
87
|
<img
|
|
@@ -70,40 +89,40 @@ export const HawaLogoButton = (props) => {
|
|
|
70
89
|
// height={20}
|
|
71
90
|
className="h-6"
|
|
72
91
|
/>
|
|
73
|
-
)
|
|
74
|
-
break
|
|
92
|
+
)
|
|
93
|
+
break
|
|
75
94
|
case "visa/master":
|
|
76
95
|
logoElement = (
|
|
77
96
|
<img
|
|
78
97
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png"
|
|
79
98
|
className="h-6"
|
|
80
99
|
/>
|
|
81
|
-
)
|
|
82
|
-
break
|
|
100
|
+
)
|
|
101
|
+
break
|
|
83
102
|
case "paypal":
|
|
84
103
|
logoElement = (
|
|
85
104
|
<img
|
|
86
105
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png"
|
|
87
106
|
className="h-6"
|
|
88
107
|
/>
|
|
89
|
-
)
|
|
90
|
-
break
|
|
108
|
+
)
|
|
109
|
+
break
|
|
91
110
|
case "googlepay":
|
|
92
111
|
logoElement = (
|
|
93
112
|
<img
|
|
94
113
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png"
|
|
95
114
|
className="h-6"
|
|
96
115
|
/>
|
|
97
|
-
)
|
|
98
|
-
break
|
|
116
|
+
)
|
|
117
|
+
break
|
|
99
118
|
case "applepay":
|
|
100
119
|
logoElement = (
|
|
101
120
|
<img
|
|
102
121
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png"
|
|
103
122
|
className="h-11"
|
|
104
123
|
/>
|
|
105
|
-
)
|
|
106
|
-
break
|
|
124
|
+
)
|
|
125
|
+
break
|
|
107
126
|
case "wallet":
|
|
108
127
|
logoElement = (
|
|
109
128
|
<svg
|
|
@@ -124,48 +143,25 @@ export const HawaLogoButton = (props) => {
|
|
|
124
143
|
/>
|
|
125
144
|
</g>
|
|
126
145
|
</svg>
|
|
127
|
-
)
|
|
128
|
-
break
|
|
146
|
+
)
|
|
147
|
+
break
|
|
129
148
|
|
|
130
149
|
default:
|
|
131
|
-
break
|
|
150
|
+
break
|
|
132
151
|
}
|
|
133
152
|
return (
|
|
134
153
|
<button
|
|
135
154
|
style={{ direction: isArabic ? "rtl" : "ltr" }}
|
|
136
155
|
{...props}
|
|
137
|
-
className="
|
|
156
|
+
className="my-2 flex h-11 w-full max-w-sm flex-row justify-center rounded-xl bg-white align-middle"
|
|
138
157
|
>
|
|
139
|
-
<div className="h-full flex
|
|
158
|
+
<div className="flex h-full flex-row items-center justify-end">
|
|
140
159
|
{logoElement}
|
|
141
160
|
</div>
|
|
142
161
|
<div style={{ width: 10 }} />
|
|
143
|
-
<div className="h-full flex
|
|
162
|
+
<div className="flex h-full flex-col items-start justify-center">
|
|
144
163
|
{props.buttonText}
|
|
145
164
|
</div>
|
|
146
165
|
</button>
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
HawaLogoButton.propTypes = {
|
|
151
|
-
lang: PropTypes.string,
|
|
152
|
-
/**
|
|
153
|
-
* The logo/icon of the button
|
|
154
|
-
*/
|
|
155
|
-
logo: PropTypes.oneOf([
|
|
156
|
-
"google",
|
|
157
|
-
"github",
|
|
158
|
-
"twitter",
|
|
159
|
-
"wallet",
|
|
160
|
-
"googlepay",
|
|
161
|
-
"applepay",
|
|
162
|
-
"stcpay",
|
|
163
|
-
"visa/master",
|
|
164
|
-
"paypal",
|
|
165
|
-
"mada"
|
|
166
|
-
]),
|
|
167
|
-
/**
|
|
168
|
-
* The text next to the logo in the button
|
|
169
|
-
*/
|
|
170
|
-
buttonText: PropTypes.string
|
|
171
|
-
};
|
|
166
|
+
)
|
|
167
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
|
|
2
|
+
type MenuTypes = {
|
|
3
|
+
popMenuID: any
|
|
4
|
+
menuItems: any
|
|
5
|
+
//
|
|
6
|
+
// icon: PropTypes.element,
|
|
7
|
+
// label: PropTypes.string,
|
|
8
|
+
// action: PropTypes.func,
|
|
9
|
+
//
|
|
10
|
+
withHeader: any
|
|
11
|
+
withIcons: any
|
|
12
|
+
headerTitle: any
|
|
13
|
+
headerSubtitle: any
|
|
14
|
+
open: any
|
|
15
|
+
handleClose: any
|
|
16
|
+
anchor: any
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const HawaMenu: React.FunctionComponent<MenuTypes> = ({
|
|
20
|
+
popMenuID,
|
|
21
|
+
menuItems,
|
|
22
|
+
withHeader,
|
|
23
|
+
withIcons,
|
|
24
|
+
headerTitle,
|
|
25
|
+
headerSubtitle,
|
|
26
|
+
open,
|
|
27
|
+
handleClose,
|
|
28
|
+
}) => {
|
|
29
|
+
return (
|
|
30
|
+
<div>
|
|
31
|
+
<button
|
|
32
|
+
className="w-44 rounded border bg-blue-700 p-2 text-white"
|
|
33
|
+
onClick={() => handleClose(!open)}
|
|
34
|
+
>
|
|
35
|
+
Menu Dropdown
|
|
36
|
+
</button>
|
|
37
|
+
<div
|
|
38
|
+
id={popMenuID}
|
|
39
|
+
className={`${
|
|
40
|
+
open ? "block" : "hidden"
|
|
41
|
+
} z-10 w-44 divide-y divide-gray-100 rounded-lg bg-white shadow dark:bg-gray-700`}
|
|
42
|
+
>
|
|
43
|
+
{withHeader && (
|
|
44
|
+
<div className="py-3 px-4 text-sm text-gray-900 dark:text-white">
|
|
45
|
+
<div>{headerTitle}</div>
|
|
46
|
+
<div className="truncate font-medium">{headerSubtitle}</div>
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
{menuItems.map((group: any) => {
|
|
50
|
+
return (
|
|
51
|
+
<ul className="py-1 text-sm text-gray-700 dark:text-gray-200">
|
|
52
|
+
{group.map((item: any) => {
|
|
53
|
+
return (
|
|
54
|
+
<li
|
|
55
|
+
onClick={item.action}
|
|
56
|
+
className={
|
|
57
|
+
item.button
|
|
58
|
+
? "mx-1 flex cursor-pointer flex-row items-center rounded-lg bg-primary-500 py-2 px-4 text-white hover:bg-primary-600 rtl:flex-row-reverse dark:hover:bg-primary-600 dark:hover:text-white"
|
|
59
|
+
: "mx-1 flex cursor-pointer flex-row items-center rounded-lg py-2 px-4 hover:bg-gray-100 rtl:flex-row-reverse dark:hover:bg-gray-600 dark:hover:text-white"
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
{withIcons && (
|
|
63
|
+
<div className="mr-2 rtl:ml-2">{item.icon}</div>
|
|
64
|
+
)}
|
|
65
|
+
{item.label}
|
|
66
|
+
</li>
|
|
67
|
+
)
|
|
68
|
+
})}
|
|
69
|
+
</ul>
|
|
70
|
+
)
|
|
71
|
+
})}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
@@ -1,50 +1,59 @@
|
|
|
1
|
-
import React, { useEffect } from "react"
|
|
1
|
+
import React, { useEffect } from "react"
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type ModalTypes = {
|
|
4
|
+
open: any
|
|
5
|
+
title: any
|
|
6
|
+
onClose: any
|
|
7
|
+
closeOnClickOutside: any
|
|
8
|
+
modalID: any
|
|
9
|
+
children: any
|
|
10
|
+
actions: any
|
|
11
|
+
}
|
|
12
|
+
export const HawaModal: React.FunctionComponent<ModalTypes> = ({
|
|
4
13
|
open,
|
|
5
14
|
title,
|
|
6
15
|
onClose,
|
|
7
16
|
closeOnClickOutside,
|
|
8
17
|
...props
|
|
9
18
|
}) => {
|
|
10
|
-
useEffect(() => {
|
|
19
|
+
useEffect((): any => {
|
|
11
20
|
if (closeOnClickOutside) {
|
|
12
21
|
window.onclick = () => {
|
|
13
|
-
console.log("open : ", open)
|
|
22
|
+
console.log("open : ", open)
|
|
14
23
|
if (open) {
|
|
15
|
-
console.log("Im clicing")
|
|
16
|
-
onClose()
|
|
24
|
+
console.log("Im clicing")
|
|
25
|
+
onClose()
|
|
17
26
|
}
|
|
18
|
-
}
|
|
27
|
+
}
|
|
19
28
|
}
|
|
20
|
-
return () => (window.
|
|
21
|
-
}, [open])
|
|
29
|
+
return () => (window.onclick = null)
|
|
30
|
+
}, [open])
|
|
22
31
|
return (
|
|
23
32
|
<div
|
|
24
33
|
id={props.modalID}
|
|
25
|
-
|
|
34
|
+
tabIndex={-1}
|
|
26
35
|
aria-hidden="true"
|
|
27
36
|
className={`${
|
|
28
37
|
open ? "block" : "hidden"
|
|
29
|
-
}
|
|
38
|
+
} h-modal fixed top-0 right-0 left-0 z-50 w-full items-center justify-center overflow-y-auto overflow-x-hidden md:inset-0 md:h-full`}
|
|
30
39
|
>
|
|
31
|
-
<div className="relative
|
|
32
|
-
<div className="relative bg-white
|
|
33
|
-
<div className="flex
|
|
40
|
+
<div className="relative h-full w-full max-w-2xl p-4 md:h-auto">
|
|
41
|
+
<div className="relative rounded-lg bg-white shadow dark:bg-gray-700">
|
|
42
|
+
<div className="flex items-start justify-between rounded-t border-b p-4 dark:border-gray-600">
|
|
34
43
|
<h3 className="text-xl font-semibold text-gray-900 dark:text-white">
|
|
35
44
|
{title}
|
|
36
45
|
</h3>
|
|
37
46
|
<button
|
|
38
47
|
type="button"
|
|
39
|
-
className="
|
|
48
|
+
className="ml-auto inline-flex items-center rounded-lg bg-transparent p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
40
49
|
data-modal-toggle="defaultModal"
|
|
41
50
|
onClick={() => {
|
|
42
|
-
onClose()
|
|
51
|
+
onClose()
|
|
43
52
|
}}
|
|
44
53
|
>
|
|
45
54
|
<svg
|
|
46
55
|
aria-hidden="true"
|
|
47
|
-
className="
|
|
56
|
+
className="h-5 w-5"
|
|
48
57
|
fill="currentColor"
|
|
49
58
|
viewBox="0 0 20 20"
|
|
50
59
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -58,12 +67,12 @@ export const HawaModal = ({
|
|
|
58
67
|
<span className="sr-only">Close modal</span>
|
|
59
68
|
</button>
|
|
60
69
|
</div>
|
|
61
|
-
<div className="
|
|
62
|
-
<div className="flex items-center
|
|
70
|
+
<div className="space-y-6 p-6">{props.children}</div>
|
|
71
|
+
<div className="flex items-center space-x-2 rounded-b border-t border-gray-200 p-6 dark:border-gray-600">
|
|
63
72
|
{props.actions}
|
|
64
73
|
</div>
|
|
65
74
|
</div>
|
|
66
75
|
</div>
|
|
67
76
|
</div>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
77
|
+
)
|
|
78
|
+
}
|